Compare commits
150 Commits
1.4
...
LabMCT_KDD
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e310df8e16 | ||
|
|
f98ff4794f | ||
|
|
93b664414b | ||
|
|
866788674f | ||
|
|
93e60a743e | ||
|
|
328a14b46a | ||
|
|
cf40cadce8 | ||
|
|
0adb130d4b | ||
|
|
f1e19ec59c | ||
|
|
c0c8399bd7 | ||
|
|
30185d5b2a | ||
|
|
9990300006 | ||
|
|
573e82e9eb | ||
|
|
07a135a10a | ||
|
|
fc172b66f8 | ||
|
|
2be0d5d1d9 | ||
|
|
3007b46892 | ||
|
|
1419db80a2 | ||
|
|
5376ceec7e | ||
|
|
d3a3e7502e | ||
|
|
50c3f9b899 | ||
|
|
8845fae147 | ||
|
|
0c291116b9 | ||
|
|
f0fa0281bf | ||
|
|
313a17a96c | ||
|
|
9e2b1d3e44 | ||
|
|
a82a283b4b | ||
|
|
b6770217bb | ||
|
|
c8b22e7ea5 | ||
|
|
8dcaaaf853 | ||
|
|
32ecdb5b37 | ||
|
|
099c7eafc8 | ||
|
|
f872d6fbc1 | ||
|
|
3e21787efb | ||
|
|
58fcd8d04d | ||
|
|
95d5146fce | ||
|
|
ea6adafc13 | ||
|
|
f65cb2c0ce | ||
|
|
fbde2bd202 | ||
|
|
0cee15c0d3 | ||
|
|
4b56a336a0 | ||
|
|
56bec0db04 | ||
|
|
dd979d191f | ||
|
|
a5f37f851b | ||
|
|
052d8680dc | ||
|
|
21e8aae823 | ||
|
|
0e866079da | ||
|
|
a8bd6ba840 | ||
|
|
96aefdd3c7 | ||
|
|
753fe57b30 | ||
|
|
9587c1b1e3 | ||
|
|
bc1b296440 | ||
|
|
5626b0120d | ||
|
|
e5d2f5f857 | ||
|
|
3eb52c46b1 | ||
|
|
aaa64bf769 | ||
|
|
b7b1d6d4e9 | ||
|
|
a90417de55 | ||
|
|
73f08df224 | ||
|
|
db9babbdca | ||
|
|
463dd2261e | ||
|
|
4dd66969af | ||
|
|
2c98003219 | ||
|
|
dd853a8f72 | ||
|
|
88d5e6b29d | ||
|
|
71e5d8cc31 | ||
|
|
15b3843172 | ||
|
|
3cffe3b3be | ||
|
|
9dd87b7777 | ||
|
|
b057cf905b | ||
|
|
d7943d30d8 | ||
|
|
1826d68841 | ||
|
|
dc1e5103e2 | ||
|
|
33c5647e57 | ||
|
|
f6f772edc5 | ||
|
|
7e460d8f34 | ||
|
|
7af2095f2f | ||
|
|
8307598d5d | ||
|
|
13fe276dbe | ||
|
|
13a5a472cd | ||
|
|
b5c11ce199 | ||
|
|
83c8c22736 | ||
|
|
c8ca7bf9e1 | ||
|
|
0184deb54d | ||
|
|
389042f3cc | ||
|
|
736358a71f | ||
|
|
bffe671679 | ||
|
|
fafc0b7946 | ||
|
|
3574feea98 | ||
|
|
25b48920bb | ||
|
|
e22ca48674 | ||
|
|
3b9773f872 | ||
|
|
3e3cf10fff | ||
|
|
421b401b4f | ||
|
|
a0c97e3388 | ||
|
|
d2a3968897 | ||
|
|
4ea7953a76 | ||
|
|
0cc0972eea | ||
|
|
77b5d1630d | ||
|
|
f962989484 | ||
|
|
1ccdf445eb | ||
|
|
3fb8861eee | ||
|
|
78381badd1 | ||
|
|
8b1a9f2a41 | ||
|
|
9ee52a0011 | ||
|
|
97a431f367 | ||
|
|
3769ad9615 | ||
|
|
8332ab3ddc | ||
|
|
3b4a2f134f | ||
|
|
5899e3716c | ||
|
|
25bc05ae40 | ||
|
|
f42629a6e5 | ||
|
|
192cb2daaa | ||
|
|
63cc87af2d | ||
|
|
3e1ea3ec67 | ||
|
|
c27a09c13c | ||
|
|
6a7230e546 | ||
|
|
ca173de71d | ||
|
|
5732e8ed14 | ||
|
|
5cc7a0864b | ||
|
|
e4671f175c | ||
|
|
17fd6b2454 | ||
|
|
7ed3945d58 | ||
|
|
35de0a2fef | ||
|
|
8a0e475f21 | ||
|
|
63d14f2345 | ||
|
|
e91849759c | ||
|
|
ee3a3af408 | ||
|
|
ffe5d5f6cb | ||
|
|
d40580c550 | ||
|
|
8e19b81eb9 | ||
|
|
d5191696e1 | ||
|
|
1d01466181 | ||
|
|
aff4d426b8 | ||
|
|
2e7f0bf51d | ||
|
|
fa551b84f6 | ||
|
|
31d4b62181 | ||
|
|
7ec542a211 | ||
|
|
e615d1c618 | ||
|
|
c86813b1cb | ||
|
|
1fe651aaa7 | ||
|
|
ba7809236b | ||
|
|
84814b3c59 | ||
|
|
73ca6e6671 | ||
|
|
990fac9a0a | ||
|
|
31ec4cdecb | ||
|
|
e32aaccaac | ||
|
|
3302401a36 | ||
|
|
c0c1383254 | ||
|
|
13a7d27046 |
@@ -1,4 +1,4 @@
|
||||
[codespell]
|
||||
skip = ./build-*,.git
|
||||
skip = ./build-*,.git,*.svg,rc_assets.py
|
||||
interactive = 3
|
||||
ignore-words-list = overlay,overlayed
|
||||
|
||||
2
.krazy
2
.krazy
@@ -19,5 +19,5 @@ SKIP /KDDockWidgetsConfig.cmake.in
|
||||
#skip more files
|
||||
SKIP CMakePresets.json
|
||||
#skip the borrowed code in the cmake subdir
|
||||
SKIP /cmake/Qt5Portability.cmake|/cmake/ECM/|/cmake/InstallLocation.cmake
|
||||
SKIP /cmake/InstallLocation.cmake|/cmake/ECM/|/cmake/KDAB/
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ Upstream-Contact: <info@kdab.com>
|
||||
Source: https://www.github.com/KDAB/KDDockWidgets
|
||||
|
||||
Files: *.qrc *.json *.xml *.html src/fwd_headers/*
|
||||
Copyright: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Copyright: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
License: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#artwork
|
||||
Files: screencap.gif images/* src/img/* docs/api/*.png examples/dockwidgets/assets/*.png src/img/classic_indicators/*.png
|
||||
Copyright: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Copyright: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
License: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#3rdparty
|
||||
|
||||
66
.travis.yml
66
.travis.yml
@@ -1,66 +0,0 @@
|
||||
env:
|
||||
global:
|
||||
- secure: "NlWO/NTPlOU6cowOMuPOvjAprXVwIjmpHHf9CoMR71E2c/eBFFKIHj10kXuyFwz2KihHAIExmo9OlGtGniNWobvIrVrabO3dsOSb6UGbPAQkzQiyQLKsDNQAZx3nMuWEKBtMsVRee6rd7/2uGTY4WB5Ot3VhrUYcN1FoRgQQ9gk="
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: bionic
|
||||
- os: osx
|
||||
osx_image: xcode11.5
|
||||
env:
|
||||
- QT_SELECT=qt5
|
||||
- CMAKE_PREFIX_PATH=/usr/local/opt/qt
|
||||
|
||||
language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DKDDockWidgets_TESTS=True -KDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
|
||||
- make
|
||||
- make test
|
||||
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- allen.winter@kdab.com
|
||||
- sergio.martins@kdab.com
|
||||
on_success: never
|
||||
on_failure: always
|
||||
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
update: true
|
||||
packages:
|
||||
- qt5-default
|
||||
- qtbase5-dev
|
||||
- qtbase5-dev-tools
|
||||
- qtbase5-private-dev
|
||||
- qttools5-dev
|
||||
- qttools5-dev-tools
|
||||
- qtdeclarative5-dev
|
||||
- qtdeclarative5-dev-tools
|
||||
- libqt5xmlpatterns5-dev
|
||||
- libqt5xmlpatterns5
|
||||
- qtxmlpatterns5-dev-tools
|
||||
- libqt5x11extras5-dev
|
||||
homebrew:
|
||||
update: true
|
||||
packages:
|
||||
- qt5
|
||||
coverity_scan:
|
||||
project:
|
||||
name: KDAB/KDDockWidgets
|
||||
notification_email: allen.winter@kdab.com
|
||||
build_command_prepend: cd build && cmake ..
|
||||
build_command: make
|
||||
branch_pattern: coverity_scan
|
||||
223
CMakeLists.txt
223
CMakeLists.txt
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -19,15 +19,9 @@
|
||||
# Build static versions of the libraries
|
||||
# Default=false
|
||||
#
|
||||
# -DKDDockWidgets_UNINSTALL=[true|false]
|
||||
# Setup the uninstall target.
|
||||
# You may want to disable the uninstall target when you are using KDDockWidgets
|
||||
# as a submodule directly and have a custom uninstall target of your own.
|
||||
# Default=true
|
||||
#
|
||||
# -DKDDockWidgets_TESTS=[true|false]
|
||||
# Build the test harness.
|
||||
# Currently ignored unless you also set KDDockWidgets_DEVELOPER_MODE=True
|
||||
# Currently ignored (except for Python bindings) unless KDDockWidgets_DEVELOPER_MODE=True.
|
||||
# Default=false
|
||||
#
|
||||
# -DKDDockWidgets_EXAMPLES=[true|false]
|
||||
@@ -45,7 +39,7 @@
|
||||
# -DKDDockWidgets_PYTHON_BINDINGS=[true|false]
|
||||
# Build/Generate python bindings. Always false for Debug builds
|
||||
# (If your shiboken or pyside is installed in a non-standard locations
|
||||
# try passing the SHIBOKEN_CUSTOM_PREFIX and PYSIDE2_CUSTOM_PREFIX variables.)
|
||||
# try passing the SHIBOKEN_CUSTOM_PREFIX and PYSIDE_CUSTOM_PREFIX variables.)
|
||||
# Default=false
|
||||
#
|
||||
# -DKDDockWidgets_PYTHON_BINDINGS_INSTALL_PREFIX=[path]
|
||||
@@ -76,12 +70,6 @@
|
||||
# Default=true
|
||||
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
if(POLICY CMP0020)
|
||||
cmake_policy(SET CMP0020 NEW)
|
||||
endif()
|
||||
if(POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif()
|
||||
|
||||
# Allow using a non-KDAB install location.
|
||||
set(KDAB_INSTALL True CACHE INTERNAL "Install to default KDAB Location")
|
||||
@@ -101,66 +89,33 @@ else()
|
||||
endif()
|
||||
|
||||
set(${PROJECT_NAME}_VERSION_MAJOR 1)
|
||||
set(${PROJECT_NAME}_VERSION_MINOR 4)
|
||||
set(${PROJECT_NAME}_VERSION_MINOR 5)
|
||||
set(${PROJECT_NAME}_VERSION_PATCH 1)
|
||||
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
|
||||
set(PROJECT_VERSION ${${PROJECT_NAME}_VERSION}) #PROJECT_VERSION is needed by some ECM modules
|
||||
set(${PROJECT_NAME}_SOVERSION "1.4")
|
||||
set(${PROJECT_NAME}_SOVERSION "1.5")
|
||||
|
||||
include(FeatureSummary)
|
||||
|
||||
option(${PROJECT_NAME}_QT6 "Build against Qt 6" OFF)
|
||||
option(${PROJECT_NAME}_QT6 "Build against Qt 6" ON)
|
||||
option(${PROJECT_NAME}_DEVELOPER_MODE "Developer Mode" OFF)
|
||||
option(${PROJECT_NAME}_PYTHON_BINDINGS "Build python bindings" OFF)
|
||||
option(${PROJECT_NAME}_UNINSTALL "Enable the uninstall target" ON)
|
||||
option(${PROJECT_NAME}_QTQUICK "Build for QtQuick instead of QtWidgets" OFF)
|
||||
option(${PROJECT_NAME}_STATIC "Build statically" OFF)
|
||||
option(${PROJECT_NAME}_TESTS "Build the tests" OFF)
|
||||
option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON)
|
||||
option(${PROJECT_NAME}_DOCS "Build the API documentation" OFF)
|
||||
option(${PROJECT_NAME}_WERROR "Use -Werror (will be true for developer-mode unconditionally)" OFF)
|
||||
option(${PROJECT_NAME}_X11EXTRAS "On Linux, link against QtX11Extras so we can detect if the compositor supports transparency. Not applicable to other platforms or Qt6." ON)
|
||||
option(${PROJECT_NAME}_XLib "On Linux, link against XLib, for a more robust window z-order detection." OFF)
|
||||
|
||||
set(${PROJECT_NAME}_QT6 ON)
|
||||
set(${PROJECT_NAME}_X11EXTRAS OFF)
|
||||
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/ECM/modules")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/KDAB/modules")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Python")
|
||||
|
||||
#Always build the test harness in developer-mode
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
set(${PROJECT_NAME}_TESTS ON)
|
||||
set(${PROJECT_NAME}_WERROR ON)
|
||||
include(ECMEnableSanitizers)
|
||||
endif()
|
||||
|
||||
option(${PROJECT_NAME}_QTQUICK "Build for QtQuick instead of QtWidgets" OFF)
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(IS_CLANG_BUILD TRUE)
|
||||
else()
|
||||
set(IS_CLANG_BUILD FALSE)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_QT6)
|
||||
find_package(Qt6Widgets REQUIRED)
|
||||
find_package(Qt6Test REQUIRED)
|
||||
set(QT_MAJOR_VERSION 6)
|
||||
set(KDDockWidgets_LIBRARY_QTID "-qt6")
|
||||
else()
|
||||
find_package(Qt5Widgets 5.12 REQUIRED)
|
||||
find_package(Qt5Test 5.12 REQUIRED)
|
||||
set(QT_MAJOR_VERSION 5)
|
||||
set(KDDockWidgets_LIBRARY_QTID "")
|
||||
endif()
|
||||
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
|
||||
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
# Set a default build type if none was specified
|
||||
set(default_build_type "Release")
|
||||
@@ -174,6 +129,65 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
if (${PROJECT_NAME}_XLib)
|
||||
add_definitions(-DKDDockWidgets_XLIB)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_QT6)
|
||||
set(Qt_VERSION_MAJOR 6)
|
||||
set(QT_MIN_VERSION "6.0.0")
|
||||
find_package(Qt6Widgets ${QT_MIN_VERSION} REQUIRED)
|
||||
find_package(Qt6Test ${QT_MIN_VERSION} REQUIRED)
|
||||
set(${PROJECT_NAME}_LIBRARY_QTID "-qt6")
|
||||
else()
|
||||
set(Qt_VERSION_MAJOR 5)
|
||||
set(QT_MIN_VERSION "5.15")
|
||||
find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED)
|
||||
find_package(Qt5Test ${QT_MIN_VERSION} REQUIRED)
|
||||
set(${PROJECT_NAME}_LIBRARY_QTID "")
|
||||
endif()
|
||||
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
|
||||
|
||||
set(${PROJECT_NAME}_DEPS "widgets")
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
find_package(Qt${Qt_VERSION_MAJOR}Quick)
|
||||
find_package(Qt${Qt_VERSION_MAJOR}QuickControls2)
|
||||
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
|
||||
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} quick quickcontrols2")
|
||||
else()
|
||||
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ${PROJECT_NAME}_QT6 AND ${PROJECT_NAME}_X11EXTRAS)
|
||||
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} x11extras")
|
||||
endif()
|
||||
|
||||
#Always build the test harness in developer-mode
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
set(${PROJECT_NAME}_TESTS ON)
|
||||
set(${PROJECT_NAME}_WERROR ON)
|
||||
include(ECMEnableSanitizers)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(IS_CLANG_BUILD TRUE)
|
||||
else()
|
||||
set(IS_CLANG_BUILD FALSE)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
# Default to hidden visibility for symbols
|
||||
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
|
||||
macro(set_compiler_flags targetName)
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
target_compile_definitions(${targetName} PUBLIC DOCKS_DEVELOPER_MODE PRIVATE QT_FORCE_ASSERTS)
|
||||
@@ -191,22 +205,28 @@ macro(set_compiler_flags targetName)
|
||||
if(${PROJECT_NAME}_WERROR AND (NOT MSVC OR IS_CLANG_BUILD)) # clang-cl accepts these too
|
||||
target_compile_options(${targetName} PRIVATE -Werror -Wundef -Wno-error=deprecated-declarations)
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
||||
set(${PROJECT_NAME}_DEPS "widgets")
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) OR
|
||||
(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32))
|
||||
# Linker warnings should be treated as errors
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
find_package(Qt${QT_MAJOR_VERSION}Quick)
|
||||
find_package(Qt${QT_MAJOR_VERSION}QuickControls2)
|
||||
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
|
||||
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} quick quickcontrols2")
|
||||
else()
|
||||
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS)
|
||||
endif()
|
||||
string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" compileflags)
|
||||
if("${CMAKE_CXX_FLAGS} ${${compileflags}}" MATCHES "-fsanitize")
|
||||
set(sanitizers_enabled TRUE)
|
||||
else()
|
||||
set(sanitizers_enabled FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ${PROJECT_NAME}_QT6)
|
||||
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} x11extras")
|
||||
# cannot enable this for clang + sanitizers
|
||||
if(NOT sanitizers_enabled OR NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Do not allow undefined symbols, even in non-symbolic shared libraries
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_STATIC)
|
||||
@@ -219,25 +239,29 @@ if(KDAB_INSTALL)
|
||||
if(UNIX)
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "Install to default KDAB Location")
|
||||
elseif(WIN32)
|
||||
set(CMAKE_INSTALL_PREFIX "C:\\KDAB\\${PROJECT_NAME}-$$VERSION" CACHE INTERNAL "Install to default KDAB Location")
|
||||
set(CMAKE_INSTALL_PREFIX "C:\\KDAB\\${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "Install to default KDAB Location")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# setup default install locations
|
||||
include(InstallLocation)
|
||||
|
||||
add_subdirectory(src)
|
||||
if(${PROJECT_NAME}_PYTHON_BINDINGS)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "^[Dd]eb" OR ${PROJECT_NAME}_STATIC)
|
||||
message(FATAL_ERROR "** Python Bindings are disabled in debug or static builds.")
|
||||
endif()
|
||||
add_subdirectory(python)
|
||||
endif()
|
||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
set(${PROJECT_NAME}_IS_ROOT_PROJECT TRUE)
|
||||
|
||||
# Generate .pri file for qmake users
|
||||
if(CMAKE_VERSION VERSION_GREATER "3.11.99" AND NOT CMAKE_CONFIGURATION_TYPES) # Not working with VS generator or older cmake versions
|
||||
message(STATUS "Building ${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} in ${CMAKE_BUILD_TYPE} mode. Installing to ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
|
||||
install(FILES LICENSE.txt README.md DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR})
|
||||
|
||||
# Generate .pri file for qmake users
|
||||
#TODO: ECM does not support Qt6 yet
|
||||
if(QT_MAJOR_VERSION EQUAL 5)
|
||||
if(Qt_VERSION_MAJOR EQUAL 5 AND
|
||||
CMAKE_VERSION VERSION_GREATER "3.11.99" AND NOT CMAKE_CONFIGURATION_TYPES) # Not working with VS generator or older cmake versions
|
||||
include(ECMGeneratePriFile)
|
||||
set(PROJECT_VERSION_STRING ${${PROJECT_NAME}_VERSION})
|
||||
ecm_generate_pri_file(BASE_NAME KDDockWidgets
|
||||
@@ -249,11 +273,27 @@ if(CMAKE_VERSION VERSION_GREATER "3.11.99" AND NOT CMAKE_CONFIGURATION_TYPES) #
|
||||
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Unable to generate the pri file for qmake users. Try updating CMake.")
|
||||
#Always disable tests, examples, docs when used as a submodule
|
||||
set(${PROJECT_NAME}_IS_ROOT_PROJECT FALSE)
|
||||
set(${PROJECT_NAME}_TESTS FALSE)
|
||||
set(${PROJECT_NAME}_EXAMPLES FALSE)
|
||||
set(${PROJECT_NAME}_DOCS FALSE)
|
||||
endif()
|
||||
|
||||
install(FILES LICENSE.txt README.md DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR})
|
||||
if(${PROJECT_NAME}_TESTS)
|
||||
enable_testing()
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(${PROJECT_NAME}_PYTHON_BINDINGS)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "^[Dd]eb" OR ${PROJECT_NAME}_STATIC)
|
||||
message(FATAL_ERROR "** Python Bindings are disabled in debug or static builds.")
|
||||
endif()
|
||||
endif()
|
||||
if(${PROJECT_NAME}_PYTHON_BINDINGS)
|
||||
add_subdirectory(python)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_EXAMPLES)
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
@@ -267,10 +307,8 @@ if(${PROJECT_NAME}_EXAMPLES)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
|
||||
if(${PROJECT_NAME}_TESTS)
|
||||
enable_testing()
|
||||
if(${PROJECT_NAME}_TESTS)
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
add_subdirectory(tests)
|
||||
|
||||
# Require Qt5.15.1 or higher to run the tests_launcher tests on Mac
|
||||
@@ -309,15 +347,10 @@ endif()
|
||||
|
||||
if(${PROJECT_NAME}_DOCS)
|
||||
add_subdirectory(docs) # needs to go last, in case there are build source files
|
||||
#don't create the dummy docs target as it can conflict when used as a submodule
|
||||
#else()
|
||||
# add_custom_target(docs
|
||||
# COMMAND ${CMAKE_COMMAND} -E echo "Sorry, there is no docs target since KDDockWidgets_DOCS=OFF."
|
||||
# "Re-run cmake with the -DKDDockWidgets_DOCS=True option if you want to generate the documentation.")
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_UNINSTALL)
|
||||
# Add uninstall target
|
||||
if(${PROJECT_NAME}_IS_ROOT_PROJECT)
|
||||
# Add uninstall target (not for submodules since parent projects typically have uninstall too)
|
||||
include(ECMUninstallTarget)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -74,6 +74,17 @@
|
||||
"CMAKE_UNITY_BUILD" : "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release-no-x11extras",
|
||||
"displayName": "release-no-x11extras",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-release-no-x11extras",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_UNITY_BUILD" : "ON",
|
||||
"KDDockWidgets_X11EXTRAS" : "OFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release-qtquick",
|
||||
"displayName": "release-qtquick",
|
||||
|
||||
13
Changelog
13
Changelog
@@ -1,5 +1,14 @@
|
||||
* v1.4.1 (unreleased)
|
||||
-
|
||||
* v1.5.1 (unreleased)
|
||||
- X11: Improved detecting which window is under the cursor, by using native X11 API
|
||||
|
||||
* v1.5.0 (24 November 2021)
|
||||
- Install the Python bindings to "site-packages"
|
||||
- The Python bindings for Qt6 use the "PyKDDockWidgetsQt6" namespace
|
||||
- Co-installable with Qt6
|
||||
- Adds support for non-detachable central widget, MainWindowOption_HasCentralWidget. (#225)
|
||||
- Fix corrupt layout when restoring old JSON
|
||||
- Fix "Unpin" button not showing up in overlayed widgets
|
||||
- Minimum Qt version is now 5.15
|
||||
|
||||
* v1.4.0 (16 July 2021)
|
||||
- No longer supports Qt versions less than 5.12
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
The KDDockWidgets software is Copyright (C) 2018-2021 Klaralvdalens Datakonsult AB.
|
||||
The KDDockWidgets software is Copyright (C) 2018-2022 Klaralvdalens Datakonsult AB.
|
||||
|
||||
You may use, distribute and copy the KDDockWidgets software under the terms of
|
||||
the GNU General Public License version 2 or under the terms of GNU General
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
KDDockWidgets is (C) 2018-2021, Klarälvdalens Datakonsult AB, and is licensed
|
||||
KDDockWidgets is (C) 2018-2022, Klarälvdalens Datakonsult AB, and is licensed
|
||||
according to the terms of the:
|
||||
GNU General Public License version 2.0 (see LICENSES/GPL-2.0-only.txt)
|
||||
or the
|
||||
|
||||
@@ -2,7 +2,7 @@ Supported Qt versions and toolchains
|
||||
=====================================
|
||||
|
||||
KDDockWidgets for QtQuick requires a C++17 capable compiler and either
|
||||
Qt >= 5.15.0 or Qt >= 6.2.
|
||||
Qt >= 5.15.2 or Qt >= 6.2.1
|
||||
|
||||
|
||||
TROUBLESHOOTING
|
||||
|
||||
52
README.md
52
README.md
@@ -82,7 +82,8 @@ Open a terminal capable of building Qt5 applications.
|
||||
Make sure you have cmake, ninja, compiler, Qt, etc in PATH.
|
||||
|
||||
Adapt the instructions to suit your cmake generator and operating system.
|
||||
Build and install the KDDockWidgets framework:
|
||||
Build and install the KDDockWidgets framework (see the "Building" section
|
||||
below for more info):
|
||||
|
||||
```
|
||||
$ cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/path/where/to/install ../path/to/kddockwidgets
|
||||
@@ -104,14 +105,29 @@ and `/usr/local/KDAB/KDDockWidgets-<version>` on non-Windows.
|
||||
|
||||
You can change the installation location by passing the option `-DCMAKE_INSTALL_PREFIX=/install/path` to cmake.
|
||||
|
||||
Building
|
||||
========
|
||||
On Linux distributions make sure to install the qt5 private development packages:
|
||||
|
||||
- SUSE: libqt5-qtbase-private-headers-devel
|
||||
- Ubuntu, debian-based: qtbase5-private-dev
|
||||
- Fedora, redhat-based: qt5-qtbase-private-devel
|
||||
- others: consult your distro
|
||||
|
||||
Using
|
||||
=====
|
||||
From your CMake project, add
|
||||
From your CMake Qt5 project, add
|
||||
|
||||
```
|
||||
find_package(KDDockWidgets CONFIG)
|
||||
```
|
||||
|
||||
or for Qt6
|
||||
|
||||
```
|
||||
find_package(KDDockWidgets-qt6 CONFIG)
|
||||
```
|
||||
|
||||
and link to the imported target `KDAB::kddockwidgets`.
|
||||
That's all you need to do (the imported target also brings in the include directories)
|
||||
|
||||
@@ -128,11 +144,12 @@ Versioning
|
||||
|
||||
New features go to master while the stable branch only accepts non-intrusive bug fixes.
|
||||
|
||||
We'll try to remain source-compatible across versions. API will get a deprecation
|
||||
notice before being removed in the next version. Note that this source-compatibility
|
||||
effort is only for the public API. Private API (headers ending in _p.h) might change so you
|
||||
shouldn't depend on them. Private API is only exposed so more advanced users can
|
||||
override, for example `paintEvent()`, and not so they can change internal business logic.
|
||||
We'll try to remain source and binary compatible across versions. API will get
|
||||
a deprecation notice before being removed in the next version. Note that this
|
||||
compatibility effort is only for the public API. Private API (headers ending
|
||||
in _p.h) might change so you shouldn't depend on them. Private API is only
|
||||
exposed so more advanced users can override, for example `paintEvent()`, and
|
||||
not so they can change internal business logic.
|
||||
|
||||
We don't promise or test binary compatibility. It's advised that you recompile
|
||||
your application whenever updating KDDW.
|
||||
@@ -140,17 +157,28 @@ your application whenever updating KDDW.
|
||||
|
||||
Supported Qt versions and toolchains
|
||||
=====================================
|
||||
KDDockWidgets requires Qt5 >= 5.12 or Qt6 >= 6.1.
|
||||
The QtQuick support requires Qt5 >= 5.15 or Qt6 >= 6.1.
|
||||
KDDockWidgets requires Qt 5.15.x or Qt6 >= 6.2.
|
||||
|
||||
|
||||
Regarding compilers, whatever toolchain is able to build Qt 5.9 should also be
|
||||
fine. Note however that MSVC 2013 isn't supported anymore due to compiler crashes.
|
||||
Styling
|
||||
========
|
||||
|
||||
Almost all private widgets used by KDDW can be derived by the user to give them
|
||||
a custom look. That's done by providing your own FrameworkWidgetFactory. Run
|
||||
"kddockwidgets_example -p" to see that in action.
|
||||
|
||||
Qt StyleSheets are not, and will not, be supported. See the comments in
|
||||
`examples/dockwidgets/MyTitleBar_CSS.h` for why. You can however use some minimal
|
||||
CSS, as shown in that example, just don't report bugs about it.
|
||||
|
||||
Warning: When using private headers, be sure to rebuild your application whenever you
|
||||
update to a new KDDW version. Binary compatibility is only kept when using public
|
||||
headers.
|
||||
|
||||
|
||||
Licensing
|
||||
=========
|
||||
KDDockWidgets is (C) 2019-2021, Klarälvdalens Datakonsult AB, and is licensed according to
|
||||
KDDockWidgets is (C) 2019-2022, Klarälvdalens Datakonsult AB, and is licensed according to
|
||||
the terms of the [GPL 2.0](LICENSES/GPL-2.0-only.txt) or [GPL 3.0](LICENSES/GPL-3.0-only.txt).
|
||||
|
||||
Contact KDAB at <info@kdab.com> to inquire about commercial licensing.
|
||||
|
||||
29
appveyor.yml
29
appveyor.yml
@@ -19,6 +19,8 @@ skip_tags: false
|
||||
|
||||
# Build worker image
|
||||
image:
|
||||
- Ubuntu
|
||||
- macos
|
||||
- Visual Studio 2019
|
||||
|
||||
# scripts that are called at very beginning, before repo cloning
|
||||
@@ -36,16 +38,28 @@ platform:
|
||||
# build Configuration, i.e. Debug, Release, etc.
|
||||
configuration:
|
||||
- Release
|
||||
- Debug
|
||||
|
||||
install:
|
||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
- set QTDIR=C:\Qt\5.15\msvc2019_64
|
||||
- set PATH=%QTDIR%\bin;%PATH%
|
||||
- sh: if [ "`uname -s`" = "Darwin" ]; then brew install ninja; else sudo apt-get -y install mesa-common-dev libglu1-mesa-dev; fi
|
||||
|
||||
before_build:
|
||||
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
- cmd: set PATH=C:\Qt\5.15\msvc2019_64;%PATH%
|
||||
- sh: if [ "`uname -s`" = "Darwin" ]; then export PATH=$HOME/Qt/5.15/clang_64/bin:$PATH; else export PATH=$HOME/Qt/5.15/gcc_64/bin:$PATH; fi
|
||||
|
||||
build_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
|
||||
- nmake
|
||||
- cmd: cmake -G Ninja -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
|
||||
- sh: cmake -G Ninja -DCMAKE_BUILD_TYPE=$CONFIGURATION -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
|
||||
- cmake --build .
|
||||
- cmd: cmake --build . --target install
|
||||
- sh: sudo cmake --build . --target install
|
||||
- cmd: set PATH=.\bin;%PATH%
|
||||
#temporarily disable testing on Windows
|
||||
#- ctest --test-dir .
|
||||
- sh: ctest --test-dir .
|
||||
|
||||
# to disable automatic builds
|
||||
#build: off
|
||||
@@ -54,11 +68,8 @@ build_script:
|
||||
# tests configuration #
|
||||
#---------------------------------#
|
||||
|
||||
test_script:
|
||||
- nmake test
|
||||
|
||||
# to disable automatic tests
|
||||
#test: off
|
||||
test: off
|
||||
|
||||
|
||||
#---------------------------------#
|
||||
|
||||
@@ -203,7 +203,6 @@ function(ECM_GENERATE_PRI_FILE)
|
||||
else()
|
||||
set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}")
|
||||
endif()
|
||||
set(PRI_TARGET_DEFINES "")
|
||||
|
||||
set(PRI_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/qt_${PRI_TARGET_BASENAME}.pri)
|
||||
if (EGPF_FILENAME_VAR)
|
||||
@@ -211,6 +210,8 @@ function(ECM_GENERATE_PRI_FILE)
|
||||
endif()
|
||||
|
||||
set(PRI_TARGET_MODULE_CONFIG "")
|
||||
set(PRI_TARGET_DEFINES "")
|
||||
set(PRI_TARGET_POSTFIX "")
|
||||
# backward compat: it was not obvious LIB_NAME needs to be a target name,
|
||||
# and some projects where the target name was not the actual library output name
|
||||
# passed the output name for LIB_NAME, so .name & .module prperties are correctly set.
|
||||
@@ -220,6 +221,10 @@ function(ECM_GENERATE_PRI_FILE)
|
||||
if (target_type STREQUAL "STATIC_LIBRARY")
|
||||
set(PRI_TARGET_MODULE_CONFIG "staticlib")
|
||||
endif()
|
||||
get_target_property(target_defs ${EGPF_LIB_NAME} INTERFACE_COMPILE_DEFINITIONS)
|
||||
list(FILTER target_defs EXCLUDE REGEX ^QT_)
|
||||
string(JOIN " " PRI_TARGET_DEFINES "${target_defs}")
|
||||
set(PRI_TARGET_POSTFIX "$<TARGET_PROPERTY:${EGPF_LIB_NAME},$<UPPER_CASE:$<CONFIG>$<$<CONFIG:>:Debug>>_POSTFIX>")
|
||||
endif()
|
||||
|
||||
file(GENERATE
|
||||
@@ -230,8 +235,8 @@ QT.${PRI_TARGET_BASENAME}.MAJOR_VERSION = ${PRI_VERSION_MAJOR}
|
||||
QT.${PRI_TARGET_BASENAME}.MINOR_VERSION = ${PRI_VERSION_MINOR}
|
||||
QT.${PRI_TARGET_BASENAME}.PATCH_VERSION = ${PRI_VERSION_PATCH}
|
||||
QT.${PRI_TARGET_BASENAME}.name = ${PRI_TARGET_LIBNAME}
|
||||
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}
|
||||
QT.${PRI_TARGET_BASENAME}.defines = ${PRI_TARGET_DEFINES}
|
||||
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}${PRI_TARGET_POSTFIX}
|
||||
QT.${PRI_TARGET_BASENAME}.DEFINES = ${PRI_TARGET_DEFINES}
|
||||
QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES}
|
||||
QT.${PRI_TARGET_BASENAME}.private_includes =
|
||||
QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS}
|
||||
|
||||
@@ -24,7 +24,7 @@ if(NOT INSTALL_DATADIR)
|
||||
set(INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR})
|
||||
endif()
|
||||
if(NOT INSTALL_DOC_DIR)
|
||||
set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR})
|
||||
set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}${KDDockWidgets_LIBRARY_QTID})
|
||||
endif()
|
||||
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
@@ -1,47 +1,52 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2016-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2016-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Allen Winter <allen.winter@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
# Assumes you've already found Qt and Qt_VERSION_MAJOR is set
|
||||
#
|
||||
# Create variables for all the various install paths for the Qt version in use
|
||||
# Make sure to have found Qt before using this.
|
||||
# sets variables like QT_INSTALL_PREFIX, QT_INSTALL_DATA, QT_INSTALL_DOCS, etc.
|
||||
# run qmake -query to see a full list
|
||||
|
||||
if(TARGET Qt${QT_MAJOR_VERSION}::qmake)
|
||||
get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_MAJOR_VERSION}::qmake LOCATION)
|
||||
if(NOT DEFINED Qt_VERSION_MAJOR)
|
||||
message(FATAL_ERROR "Please set Qt_VERSION_MAJOR first (ie. set(Qt_VERSION_MAJOR 5))")
|
||||
endif()
|
||||
|
||||
if(TARGET Qt${Qt_VERSION_MAJOR}::qmake)
|
||||
get_target_property(QT_QMAKE_EXECUTABLE Qt${Qt_VERSION_MAJOR}::qmake LOCATION)
|
||||
else()
|
||||
message(FATAL_ERROR "No supported Qt version found. Make sure you find Qt before calling this")
|
||||
message(FATAL_ERROR "No supported Qt version found. Make sure you find Qt before calling this")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${QT_QMAKE_EXECUTABLE} -query
|
||||
RESULT_VARIABLE return_code
|
||||
OUTPUT_VARIABLE ALL_VARS
|
||||
COMMAND ${QT_QMAKE_EXECUTABLE} -query
|
||||
RESULT_VARIABLE return_code
|
||||
OUTPUT_VARIABLE ALL_VARS
|
||||
)
|
||||
if(NOT return_code EQUAL 0)
|
||||
message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query")
|
||||
message(FATAL_ERROR "QMake call failed: ${return_code}")
|
||||
message(WARNING "Failed call: ${QT_QMAKE_EXECUTABLE} -query")
|
||||
message(FATAL_ERROR "QMake call failed: ${return_code}")
|
||||
endif()
|
||||
|
||||
string(REPLACE "\n" ";" VARS_LIST ${ALL_VARS})
|
||||
foreach(QVAL ${VARS_LIST})
|
||||
if(QVAL MATCHES "QT_INSTALL_")
|
||||
string(REPLACE ":" ";" QVAL_LIST ${QVAL})
|
||||
list(LENGTH QVAL_LIST listlen)
|
||||
list(GET QVAL_LIST 0 var)
|
||||
if(WIN32 AND ${listlen} GREATER 2)
|
||||
list(GET QVAL_LIST 2 path)
|
||||
list(GET QVAL_LIST 1 drive)
|
||||
set(path "${drive}:${path}")
|
||||
else()
|
||||
list(GET QVAL_LIST 1 path)
|
||||
if(QVAL MATCHES "QT_INSTALL_")
|
||||
string(REPLACE ":" ";" QVAL_LIST ${QVAL})
|
||||
list(LENGTH QVAL_LIST listlen)
|
||||
list(GET QVAL_LIST 0 var)
|
||||
if(WIN32 AND ${listlen} GREATER 2)
|
||||
list(GET QVAL_LIST 2 path)
|
||||
list(GET QVAL_LIST 1 drive)
|
||||
set(path "${drive}:${path}")
|
||||
else()
|
||||
list(GET QVAL_LIST 1 path)
|
||||
endif()
|
||||
if(NOT ${var}) #if set already on the command line for example
|
||||
set(${var} ${path} CACHE PATH "Qt install path for ${var}")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT ${var}) #if set already on the command line for example
|
||||
set(${var} ${path} CACHE PATH "Qt install path for ${var}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
@@ -19,6 +19,10 @@ endif()
|
||||
#Qt5 requires C++14
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
#remove noisy compiler warnings (as the generated code is not necessarily super-warning-free)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all -Wno-extra")
|
||||
endif()
|
||||
|
||||
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
|
||||
get_target_property(QtCore_is_framework Qt5::Core FRAMEWORK)
|
||||
@@ -130,6 +134,11 @@ macro(CREATE_PYTHON_BINDINGS
|
||||
OUTPUT_NAME ${MODULE_NAME}
|
||||
LIBRARY_OUTPUT_DIRECTORY ${MODULE_OUTPUT_DIR}
|
||||
)
|
||||
if(APPLE)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
|
||||
elseif(NOT WIN32) #ie. linux
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
@@ -19,6 +19,10 @@ endif()
|
||||
#Qt6 requires C++17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
#remove noisy compiler warnings (as the generated code is not necessarily super-warning-free)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all -Wno-extra")
|
||||
endif()
|
||||
|
||||
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
|
||||
get_target_property(QtCore_is_framework Qt6::Core FRAMEWORK)
|
||||
@@ -130,6 +134,11 @@ macro(CREATE_PYTHON_BINDINGS
|
||||
OUTPUT_NAME ${MODULE_NAME}
|
||||
LIBRARY_OUTPUT_DIRECTORY ${MODULE_OUTPUT_DIR}
|
||||
)
|
||||
if(APPLE)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
|
||||
elseif(NOT WIN32) #ie. linux
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
@@ -11,7 +11,7 @@ from conans import ConanFile, CMake, tools
|
||||
|
||||
class KDDockWidgetsConan(ConanFile):
|
||||
name = "kddockwidgets"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
default_user = "kdab"
|
||||
default_channel = "stable"
|
||||
license = ("https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-2.0-only.txt",
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
kddockwidgets (1.5.0) release candidate; urgency=high
|
||||
|
||||
* 1.5.0 final
|
||||
|
||||
-- Allen Winter <allen.winter@kdab.com> Mon, 24 Nov 2021 12:00:00 -0500
|
||||
|
||||
kddockwidgets (1.4.0) release candidate; urgency=high
|
||||
|
||||
* 1.4.0 final
|
||||
|
||||
@@ -6,7 +6,7 @@ Build-Depends: debhelper (>=9), cdbs, cmake
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: https://github.com/KDAB/KDDockWidgets
|
||||
|
||||
Package: kddockwidgets
|
||||
Package: qt5-kddockwidgets
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: KDAB's Dock Widget Framework for Qt
|
||||
Description: KDAB's Dock Widget Framework for Qt
|
||||
@@ -1,10 +1,10 @@
|
||||
Format: 1.0
|
||||
Source: kddockwidgets
|
||||
Version: 1.4.0-1
|
||||
Version: 1.5.0-1
|
||||
Binary: kddockwidgets
|
||||
Maintainer: Allen Winter <allen.winter@kdab.com>
|
||||
Architecture: any
|
||||
Build-Depends: debhelper (>=9), cdbs, cmake, qtbase5-dev, libqt5x11extras5-dev
|
||||
Build-Depends: debhelper (>=9), cdbs, cmake, qtbase5-dev, qtbase5-private-dev, libqt5x11extras5-dev, libfontconfig-dev
|
||||
|
||||
Files:
|
||||
00000000000000000000000000000000 00000 qt5-kddockwidgets-1.4.0.tar.gz
|
||||
00000000000000000000000000000000 00000 qt5-kddockwidgets-1.5.0.tar.gz
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: qt5-kddockwidgets
|
||||
Version: 1.4.0
|
||||
Version: 1.5.0
|
||||
Release: 1
|
||||
Summary: KDAB's Dock Widget Framework for Qt5
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
@@ -14,15 +14,15 @@ Packager: Klaralvdalens Datakonsult AB (KDAB) <info@kdab.com>
|
||||
|
||||
BuildRequires: cmake
|
||||
%if %{defined suse_version}
|
||||
BuildRequires: libqt5-qtbase-devel libqt5-qtx11extras-devel
|
||||
BuildRequires: libqt5-qtbase-devel libqt5-qtbase-private-headers-devel libqt5-qtx11extras-devel
|
||||
%endif
|
||||
|
||||
%if %{defined fedora}
|
||||
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtx11extras-devel desktop-file-utils
|
||||
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtx11extras-devel desktop-file-utils
|
||||
%endif
|
||||
|
||||
%if %{defined rhel}
|
||||
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtx11extras-devel desktop-file-utils
|
||||
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtx11extras-devel desktop-file-utils
|
||||
%endif
|
||||
|
||||
%description
|
||||
@@ -98,6 +98,8 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
|
||||
%{_libdir}/libkddockwidgets.so
|
||||
|
||||
%changelog
|
||||
* Mon Nov 24 2021 Allen Winter <allen.winter@kdab.com> 1.5.0
|
||||
1.5.0 final
|
||||
* Fri Jul 16 2021 Allen Winter <allen.winter@kdab.com> 1.4.0
|
||||
1.4.0 final
|
||||
* Mon Jun 07 2021 Allen Winter <allen.winter@kdab.com> 1.3.1
|
||||
|
||||
12
distro/qt6-debian.control
Normal file
12
distro/qt6-debian.control
Normal file
@@ -0,0 +1,12 @@
|
||||
Source: kddockwidgets
|
||||
Section: Miscellaneous
|
||||
Priority: optional
|
||||
Maintainer: Allen Winter <allen.winter@kdab.com>
|
||||
Build-Depends: debhelper (>=9), cdbs, cmake
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: https://github.com/KDAB/KDDockWidgets
|
||||
|
||||
Package: qt6-kddockwidgets
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: KDAB's Dock Widget Framework for Qt
|
||||
@@ -1,10 +1,10 @@
|
||||
Format: 1.0
|
||||
Source: kddockwidgets
|
||||
Version: 1.4.0-1
|
||||
Version: 1.5.0-1
|
||||
Binary: kddockwidgets
|
||||
Maintainer: Allen Winter <allen.winter@kdab.com>
|
||||
Architecture: any
|
||||
Build-Depends: debhelper (>=9), cdbs, cmake, qtbase6-dev, libqt6x11extras5-dev
|
||||
Build-Depends: debhelper (>=9), cdbs, cmake, qtbase6-dev, qtbase6-private-dev, libqt6x11extras5-dev, libfontconfig-dev
|
||||
|
||||
Files:
|
||||
00000000000000000000000000000000 00000 qt6-kddockwidgets-1.4.0.tar.gz
|
||||
00000000000000000000000000000000 00000 qt6-kddockwidgets-1.5.0.tar.gz
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: qt6-kddockwidgets
|
||||
Version: 1.4.0
|
||||
Version: 1.5.0
|
||||
Release: 1
|
||||
Summary: KDAB's Dock Widget Framework for Qt6
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
@@ -14,15 +14,15 @@ Packager: Klaralvdalens Datakonsult AB (KDAB) <info@kdab.com>
|
||||
|
||||
BuildRequires: cmake
|
||||
%if %{defined suse_version}
|
||||
BuildRequires: libqt6-qtbase-devel libqt6-qtx11extras-devel
|
||||
BuildRequires: libqt6-qtbase-devel libqt6-qtbase-private-headers-devel libqt6-qtx11extras-devel
|
||||
%endif
|
||||
|
||||
%if %{defined fedora}
|
||||
BuildRequires: gcc-c++ qt6-qtbase-devel desktop-file-utils
|
||||
BuildRequires: gcc-c++ qt6-qtbase-devel qt6-qtbase-private-devel desktop-file-utils libxkbcommon-devel
|
||||
%endif
|
||||
|
||||
%if %{defined rhel}
|
||||
BuildRequires: gcc-c++ qt6-qtbase-devel qt6-qtx11extras-devel desktop-file-utils
|
||||
BuildRequires: gcc-c++ qt6-qtbase-devel qt6-qtbase-private-devel qt6-qtx11extras-devel desktop-file-utils libxkbcommon-devel
|
||||
%endif
|
||||
|
||||
%description
|
||||
@@ -74,19 +74,21 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DKDDockWidgets_QT6=True -DCMAKE_BUILD_TYPE=
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_prefix}/share/doc/KDDockWidgets
|
||||
%{_prefix}/share/doc/KDDockWidgets-qt6
|
||||
%{_libdir}/libkddockwidgets-qt6.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{_includedir}/kddockwidgets
|
||||
%{_includedir}/kddockwidgets/*
|
||||
%dir %{_libdir}/cmake/KDDockWidgets
|
||||
%{_libdir}/cmake/KDDockWidgets/*
|
||||
%dir %{_includedir}/kddockwidgets-qt6
|
||||
%{_includedir}/kddockwidgets-qt6/kddockwidgets/*
|
||||
%dir %{_libdir}/cmake/KDDockWidgets-qt6
|
||||
%{_libdir}/cmake/KDDockWidgets-qt6/*
|
||||
%{_libdir}/libkddockwidgets-qt6.so
|
||||
#%{_prefix}/mkspecs/modules/* ECMGeneratePriFile isn't ported to Qt6 yet
|
||||
|
||||
%changelog
|
||||
* Mon Nov 24 2021 Allen Winter <allen.winter@kdab.com> 1.5.0
|
||||
1.5.0 final
|
||||
* Fri Jul 16 2021 Allen Winter <allen.winter@kdab.com> 1.4.0
|
||||
1.4.0 final
|
||||
* Mon Jun 07 2021 Allen Winter <allen.winter@kdab.com> 1.3.1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Allen Winter <allen.winter@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -9,17 +9,6 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
# qhelpgenerator
|
||||
find_program(QHELPGEN_EXECUTABLE qhelpgenerator
|
||||
HINTS ${QT_INSTALL_BINS}
|
||||
)
|
||||
if(QHELPGEN_EXECUTABLE)
|
||||
set(HAVE_QHELPGEN "YES")
|
||||
else()
|
||||
set(HAVE_QHELPGEN "NO")
|
||||
message(STATUS "Unable to generate the API documentation in qch format. To fix, install the qthelpgenerator program which comes with Qt5.")
|
||||
endif()
|
||||
|
||||
# Doxygen
|
||||
find_package(Doxygen)
|
||||
set_package_properties(Doxygen PROPERTIES
|
||||
@@ -28,12 +17,6 @@ set_package_properties(Doxygen PROPERTIES
|
||||
URL "https://www.doxygen.org"
|
||||
PURPOSE "Needed to build the API documentation."
|
||||
)
|
||||
if(DOXYGEN_DOT_EXECUTABLE)
|
||||
set(HAVE_DOT "YES")
|
||||
else()
|
||||
set(HAVE_DOT "NO")
|
||||
message(STATUS "Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org")
|
||||
endif()
|
||||
|
||||
if(DOXYGEN_FOUND)
|
||||
add_subdirectory(api)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Allen Winter <allen.winter@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -9,6 +9,25 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
# dot should come with Doxygen find_package(Doxygen)
|
||||
if(DOXYGEN_DOT_EXECUTABLE)
|
||||
set(HAVE_DOT "YES")
|
||||
else()
|
||||
set(HAVE_DOT "NO")
|
||||
message(STATUS "Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org")
|
||||
endif()
|
||||
|
||||
# qhelpgenerator
|
||||
find_program(QHELPGEN_EXECUTABLE qhelpgenerator
|
||||
HINTS ${QT_INSTALL_BINS}
|
||||
)
|
||||
if(QHELPGEN_EXECUTABLE)
|
||||
set(HAVE_QHELPGEN "YES")
|
||||
else()
|
||||
set(HAVE_QHELPGEN "NO")
|
||||
message(STATUS "Unable to generate the API documentation in qch format. To fix, install the qthelpgenerator program which comes with Qt.")
|
||||
endif()
|
||||
|
||||
find_file(QDOC_QTCORE_TAG qtcore.tags
|
||||
HINTS ${QT_INSTALL_DOCS}/qtcore
|
||||
HINTS ${QT_INSTALL_DATA}/doc/qtcore
|
||||
@@ -47,4 +66,6 @@ add_custom_command(
|
||||
add_custom_target(kddockwidgets-api.qch ALL DEPENDS ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch)
|
||||
add_custom_target(docs DEPENDS kddockwidgets-api.qch)
|
||||
|
||||
install(FILES ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch DESTINATION ${INSTALL_DOC_DIR})
|
||||
set(QCH_INSTALL_DIR ${INSTALL_DOC_DIR} CACHE STRING "Install location of Qt Assistant help files.")
|
||||
install(FILES ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch DESTINATION ${QCH_INSTALL_DIR})
|
||||
install(FILES ${DOXYGEN_OUTPUT_DIR}/kddockwidgets.tags DESTINATION ${INSTALL_DOC_DIR})
|
||||
|
||||
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# title of most generated pages and in a few other places.
|
||||
# The default value is: My Project.
|
||||
|
||||
PROJECT_NAME = "KDDockWidgets API Documentation"
|
||||
PROJECT_NAME = "@PROJECT_NAME@ API Documentation"
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
@@ -874,7 +874,9 @@ INPUT_ENCODING = UTF-8
|
||||
|
||||
FILE_PATTERNS = *.cpp \
|
||||
*.h \
|
||||
*.md
|
||||
*.dox \
|
||||
*.md \
|
||||
*.gif
|
||||
|
||||
# The RECURSIVE tag can be used to specify whether or not subdirectories should
|
||||
# be searched for input files as well.
|
||||
@@ -1446,7 +1448,7 @@ QCH_FILE = "@DOXYGEN_OUTPUT_DIR@/qch/kddockwidgets-api.qch"
|
||||
# The default value is: org.doxygen.Project.
|
||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||
|
||||
QHP_NAMESPACE = com.kdab.KDDockWidgets.api.@KDDockWidgets_VERSION@
|
||||
QHP_NAMESPACE = com.kdab.@PROJECT_NAME@.api.@KDDockWidgets_VERSION@
|
||||
|
||||
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
|
||||
# Help Project output. For more information please see Qt Help Project / Virtual
|
||||
@@ -1455,7 +1457,7 @@ QHP_NAMESPACE = com.kdab.KDDockWidgets.api.@KDDockWidgets_VERSION@
|
||||
# The default value is: doc.
|
||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||
|
||||
QHP_VIRTUAL_FOLDER = KDDockWidgets-@KDDockWidgets_VERSION@
|
||||
QHP_VIRTUAL_FOLDER = @PROJECT_NAME@-@KDDockWidgets_VERSION@
|
||||
|
||||
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
|
||||
# filter to add. For more information please see Qt Help Project / Custom
|
||||
@@ -1758,7 +1760,7 @@ LATEX_OUTPUT = latex
|
||||
# the output language.
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
LATEX_CMD_NAME =
|
||||
LATEX_CMD_NAME = latex
|
||||
|
||||
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
|
||||
# index for LaTeX.
|
||||
@@ -1795,7 +1797,7 @@ COMPACT_LATEX = NO
|
||||
# The default value is: a4.
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
PAPER_TYPE = a4wide
|
||||
PAPER_TYPE = a4
|
||||
|
||||
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
|
||||
# that should be included in the LaTeX output. The package can be specified just
|
||||
@@ -1872,7 +1874,7 @@ PDF_HYPERLINKS = YES
|
||||
# The default value is: YES.
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
USE_PDFLATEX = YES
|
||||
USE_PDFLATEX = NO
|
||||
|
||||
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
|
||||
# command to the generated LaTeX files. This will instruct LaTeX to keep running
|
||||
@@ -2255,7 +2257,7 @@ TAGFILES = "@QDOC_TAG_DIR@/qtcore/qtcore.tags=https://doc.qt.io/qt
|
||||
# tag file that is based on the input files it reads. See section "Linking to
|
||||
# external documentation" for more information about the usage of tag files.
|
||||
|
||||
GENERATE_TAGFILE = kddockwidgets.tag
|
||||
GENERATE_TAGFILE = "@DOXYGEN_OUTPUT_DIR@/kddockwidgets.tags"
|
||||
|
||||
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
|
||||
# the class index. If set to NO, only the inherited external classes will be
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<hr>
|
||||
<div style="float: left;">
|
||||
<img src="kdab-logo-16x16.png">
|
||||
<font style="font-weight: bold;">© 2019-2021 Klarälvdalens Datakonsult AB (KDAB)</font>
|
||||
<font style="font-weight: bold;">© 2019-2022 Klarälvdalens Datakonsult AB (KDAB)</font>
|
||||
<br>
|
||||
"The Qt, C++ and OpenGL Experts"<br>
|
||||
<a href="https://www.kdab.com/">https://www.kdab.com/</a>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
#include "MyFrameworkWidgetFactory.h"
|
||||
#include "MyTitleBar_CSS.h"
|
||||
|
||||
#include <kddockwidgets/FrameworkWidgetFactory.h>
|
||||
|
||||
@@ -89,11 +90,13 @@ MySeparator::~MySeparator() = default;
|
||||
|
||||
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const
|
||||
{
|
||||
// Feel free to return MyTitleBar_CSS here instead, but just for education purposes!
|
||||
return new MyTitleBar(frame);
|
||||
}
|
||||
|
||||
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::FloatingWindow *fw) const
|
||||
{
|
||||
// Feel free to return MyTitleBar_CSS here instead, but just for education purposes!
|
||||
return new MyTitleBar(fw);
|
||||
}
|
||||
|
||||
@@ -101,4 +104,3 @@ Layouting::Separator * CustomWidgetFactory::createSeparator(Layouting::Widget *p
|
||||
{
|
||||
return new MySeparator(parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -56,9 +56,9 @@ MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowO
|
||||
, m_dockwidget5DoesntCloseBeforeRestore(dockwidget5DoesntCloseBeforeRestore)
|
||||
{
|
||||
auto menubar = menuBar();
|
||||
auto fileMenu = new QMenu(QStringLiteral("File"));
|
||||
m_toggleMenu = new QMenu(QStringLiteral("Toggle"));
|
||||
auto miscMenu = new QMenu(QStringLiteral("Misc"));
|
||||
auto fileMenu = new QMenu(QStringLiteral("File"), this);
|
||||
m_toggleMenu = new QMenu(QStringLiteral("Toggle"), this);
|
||||
auto miscMenu = new QMenu(QStringLiteral("Misc"), this);
|
||||
|
||||
menubar->addMenu(fileMenu);
|
||||
menubar->addMenu(m_toggleMenu);
|
||||
@@ -115,6 +115,10 @@ MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowO
|
||||
|
||||
setAffinities({ affinityName });
|
||||
createDockWidgets();
|
||||
|
||||
if (options & KDDockWidgets::MainWindowOption_HasCentralWidget) {
|
||||
setPersistentCentralWidget(new MyWidget1());
|
||||
}
|
||||
}
|
||||
|
||||
MyMainWindow::~MyMainWindow()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
86
examples/dockwidgets/MyTitleBar_CSS.h
Normal file
86
examples/dockwidgets/MyTitleBar_CSS.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#ifndef EXAMPLETITLEBAR_CSS_H
|
||||
#define EXAMPLETITLEBAR_CSS_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <kddockwidgets/private/widgets/TitleBarWidget_p.h>
|
||||
|
||||
/**
|
||||
* @brief Shows how to implement a custom titlebar which uses "Qt StyleSheets".
|
||||
*
|
||||
* Derive from KDDockWidgets::DefaultWidgetFactory and override the two createTitleBar() methods.
|
||||
*
|
||||
* To try it out, modify examples/dockwidgets/MyFrameworkWidgetFactory.cpp to return a MyTitleBar_CSS instance.
|
||||
* Run the example with: ./bin/kddockwidgets_example -p
|
||||
*
|
||||
* WARNINGS:
|
||||
* - Qt StyleSheets are not recommended for new applications. Often you are able to style 90% of
|
||||
* the application but then hit a road block. QStyle is much more powerful and flexible.
|
||||
* - The Qt maintainers have manifested intention to deprecated stylesheets.
|
||||
* - Stylesheets are supported for built-in QWidgets (QPushButton, QComboBox, etc.), any widget
|
||||
* that's not in Qt needs to be crafted by the user, that includes, for example, having to paint
|
||||
* your background manually. KDDockWidget::TitleBarWidget does this for your convenience though.
|
||||
* - Qt stylesheets don't react to property changes (known old bug in Qt), for example:
|
||||
* QLineEdit[readOnly="true"] { color: gray }
|
||||
* this won't trigger when readOnly changes to false, you need to set/unset. This is QTBUG-51236
|
||||
* - KDDockWidgets::TitleBarWidget::isFocused is a property, there for needs to workaround the
|
||||
* above bug by unsetting the sheet and setting it again.
|
||||
*/
|
||||
class MyTitleBar_CSS : public KDDockWidgets::TitleBarWidget
|
||||
{
|
||||
public:
|
||||
explicit MyTitleBar_CSS(KDDockWidgets::Frame *frame)
|
||||
: KDDockWidgets::TitleBarWidget(frame)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
explicit MyTitleBar_CSS(KDDockWidgets::FloatingWindow *fw)
|
||||
: KDDockWidgets::TitleBarWidget(fw)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
~MyTitleBar_CSS() override;
|
||||
|
||||
void initStyleSheet()
|
||||
{
|
||||
// Or use qApp->setStyleSheet(), as you prefer
|
||||
setStyleSheet(QStringLiteral("KDDockWidgets--TitleBarWidget {"
|
||||
"background: blue"
|
||||
"}"
|
||||
"KDDockWidgets--TitleBarWidget:hover {"
|
||||
"background: red"
|
||||
"}"
|
||||
"KDDockWidgets--TitleBarWidget[isFocused=true] {"
|
||||
"background: green"
|
||||
"}"));
|
||||
}
|
||||
|
||||
void init()
|
||||
{
|
||||
initStyleSheet();
|
||||
connect(this, &KDDockWidgets::TitleBar::isFocusedChanged, this, [this] {
|
||||
// Workaround QTBUG-51236, this makes the [isFocused=true] syntax useful
|
||||
setStyleSheet(QString());
|
||||
initStyleSheet();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
MyTitleBar_CSS::~MyTitleBar_CSS()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -120,9 +120,17 @@ int main(int argc, char **argv)
|
||||
parser.addOption(dontCloseBeforeRestore);
|
||||
|
||||
QCommandLineOption showButtonsInTabBarIfTitleBarHidden("show-buttons-in-tabbar-if-titlebar-hidden",
|
||||
QCoreApplication::translate("main", "If we're not using title bars we'll still show the close and float button in the tab bar"));
|
||||
QCoreApplication::translate("main", "If we're not using title bars we'll still show the close and float button in the tab bar"));
|
||||
parser.addOption(showButtonsInTabBarIfTitleBarHidden);
|
||||
|
||||
QCommandLineOption centralWidget("central-widget",
|
||||
QCoreApplication::translate("main", "The main window will have a non-detachable central widget"));
|
||||
parser.addOption(centralWidget);
|
||||
|
||||
QCommandLineOption ctxtMenuOnTabs("allow-switch-tabs-via-menu",
|
||||
QCoreApplication::translate("main", "Allow switching tabs via context menu in tabs area"));
|
||||
parser.addOption(ctxtMenuOnTabs);
|
||||
|
||||
#if defined(DOCKS_DEVELOPER_MODE)
|
||||
parser.addOption(centralFrame);
|
||||
|
||||
@@ -164,6 +172,9 @@ int main(int argc, char **argv)
|
||||
options = parser.isSet(centralFrame) ? MainWindowOption_HasCentralFrame
|
||||
: MainWindowOption_None;
|
||||
|
||||
if (parser.isSet(centralWidget))
|
||||
options |= MainWindowOption_HasCentralWidget;
|
||||
|
||||
if (parser.isSet(noQtTool))
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows;
|
||||
|
||||
@@ -230,6 +241,9 @@ int main(int argc, char **argv)
|
||||
if (parser.isSet(tabsHaveCloseButton))
|
||||
flags |= KDDockWidgets::Config::Flag_TabsHaveCloseButton;
|
||||
|
||||
if (parser.isSet(ctxtMenuOnTabs))
|
||||
flags |= KDDockWidgets::Config::Flag_AllowSwitchingTabsViaMenu;
|
||||
|
||||
|
||||
if (parser.isSet(doubleClickMaximize))
|
||||
flags |= KDDockWidgets::Config::Flag_DoubleClickMaximizes;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
set(PYTHON_VERSION "3.7" CACHE STRING "Use specific python version to build the project.")
|
||||
find_package(Python3 ${PYTHON_VERSION} REQUIRED COMPONENTS Interpreter Development)
|
||||
set(PYTHON_BINDING_NAMESPACE "PyKDDockWidgets")
|
||||
|
||||
# Just to fix warnings with --warn-uninitialized
|
||||
if(NOT DEFINED SHIBOKEN_CUSTOM_PREFIX) #look for shiboken in a custom location
|
||||
@@ -21,15 +19,26 @@ if(NOT DEFINED PYSIDE_CUSTOM_PREFIX) #look for pyside in a custom location
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_QT6)
|
||||
find_package(Shiboken6 REQUIRED)
|
||||
find_package(PySide6 ${Qt6Widgets_VERSION} EXACT REQUIRED)
|
||||
include(PySide6ModuleBuild)
|
||||
set(PYSIDE_MAJOR_VERSION "6")
|
||||
set(PYTHON_BINDING_NAMESPACE "${PYTHON_BINDING_NAMESPACE}Qt${PYSIDE_MAJOR_VERSION}")
|
||||
set(QtWidgets_VERSION ${Qt6Widgets_VERSION})
|
||||
else()
|
||||
find_package(Shiboken2 REQUIRED)
|
||||
find_package(PySide2 ${Qt5Widgets_VERSION} EXACT REQUIRED)
|
||||
include(PySide2ModuleBuild)
|
||||
set(PYSIDE_MAJOR_VERSION "2")
|
||||
set(QtWidgets_VERSION ${Qt5Widgets_VERSION})
|
||||
endif()
|
||||
|
||||
find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter Development)
|
||||
find_package(Shiboken${PYSIDE_MAJOR_VERSION} REQUIRED)
|
||||
find_package(PySide${PYSIDE_MAJOR_VERSION} ${QtWidgets_VERSION} EXACT REQUIRED)
|
||||
|
||||
if(NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX)
|
||||
set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
endif()
|
||||
set(BINDINGS_DIR "${INSTALL_LIBRARY_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/${PYTHON_BINDING_NAMESPACE}")
|
||||
set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX "${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/${BINDINGS_DIR}")
|
||||
|
||||
include(PySide${PYSIDE_MAJOR_VERSION}ModuleBuild)
|
||||
add_subdirectory(PyKDDockWidgets)
|
||||
if(${PROJECT_NAME}_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -48,9 +48,10 @@ set(PyKDDockWidgets_target_include_directories
|
||||
# Libraries that will be necessary to link the target, this will used in the command 'target_link_libraries'
|
||||
set(PyKDDockWidgets_target_link_libraries
|
||||
KDAB::kddockwidgets
|
||||
Qt${QT_MAJOR_VERSION}::Core
|
||||
Qt${QT_MAJOR_VERSION}::Gui
|
||||
Qt${QT_MAJOR_VERSION}::Widgets
|
||||
Qt${Qt_VERSION_MAJOR}::Core
|
||||
Qt${Qt_VERSION_MAJOR}::Gui
|
||||
Qt${Qt_VERSION_MAJOR}::Widgets
|
||||
${Python3_LIBRARIES}
|
||||
)
|
||||
|
||||
# changes on these files should trigger a new generation
|
||||
@@ -80,4 +81,19 @@ create_python_bindings(
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/__init__.py @ONLY)
|
||||
|
||||
# install
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/__init__.py DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/PyKDDockWidgets)
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/__init__.py
|
||||
$<TARGET_FILE:KDAB::kddockwidgets>
|
||||
DESTINATION
|
||||
${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
|
||||
)
|
||||
if(NOT WIN32)
|
||||
install(
|
||||
FILES
|
||||
$<TARGET_LINKER_FILE:KDAB::kddockwidgets>
|
||||
$<TARGET_SONAME_FILE:KDAB::kddockwidgets>
|
||||
DESTINATION
|
||||
${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -10,9 +10,31 @@
|
||||
#
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
__all__ = ['KDDockWidgets']
|
||||
|
||||
def setupLibraryPath():
|
||||
if sys.platform != 'win32':
|
||||
return
|
||||
|
||||
if "@PYSIDE_MAJOR_VERSION@" == "6":
|
||||
from shiboken@PYSIDE_MAJOR_VERSION@ import Shiboken
|
||||
else:
|
||||
from shiboken@PYSIDE_MAJOR_VERSION@ import shiboken@PYSIDE_MAJOR_VERSION@ as Shiboken
|
||||
|
||||
from PySide@PYSIDE_MAJOR_VERSION@ import QtCore
|
||||
extra_dll_dirs = [ os.path.abspath(os.path.dirname(Shiboken.__file__)),
|
||||
os.path.abspath(os.path.dirname(QtCore.__file__)),
|
||||
os.path.abspath(os.path.dirname(__file__)) ]
|
||||
|
||||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
|
||||
for dll_dir in extra_dll_dirs:
|
||||
os.add_dll_directory(dll_dir)
|
||||
|
||||
for dll_dir in extra_dll_dirs:
|
||||
os.environ['PATH'] = os.fspath(dll_dir) + os.pathsep + os.environ['PATH']
|
||||
|
||||
# Preload PySide libraries to avoid missing libraries while loading KDDockWidgets
|
||||
try:
|
||||
from PySide@PYSIDE_MAJOR_VERSION@ import QtCore
|
||||
@@ -22,3 +44,5 @@ try:
|
||||
except Exception:
|
||||
print("Failed to load PySide")
|
||||
raise
|
||||
|
||||
setupLibraryPath()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
163
python/examples-qt6/MyMainWindow.py
Normal file
163
python/examples-qt6/MyMainWindow.py
Normal file
@@ -0,0 +1,163 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
from PyKDDockWidgetsQt6 import KDDockWidgets
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
|
||||
from MyWidget1 import MyWidget1
|
||||
from MyWidget2 import MyWidget2
|
||||
from MyWidget3 import MyWidget3
|
||||
|
||||
def newMyWidget(parent = None):
|
||||
randomNumber = QtCore.QRandomGenerator.global_().bounded(0, 100) + 1
|
||||
if (randomNumber < 50):
|
||||
if (randomNumber < 33):
|
||||
return MyWidget1(parent)
|
||||
else:
|
||||
return MyWidget3(parent)
|
||||
else:
|
||||
return MyWidget2(parent)
|
||||
|
||||
class MyMainWindow(KDDockWidgets.MainWindow):
|
||||
s_count = 0
|
||||
s_menuCount = 0
|
||||
|
||||
def __init__(self, uniqueName, options = KDDockWidgets.MainWindowOption_None, dockWidget0IsNonClosable = False, nonDockableDockWidget9 = False, restoreIsRelative = False, maxSizeForDockWidget8 = False, affinityName = "", parent = None):
|
||||
super().__init__(uniqueName, options, parent)
|
||||
self.m_dockWidget0IsNonClosable = dockWidget0IsNonClosable
|
||||
self.m_dockWidget9IsNonDockable = nonDockableDockWidget9
|
||||
self.m_restoreIsRelative = restoreIsRelative
|
||||
self.m_maxSizeForDockWidget8 = maxSizeForDockWidget8
|
||||
self.m_dockwidgets = []
|
||||
|
||||
menubar = self.menuBar()
|
||||
fileMenu = QtWidgets.QMenu("File")
|
||||
self.m_toggleMenu = QtWidgets.QMenu("Toggle")
|
||||
menubar.addMenu(fileMenu)
|
||||
menubar.addMenu(self.m_toggleMenu)
|
||||
|
||||
newAction = fileMenu.addAction("New DockWidget")
|
||||
newAction.triggered.connect(self._newDockWidget)
|
||||
|
||||
saveLayoutAction = fileMenu.addAction("Save Layout")
|
||||
saveLayoutAction.triggered.connect(self._saveLayout)
|
||||
|
||||
restoreLayoutAction = fileMenu.addAction("Restore Layout")
|
||||
restoreLayoutAction.triggered.connect(self._restoreLayout)
|
||||
|
||||
closeAllAction = fileMenu.addAction("Close All")
|
||||
closeAllAction.triggered.connect(self._closeAll)
|
||||
|
||||
layoutEqually = fileMenu.addAction("Layout Equally")
|
||||
layoutEqually.triggered.connect(self.layoutEqually)
|
||||
|
||||
quitAction = fileMenu.addAction("Quit")
|
||||
quitAction.triggered.connect(QtWidgets.QApplication.instance().quit)
|
||||
|
||||
self.setAffinities([ affinityName ])
|
||||
self.createDockWidgets()
|
||||
|
||||
def _newDockWidget(self):
|
||||
MyMainWindow.s_menuCount += 1
|
||||
w = newMyWidget(self)
|
||||
w.setGeometry(100, 100, 400, 400)
|
||||
dock = KDDockWidgets.DockWidget("new dock %d"%(MyMainWindow.s_menuCount))
|
||||
dock.setWidget(w)
|
||||
dock.resize(600, 600)
|
||||
dock.show()
|
||||
self.m_dockwidgets.append(dock)
|
||||
|
||||
def _saveLayout(self):
|
||||
#saver = KDDockWidgets.LayoutSaver()
|
||||
#result = saver.saveToFile("mylayout.json")
|
||||
#print("Saving layout to disk. Result=", result)
|
||||
print("Not available")
|
||||
|
||||
def _restoreLayout(self):
|
||||
#options = KDDockWidgets.RestoreOption_None
|
||||
#if self.m_restoreIsRelative:
|
||||
# options |= KDDockWidgets.RestoreOption_RelativeToMainWindow
|
||||
#saver = KDDockWidgets.LayoutSaver(options)
|
||||
#saver.restoreFromFile("mylayout.json")
|
||||
print("Not available")
|
||||
|
||||
def _closeAll(self):
|
||||
for dw in self.m_dockwidgets:
|
||||
dw.close()
|
||||
|
||||
def createDockWidgets(self):
|
||||
if self.m_dockWidget9IsNonDockable:
|
||||
numDockWidgets = 10
|
||||
else:
|
||||
numDockWidgets = 9
|
||||
|
||||
# numDockWidgets = 2
|
||||
# Create 9 KDDockWidget::DockWidget and the respective widgets they're hosting (MyWidget instances)
|
||||
for i in range(numDockWidgets):
|
||||
self.m_dockwidgets.append(self.newDockWidget())
|
||||
|
||||
# MainWindow::addDockWidget() attaches a dock widget to the main window:
|
||||
initialOpts = KDDockWidgets.InitialOption(KDDockWidgets.InitialVisibilityOption.StartHidden, QtCore.QSize(500, 500))
|
||||
self.addDockWidget(self.m_dockwidgets[0], KDDockWidgets.Location_OnBottom, None, initialOpts)
|
||||
|
||||
# Here, for finer granularity we specify right of dockwidgets[0]:
|
||||
self.addDockWidget(self.m_dockwidgets[1], KDDockWidgets.Location_OnRight, self.m_dockwidgets[0])
|
||||
|
||||
self.addDockWidget(self.m_dockwidgets[2], KDDockWidgets.Location_OnLeft)
|
||||
self.addDockWidget(self.m_dockwidgets[3], KDDockWidgets.Location_OnBottom)
|
||||
self.addDockWidget(self.m_dockwidgets[4], KDDockWidgets.Location_OnBottom)
|
||||
|
||||
# Tab two dock widgets together
|
||||
self.m_dockwidgets[3].addDockWidgetAsTab(self.m_dockwidgets[5])
|
||||
|
||||
# 6 is floating, as it wasn't added to the main window via MainWindow::addDockWidget().
|
||||
# and we tab 7 with it.
|
||||
self.m_dockwidgets[6].addDockWidgetAsTab(self.m_dockwidgets[7])
|
||||
|
||||
# Floating windows also support nesting, here we add 8 to the bottom of the group
|
||||
self.m_dockwidgets[6].addDockWidgetToContainingWindow(self.m_dockwidgets[8], KDDockWidgets.Location_OnBottom)
|
||||
|
||||
floatingWindow = self.m_dockwidgets[6].window()
|
||||
floatingWindow.move(100, 100)
|
||||
|
||||
def newDockWidget(self):
|
||||
# Passing options is optional, we just want to illustrate Option_NotClosable here
|
||||
options = KDDockWidgets.DockWidget.Option_None
|
||||
if (MyMainWindow.s_count == 0) and self.m_dockWidget0IsNonClosable:
|
||||
options |= KDDockWidgets.DockWidget.Option_NotClosable
|
||||
|
||||
if (MyMainWindow.s_count == 9) and self.m_dockWidget9IsNonDockable:
|
||||
options |= KDDockWidgets.DockWidget.Option_NotDockable
|
||||
|
||||
dock = KDDockWidgets.DockWidget("DockWidget #%d"%(MyMainWindow.s_count), options)
|
||||
dock.setAffinities(self.affinities()); # optional, just to show the feature. Pass -mi to the example to see incompatible dock widgets
|
||||
|
||||
if MyMainWindow.s_count == 1:
|
||||
dock.setIcon(QtGui.QIcon.fromTheme("mail-message"))
|
||||
|
||||
myWidget = newMyWidget(self)
|
||||
if (MyMainWindow.s_count == 8) and self.m_maxSizeForDockWidget8:
|
||||
# Set a maximum size on dock #8
|
||||
myWidget.setMaximumSize(200, 200)
|
||||
|
||||
dock.setWidget(myWidget)
|
||||
|
||||
if dock.options() & KDDockWidgets.DockWidget.Option_NotDockable:
|
||||
dock.setTitle("DockWidget #%d (%s)" %(MyMainWindow.s_count, "non dockable"))
|
||||
else:
|
||||
dock.setTitle("DockWidget #%d"%(MyMainWindow.s_count))
|
||||
|
||||
dock.resize(600, 600)
|
||||
self.m_toggleMenu.addAction(dock.toggleAction())
|
||||
MyMainWindow.s_count += 1
|
||||
return dock
|
||||
|
||||
51
python/examples-qt6/MyWidget.py
Normal file
51
python/examples-qt6/MyWidget.py
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
import PyKDDockWidgetsQt6
|
||||
|
||||
from PySide6 import QtWidgets, QtGui, QtCore
|
||||
|
||||
class MyWidget(QtWidgets.QWidget):
|
||||
s_images = {}
|
||||
def __init__(self, backgroundFile, logoFile, parent = None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.m_background = self._lookupImage(backgroundFile)
|
||||
self.m_logo = self._lookupImage(logoFile)
|
||||
|
||||
def _lookupImage(self, imageName):
|
||||
if imageName == "":
|
||||
return None
|
||||
|
||||
if imageName not in MyWidget.s_images:
|
||||
MyWidget.s_images[imageName] = QtGui.QImage(imageName)
|
||||
|
||||
return MyWidget.s_images[imageName]
|
||||
|
||||
def drawLogo(self, p):
|
||||
|
||||
if not self.m_logo:
|
||||
return
|
||||
|
||||
ratio = self.m_logo.height() / (self.m_logo.width() * 1.0)
|
||||
maxWidth = int(0.80 * self.size().width())
|
||||
maxHeight = int(0.80 * self.size().height())
|
||||
proposedHeight = int(maxWidth * ratio)
|
||||
if (proposedHeight <= maxHeight):
|
||||
width = maxWidth
|
||||
else:
|
||||
width = int(maxHeight / ratio)
|
||||
|
||||
height = int(width * ratio)
|
||||
targetLogoRect = QtCore.QRect(0,0, width, height)
|
||||
targetLogoRect.moveCenter(self.rect().center() + QtCore.QPoint(0, -int(self.size().height() * 0.00)))
|
||||
p.drawImage(targetLogoRect, self.m_logo, self.m_logo.rect());
|
||||
|
||||
29
python/examples-qt6/MyWidget1.py
Normal file
29
python/examples-qt6/MyWidget1.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
import PyKDDockWidgetsQt6
|
||||
|
||||
from PySide6 import QtWidgets, QtGui
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
|
||||
class MyWidget1(MyWidget):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(":/assets/triangles.png", ":/assets/KDAB_bubble_white.png", parent)
|
||||
|
||||
|
||||
def paintEvent(self, ev):
|
||||
p = QtGui.QPainter(self)
|
||||
p.fillRect(self.rect(), QtGui.QColor(0xCC, 0xCC, 0xCC))
|
||||
p.drawImage(self.m_background.rect(), self.m_background, self.m_background.rect())
|
||||
self.drawLogo(p)
|
||||
|
||||
27
python/examples-qt6/MyWidget2.py
Normal file
27
python/examples-qt6/MyWidget2.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
import PyKDDockWidgetsQt6
|
||||
|
||||
from PySide6 import QtWidgets, QtGui, QtCore
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
class MyWidget2(MyWidget):
|
||||
|
||||
def __init__(self, parent = None):
|
||||
super().__init__("", ":/assets/KDAB_bubble_blue.png", parent)
|
||||
|
||||
def paintEvent(self, ev):
|
||||
p = QtGui.QPainter(self)
|
||||
p.fillRect(self.rect(), QtCore.Qt.white);
|
||||
self.drawLogo(p)
|
||||
|
||||
32
python/examples-qt6/MyWidget3.py
Normal file
32
python/examples-qt6/MyWidget3.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
import PyKDDockWidgetsQt6
|
||||
|
||||
from PySide6 import QtWidgets, QtGui, QtCore
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
class MyWidget3(MyWidget):
|
||||
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(":/assets/base.png", ":/assets/KDAB_bubble_fulcolor.png", parent)
|
||||
self.m_triangle = QtGui.QImage(":/assets/tri.png")
|
||||
|
||||
def paintEvent(self, ev):
|
||||
p = QtGui.QPainter(self)
|
||||
p.fillRect(self.rect(), QtGui.QColor(0xD5, 0xD5, 0xD5))
|
||||
p.drawImage(self.m_background.rect(), self.m_background, self.m_background.rect())
|
||||
|
||||
targetRect = QtCore.QRect(QtCore.QPoint(self.width() - self.m_triangle.width(), self.height() - self.m_triangle.height()), self.m_triangle.size())
|
||||
|
||||
self.drawLogo(p)
|
||||
|
||||
8
python/examples-qt6/README.txt
Normal file
8
python/examples-qt6/README.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Running python example
|
||||
======================
|
||||
|
||||
Generate resource file with:
|
||||
~# rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc
|
||||
|
||||
Run the app:
|
||||
~# python3 main.py
|
||||
38
python/examples-qt6/main.py
Normal file
38
python/examples-qt6/main.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
from PyKDDockWidgetsQt6 import KDDockWidgets
|
||||
from MyMainWindow import MyMainWindow
|
||||
|
||||
from PySide6 import QtWidgets, QtCore
|
||||
|
||||
import sys
|
||||
try:
|
||||
import rc_assets
|
||||
except:
|
||||
exit("Oops.. rc_assets needs to be generated first.\nPlease run:\n rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc\n(Make sure to use the rcc from the Qt6 version used to generate the bindings!)")
|
||||
|
||||
if __name__ == "__main__":
|
||||
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
||||
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
|
||||
app.setOrganizationName("KDAB")
|
||||
app.setApplicationName("Test app")
|
||||
app.setStyle(QtWidgets.QStyleFactory.create("Fusion"))
|
||||
|
||||
mainWindow = MyMainWindow("MyMainWindow", )
|
||||
mainWindow.setWindowTitle("Main Window 1")
|
||||
mainWindow.resize(1200, 1200)
|
||||
mainWindow.show()
|
||||
|
||||
app.exec_()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
from PyKDDockWidgets import KDDockWidgets
|
||||
|
||||
from PySide import QtCore, QtWidgets, QtGui
|
||||
from PySide2 import QtCore, QtWidgets, QtGui
|
||||
|
||||
from MyWidget1 import MyWidget1
|
||||
from MyWidget2 import MyWidget2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui, QtCore
|
||||
from PySide2 import QtWidgets, QtGui, QtCore
|
||||
|
||||
class MyWidget(QtWidgets.QWidget):
|
||||
s_images = {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui
|
||||
from PySide2 import QtWidgets, QtGui
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui, QtCore
|
||||
from PySide2 import QtWidgets, QtGui, QtCore
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui, QtCore
|
||||
from PySide2 import QtWidgets, QtGui, QtCore
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -12,10 +12,13 @@
|
||||
from PyKDDockWidgets import KDDockWidgets
|
||||
from MyMainWindow import MyMainWindow
|
||||
|
||||
from PySide import QtWidgets, QtCore
|
||||
from PySide2 import QtWidgets, QtCore
|
||||
|
||||
import sys
|
||||
import rc_assets
|
||||
try:
|
||||
import rc_assets
|
||||
except:
|
||||
exit("Oops.. rc_assets needs to be generated first.\nPlease run:\n rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc\n(Make sure to use the rcc from the Qt5 version used to generate the bindings!)")
|
||||
|
||||
if __name__ == "__main__":
|
||||
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
||||
|
||||
40
python/tests/CMakeLists.txt
Normal file
40
python/tests/CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.py @ONLY)
|
||||
|
||||
set(TEST_PYTHONPATH
|
||||
${CMAKE_BINARY_DIR}/python
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
set(TEST_LIBRARYPATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
|
||||
if(WIN32)
|
||||
set(TEST_LIBRARY_VAR "PATH")
|
||||
string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
|
||||
string(REPLACE "\\" "/" TEST_LIBRARYPATH "${TEST_LIBRARYPATH}")
|
||||
list(JOIN TEST_PYTHONPATH "\\;" TEST_PYTHONPATH)
|
||||
list(JOIN TEST_LIBRARYPATH "\\;" TEST_LIBRARYPATH)
|
||||
else()
|
||||
set(TEST_LIBRARY_VAR "LD_LIBRARY_PATH")
|
||||
list(JOIN TEST_PYTHONPATH ":" TEST_PYTHONPATH)
|
||||
list(JOIN TEST_LIBRARYPATH ":" TEST_LIBRARYPATH)
|
||||
endif()
|
||||
|
||||
set(PYTHON_ENV_COMMON "PYTHONPATH=${TEST_PYTHONPATH};${TEST_LIBRARY_VAR}=${TEST_LIBRARYPATH}")
|
||||
|
||||
file(GLOB TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tst_*.py)
|
||||
foreach(test_file ${TEST_FILES})
|
||||
get_filename_component(test_name ${test_file} NAME_WE)
|
||||
add_test(${test_name} ${Python3_EXECUTABLE} ${test_file})
|
||||
set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "${PYTHON_ENV_COMMON}")
|
||||
endforeach()
|
||||
|
||||
19
python/tests/config.py.cmake
Normal file
19
python/tests/config.py.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
class TstConfig(object):
|
||||
bindingsNamespace = "PyKDDockWidgets"
|
||||
|
||||
def initLibraryPath():
|
||||
if sys.platform == 'win32' and sys.version_info[0] == 3 and sys.version_info[1] >= 8:
|
||||
os.add_dll_directory("@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
|
||||
30
python/tests/tst_importModule.py
Normal file
30
python/tests/tst_importModule.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Renato Araujo <renato.araujo@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
import unittest
|
||||
import importlib
|
||||
import inspect
|
||||
|
||||
from config import TstConfig
|
||||
|
||||
class TestImportModules(unittest.TestCase):
|
||||
def test_importModules(self):
|
||||
m = importlib.import_module(TstConfig.bindingsNamespace + '.KDDockWidgets')
|
||||
moduleSymbols = []
|
||||
for t in inspect.getmembers(m):
|
||||
moduleSymbols.append(t[0])
|
||||
|
||||
symbols = ['MainWindow', 'DockWidget']
|
||||
for symbol in symbols:
|
||||
self.assertIn(symbol, moduleSymbols)
|
||||
|
||||
if __name__ == '__main__':
|
||||
TstConfig.initLibraryPath()
|
||||
unittest.main()
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -74,6 +74,7 @@ set(DOCKSLIBS_SRCS
|
||||
private/DropAreaWithCentralFrame_p.h
|
||||
private/WidgetResizeHandler.cpp
|
||||
private/WidgetResizeHandler_p.h
|
||||
private/WindowZOrder_x11_p.h
|
||||
private/indicators/NullIndicators.cpp
|
||||
private/indicators/NullIndicators_p.h
|
||||
private/indicators/ClassicIndicators.cpp
|
||||
@@ -245,9 +246,16 @@ add_library(KDAB::kddockwidgets ALIAS kddockwidgets)
|
||||
set_target_properties(kddockwidgets PROPERTIES OUTPUT_NAME "kddockwidgets${KDDockWidgets_LIBRARY_QTID}")
|
||||
set_compiler_flags(kddockwidgets)
|
||||
|
||||
if(${PROJECT_NAME}_QT6)
|
||||
set(DOCKS_INCLUDES_INSTALL_PATH "include/kddockwidgets-qt6")
|
||||
else()
|
||||
set(DOCKS_INCLUDES_INSTALL_PATH "include/")
|
||||
endif()
|
||||
|
||||
|
||||
target_include_directories(kddockwidgets
|
||||
PUBLIC
|
||||
$<INSTALL_INTERFACE:include>
|
||||
$<INSTALL_INTERFACE:${DOCKS_INCLUDES_INSTALL_PATH}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fwd_headers>
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -287,16 +295,20 @@ if(CMAKE_COMPILER_IS_GNUCXX OR IS_CLANG_BUILD)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
target_link_libraries(kddockwidgets PUBLIC Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::Quick Qt${QT_MAJOR_VERSION}::QuickControls2)
|
||||
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::Widgets Qt${Qt_VERSION_MAJOR}::Quick Qt${Qt_VERSION_MAJOR}::QuickControls2)
|
||||
else()
|
||||
target_link_libraries(kddockwidgets PUBLIC Qt${QT_MAJOR_VERSION}::Widgets)
|
||||
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::Widgets PRIVATE Qt${Qt_VERSION_MAJOR}::WidgetsPrivate)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(kddockwidgets PRIVATE Qt${QT_MAJOR_VERSION}::GuiPrivate dwmapi)
|
||||
elseif(NOT APPLE AND NOT EMSCRIPTEN AND NOT ${PROJECT_NAME}_QT6)
|
||||
find_package(Qt${QT_MAJOR_VERSION}X11Extras)
|
||||
target_link_libraries(kddockwidgets PUBLIC Qt${QT_MAJOR_VERSION}::X11Extras)
|
||||
target_link_libraries(kddockwidgets PRIVATE Qt${Qt_VERSION_MAJOR}::GuiPrivate dwmapi)
|
||||
elseif(NOT APPLE AND NOT EMSCRIPTEN AND NOT ${PROJECT_NAME}_QT6 AND ${PROJECT_NAME}_X11EXTRAS)
|
||||
find_package(Qt${Qt_VERSION_MAJOR}X11Extras)
|
||||
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::X11Extras)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_XLib)
|
||||
target_link_libraries(kddockwidgets PRIVATE X11)
|
||||
endif()
|
||||
|
||||
set_target_properties(kddockwidgets PROPERTIES
|
||||
@@ -331,23 +343,23 @@ if(MSVC AND NOT ${PROJECT_NAME}_STATIC)
|
||||
install(FILES "$<TARGET_PDB_FILE_DIR:kddockwidgets>/$<TARGET_PDB_FILE_NAME:kddockwidgets>" DESTINATION ${INSTALL_LIBRARY_DIR} CONFIGURATIONS Debug RelWithDebInfo)
|
||||
endif()
|
||||
|
||||
install(FILES ${camelcase_HEADERS} DESTINATION include/kddockwidgets)
|
||||
install(FILES ${DOCKS_INSTALLABLE_INCLUDES} DESTINATION include/kddockwidgets)
|
||||
install(FILES ${DOCKS_INSTALLABLE_PRIVATE_INCLUDES} DESTINATION include/kddockwidgets/private)
|
||||
install(FILES private/multisplitter/Item_p.h DESTINATION include/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Widget.h DESTINATION include/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Separator_p.h DESTINATION include/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/indicators/ClassicIndicators_p.h DESTINATION include/kddockwidgets/private/indicators)
|
||||
install(FILES private/indicators/SegmentedIndicators_p.h DESTINATION include/kddockwidgets/private/indicators)
|
||||
install(FILES ${camelcase_HEADERS} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets)
|
||||
install(FILES ${DOCKS_INSTALLABLE_INCLUDES} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets)
|
||||
install(FILES ${DOCKS_INSTALLABLE_PRIVATE_INCLUDES} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private)
|
||||
install(FILES private/multisplitter/Item_p.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Widget.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Separator_p.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/indicators/ClassicIndicators_p.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/indicators)
|
||||
install(FILES private/indicators/SegmentedIndicators_p.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/indicators)
|
||||
|
||||
if(KDDockWidgets_QTQUICK)
|
||||
install(FILES ${DOCKS_INSTALLABLE_PRIVATE_QUICK_INCLUDES} DESTINATION include/kddockwidgets/private/quick)
|
||||
install(FILES private/multisplitter/Separator_quick.h DESTINATION include/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Widget_quick.h DESTINATION include/kddockwidgets/private/multisplitter)
|
||||
install(FILES ${DOCKS_INSTALLABLE_PRIVATE_QUICK_INCLUDES} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/quick)
|
||||
install(FILES private/multisplitter/Separator_quick.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Widget_quick.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/multisplitter)
|
||||
else()
|
||||
install(FILES ${DOCKS_INSTALLABLE_PRIVATE_WIDGET_INCLUDES} DESTINATION include/kddockwidgets/private/widgets)
|
||||
install(FILES private/multisplitter/Separator_qwidget.h DESTINATION include/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Widget_qwidget.h DESTINATION include/kddockwidgets/private/multisplitter)
|
||||
install(FILES ${DOCKS_INSTALLABLE_PRIVATE_WIDGET_INCLUDES} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/widgets)
|
||||
install(FILES private/multisplitter/Separator_qwidget.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/multisplitter)
|
||||
install(FILES private/multisplitter/Widget_qwidget.h DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/private/multisplitter)
|
||||
endif()
|
||||
|
||||
# Generate library version files
|
||||
@@ -356,21 +368,21 @@ ecm_setup_version(
|
||||
${${PROJECT_NAME}_VERSION}
|
||||
VARIABLE_PREFIX KDDOCKWIDGETS
|
||||
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kddockwidgets_version.h"
|
||||
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgetsConfigVersion.cmake"
|
||||
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets${KDDockWidgets_LIBRARY_QTID}ConfigVersion.cmake"
|
||||
SOVERSION ${${PROJECT_NAME}_SOVERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kddockwidgets_version.h" DESTINATION include/kddockwidgets)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kddockwidgets_version.h" DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets)
|
||||
|
||||
install(EXPORT kddockwidgetsTargets
|
||||
FILE KDDockWidgetsTargets.cmake
|
||||
FILE KDDockWidgets${KDDockWidgets_LIBRARY_QTID}Targets.cmake
|
||||
NAMESPACE KDAB::
|
||||
DESTINATION ${INSTALL_LIBRARY_DIR}/cmake/KDDockWidgets
|
||||
DESTINATION ${INSTALL_LIBRARY_DIR}/cmake/KDDockWidgets${KDDockWidgets_LIBRARY_QTID}
|
||||
)
|
||||
configure_file(KDDockWidgetsConfig.cmake.in KDDockWidgetsConfig.cmake @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgetsConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgetsConfigVersion.cmake"
|
||||
DESTINATION ${INSTALL_LIBRARY_DIR}/cmake/KDDockWidgets
|
||||
configure_file(KDDockWidgetsConfig.cmake.in KDDockWidgets${KDDockWidgets_LIBRARY_QTID}Config.cmake @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets${KDDockWidgets_LIBRARY_QTID}Config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets${KDDockWidgets_LIBRARY_QTID}ConfigVersion.cmake"
|
||||
DESTINATION ${INSTALL_LIBRARY_DIR}/cmake/KDDockWidgets${KDDockWidgets_LIBRARY_QTID}
|
||||
)
|
||||
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
@@ -381,7 +393,7 @@ if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
|
||||
if(NOT ${PROJECT_NAME}_QTQUICK AND KDDockWidgets_LINTER) # TODO: We can support it
|
||||
add_executable(kddockwidgets_linter layoutlinter_main.cpp)
|
||||
target_link_libraries(kddockwidgets_linter kddockwidgets Qt${QT_MAJOR_VERSION}::Widgets)
|
||||
target_link_libraries(kddockwidgets_linter kddockwidgets Qt${Qt_VERSION_MAJOR}::Widgets)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
11
src/Config.h
11
src/Config.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -61,6 +61,9 @@ public:
|
||||
~Config();
|
||||
|
||||
///@brief Flag enum to tune certain behaviours, the defaults are Flag_Default
|
||||
///@warning Only the default is supported on all platforms. Not all options work with all window managers,
|
||||
/// Qt does its best to abstract the differences however that's only a best effort. This is true specially
|
||||
/// for any option that changes window flags.
|
||||
enum Flag
|
||||
{
|
||||
Flag_None = 0, ///< No option set
|
||||
@@ -83,6 +86,7 @@ public:
|
||||
Flag_KeepAboveIfNotUtilityWindow = 0x10000, ///< Only meaningful if Flag_DontUseUtilityFloatingWindows is set. If floating windows are normal windows, you might still want them to keep above and not minimize when you focus the main window.
|
||||
Flag_CloseOnlyCurrentTab = 0x20000, ///< The TitleBar's close button will only close the current tab, instead of all of them
|
||||
Flag_ShowButtonsOnTabBarIfTitleBarHidden = 0x40000, ///< When using Flag_HideTitleBarWhenTabsVisible the close/float buttons disappear with the title bar. With Flag_ShowButtonsOnTabBarIfHidden they'll be shown in the tab bar.
|
||||
Flag_AllowSwitchingTabsViaMenu = 0x80000, ///< Allow switching tabs via a context menu when right clicking on the tab area
|
||||
Flag_Default = Flag_AeroSnapWithClientDecos ///< The defaults
|
||||
};
|
||||
Q_DECLARE_FLAGS(Flags, Flag)
|
||||
@@ -112,8 +116,9 @@ public:
|
||||
InternalFlag_DontUseQtToolWindowsForFloatingWindows = 4, ///< FloatingWindows will use Qt::Window instead of Qt::Tool.
|
||||
InternalFlag_DontShowWhenUnfloatingHiddenWindow = 8, ///< DockWidget::setFloating(false) won't do anything if the window is hidden.
|
||||
InternalFlag_UseTransparentFloatingWindow = 16, ///< For QtQuick only. Allows to have round-corners. It's flaky when used with native Windows drop-shadow.
|
||||
InternalFlag_DisableTranslucency = 32 ///< KDDW tries to detect if your Window Manager doesn't support transparent windows, but the detection might fail
|
||||
/// with more exotic setups. This flag can be used to override.
|
||||
InternalFlag_DisableTranslucency = 32, ///< KDDW tries to detect if your Window Manager doesn't support transparent windows, but the detection might fail
|
||||
/// with more exotic setups. This flag can be used to override.
|
||||
InternalFlag_TopLevelIndicatorRubberBand = 64 ///< Makes the rubber band of classic drop indicators to be top-level windows. Helps with working around MFC bugs
|
||||
};
|
||||
Q_DECLARE_FLAGS(InternalFlags, InternalFlag)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
@@ -83,6 +83,13 @@ void DockWidgetBase::addDockWidgetAsTab(DockWidgetBase *other, InitialOption opt
|
||||
return;
|
||||
}
|
||||
|
||||
if (isPersistentCentralDockWidget()) {
|
||||
qWarning() << Q_FUNC_INFO << "Not supported with MainWindowOption_HasCentralWidget."
|
||||
<< "MainWindowOption_HasCentralWidget can only have 1 widget in the center."
|
||||
<< "Use MainWindowOption_HasCentralFrame instead, which is similar but supports tabbing.";
|
||||
return;
|
||||
}
|
||||
|
||||
Frame *frame = d->frame();
|
||||
|
||||
if (frame) {
|
||||
@@ -182,6 +189,9 @@ bool DockWidgetBase::setFloating(bool floats)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (floats && isPersistentCentralDockWidget())
|
||||
return false;
|
||||
|
||||
if (floats) {
|
||||
d->saveTabIndex();
|
||||
if (isTabbed()) {
|
||||
@@ -503,6 +513,7 @@ FloatingWindow *DockWidgetBase::Private::morphIntoFloatingWindow()
|
||||
auto frame = Config::self().frameworkWidgetFactory()->createFrame();
|
||||
frame->addWidget(q);
|
||||
geo.setSize(geo.size().boundedTo(frame->maxSizeHint()));
|
||||
FloatingWindow::ensureRectIsOnScreen(geo);
|
||||
auto floatingWindow =
|
||||
Config::self().frameworkWidgetFactory()->createFloatingWindow(frame, nullptr, geo);
|
||||
floatingWindow->show();
|
||||
@@ -620,6 +631,9 @@ void DockWidgetBase::Private::close()
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_isPersistentCentralDockWidget)
|
||||
return;
|
||||
|
||||
// If it's overlayed and we're closing, we need to close the overlay
|
||||
if (SideBar *sb = DockRegistry::self()->sideBarForDockWidget(q)) {
|
||||
auto mainWindow = sb->mainWindow();
|
||||
@@ -719,10 +733,9 @@ void DockWidgetBase::Private::show()
|
||||
void DockWidgetBase::onParentChanged()
|
||||
{
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
// TODO: In v1.4, remove this part and use the signal emitting the arg
|
||||
Q_EMIT parentChanged();
|
||||
#else
|
||||
Q_EMIT parentChanged(this);
|
||||
Q_EMIT QQuickItem::parentChanged(parentItem());
|
||||
#endif
|
||||
d->updateToggleAction();
|
||||
d->updateFloatAction();
|
||||
@@ -837,6 +850,11 @@ void DockWidgetBase::setMDIZ(int z)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool DockWidgetBase::isPersistentCentralDockWidget() const
|
||||
{
|
||||
return d->m_isPersistentCentralDockWidget;
|
||||
}
|
||||
|
||||
LayoutSaver::DockWidget::Ptr DockWidgetBase::Private::serialize() const
|
||||
{
|
||||
auto ptr = LayoutSaver::DockWidget::dockWidgetForName(q->uniqueName());
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user