Compare commits
180 Commits
python-uni
...
advancedCu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61079be42d | ||
|
|
743dbc0718 | ||
|
|
fd4588de0f | ||
|
|
6ba10cfe12 | ||
|
|
096176dc72 | ||
|
|
25b04d7ed8 | ||
|
|
e345e89c35 | ||
|
|
a97663294c | ||
|
|
bb4cf802f5 | ||
|
|
701069617c | ||
|
|
a8c50f1876 | ||
|
|
61cca1e5ec | ||
|
|
7db9938b85 | ||
|
|
01cc915734 | ||
|
|
3454b67a45 | ||
|
|
21765efbac | ||
|
|
60a1e46453 | ||
|
|
8b8ef7f2b0 | ||
|
|
c0e8fe3869 | ||
|
|
524dff9105 | ||
|
|
0099a19a82 | ||
|
|
e6b8636e88 | ||
|
|
86419fd979 | ||
|
|
220471f746 | ||
|
|
412860abac | ||
|
|
2eeb4aac27 | ||
|
|
bfb2ec701e | ||
|
|
54bf24d5d4 | ||
|
|
76cbb760ed | ||
|
|
4824a398ab | ||
|
|
a502a8250b | ||
|
|
85fb4ff671 | ||
|
|
6db3ccc87f | ||
|
|
5811cab164 | ||
|
|
1387c2f573 | ||
|
|
79cc347cd8 | ||
|
|
e62bde3152 | ||
|
|
81abb3cea5 | ||
|
|
ecd3c20adf | ||
|
|
755d53432b | ||
|
|
e00a552bf8 | ||
|
|
faf93fe597 | ||
|
|
4f8aac7df3 | ||
|
|
719803ecfa | ||
|
|
f0ef24383b | ||
|
|
4f8b174a8d | ||
|
|
675b166956 | ||
|
|
b13ba1e42e | ||
|
|
481dae64c3 | ||
|
|
6b04e20a7e | ||
|
|
8a3ee35993 | ||
|
|
146c656e29 | ||
|
|
a190e2dfbf | ||
|
|
d0daff6771 | ||
|
|
721795b113 | ||
|
|
40231b7fae | ||
|
|
1d0300ecc8 | ||
|
|
ce20628555 | ||
|
|
d0dcac6b03 | ||
|
|
2b1aa44eff | ||
|
|
ae42dffcb1 | ||
|
|
21adfe06ad | ||
|
|
7de26139a2 | ||
|
|
894ff9fea0 | ||
|
|
942c462586 | ||
|
|
128645693c | ||
|
|
86bceb4c48 | ||
|
|
ea64aae861 | ||
|
|
d1645dff73 | ||
|
|
a72e018f3b | ||
|
|
66b0ba8902 | ||
|
|
18457d80aa | ||
|
|
95c12dbd4c | ||
|
|
c7682a3524 | ||
|
|
4922363e71 | ||
|
|
9f6ec0244f | ||
|
|
747e987f28 | ||
|
|
68e01c70ee | ||
|
|
296b2a3370 | ||
|
|
074bc26be9 | ||
|
|
f8e6ecf821 | ||
|
|
3e70a2cc71 | ||
|
|
65ced9604f | ||
|
|
45b0536c6a | ||
|
|
8c8f5a8fda | ||
|
|
22a9ce2596 | ||
|
|
93b664414b | ||
|
|
866788674f | ||
|
|
f13f0129d4 | ||
|
|
22ffc6c7ea | ||
|
|
d1767b5534 | ||
|
|
2fbe4f872e | ||
|
|
93e60a743e | ||
|
|
328a14b46a | ||
|
|
9c17b44ad7 | ||
|
|
cf40cadce8 | ||
|
|
16c43b8c24 | ||
|
|
8391d85d48 | ||
|
|
e59e5d7a71 | ||
|
|
aa3c3272ee | ||
|
|
1d8fad245a | ||
|
|
789c531f3d | ||
|
|
5b87fb4435 | ||
|
|
402f0b9d90 | ||
|
|
37567d3980 | ||
|
|
6cef4cea2c | ||
|
|
aea2bf971b | ||
|
|
00a0e455e7 | ||
|
|
d5c7fbfedd | ||
|
|
bea6c09494 | ||
|
|
0adb130d4b | ||
|
|
92d0d74641 | ||
|
|
4d4f2a0183 | ||
|
|
f1e19ec59c | ||
|
|
64b5564f99 | ||
|
|
66cc9ddc03 | ||
|
|
336f1146d3 | ||
|
|
29b1a434c4 | ||
|
|
c0c8399bd7 | ||
|
|
b20ce0895b | ||
|
|
e67f55af51 | ||
|
|
f1410948f8 | ||
|
|
30185d5b2a | ||
|
|
9990300006 | ||
|
|
573e82e9eb | ||
|
|
07a135a10a | ||
|
|
fc172b66f8 | ||
|
|
2be0d5d1d9 | ||
|
|
3007b46892 | ||
|
|
1419db80a2 | ||
|
|
5376ceec7e | ||
|
|
d3a3e7502e | ||
|
|
50c3f9b899 | ||
|
|
8845fae147 | ||
|
|
0c291116b9 | ||
|
|
f0fa0281bf | ||
|
|
313a17a96c | ||
|
|
9e2b1d3e44 | ||
|
|
d832750eb7 | ||
|
|
a82a283b4b | ||
|
|
77392709e2 | ||
|
|
b6770217bb | ||
|
|
c8b22e7ea5 | ||
|
|
8dcaaaf853 | ||
|
|
32ecdb5b37 | ||
|
|
099c7eafc8 | ||
|
|
f872d6fbc1 | ||
|
|
3e21787efb | ||
|
|
58fcd8d04d | ||
|
|
6fd0b4ddee | ||
|
|
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 |
@@ -1,4 +1,4 @@
|
|||||||
[codespell]
|
[codespell]
|
||||||
skip = ./build-*,.git
|
skip = ./build-*,.git,*.svg,rc_assets.py
|
||||||
interactive = 3
|
interactive = 3
|
||||||
ignore-words-list = overlay,overlayed
|
ignore-words-list = overlay,overlayed
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -64,3 +64,5 @@ kddockwidgets_minimal_example
|
|||||||
*.sln
|
*.sln
|
||||||
*.dir
|
*.dir
|
||||||
.vscode
|
.vscode
|
||||||
|
/.cache
|
||||||
|
/compile_commands.json
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ Upstream-Contact: <info@kdab.com>
|
|||||||
Source: https://www.github.com/KDAB/KDDockWidgets
|
Source: https://www.github.com/KDAB/KDDockWidgets
|
||||||
|
|
||||||
Files: *.qrc *.json *.xml *.html src/fwd_headers/*
|
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
|
License: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|
||||||
#artwork
|
#artwork
|
||||||
Files: screencap.gif images/* src/img/* docs/api/*.png examples/dockwidgets/assets/*.png src/img/classic_indicators/*.png
|
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
|
License: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|
||||||
#3rdparty
|
#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
|
|
||||||
173
CMakeLists.txt
173
CMakeLists.txt
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
#
|
#
|
||||||
# -DKDDockWidgets_TESTS=[true|false]
|
# -DKDDockWidgets_TESTS=[true|false]
|
||||||
# Build the test harness.
|
# 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
|
# Default=false
|
||||||
#
|
#
|
||||||
# -DKDDockWidgets_EXAMPLES=[true|false]
|
# -DKDDockWidgets_EXAMPLES=[true|false]
|
||||||
@@ -89,11 +89,11 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${PROJECT_NAME}_VERSION_MAJOR 1)
|
set(${PROJECT_NAME}_VERSION_MAJOR 1)
|
||||||
set(${PROJECT_NAME}_VERSION_MINOR 4)
|
set(${PROJECT_NAME}_VERSION_MINOR 5)
|
||||||
set(${PROJECT_NAME}_VERSION_PATCH 95)
|
set(${PROJECT_NAME}_VERSION_PATCH 95)
|
||||||
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
|
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_VERSION ${${PROJECT_NAME}_VERSION}) #PROJECT_VERSION is needed by some ECM modules
|
||||||
set(${PROJECT_NAME}_SOVERSION "1.5")
|
set(${PROJECT_NAME}_SOVERSION "1.6")
|
||||||
|
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
|
|
||||||
@@ -107,6 +107,7 @@ option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON)
|
|||||||
option(${PROJECT_NAME}_DOCS "Build the API documentation" OFF)
|
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}_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}_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)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
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/ECM/modules")
|
||||||
@@ -124,25 +125,25 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (${PROJECT_NAME}_XLib)
|
||||||
|
add_definitions(-DKDDockWidgets_XLIB)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${PROJECT_NAME}_QT6)
|
if(${PROJECT_NAME}_QT6)
|
||||||
set(Qt_VERSION_MAJOR 6)
|
set(Qt_VERSION_MAJOR 6)
|
||||||
set(QT_MIN_VERSION "6.0.0")
|
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")
|
set(${PROJECT_NAME}_LIBRARY_QTID "-qt6")
|
||||||
else()
|
else()
|
||||||
set(Qt_VERSION_MAJOR 5)
|
set(Qt_VERSION_MAJOR 5)
|
||||||
set(QT_MIN_VERSION "5.12")
|
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 "")
|
set(${PROJECT_NAME}_LIBRARY_QTID "")
|
||||||
endif()
|
endif()
|
||||||
|
find_package(Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS Widgets Test)
|
||||||
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
|
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
|
||||||
|
|
||||||
set(${PROJECT_NAME}_DEPS "widgets")
|
set(${PROJECT_NAME}_DEPS "widgets")
|
||||||
if(${PROJECT_NAME}_QTQUICK)
|
if(${PROJECT_NAME}_QTQUICK)
|
||||||
find_package(Qt${Qt_VERSION_MAJOR}Quick)
|
find_package(Qt${Qt_VERSION_MAJOR} NO_MODULE REQUIRED COMPONENTS Quick QuickControls2)
|
||||||
find_package(Qt${Qt_VERSION_MAJOR}QuickControls2)
|
|
||||||
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
|
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
|
||||||
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} quick quickcontrols2")
|
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} quick quickcontrols2")
|
||||||
else()
|
else()
|
||||||
@@ -207,16 +208,18 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) OR
|
|||||||
|
|
||||||
string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" compileflags)
|
string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" compileflags)
|
||||||
if("${CMAKE_CXX_FLAGS} ${${compileflags}}" MATCHES "-fsanitize")
|
if("${CMAKE_CXX_FLAGS} ${${compileflags}}" MATCHES "-fsanitize")
|
||||||
set(sanitizers_enabled TRUE)
|
set(sanitizers_enabled TRUE)
|
||||||
else()
|
else()
|
||||||
set(sanitizers_enabled FALSE)
|
set(sanitizers_enabled FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# cannot enable this for clang + sanitizers
|
if(APPLE OR LINUX)
|
||||||
if (NOT sanitizers_enabled OR NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
# 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
|
# 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_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}")
|
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -230,7 +233,7 @@ if(KDAB_INSTALL)
|
|||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "Install to default KDAB Location")
|
set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "Install to default KDAB Location")
|
||||||
elseif(WIN32)
|
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -263,80 +266,88 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
|||||||
)
|
)
|
||||||
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
|
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
#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()
|
||||||
|
|
||||||
|
if(${PROJECT_NAME}_TESTS)
|
||||||
|
enable_testing()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
if(${PROJECT_NAME}_IS_ROOT_PROJECT)
|
|
||||||
if(${PROJECT_NAME}_EXAMPLES)
|
|
||||||
if(${PROJECT_NAME}_QTQUICK)
|
|
||||||
add_subdirectory(examples/qtquick)
|
|
||||||
else()
|
|
||||||
add_subdirectory(examples/dockwidgets)
|
|
||||||
add_subdirectory(examples/minimal)
|
|
||||||
add_subdirectory(examples/minimal-mdi)
|
|
||||||
set_compiler_flags(kddockwidgets_example)
|
|
||||||
set_compiler_flags(kddockwidgets_minimal_example)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
|
||||||
|
|
||||||
if(${PROJECT_NAME}_TESTS)
|
|
||||||
enable_testing()
|
|
||||||
add_subdirectory(tests)
|
|
||||||
|
|
||||||
# Require Qt5.15.1 or higher to run the tests_launcher tests on Mac
|
|
||||||
if(NOT APPLE OR Qt5Widgets_VERSION VERSION_GREATER 5.15.0)
|
|
||||||
# tst_docks.exe is pretty big (160 tests), so split it in more runs so we can use threads.
|
|
||||||
add_test(NAME tst_docks0 COMMAND tests_launcher 0 5)
|
|
||||||
add_test(NAME tst_docks1 COMMAND tests_launcher 1 5)
|
|
||||||
add_test(NAME tst_docks2 COMMAND tests_launcher 2 5)
|
|
||||||
add_test(NAME tst_docks3 COMMAND tests_launcher 3 5)
|
|
||||||
add_test(NAME tst_docks4 COMMAND tests_launcher 4 5)
|
|
||||||
add_test(NAME tst_docks5 COMMAND tests_launcher 5 5)
|
|
||||||
add_test(NAME tst_docks6 COMMAND tests_launcher 6 5)
|
|
||||||
add_test(NAME tst_docks7 COMMAND tests_launcher 7 5)
|
|
||||||
add_test(NAME tst_docks8 COMMAND tests_launcher 8 5)
|
|
||||||
add_test(NAME tst_docks9 COMMAND tests_launcher 9 5)
|
|
||||||
add_test(NAME tst_docks10 COMMAND tests_launcher 10 5)
|
|
||||||
add_test(NAME tst_docks11 COMMAND tests_launcher 10 5)
|
|
||||||
add_test(NAME tst_docks12 COMMAND tests_launcher 11 5)
|
|
||||||
add_test(NAME tst_docks13 COMMAND tests_launcher 12 5)
|
|
||||||
add_test(NAME tst_docks14 COMMAND tests_launcher 13 5)
|
|
||||||
add_test(NAME tst_docks15 COMMAND tests_launcher 14 5)
|
|
||||||
add_test(NAME tst_docks16 COMMAND tests_launcher 15 5)
|
|
||||||
add_test(NAME tst_docks17 COMMAND tests_launcher 16 5)
|
|
||||||
add_test(NAME tst_docks18 COMMAND tests_launcher 17 5)
|
|
||||||
add_test(NAME tst_docks19 COMMAND tests_launcher 18 5)
|
|
||||||
add_test(NAME tst_docks20 COMMAND tests_launcher 19 5)
|
|
||||||
add_test(NAME tst_docks21 COMMAND tests_launcher 20 5) # one more for rounding leftovers
|
|
||||||
endif()
|
|
||||||
if(NOT ${PROJECT_NAME}_QTQUICK)
|
|
||||||
# tst_multisplitter depends on QWidget
|
|
||||||
add_test(NAME tst_multisplitter COMMAND tst_multisplitter)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${PROJECT_NAME}_DOCS)
|
|
||||||
add_subdirectory(docs) # needs to go last, in case there are build source files
|
|
||||||
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()
|
|
||||||
|
|
||||||
# Add uninstall target
|
|
||||||
include(ECMUninstallTarget)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${PROJECT_NAME}_PYTHON_BINDINGS)
|
if(${PROJECT_NAME}_PYTHON_BINDINGS)
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "^[Dd]eb" OR ${PROJECT_NAME}_STATIC)
|
if(CMAKE_BUILD_TYPE MATCHES "^[Dd]eb" OR ${PROJECT_NAME}_STATIC)
|
||||||
message(FATAL_ERROR "** Python Bindings are disabled in debug or static builds.")
|
message(FATAL_ERROR "** Python Bindings are disabled in debug or static builds.")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
if(${PROJECT_NAME}_PYTHON_BINDINGS)
|
||||||
add_subdirectory(python)
|
add_subdirectory(python)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${PROJECT_NAME}_EXAMPLES)
|
||||||
|
if(${PROJECT_NAME}_QTQUICK)
|
||||||
|
add_subdirectory(examples/qtquick)
|
||||||
|
else()
|
||||||
|
add_subdirectory(examples/dockwidgets)
|
||||||
|
add_subdirectory(examples/minimal)
|
||||||
|
add_subdirectory(examples/minimal-mdi)
|
||||||
|
add_subdirectory(examples/mdi_with_docking)
|
||||||
|
set_compiler_flags(kddockwidgets_example)
|
||||||
|
set_compiler_flags(kddockwidgets_minimal_example)
|
||||||
|
set_compiler_flags(kddockwidgets_mdi_with_docking_example)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
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
|
||||||
|
if(NOT APPLE OR Qt5Widgets_VERSION VERSION_GREATER 5.15.0)
|
||||||
|
# tst_docks.exe is pretty big (160 tests), so split it in more runs so we can use threads.
|
||||||
|
add_test(NAME tst_docks0 COMMAND tests_launcher 0 5)
|
||||||
|
add_test(NAME tst_docks1 COMMAND tests_launcher 1 5)
|
||||||
|
add_test(NAME tst_docks2 COMMAND tests_launcher 2 5)
|
||||||
|
add_test(NAME tst_docks3 COMMAND tests_launcher 3 5)
|
||||||
|
add_test(NAME tst_docks4 COMMAND tests_launcher 4 5)
|
||||||
|
add_test(NAME tst_docks5 COMMAND tests_launcher 5 5)
|
||||||
|
add_test(NAME tst_docks6 COMMAND tests_launcher 6 5)
|
||||||
|
add_test(NAME tst_docks7 COMMAND tests_launcher 7 5)
|
||||||
|
add_test(NAME tst_docks8 COMMAND tests_launcher 8 5)
|
||||||
|
add_test(NAME tst_docks9 COMMAND tests_launcher 9 5)
|
||||||
|
add_test(NAME tst_docks10 COMMAND tests_launcher 10 5)
|
||||||
|
add_test(NAME tst_docks11 COMMAND tests_launcher 10 5)
|
||||||
|
add_test(NAME tst_docks12 COMMAND tests_launcher 11 5)
|
||||||
|
add_test(NAME tst_docks13 COMMAND tests_launcher 12 5)
|
||||||
|
add_test(NAME tst_docks14 COMMAND tests_launcher 13 5)
|
||||||
|
add_test(NAME tst_docks15 COMMAND tests_launcher 14 5)
|
||||||
|
add_test(NAME tst_docks16 COMMAND tests_launcher 15 5)
|
||||||
|
add_test(NAME tst_docks17 COMMAND tests_launcher 16 5)
|
||||||
|
add_test(NAME tst_docks18 COMMAND tests_launcher 17 5)
|
||||||
|
add_test(NAME tst_docks19 COMMAND tests_launcher 18 5)
|
||||||
|
add_test(NAME tst_docks20 COMMAND tests_launcher 19 5)
|
||||||
|
add_test(NAME tst_docks21 COMMAND tests_launcher 20 5) # one more for rounding leftovers
|
||||||
|
endif()
|
||||||
|
if(NOT ${PROJECT_NAME}_QTQUICK)
|
||||||
|
# tst_multisplitter depends on QWidget
|
||||||
|
add_test(NAME tst_multisplitter COMMAND tst_multisplitter)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${PROJECT_NAME}_DOCS)
|
||||||
|
add_subdirectory(docs) # needs to go last, in case there are build source files
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${PROJECT_NAME}_IS_ROOT_PROJECT)
|
||||||
|
# Add uninstall target (not for submodules since parent projects typically have uninstall too)
|
||||||
|
include(ECMUninstallTarget)
|
||||||
|
endif()
|
||||||
|
|
||||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Debug",
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||||
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
|
|
||||||
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
|
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
|
||||||
"KDDockWidgets_FUZZER" : "OFF"
|
"KDDockWidgets_FUZZER" : "OFF"
|
||||||
},
|
},
|
||||||
@@ -18,16 +17,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dev-gammaray",
|
"name": "dev-asan",
|
||||||
"displayName": "dev-gammaray",
|
"displayName": "dev-asan",
|
||||||
"description": "A Gammaray friendly build. (No ASAN)",
|
"description": "An ASAN/UBSAN build",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/build-dev-gammaray",
|
"binaryDir": "${sourceDir}/build-dev-asan",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Debug",
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||||
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
|
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
|
||||||
"KDDockWidgets_FUZZER" : "OFF"
|
"KDDockWidgets_FUZZER" : "OFF",
|
||||||
|
"ECM_ENABLE_SANITIZERS" : "'address;undefined'"
|
||||||
},
|
},
|
||||||
"warnings" : {
|
"warnings" : {
|
||||||
"uninitialized" : true
|
"uninitialized" : true
|
||||||
@@ -164,6 +164,23 @@
|
|||||||
"displayName": "dev6",
|
"displayName": "dev6",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/build-dev6",
|
"binaryDir": "${sourceDir}/build-dev6",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"KDDockWidgets_QT6": "ON",
|
||||||
|
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
|
||||||
|
"KDDockWidgets_FUZZER" : "OFF",
|
||||||
|
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dev-asan6",
|
||||||
|
"displayName": "dev-asan6",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build-dev-asan6",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Debug",
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
"KDDockWidgets_QT6": "ON",
|
"KDDockWidgets_QT6": "ON",
|
||||||
@@ -295,6 +312,51 @@
|
|||||||
"QML2_IMPORT_PATH" : "$env{QT6_DIR}/imports:$env{QT6_DIR}/qml",
|
"QML2_IMPORT_PATH" : "$env{QT6_DIR}/imports:$env{QT6_DIR}/qml",
|
||||||
"LD_LIBRARY_PATH" : "$env{QT6_DIR}/lib"
|
"LD_LIBRARY_PATH" : "$env{QT6_DIR}/lib"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dev-time-trace",
|
||||||
|
"displayName": "dev-time-trace",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build-dev-time-trace",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
|
||||||
|
"KDDockWidgets_FUZZER" : "OFF",
|
||||||
|
"CMAKE_C_FLAGS_INIT" : "-ftime-trace",
|
||||||
|
"CMAKE_CXX_FLAGS_INIT": "-ftime-trace"
|
||||||
|
},
|
||||||
|
"warnings" : {
|
||||||
|
"uninitialized" : true
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"CC": "clang",
|
||||||
|
"CXX": "clang++",
|
||||||
|
"CCACHE_DISABLE" : "ON"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dev6-time-trace",
|
||||||
|
"displayName": "dev6-time-trace",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build-dev6-time-trace",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
|
||||||
|
"KDDockWidgets_FUZZER" : "OFF",
|
||||||
|
"KDDockWidgets_QT6" : "ON",
|
||||||
|
"CMAKE_C_FLAGS_INIT" : "-ftime-trace",
|
||||||
|
"CMAKE_CXX_FLAGS_INIT": "-ftime-trace"
|
||||||
|
},
|
||||||
|
"warnings" : {
|
||||||
|
"uninitialized" : true
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"CC": "clang",
|
||||||
|
"CXX": "clang++",
|
||||||
|
"CCACHE_DISABLE" : "ON"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"buildPresets": [
|
"buildPresets": [
|
||||||
|
|||||||
21
Changelog
21
Changelog
@@ -1,11 +1,24 @@
|
|||||||
* v1.5.0 (unreleased)
|
* v1.6.0 (unreleased)
|
||||||
|
- Fixed restoring of normal geometry when closing a maximized window (#259)
|
||||||
|
- Experimental support for docking into dock widgets which are in a MDI area.
|
||||||
|
- Fixed potential crash involving infinite loop between QWidget::create() and QWidget::createWinId()
|
||||||
|
- Moved DropIndicatorOverlayInterface::DropLocation enum to KDDockWidgets namespace scope
|
||||||
|
- Added Config::setDropIndicatorAllowedFunc() and corresponding example
|
||||||
|
(kddockwidgets_example --hide-certain-docking-indicators)
|
||||||
|
- Fixed case where unfloating wouldn't restore to the main window (#44 and #96)
|
||||||
|
- Fixed MainWindow not propagating close events to docked widgets
|
||||||
|
|
||||||
|
* 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"
|
- Install the Python bindings to "site-packages"
|
||||||
- The Python bindings for Qt6 use the "PyKDDockWidgetsQt6" namespace
|
- The Python bindings for Qt6 use the "PyKDDockWidgetsQt6" namespace
|
||||||
- Co-installable with Qt6
|
- Co-installable with Qt6
|
||||||
- Adds support for non-detachable central widget, MainWindowOption_HasCentralWidget. (#225)
|
- Adds support for non-detachable central widget, MainWindowOption_HasCentralWidget. (#225)
|
||||||
|
- Fix corrupt layout when restoring old JSON
|
||||||
* v1.4.1 (unreleased)
|
- Fix "Unpin" button not showing up in overlayed widgets
|
||||||
-
|
- Minimum Qt version is now 5.15
|
||||||
|
|
||||||
* v1.4.0 (16 July 2021)
|
* v1.4.0 (16 July 2021)
|
||||||
- No longer supports Qt versions less than 5.12
|
- 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
|
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
|
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:
|
according to the terms of the:
|
||||||
GNU General Public License version 2.0 (see LICENSES/GPL-2.0-only.txt)
|
GNU General Public License version 2.0 (see LICENSES/GPL-2.0-only.txt)
|
||||||
or the
|
or the
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
Supported Qt versions and toolchains
|
Supported Qt versions and toolchains
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
KDDockWidgets for QtQuick requires a C++17 capable compiler and either
|
KDDockWidgets for QtQuick requires a C++17 capable compiler and Qt >= 6.2.1.
|
||||||
Qt >= 5.15.0 or Qt >= 6.2.
|
|
||||||
|
Qt 5.15.2 will probably also work, but it's not built and tested by KDAB CI, we
|
||||||
|
advise users to move to Qt6 as soon as possible.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TROUBLESHOOTING
|
TROUBLESHOOTING
|
||||||
|
|||||||
47
README.md
47
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.
|
Make sure you have cmake, ninja, compiler, Qt, etc in PATH.
|
||||||
|
|
||||||
Adapt the instructions to suit your cmake generator and operating system.
|
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
|
$ cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/path/where/to/install ../path/to/kddockwidgets
|
||||||
@@ -104,6 +105,15 @@ 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.
|
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
|
Using
|
||||||
=====
|
=====
|
||||||
From your CMake Qt5 project, add
|
From your CMake Qt5 project, add
|
||||||
@@ -134,29 +144,42 @@ Versioning
|
|||||||
|
|
||||||
New features go to master while the stable branch only accepts non-intrusive bug fixes.
|
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
|
We'll try to remain source and binary compatible across versions. API will get
|
||||||
notice before being removed in the next version. Note that this source-compatibility
|
a deprecation notice before being removed in the next version. Note that this
|
||||||
effort is only for the public API. Private API (headers ending in _p.h) might change so you
|
compatibility effort is only for the public API. Private API (headers ending
|
||||||
shouldn't depend on them. Private API is only exposed so more advanced users can
|
in _p.h) might change so you shouldn't depend on them. Private API is only
|
||||||
override, for example `paintEvent()`, and not so they can change internal business logic.
|
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
|
We don't promise or test binary compatibility. It's advised that you recompile
|
||||||
your application whenever updating KDDW.
|
your application whenever updating KDDW.
|
||||||
|
|
||||||
|
|
||||||
Supported Qt versions and toolchains
|
Supported Qt versions and toolchains
|
||||||
=====================================
|
====================================
|
||||||
KDDockWidgets requires Qt5 >= 5.12 or Qt6 >= 6.1.
|
KDDockWidgets requires a C++17 capable compiler and Qt 5.15.x or Qt6 >= 6.2
|
||||||
The QtQuick support requires Qt5 >= 5.15 or Qt6 >= 6.1.
|
For QtQuick support see [README-QtQuick.md](README-QtQuick.md).
|
||||||
|
|
||||||
|
|
||||||
Regarding compilers, whatever toolchain is able to build Qt 5.9 should also be
|
Styling
|
||||||
fine. Note however that MSVC 2013 isn't supported anymore due to compiler crashes.
|
========
|
||||||
|
|
||||||
|
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
|
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).
|
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.
|
Contact KDAB at <info@kdab.com> to inquire about commercial licensing.
|
||||||
|
|||||||
34
appveyor.yml
34
appveyor.yml
@@ -19,6 +19,8 @@ skip_tags: false
|
|||||||
|
|
||||||
# Build worker image
|
# Build worker image
|
||||||
image:
|
image:
|
||||||
|
- Ubuntu2004
|
||||||
|
- macos
|
||||||
- Visual Studio 2019
|
- Visual Studio 2019
|
||||||
|
|
||||||
# scripts that are called at very beginning, before repo cloning
|
# scripts that are called at very beginning, before repo cloning
|
||||||
@@ -36,16 +38,33 @@ platform:
|
|||||||
# build Configuration, i.e. Debug, Release, etc.
|
# build Configuration, i.e. Debug, Release, etc.
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
- Debug
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- useqt6: False
|
||||||
|
- useqt6: True
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
- sh: if [ "`uname -s`" = "Darwin" ]; then brew install ninja; else sudo apt-get -y update; sudo apt-get -y install mesa-common-dev libglu1-mesa-dev libxkbcommon-dev libxkbcommon-x11-dev; fi
|
||||||
- set QTDIR=C:\Qt\5.15\msvc2019_64
|
|
||||||
- set PATH=%QTDIR%\bin;%PATH%
|
before_build:
|
||||||
|
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
- cmd: set PATH=C:\Qt\6.2\msvc2019_64;C:\Qt\5.15\msvc2019_64;%PATH%
|
||||||
|
- sh: if [ "`uname -s`" = "Darwin" ]; then export PATH=$HOME/Qt/6.1/macos/bin:$HOME/Qt/5.15/clang_64/bin:$PATH; else export PATH=$HOME/Qt/6.2/gcc_64/bin:$HOME/Qt/5.15/gcc_64/bin:$PATH; fi
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
|
- cmd: cmake -G Ninja -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DKDDockWidgets_QT6=%useqt6% -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
|
||||||
- nmake
|
- sh: cmake -G Ninja -DCMAKE_BUILD_TYPE=$CONFIGURATION -DKDDockWidgets_QT6=$useqt6 -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
|
# to disable automatic builds
|
||||||
#build: off
|
#build: off
|
||||||
@@ -54,11 +73,8 @@ build_script:
|
|||||||
# tests configuration #
|
# tests configuration #
|
||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
|
|
||||||
test_script:
|
|
||||||
- nmake test
|
|
||||||
|
|
||||||
# to disable automatic tests
|
# to disable automatic tests
|
||||||
#test: off
|
test: off
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
|
|||||||
@@ -203,7 +203,6 @@ function(ECM_GENERATE_PRI_FILE)
|
|||||||
else()
|
else()
|
||||||
set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}")
|
set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
set(PRI_TARGET_DEFINES "")
|
|
||||||
|
|
||||||
set(PRI_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/qt_${PRI_TARGET_BASENAME}.pri)
|
set(PRI_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/qt_${PRI_TARGET_BASENAME}.pri)
|
||||||
if (EGPF_FILENAME_VAR)
|
if (EGPF_FILENAME_VAR)
|
||||||
@@ -211,6 +210,8 @@ function(ECM_GENERATE_PRI_FILE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PRI_TARGET_MODULE_CONFIG "")
|
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,
|
# 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
|
# 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.
|
# 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")
|
if (target_type STREQUAL "STATIC_LIBRARY")
|
||||||
set(PRI_TARGET_MODULE_CONFIG "staticlib")
|
set(PRI_TARGET_MODULE_CONFIG "staticlib")
|
||||||
endif()
|
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()
|
endif()
|
||||||
|
|
||||||
file(GENERATE
|
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}.MINOR_VERSION = ${PRI_VERSION_MINOR}
|
||||||
QT.${PRI_TARGET_BASENAME}.PATCH_VERSION = ${PRI_VERSION_PATCH}
|
QT.${PRI_TARGET_BASENAME}.PATCH_VERSION = ${PRI_VERSION_PATCH}
|
||||||
QT.${PRI_TARGET_BASENAME}.name = ${PRI_TARGET_LIBNAME}
|
QT.${PRI_TARGET_BASENAME}.name = ${PRI_TARGET_LIBNAME}
|
||||||
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}
|
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}${PRI_TARGET_POSTFIX}
|
||||||
QT.${PRI_TARGET_BASENAME}.defines = ${PRI_TARGET_DEFINES}
|
QT.${PRI_TARGET_BASENAME}.DEFINES = ${PRI_TARGET_DEFINES}
|
||||||
QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES}
|
QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES}
|
||||||
QT.${PRI_TARGET_BASENAME}.private_includes =
|
QT.${PRI_TARGET_BASENAME}.private_includes =
|
||||||
QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS}
|
QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS}
|
||||||
|
|||||||
@@ -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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# 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>
|
# Author: Allen Winter <allen.winter@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
@@ -28,7 +28,7 @@ execute_process(
|
|||||||
OUTPUT_VARIABLE ALL_VARS
|
OUTPUT_VARIABLE ALL_VARS
|
||||||
)
|
)
|
||||||
if(NOT return_code EQUAL 0)
|
if(NOT return_code EQUAL 0)
|
||||||
message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query")
|
message(WARNING "Failed call: ${QT_QMAKE_EXECUTABLE} -query")
|
||||||
message(FATAL_ERROR "QMake call failed: ${return_code}")
|
message(FATAL_ERROR "QMake call failed: ${return_code}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
@@ -19,6 +19,10 @@ endif()
|
|||||||
#Qt5 requires C++14
|
#Qt5 requires C++14
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
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.
|
# 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)
|
get_target_property(QtCore_is_framework Qt5::Core FRAMEWORK)
|
||||||
|
|||||||
@@ -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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
@@ -19,6 +19,10 @@ endif()
|
|||||||
#Qt6 requires C++17
|
#Qt6 requires C++17
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
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.
|
# 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)
|
get_target_property(QtCore_is_framework Qt6::Core FRAMEWORK)
|
||||||
|
|||||||
@@ -47,6 +47,17 @@
|
|||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"externalConsole": false
|
"externalConsole": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "gdb-kddockwidgets_mdi_with_docking_example",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_mdi_with_docking_example",
|
||||||
|
"args": [],
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"externalConsole": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "gdb-tst_docks",
|
"name": "gdb-tst_docks",
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
#
|
#
|
||||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||||
@@ -11,7 +11,7 @@ from conans import ConanFile, CMake, tools
|
|||||||
|
|
||||||
class KDDockWidgetsConan(ConanFile):
|
class KDDockWidgetsConan(ConanFile):
|
||||||
name = "kddockwidgets"
|
name = "kddockwidgets"
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
default_user = "kdab"
|
default_user = "kdab"
|
||||||
default_channel = "stable"
|
default_channel = "stable"
|
||||||
license = ("https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-2.0-only.txt",
|
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
|
kddockwidgets (1.4.0) release candidate; urgency=high
|
||||||
|
|
||||||
* 1.4.0 final
|
* 1.4.0 final
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Build-Depends: debhelper (>=9), cdbs, cmake
|
|||||||
Standards-Version: 3.9.6
|
Standards-Version: 3.9.6
|
||||||
Homepage: https://github.com/KDAB/KDDockWidgets
|
Homepage: https://github.com/KDAB/KDDockWidgets
|
||||||
|
|
||||||
Package: kddockwidgets
|
Package: qt5-kddockwidgets
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
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
|
Format: 1.0
|
||||||
Source: kddockwidgets
|
Source: kddockwidgets
|
||||||
Version: 1.4.0-1
|
Version: 1.5.0-1
|
||||||
Binary: kddockwidgets
|
Binary: kddockwidgets
|
||||||
Maintainer: Allen Winter <allen.winter@kdab.com>
|
Maintainer: Allen Winter <allen.winter@kdab.com>
|
||||||
Architecture: any
|
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:
|
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
|
Name: qt5-kddockwidgets
|
||||||
Version: 1.4.0
|
Version: 1.5.0
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: KDAB's Dock Widget Framework for Qt5
|
Summary: KDAB's Dock Widget Framework for Qt5
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
@@ -14,15 +14,15 @@ Packager: Klaralvdalens Datakonsult AB (KDAB) <info@kdab.com>
|
|||||||
|
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
%if %{defined suse_version}
|
%if %{defined suse_version}
|
||||||
BuildRequires: libqt5-qtbase-devel libqt5-qtx11extras-devel
|
BuildRequires: libqt5-qtbase-devel libqt5-qtbase-private-headers-devel libqt5-qtx11extras-devel
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{defined fedora}
|
%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
|
%endif
|
||||||
|
|
||||||
%if %{defined rhel}
|
%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
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -98,6 +98,8 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
|
|||||||
%{_libdir}/libkddockwidgets.so
|
%{_libdir}/libkddockwidgets.so
|
||||||
|
|
||||||
%changelog
|
%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
|
* Fri Jul 16 2021 Allen Winter <allen.winter@kdab.com> 1.4.0
|
||||||
1.4.0 final
|
1.4.0 final
|
||||||
* Mon Jun 07 2021 Allen Winter <allen.winter@kdab.com> 1.3.1
|
* 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
|
Format: 1.0
|
||||||
Source: kddockwidgets
|
Source: kddockwidgets
|
||||||
Version: 1.4.0-1
|
Version: 1.5.0-1
|
||||||
Binary: kddockwidgets
|
Binary: kddockwidgets
|
||||||
Maintainer: Allen Winter <allen.winter@kdab.com>
|
Maintainer: Allen Winter <allen.winter@kdab.com>
|
||||||
Architecture: any
|
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:
|
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
|
Name: qt6-kddockwidgets
|
||||||
Version: 1.4.0
|
Version: 1.5.0
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: KDAB's Dock Widget Framework for Qt6
|
Summary: KDAB's Dock Widget Framework for Qt6
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
@@ -14,15 +14,15 @@ Packager: Klaralvdalens Datakonsult AB (KDAB) <info@kdab.com>
|
|||||||
|
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
%if %{defined suse_version}
|
%if %{defined suse_version}
|
||||||
BuildRequires: libqt6-qtbase-devel libqt6-qtx11extras-devel
|
BuildRequires: libqt6-qtbase-devel libqt6-qtbase-private-headers-devel libqt6-qtx11extras-devel
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{defined fedora}
|
%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
|
%endif
|
||||||
|
|
||||||
%if %{defined rhel}
|
%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
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -87,6 +87,8 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DKDDockWidgets_QT6=True -DCMAKE_BUILD_TYPE=
|
|||||||
#%{_prefix}/mkspecs/modules/* ECMGeneratePriFile isn't ported to Qt6 yet
|
#%{_prefix}/mkspecs/modules/* ECMGeneratePriFile isn't ported to Qt6 yet
|
||||||
|
|
||||||
%changelog
|
%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
|
* Fri Jul 16 2021 Allen Winter <allen.winter@kdab.com> 1.4.0
|
||||||
1.4.0 final
|
1.4.0 final
|
||||||
* Mon Jun 07 2021 Allen Winter <allen.winter@kdab.com> 1.3.1
|
* Mon Jun 07 2021 Allen Winter <allen.winter@kdab.com> 1.3.1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Allen Winter <allen.winter@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Allen Winter <allen.winter@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div style="float: left;">
|
<div style="float: left;">
|
||||||
<img src="kdab-logo-16x16.png">
|
<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>
|
<br>
|
||||||
"The Qt, C++ and OpenGL Experts"<br>
|
"The Qt, C++ and OpenGL Experts"<br>
|
||||||
<a href="https://www.kdab.com/">https://www.kdab.com/</a>
|
<a href="https://www.kdab.com/">https://www.kdab.com/</a>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
#include <kddockwidgets/FrameworkWidgetFactory.h>
|
#include <kddockwidgets/FrameworkWidgetFactory.h>
|
||||||
|
|
||||||
#include <kddockwidgets/private/TabWidget_p.h>
|
#include <kddockwidgets/private/TabWidget_p.h>
|
||||||
|
#include <kddockwidgets/private/FloatingWindow_p.h>
|
||||||
#include <kddockwidgets/private/widgets/FrameWidget_p.h>
|
#include <kddockwidgets/private/widgets/FrameWidget_p.h>
|
||||||
#include <kddockwidgets/private/widgets/TabBarWidget_p.h>
|
#include <kddockwidgets/private/widgets/TabBarWidget_p.h>
|
||||||
#include <kddockwidgets/private/widgets/TabWidgetWidget_p.h>
|
#include <kddockwidgets/private/widgets/TabWidgetWidget_p.h>
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
class MyTitleBar : public KDDockWidgets::TitleBarWidget
|
class MyTitleBar : public KDDockWidgets::TitleBarWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
bool m_isSpecialType = false;
|
||||||
explicit MyTitleBar(KDDockWidgets::Frame *frame)
|
explicit MyTitleBar(KDDockWidgets::Frame *frame)
|
||||||
: KDDockWidgets::TitleBarWidget(frame)
|
: KDDockWidgets::TitleBarWidget(frame)
|
||||||
{
|
{
|
||||||
@@ -45,24 +47,73 @@ public:
|
|||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
setFixedHeight(60);
|
setFixedHeight(60);
|
||||||
|
|
||||||
|
if (auto tb = tabBar()) {
|
||||||
|
if (auto tbWidget = qobject_cast<KDDockWidgets::TabBarWidget *>(tb->asWidget())) {
|
||||||
|
// 1. Be notified when dock widgets are added/removed from the tabbar and when current changes
|
||||||
|
|
||||||
|
connect(tbWidget, &KDDockWidgets::TabBarWidget::dockWidgetInserted, this, &MyTitleBar::updateType);
|
||||||
|
connect(tbWidget, &KDDockWidgets::TabBarWidget::dockWidgetRemoved, this, &MyTitleBar::updateType);
|
||||||
|
connect(tbWidget, &KDDockWidgets::TabBarWidget::currentChanged, this, &MyTitleBar::updateType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (KDDockWidgets::FloatingWindow *fw = floatingWindow()) {
|
||||||
|
// 2. Floating Windows with more than 1 Frame (more than 1 tabbar) won't have a special titlebar.
|
||||||
|
// during runtime a FloatingWindow can have frames removed/added, so update its title bar type.
|
||||||
|
connect(fw, &KDDockWidgets::FloatingWindow::numFramesChanged, this, &MyTitleBar::updateType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void paintEvent(QPaintEvent *) override
|
void updateType()
|
||||||
{
|
{
|
||||||
QPainter p(this);
|
m_isSpecialType = false;
|
||||||
QPen pen(Qt::black);
|
|
||||||
const QColor focusedBackgroundColor = Qt::yellow;
|
if (tabBar() != nullptr) { // Will be null for floating windows with several frames.
|
||||||
const QColor backgroundColor = focusedBackgroundColor.darker(115);
|
const auto dws = dockWidgets();
|
||||||
QBrush brush(isFocused() ? focusedBackgroundColor : backgroundColor);
|
for (auto dw : dws) {
|
||||||
pen.setWidth(4);
|
// 3. If this TitleBar contains dock widget #1 or #2 it's special and will have custom painting
|
||||||
p.setPen(pen);
|
if (dw->uniqueName() == QLatin1String("DockWidget #1") ||
|
||||||
p.setBrush(brush);
|
dw->uniqueName() == QLatin1String("DockWidget #2")) {
|
||||||
p.drawRect(rect().adjusted(4, 4, -4, -4));
|
m_isSpecialType = true;
|
||||||
QFont f = qApp->font();
|
break;
|
||||||
f.setPixelSize(30);
|
}
|
||||||
f.setBold(true);
|
}
|
||||||
p.setFont(f);
|
|
||||||
p.drawText(QPoint(10,40), title());
|
QWidget::update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void paintEvent(QPaintEvent *ev) override
|
||||||
|
{
|
||||||
|
KDDockWidgets::DockWidgetBase *currentDW = nullptr;
|
||||||
|
if (auto tb = tabBar()) {
|
||||||
|
if (auto tbWidget = qobject_cast<KDDockWidgets::TabBarWidget *>(tb->asWidget())) {
|
||||||
|
// 4. Know the current tab, so it can influence the title bar
|
||||||
|
currentDW = tbWidget->currentDockWidget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_isSpecialType) {
|
||||||
|
QPainter p(this);
|
||||||
|
QPen pen(Qt::black);
|
||||||
|
const bool isDw2 = currentDW && currentDW->uniqueName() == QLatin1String("DockWidget #2");
|
||||||
|
const QColor focusedBackgroundColor = isDw2 ? Qt::cyan : Qt::yellow;
|
||||||
|
|
||||||
|
const QColor backgroundColor = focusedBackgroundColor.darker(115);
|
||||||
|
QBrush brush(isFocused() ? focusedBackgroundColor : backgroundColor);
|
||||||
|
pen.setWidth(4);
|
||||||
|
p.setPen(pen);
|
||||||
|
p.setBrush(brush);
|
||||||
|
p.drawRect(rect().adjusted(4, 4, -4, -4));
|
||||||
|
QFont f = qApp->font();
|
||||||
|
f.setPixelSize(30);
|
||||||
|
f.setBold(true);
|
||||||
|
p.setFont(f);
|
||||||
|
p.drawText(QPoint(10, 40), title());
|
||||||
|
} else {
|
||||||
|
KDDockWidgets::TitleBarWidget::paintEvent(ev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -47,6 +47,7 @@ static MyWidget *newMyWidget()
|
|||||||
MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
|
MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
|
||||||
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
|
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
|
||||||
bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore,
|
bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore,
|
||||||
|
bool dock0BlocksCloseEvent,
|
||||||
const QString &affinityName, QWidget *parent)
|
const QString &affinityName, QWidget *parent)
|
||||||
: MainWindow(uniqueName, options, parent)
|
: MainWindow(uniqueName, options, parent)
|
||||||
, m_dockWidget0IsNonClosable(dockWidget0IsNonClosable)
|
, m_dockWidget0IsNonClosable(dockWidget0IsNonClosable)
|
||||||
@@ -54,6 +55,7 @@ MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowO
|
|||||||
, m_restoreIsRelative(restoreIsRelative)
|
, m_restoreIsRelative(restoreIsRelative)
|
||||||
, m_maxSizeForDockWidget8(maxSizeForDockWidget8)
|
, m_maxSizeForDockWidget8(maxSizeForDockWidget8)
|
||||||
, m_dockwidget5DoesntCloseBeforeRestore(dockwidget5DoesntCloseBeforeRestore)
|
, m_dockwidget5DoesntCloseBeforeRestore(dockwidget5DoesntCloseBeforeRestore)
|
||||||
|
, m_dock0BlocksCloseEvent(dock0BlocksCloseEvent)
|
||||||
{
|
{
|
||||||
auto menubar = menuBar();
|
auto menubar = menuBar();
|
||||||
auto fileMenu = new QMenu(QStringLiteral("File"), this);
|
auto fileMenu = new QMenu(QStringLiteral("File"), this);
|
||||||
@@ -190,6 +192,9 @@ KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
|
|||||||
myWidget->setMaximumSize(200, 200);
|
myWidget->setMaximumSize(200, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count == 0 && m_dock0BlocksCloseEvent)
|
||||||
|
myWidget->blockCloseEvent();
|
||||||
|
|
||||||
dock->setWidget(myWidget);
|
dock->setWidget(myWidget);
|
||||||
|
|
||||||
if (dock->options() & KDDockWidgets::DockWidget::Option_NotDockable) {
|
if (dock->options() & KDDockWidgets::DockWidget::Option_NotDockable) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -20,7 +20,7 @@ class MyMainWindow : public KDDockWidgets::MainWindow
|
|||||||
public:
|
public:
|
||||||
explicit MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
|
explicit MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
|
||||||
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
|
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
|
||||||
bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore,
|
bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore, bool dock0BlocksCloseEvent,
|
||||||
const QString &affinityName = {}, // Usually not needed. Just here to show the feature.
|
const QString &affinityName = {}, // Usually not needed. Just here to show the feature.
|
||||||
QWidget *parent = nullptr);
|
QWidget *parent = nullptr);
|
||||||
~MyMainWindow() override;
|
~MyMainWindow() override;
|
||||||
@@ -34,5 +34,6 @@ private:
|
|||||||
const bool m_restoreIsRelative;
|
const bool m_restoreIsRelative;
|
||||||
const bool m_maxSizeForDockWidget8;
|
const bool m_maxSizeForDockWidget8;
|
||||||
const bool m_dockwidget5DoesntCloseBeforeRestore;
|
const bool m_dockwidget5DoesntCloseBeforeRestore;
|
||||||
|
const bool m_dock0BlocksCloseEvent;
|
||||||
KDDockWidgets::DockWidget::List m_dockwidgets;
|
KDDockWidgets::DockWidget::List m_dockwidgets;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -9,6 +9,11 @@
|
|||||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
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>
|
#include <kddockwidgets/private/widgets/TitleBarWidget_p.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,3 +82,5 @@ public:
|
|||||||
MyTitleBar_CSS::~MyTitleBar_CSS()
|
MyTitleBar_CSS::~MyTitleBar_CSS()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QCloseEvent>
|
||||||
|
|
||||||
static QHash<QString, QImage> s_images; /// clazy:exclude=non-pod-global-static
|
static QHash<QString, QImage> s_images; /// clazy:exclude=non-pod-global-static
|
||||||
|
|
||||||
@@ -70,6 +71,20 @@ void MyWidget::drawLogo(QPainter &p)
|
|||||||
p.drawImage(targetLogoRect, m_logo, m_logo.rect());
|
p.drawImage(targetLogoRect, m_logo, m_logo.rect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyWidget::blockCloseEvent()
|
||||||
|
{
|
||||||
|
m_blocksCloseEvent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyWidget::closeEvent(QCloseEvent *ev)
|
||||||
|
{
|
||||||
|
if (m_blocksCloseEvent) {
|
||||||
|
ev->ignore();
|
||||||
|
} else {
|
||||||
|
QWidget::closeEvent(ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MyWidget1::MyWidget1(MyWidget::QWidget *parent)
|
MyWidget1::MyWidget1(MyWidget::QWidget *parent)
|
||||||
: MyWidget(QStringLiteral(":/assets/triangles.png"), QStringLiteral(":/assets/KDAB_bubble_white.png"), parent)
|
: MyWidget(QStringLiteral(":/assets/triangles.png"), QStringLiteral(":/assets/KDAB_bubble_white.png"), parent)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -26,10 +26,16 @@ class MyWidget : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent = nullptr);
|
explicit MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent = nullptr);
|
||||||
~MyWidget();
|
~MyWidget();
|
||||||
|
|
||||||
|
// These two are just for demonstrating how to block the close event, if desired
|
||||||
|
void blockCloseEvent();
|
||||||
|
void closeEvent(QCloseEvent *) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void drawLogo(QPainter &);
|
void drawLogo(QPainter &);
|
||||||
QImage m_background;
|
QImage m_background;
|
||||||
QImage m_logo;
|
QImage m_logo;
|
||||||
|
bool m_blocksCloseEvent = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MyWidget1 : public MyWidget
|
class MyWidget1 : public MyWidget
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "MyMainWindow.h"
|
#include "MyMainWindow.h"
|
||||||
#include "MyFrameworkWidgetFactory.h"
|
#include "MyFrameworkWidgetFactory.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <kddockwidgets/Config.h>
|
#include <kddockwidgets/Config.h>
|
||||||
|
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
@@ -119,6 +120,10 @@ int main(int argc, char **argv)
|
|||||||
QCoreApplication::translate("main", "DockWidget #5 won't be closed before a restore. Illustrates LayoutSaverOption::DontCloseBeforeRestore"));
|
QCoreApplication::translate("main", "DockWidget #5 won't be closed before a restore. Illustrates LayoutSaverOption::DontCloseBeforeRestore"));
|
||||||
parser.addOption(dontCloseBeforeRestore);
|
parser.addOption(dontCloseBeforeRestore);
|
||||||
|
|
||||||
|
QCommandLineOption blockCloseEvent("block-close-event",
|
||||||
|
QCoreApplication::translate("main", "DockWidget #0 will block close events"));
|
||||||
|
parser.addOption(blockCloseEvent);
|
||||||
|
|
||||||
QCommandLineOption showButtonsInTabBarIfTitleBarHidden("show-buttons-in-tabbar-if-titlebar-hidden",
|
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);
|
parser.addOption(showButtonsInTabBarIfTitleBarHidden);
|
||||||
@@ -131,6 +136,10 @@ int main(int argc, char **argv)
|
|||||||
QCoreApplication::translate("main", "Allow switching tabs via context menu in tabs area"));
|
QCoreApplication::translate("main", "Allow switching tabs via context menu in tabs area"));
|
||||||
parser.addOption(ctxtMenuOnTabs);
|
parser.addOption(ctxtMenuOnTabs);
|
||||||
|
|
||||||
|
QCommandLineOption hideCertainDockingIndicators("hide-certain-docking-indicators",
|
||||||
|
QCoreApplication::translate("main", "Illustrates usage of Config::setDropIndicatorAllowedFunc()"));
|
||||||
|
parser.addOption(hideCertainDockingIndicators);
|
||||||
|
|
||||||
#if defined(DOCKS_DEVELOPER_MODE)
|
#if defined(DOCKS_DEVELOPER_MODE)
|
||||||
parser.addOption(centralFrame);
|
parser.addOption(centralFrame);
|
||||||
|
|
||||||
@@ -253,6 +262,24 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parser.isSet(hideCertainDockingIndicators)) {
|
||||||
|
// Here we exemplify adding a restriction to "Dock Widget 8"
|
||||||
|
// Dock widget 8 will only be allowed to dock to the outter areasa
|
||||||
|
auto func = [](KDDockWidgets::DropLocation location,
|
||||||
|
const KDDockWidgets::DockWidgetBase::List &source,
|
||||||
|
const KDDockWidgets::DockWidgetBase::List &target) {
|
||||||
|
Q_UNUSED(target); // When dragging into a tab, 'target' would have the list of already tabbed dock widgets
|
||||||
|
|
||||||
|
const bool isDraggingDW8 = std::find_if(source.cbegin(), source.cend(), [] (KDDockWidgets::DockWidgetBase *dw) {
|
||||||
|
return dw->uniqueName() == QLatin1String("DockWidget #8");
|
||||||
|
}) != source.cend();
|
||||||
|
|
||||||
|
return (location & KDDockWidgets::DropLocation_Outter) || !isDraggingDW8;
|
||||||
|
};
|
||||||
|
|
||||||
|
KDDockWidgets::Config::self().setDropIndicatorAllowedFunc(func);
|
||||||
|
}
|
||||||
|
|
||||||
KDDockWidgets::Config::self().setFlags(flags);
|
KDDockWidgets::Config::self().setFlags(flags);
|
||||||
|
|
||||||
const bool nonClosableDockWidget0 = parser.isSet(nonClosableDockWidget);
|
const bool nonClosableDockWidget0 = parser.isSet(nonClosableDockWidget);
|
||||||
@@ -261,6 +288,7 @@ int main(int argc, char **argv)
|
|||||||
const bool maxSizeForDockWidget8 = parser.isSet(maxSizeOption);
|
const bool maxSizeForDockWidget8 = parser.isSet(maxSizeOption);
|
||||||
const bool dontCloseDockWidget5BeforeRestore = parser.isSet(dontCloseBeforeRestore);
|
const bool dontCloseDockWidget5BeforeRestore = parser.isSet(dontCloseBeforeRestore);
|
||||||
const bool usesMainWindowsWithAffinity = parser.isSet(multipleMainWindows);
|
const bool usesMainWindowsWithAffinity = parser.isSet(multipleMainWindows);
|
||||||
|
const bool dock0BlocksCloseEvent = parser.isSet(blockCloseEvent);
|
||||||
|
|
||||||
#ifdef KDDOCKWIDGETS_SUPPORTS_NESTED_MAINWINDOWS
|
#ifdef KDDOCKWIDGETS_SUPPORTS_NESTED_MAINWINDOWS
|
||||||
const bool usesDockableMainWindows = parser.isSet(dockableMainWindows);
|
const bool usesDockableMainWindows = parser.isSet(dockableMainWindows);
|
||||||
@@ -270,7 +298,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
MyMainWindow mainWindow(QStringLiteral("MyMainWindow"), options, nonClosableDockWidget0,
|
MyMainWindow mainWindow(QStringLiteral("MyMainWindow"), options, nonClosableDockWidget0,
|
||||||
nonDockableDockWidget9, restoreIsRelative, maxSizeForDockWidget8,
|
nonDockableDockWidget9, restoreIsRelative, maxSizeForDockWidget8,
|
||||||
dontCloseDockWidget5BeforeRestore);
|
dontCloseDockWidget5BeforeRestore, dock0BlocksCloseEvent);
|
||||||
mainWindow.setWindowTitle("Main Window 1");
|
mainWindow.setWindowTitle("Main Window 1");
|
||||||
mainWindow.resize(1200, 1200);
|
mainWindow.resize(1200, 1200);
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
@@ -289,7 +317,7 @@ int main(int argc, char **argv)
|
|||||||
auto mainWindow2 = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
|
auto mainWindow2 = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
|
||||||
nonClosableDockWidget0, nonDockableDockWidget9,
|
nonClosableDockWidget0, nonDockableDockWidget9,
|
||||||
restoreIsRelative, maxSizeForDockWidget8,
|
restoreIsRelative, maxSizeForDockWidget8,
|
||||||
dontCloseDockWidget5BeforeRestore, affinity);
|
dontCloseDockWidget5BeforeRestore, dock0BlocksCloseEvent, affinity);
|
||||||
if (affinity.isEmpty())
|
if (affinity.isEmpty())
|
||||||
mainWindow2->setWindowTitle("Main Window 2");
|
mainWindow2->setWindowTitle("Main Window 2");
|
||||||
else
|
else
|
||||||
@@ -303,7 +331,7 @@ int main(int argc, char **argv)
|
|||||||
const QString affinity = QStringLiteral("Inner-DockWidgets-2");
|
const QString affinity = QStringLiteral("Inner-DockWidgets-2");
|
||||||
auto dockableMainWindow = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
|
auto dockableMainWindow = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
|
||||||
false, false, restoreIsRelative, false,
|
false, false, restoreIsRelative, false,
|
||||||
false, affinity);
|
false, false, affinity);
|
||||||
|
|
||||||
dockableMainWindow->setAffinities({ affinity });
|
dockableMainWindow->setAffinities({ affinity });
|
||||||
|
|
||||||
|
|||||||
40
examples/mdi_with_docking/CMakeLists.txt
Normal file
40
examples/mdi_with_docking/CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#
|
||||||
|
# This file is part of KDDockWidgets.
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2019-2021 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
|
||||||
|
#
|
||||||
|
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.7)
|
||||||
|
project(kddockwidgets_mdi_with_docking_example)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIRS ON)
|
||||||
|
|
||||||
|
if(NOT TARGET kddockwidgets)
|
||||||
|
# This will look for Qt, do find_package yourself manually before
|
||||||
|
# if you want to look for a specific Qt version for instance.
|
||||||
|
find_package(KDDockWidgets REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/resources_example.qrc)
|
||||||
|
|
||||||
|
# Just to reuse MyWidget.h
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/)
|
||||||
|
|
||||||
|
add_executable(kddockwidgets_mdi_with_docking_example
|
||||||
|
main.cpp
|
||||||
|
../dockwidgets/MyWidget.cpp
|
||||||
|
${RESOURCES_EXAMPLE_SRC}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(kddockwidgets_mdi_with_docking_example
|
||||||
|
PRIVATE
|
||||||
|
KDAB::kddockwidgets
|
||||||
|
)
|
||||||
|
|
||||||
95
examples/mdi_with_docking/main.cpp
Normal file
95
examples/mdi_with_docking/main.cpp
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
This file is part of KDDockWidgets.
|
||||||
|
|
||||||
|
SPDX-FileCopyrightText: 2019-2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "MyWidget.h"
|
||||||
|
|
||||||
|
#include <kddockwidgets/DockWidget.h>
|
||||||
|
#include <kddockwidgets/MainWindow.h>
|
||||||
|
#include <kddockwidgets/MDIArea.h>
|
||||||
|
|
||||||
|
#include <QStyleFactory>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
|
// clazy:excludeall=qstring-allocations
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
|
#endif
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
|
app.setOrganizationName(QStringLiteral("KDAB"));
|
||||||
|
app.setApplicationName(QStringLiteral("App supporting both docking and a MDI area"));
|
||||||
|
|
||||||
|
QCommandLineParser parser;
|
||||||
|
parser.setApplicationDescription("KDDockWidgets MDI mixed with normal docking");
|
||||||
|
parser.addHelpOption();
|
||||||
|
|
||||||
|
QCommandLineOption nestedDocking("n", QCoreApplication::translate("main", "The MDI dock widgets will serve as drop areas, allowing for further nesting"));
|
||||||
|
parser.addOption(nestedDocking);
|
||||||
|
|
||||||
|
parser.process(app);
|
||||||
|
|
||||||
|
// Fusion looks better in general, but feel free to change
|
||||||
|
qApp->setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
|
||||||
|
|
||||||
|
// # 1. Create our main window
|
||||||
|
|
||||||
|
KDDockWidgets::MainWindow mainWindow(QStringLiteral("MyMainWindow"), KDDockWidgets::MainWindowOption_HasCentralWidget);
|
||||||
|
mainWindow.setWindowTitle("Main Window");
|
||||||
|
mainWindow.resize(1600, 1200);
|
||||||
|
mainWindow.show();
|
||||||
|
|
||||||
|
// # 2. Create a dock widget, it needs a unique name
|
||||||
|
auto dock1 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock1"));
|
||||||
|
auto widget1 = new MyWidget1();
|
||||||
|
dock1->setWidget(widget1);
|
||||||
|
|
||||||
|
auto dock2 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock2"));
|
||||||
|
auto widget2 = new MyWidget2();
|
||||||
|
dock2->setWidget(widget2);
|
||||||
|
|
||||||
|
// # 3. Dock them
|
||||||
|
mainWindow.addDockWidget(dock1, KDDockWidgets::Location_OnLeft, nullptr, KDDockWidgets::InitialOption(QSize(300, 0)));
|
||||||
|
mainWindow.addDockWidget(dock2, KDDockWidgets::Location_OnBottom, nullptr, KDDockWidgets::InitialOption(QSize(0, 300)));
|
||||||
|
|
||||||
|
KDDockWidgets::DockWidgetBase::Options options = {};
|
||||||
|
if (parser.isSet(nestedDocking)) {
|
||||||
|
options |= KDDockWidgets::DockWidgetBase::Option_MDINestable;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. Create our MDI widgets, which will go into the MDI area
|
||||||
|
auto mdiWidget1 = new KDDockWidgets::DockWidget(QStringLiteral("MDI widget1"), options);
|
||||||
|
mdiWidget1->setWidget(new MyWidget1());
|
||||||
|
|
||||||
|
auto mdiWidget2 = new KDDockWidgets::DockWidget(QStringLiteral("MDI widget2"), options);
|
||||||
|
mdiWidget2->setWidget(new MyWidget2());
|
||||||
|
|
||||||
|
auto mdiWidget3 = new KDDockWidgets::DockWidget(QStringLiteral("MDI widget3"), options);
|
||||||
|
auto widget3 = new MyWidget3();
|
||||||
|
mdiWidget3->setWidget(widget3);
|
||||||
|
|
||||||
|
// Just for my personal testing: Overkill to add an option
|
||||||
|
// widget3->blockCloseEvent();
|
||||||
|
|
||||||
|
auto mdiArea = new KDDockWidgets::MDIArea();
|
||||||
|
mainWindow.setPersistentCentralWidget(mdiArea);
|
||||||
|
|
||||||
|
mdiArea->addDockWidget(mdiWidget1, QPoint(10, 10));
|
||||||
|
mdiArea->addDockWidget(mdiWidget2, QPoint(50, 50));
|
||||||
|
mdiArea->addDockWidget(mdiWidget3, QPoint(110, 110));
|
||||||
|
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -24,6 +24,9 @@ endif()
|
|||||||
|
|
||||||
set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/resources_example.qrc)
|
set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/resources_example.qrc)
|
||||||
|
|
||||||
|
# Just to reuse MyWidget.h
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/)
|
||||||
|
|
||||||
add_executable(kddockwidgets_minimal_mdi_example
|
add_executable(kddockwidgets_minimal_mdi_example
|
||||||
main.cpp
|
main.cpp
|
||||||
../dockwidgets/MyWidget.cpp
|
../dockwidgets/MyWidget.cpp
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
/*
|
|
||||||
This file is part of KDDockWidgets.
|
|
||||||
|
|
||||||
SPDX-FileCopyrightText: 2019-2021 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "MyWidget.h"
|
|
||||||
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QLineEdit>
|
|
||||||
|
|
||||||
static QHash<QString, QImage> s_images; /// clazy:exclude=non-pod-global-static
|
|
||||||
|
|
||||||
MyWidget::MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
{
|
|
||||||
if (!backgroundFile.isEmpty()) {
|
|
||||||
auto it = s_images.find(backgroundFile);
|
|
||||||
if (it == s_images.end())
|
|
||||||
it = s_images.insert(backgroundFile, QImage(backgroundFile));
|
|
||||||
m_background = it.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!logoFile.isEmpty()) {
|
|
||||||
auto it = s_images.find(logoFile);
|
|
||||||
if (it == s_images.end())
|
|
||||||
it = s_images.insert(logoFile, QImage(logoFile));
|
|
||||||
m_logo = it.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
setFocusPolicy(Qt::StrongFocus);
|
|
||||||
#if 0
|
|
||||||
// Uncomment to show focus propagation working
|
|
||||||
new QLineEdit(this);
|
|
||||||
auto l2 = new QLineEdit(this);
|
|
||||||
l2->move(0, 100);
|
|
||||||
setFocusProxy(l2);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
MyWidget::~MyWidget()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyWidget::drawLogo(QPainter &p)
|
|
||||||
{
|
|
||||||
if (m_logo.isNull())
|
|
||||||
return;
|
|
||||||
|
|
||||||
const qreal ratio = m_logo.height() / (m_logo.width() * 1.0);
|
|
||||||
|
|
||||||
const int maxWidth = int(0.80 * size().width());
|
|
||||||
const int maxHeight = int(0.80 * size().height());
|
|
||||||
|
|
||||||
const int proposedHeight = int(maxWidth * ratio);
|
|
||||||
|
|
||||||
const int width = proposedHeight <= maxHeight ? maxWidth
|
|
||||||
: int(maxHeight / ratio);
|
|
||||||
|
|
||||||
const int height = int(width * ratio);
|
|
||||||
QRect targetLogoRect(0,0, width, height);
|
|
||||||
targetLogoRect.moveCenter(rect().center() + QPoint(0, -int(size().height() * 0.00)));
|
|
||||||
p.drawImage(targetLogoRect, m_logo, m_logo.rect());
|
|
||||||
}
|
|
||||||
|
|
||||||
MyWidget1::MyWidget1(MyWidget::QWidget *parent)
|
|
||||||
: MyWidget(QStringLiteral(":/assets/triangles.png"), QStringLiteral(":/assets/KDAB_bubble_white.png"), parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyWidget1::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
QPainter p(this);
|
|
||||||
p.fillRect(rect(), QColor(0xCC, 0xCC, 0xCC));
|
|
||||||
p.drawImage(m_background.rect(), m_background, m_background.rect());
|
|
||||||
|
|
||||||
drawLogo(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
MyWidget2::MyWidget2(MyWidget::QWidget *parent)
|
|
||||||
: MyWidget(QString(), QStringLiteral(":/assets/KDAB_bubble_blue.png"), parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyWidget2::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
QPainter p(this);
|
|
||||||
p.fillRect(rect(), Qt::white);
|
|
||||||
drawLogo(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
MyWidget3::MyWidget3(MyWidget::QWidget *parent)
|
|
||||||
: MyWidget(QStringLiteral(":/assets/base.png"), QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"), parent)
|
|
||||||
, m_triangle(QImage(QStringLiteral(":/assets/tri.png")))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyWidget3::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
QPainter p(this);
|
|
||||||
p.fillRect(rect(), QColor(0xD5, 0xD5, 0xD5));
|
|
||||||
|
|
||||||
p.drawImage(m_background.rect(), m_background, m_background.rect());
|
|
||||||
|
|
||||||
const QRect targetRect = QRect({ width() - m_triangle.width(), height() - m_triangle.height() }, m_triangle.size());
|
|
||||||
|
|
||||||
p.drawImage(targetRect, m_triangle, m_triangle.rect());
|
|
||||||
drawLogo(p);
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
This file is part of KDDockWidgets.
|
|
||||||
|
|
||||||
SPDX-FileCopyrightText: 2019-2021 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 EXAMPLEDOCKABLEWIDGET_H
|
|
||||||
#define EXAMPLEDOCKABLEWIDGET_H
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QPainter;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
class MyWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
MyWidget() = default;
|
|
||||||
explicit MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent = nullptr);
|
|
||||||
~MyWidget();
|
|
||||||
protected:
|
|
||||||
void drawLogo(QPainter &);
|
|
||||||
QImage m_background;
|
|
||||||
QImage m_logo;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MyWidget1 : public MyWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit MyWidget1(QWidget *parent = nullptr);
|
|
||||||
protected:
|
|
||||||
void paintEvent(QPaintEvent*) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MyWidget2 : public MyWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit MyWidget2(QWidget *parent = nullptr);
|
|
||||||
protected:
|
|
||||||
void paintEvent(QPaintEvent*) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MyWidget3 : public MyWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit MyWidget3(QWidget *parent = nullptr);
|
|
||||||
protected:
|
|
||||||
void paintEvent(QPaintEvent*) override;
|
|
||||||
QImage m_triangle;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -53,6 +53,9 @@ int main(int argc, char **argv)
|
|||||||
auto widget3 = new MyWidget3();
|
auto widget3 = new MyWidget3();
|
||||||
dock3->setWidget(widget3);
|
dock3->setWidget(widget3);
|
||||||
|
|
||||||
|
// Just for my personal testing: Overkill to add an option
|
||||||
|
// widget3->blockCloseEvent();
|
||||||
|
|
||||||
// # 3. Dock them
|
// # 3. Dock them
|
||||||
mainWindow.addDockWidget(dock1, QPoint(10, 10));
|
mainWindow.addDockWidget(dock1, QPoint(10, 10));
|
||||||
mainWindow.addDockWidget(dock2, QPoint(50, 50));
|
mainWindow.addDockWidget(dock2, QPoint(50, 50));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -39,4 +39,6 @@ set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX "${${PROJECT_NAME}_PYTHON_BIN
|
|||||||
|
|
||||||
include(PySide${PYSIDE_MAJOR_VERSION}ModuleBuild)
|
include(PySide${PYSIDE_MAJOR_VERSION}ModuleBuild)
|
||||||
add_subdirectory(PyKDDockWidgets)
|
add_subdirectory(PyKDDockWidgets)
|
||||||
add_subdirectory(tests)
|
if(${PROJECT_NAME}_TESTS)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -15,15 +15,25 @@ import os
|
|||||||
__all__ = ['KDDockWidgets']
|
__all__ = ['KDDockWidgets']
|
||||||
|
|
||||||
def setupLibraryPath():
|
def setupLibraryPath():
|
||||||
package_dir = os.path.abspath(os.path.dirname(__file__))
|
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
return
|
return
|
||||||
|
|
||||||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
|
if "@PYSIDE_MAJOR_VERSION@" == "6":
|
||||||
os.add_dll_directory(package_dir)
|
from shiboken@PYSIDE_MAJOR_VERSION@ import Shiboken
|
||||||
return
|
else:
|
||||||
|
from shiboken@PYSIDE_MAJOR_VERSION@ import shiboken@PYSIDE_MAJOR_VERSION@ as Shiboken
|
||||||
|
|
||||||
os.environ['PATH'] = os.fspath(package_dir) + os.pathsep + os.environ['PATH']
|
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
|
# Preload PySide libraries to avoid missing libraries while loading KDDockWidgets
|
||||||
try:
|
try:
|
||||||
@@ -36,15 +46,3 @@ except Exception:
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
setupLibraryPath()
|
setupLibraryPath()
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# This file is part of KDDockWidgets.
|
|
||||||
#
|
|
||||||
# SPDX-FileCopyrightText: 2020-2021 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.
|
|
||||||
#
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -15,7 +15,10 @@ from MyMainWindow import MyMainWindow
|
|||||||
from PySide6 import QtWidgets, QtCore
|
from PySide6 import QtWidgets, QtCore
|
||||||
|
|
||||||
import sys
|
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 Qt6 version used to generate the bindings!)")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -15,7 +15,10 @@ from MyMainWindow import MyMainWindow
|
|||||||
from PySide2 import QtWidgets, QtCore
|
from PySide2 import QtWidgets, QtCore
|
||||||
|
|
||||||
import sys
|
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__":
|
if __name__ == "__main__":
|
||||||
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -18,23 +18,23 @@ set(TEST_PYTHONPATH
|
|||||||
set(TEST_LIBRARYPATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
set(TEST_LIBRARYPATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(TEST_LIBRARY_VAR "PATH")
|
set(TEST_LIBRARY_VAR "PATH")
|
||||||
string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
|
string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
|
||||||
string(REPLACE "\\" "/" TEST_LIBRARYPATH "${TEST_LIBRARYPATH}")
|
string(REPLACE "\\" "/" TEST_LIBRARYPATH "${TEST_LIBRARYPATH}")
|
||||||
list(JOIN TEST_PYTHONPATH "\\;" TEST_PYTHONPATH)
|
list(JOIN TEST_PYTHONPATH "\\;" TEST_PYTHONPATH)
|
||||||
list(JOIN TEST_LIBRARYPATH "\\;" TEST_LIBRARYPATH)
|
list(JOIN TEST_LIBRARYPATH "\\;" TEST_LIBRARYPATH)
|
||||||
else()
|
else()
|
||||||
set(TEST_LIBRARY_VAR "LD_LIBRARY_PATH")
|
set(TEST_LIBRARY_VAR "LD_LIBRARY_PATH")
|
||||||
list(JOIN TEST_PYTHONPATH ":" TEST_PYTHONPATH)
|
list(JOIN TEST_PYTHONPATH ":" TEST_PYTHONPATH)
|
||||||
list(JOIN TEST_LIBRARYPATH ":" TEST_LIBRARYPATH)
|
list(JOIN TEST_LIBRARYPATH ":" TEST_LIBRARYPATH)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PYTHON_ENV_COMMON "PYTHONPATH=${TEST_PYTHONPATH};${TEST_LIBRARY_VAR}=${TEST_LIBRARYPATH}")
|
set(PYTHON_ENV_COMMON "PYTHONPATH=${TEST_PYTHONPATH};${TEST_LIBRARY_VAR}=${TEST_LIBRARYPATH}")
|
||||||
|
|
||||||
file(GLOB TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tst_*.py)
|
file(GLOB TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tst_*.py)
|
||||||
foreach(test_file ${TEST_FILES})
|
foreach(test_file ${TEST_FILES})
|
||||||
get_filename_component(test_name ${test_file} NAME_WE)
|
get_filename_component(test_name ${test_file} NAME_WE)
|
||||||
add_test(${test_name} ${Python3_EXECUTABLE} ${test_file})
|
add_test(${test_name} ${Python3_EXECUTABLE} ${test_file})
|
||||||
set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "${PYTHON_ENV_COMMON}")
|
set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "${PYTHON_ENV_COMMON}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +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):
|
class TstConfig(object):
|
||||||
bindingsNamespace = "@PYTHON_BINDING_NAMESPACE@"
|
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@")
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
# 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 unittest
|
||||||
import importlib
|
import importlib
|
||||||
import inspect
|
import inspect
|
||||||
@@ -16,4 +26,5 @@ class TestImportModules(unittest.TestCase):
|
|||||||
self.assertIn(symbol, moduleSymbols)
|
self.assertIn(symbol, moduleSymbols)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
TstConfig.initLibraryPath()
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of KDDockWidgets.
|
# 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>
|
# Author: Sergio Martins <sergio.martins@kdab.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -35,6 +35,8 @@ set(DOCKSLIBS_SRCS
|
|||||||
MainWindowBase.h
|
MainWindowBase.h
|
||||||
MainWindowMDI.cpp
|
MainWindowMDI.cpp
|
||||||
MainWindowMDI.h
|
MainWindowMDI.h
|
||||||
|
MDIArea.cpp
|
||||||
|
MDIArea.h
|
||||||
LayoutSaver.cpp
|
LayoutSaver.cpp
|
||||||
LayoutSaver.h
|
LayoutSaver.h
|
||||||
private/LayoutSaver_p.h
|
private/LayoutSaver_p.h
|
||||||
@@ -74,6 +76,7 @@ set(DOCKSLIBS_SRCS
|
|||||||
private/DropAreaWithCentralFrame_p.h
|
private/DropAreaWithCentralFrame_p.h
|
||||||
private/WidgetResizeHandler.cpp
|
private/WidgetResizeHandler.cpp
|
||||||
private/WidgetResizeHandler_p.h
|
private/WidgetResizeHandler_p.h
|
||||||
|
private/WindowZOrder_x11_p.h
|
||||||
private/indicators/NullIndicators.cpp
|
private/indicators/NullIndicators.cpp
|
||||||
private/indicators/NullIndicators_p.h
|
private/indicators/NullIndicators_p.h
|
||||||
private/indicators/ClassicIndicators.cpp
|
private/indicators/ClassicIndicators.cpp
|
||||||
@@ -125,6 +128,7 @@ set(DOCKS_INSTALLABLE_PRIVATE_INCLUDES
|
|||||||
private/WidgetResizeHandler_p.h
|
private/WidgetResizeHandler_p.h
|
||||||
private/DockRegistry_p.h
|
private/DockRegistry_p.h
|
||||||
private/TabWidget_p.h
|
private/TabWidget_p.h
|
||||||
|
private/MDILayoutWidget_p.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(DOCKS_INSTALLABLE_PRIVATE_WIDGET_INCLUDES
|
set(DOCKS_INSTALLABLE_PRIVATE_WIDGET_INCLUDES
|
||||||
@@ -218,6 +222,7 @@ else()
|
|||||||
${DOCKS_INSTALLABLE_INCLUDES}
|
${DOCKS_INSTALLABLE_INCLUDES}
|
||||||
MainWindow.h
|
MainWindow.h
|
||||||
DockWidget.h
|
DockWidget.h
|
||||||
|
MDIArea.h
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -294,7 +299,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR IS_CLANG_BUILD)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${PROJECT_NAME}_QTQUICK)
|
if(${PROJECT_NAME}_QTQUICK)
|
||||||
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::Widgets Qt${Qt_VERSION_MAJOR}::Quick Qt${Qt_VERSION_MAJOR}::QuickControls2)
|
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::Widgets Qt${Qt_VERSION_MAJOR}::Quick Qt${Qt_VERSION_MAJOR}::QuickControls2 PRIVATE Qt${Qt_VERSION_MAJOR}::GuiPrivate)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::Widgets PRIVATE Qt${Qt_VERSION_MAJOR}::WidgetsPrivate)
|
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::Widgets PRIVATE Qt${Qt_VERSION_MAJOR}::WidgetsPrivate)
|
||||||
endif()
|
endif()
|
||||||
@@ -306,6 +311,10 @@ elseif(NOT APPLE AND NOT EMSCRIPTEN AND NOT ${PROJECT_NAME}_QT6 AND ${PROJECT_NA
|
|||||||
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::X11Extras)
|
target_link_libraries(kddockwidgets PUBLIC Qt${Qt_VERSION_MAJOR}::X11Extras)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${PROJECT_NAME}_XLib)
|
||||||
|
target_link_libraries(kddockwidgets PRIVATE X11)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(kddockwidgets PROPERTIES
|
set_target_properties(kddockwidgets PROPERTIES
|
||||||
SOVERSION ${${PROJECT_NAME}_SOVERSION}
|
SOVERSION ${${PROJECT_NAME}_SOVERSION}
|
||||||
VERSION ${${PROJECT_NAME}_VERSION}
|
VERSION ${${PROJECT_NAME}_VERSION}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "private/multisplitter/MultiSplitterConfig.h"
|
#include "private/multisplitter/MultiSplitterConfig.h"
|
||||||
#include "private/multisplitter/Widget.h"
|
#include "private/multisplitter/Widget.h"
|
||||||
|
#include "private/multisplitter/Item_p.h"
|
||||||
#include "private/DockRegistry_p.h"
|
#include "private/DockRegistry_p.h"
|
||||||
#include "private/Utils_p.h"
|
#include "private/Utils_p.h"
|
||||||
#include "private/DragController_p.h"
|
#include "private/DragController_p.h"
|
||||||
@@ -54,6 +55,7 @@ public:
|
|||||||
DockWidgetFactoryFunc m_dockWidgetFactoryFunc = nullptr;
|
DockWidgetFactoryFunc m_dockWidgetFactoryFunc = nullptr;
|
||||||
MainWindowFactoryFunc m_mainWindowFactoryFunc = nullptr;
|
MainWindowFactoryFunc m_mainWindowFactoryFunc = nullptr;
|
||||||
TabbingAllowedFunc m_tabbingAllowedFunc = nullptr;
|
TabbingAllowedFunc m_tabbingAllowedFunc = nullptr;
|
||||||
|
DropIndicatorAllowedFunc m_dropIndicatorAllowedFunc = nullptr;
|
||||||
FrameworkWidgetFactory *m_frameworkWidgetFactory = nullptr;
|
FrameworkWidgetFactory *m_frameworkWidgetFactory = nullptr;
|
||||||
Flags m_flags = Flag_Default;
|
Flags m_flags = Flag_Default;
|
||||||
InternalFlags m_internalFlags = InternalFlag_None;
|
InternalFlags m_internalFlags = InternalFlag_None;
|
||||||
@@ -180,6 +182,16 @@ TabbingAllowedFunc Config::tabbingAllowedFunc() const
|
|||||||
return d->m_tabbingAllowedFunc;
|
return d->m_tabbingAllowedFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Config::setDropIndicatorAllowedFunc(DropIndicatorAllowedFunc func)
|
||||||
|
{
|
||||||
|
d->m_dropIndicatorAllowedFunc = func;
|
||||||
|
}
|
||||||
|
|
||||||
|
DropIndicatorAllowedFunc Config::dropIndicatorAllowedFunc() const
|
||||||
|
{
|
||||||
|
return d->m_dropIndicatorAllowedFunc;
|
||||||
|
}
|
||||||
|
|
||||||
void Config::setAbsoluteWidgetMinSize(QSize size)
|
void Config::setAbsoluteWidgetMinSize(QSize size)
|
||||||
{
|
{
|
||||||
if (!DockRegistry::self()->isEmpty(/*excludeBeingDeleted=*/false)) {
|
if (!DockRegistry::self()->isEmpty(/*excludeBeingDeleted=*/false)) {
|
||||||
|
|||||||
64
src/Config.h
64
src/Config.h
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
#define KD_DOCKWIDGETS_CONFIG_H
|
#define KD_DOCKWIDGETS_CONFIG_H
|
||||||
|
|
||||||
#include "docks_export.h"
|
#include "docks_export.h"
|
||||||
|
#include "KDDockWidgets.h"
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
@@ -37,6 +38,22 @@ class FrameworkWidgetFactory;
|
|||||||
typedef KDDockWidgets::DockWidgetBase *(*DockWidgetFactoryFunc)(const QString &name);
|
typedef KDDockWidgets::DockWidgetBase *(*DockWidgetFactoryFunc)(const QString &name);
|
||||||
typedef KDDockWidgets::MainWindowBase *(*MainWindowFactoryFunc)(const QString &name);
|
typedef KDDockWidgets::MainWindowBase *(*MainWindowFactoryFunc)(const QString &name);
|
||||||
|
|
||||||
|
/// @brief Function to allow more granularity to disallow where widgets are dropped
|
||||||
|
///
|
||||||
|
/// By default, widgets can be dropped to the outter and inner left/right/top/bottom
|
||||||
|
/// and center. The client app can however provide a lambda via setDropIndicatorAllowedFunc
|
||||||
|
/// to block (by returning false) any specific locations they desire.
|
||||||
|
///
|
||||||
|
/// @param location The drop indicator location to allow or disallow
|
||||||
|
/// @param source The dock widgets being dragged
|
||||||
|
/// @param target The dock widgets within an existing docked tab group
|
||||||
|
/// @return true if the docking is allowed.
|
||||||
|
/// @sa setDropIndicatorAllowedFunc
|
||||||
|
typedef bool (*DropIndicatorAllowedFunc)(DropLocation location,
|
||||||
|
const QVector<DockWidgetBase *> &source,
|
||||||
|
const QVector<DockWidgetBase *> &target);
|
||||||
|
|
||||||
|
/// @deprecated Use DropIndicatorAllowedFunc instead.
|
||||||
/// @brief Function to allow the user more granularity to disallow dock widgets to tab together
|
/// @brief Function to allow the user more granularity to disallow dock widgets to tab together
|
||||||
/// @param source The dock widgets being dragged
|
/// @param source The dock widgets being dragged
|
||||||
/// @param target The dock widgets within an existing docked tab group
|
/// @param target The dock widgets within an existing docked tab group
|
||||||
@@ -61,6 +78,9 @@ public:
|
|||||||
~Config();
|
~Config();
|
||||||
|
|
||||||
///@brief Flag enum to tune certain behaviours, the defaults are Flag_Default
|
///@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
|
enum Flag
|
||||||
{
|
{
|
||||||
Flag_None = 0, ///< No option set
|
Flag_None = 0, ///< No option set
|
||||||
@@ -113,8 +133,9 @@ public:
|
|||||||
InternalFlag_DontUseQtToolWindowsForFloatingWindows = 4, ///< FloatingWindows will use Qt::Window instead of Qt::Tool.
|
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_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_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
|
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.
|
/// 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)
|
Q_DECLARE_FLAGS(InternalFlags, InternalFlag)
|
||||||
|
|
||||||
@@ -199,6 +220,8 @@ public:
|
|||||||
bool dropIndicatorsInhibited() const;
|
bool dropIndicatorsInhibited() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated Use setDropIndicatorAllowedFunc() instead, and catch the DropLocation_Center case.
|
||||||
|
*
|
||||||
* @brief Allows the user to intercept a docking attempt to center (tabbed) and disallow it.
|
* @brief Allows the user to intercept a docking attempt to center (tabbed) and disallow it.
|
||||||
*
|
*
|
||||||
* Whenever the user tries to tab two widgets together, the framework will call @p func. If
|
* Whenever the user tries to tab two widgets together, the framework will call @p func. If
|
||||||
@@ -215,8 +238,10 @@ public:
|
|||||||
* // disallows dockFoo to be tabbed with dockBar.
|
* // disallows dockFoo to be tabbed with dockBar.
|
||||||
* return !(source.contains(dockFoo) && target.contains(dockBar));
|
* return !(source.contains(dockFoo) && target.contains(dockBar));
|
||||||
* }
|
* }
|
||||||
* @endcode
|
*
|
||||||
* KDDockWidgets::Config::self()->setTabbingAllowedFunc(func);
|
* KDDockWidgets::Config::self()->setTabbingAllowedFunc(func);
|
||||||
|
*
|
||||||
|
* @endcode
|
||||||
*/
|
*/
|
||||||
void setTabbingAllowedFunc(TabbingAllowedFunc func);
|
void setTabbingAllowedFunc(TabbingAllowedFunc func);
|
||||||
|
|
||||||
@@ -225,6 +250,37 @@ public:
|
|||||||
///@sa setTabbingAllowedFunc().
|
///@sa setTabbingAllowedFunc().
|
||||||
TabbingAllowedFunc tabbingAllowedFunc() const;
|
TabbingAllowedFunc tabbingAllowedFunc() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Allows the client app to disallow certain docking indicators.
|
||||||
|
*
|
||||||
|
* For example, let's assume the app doesn't want to show outter indicators for a certain
|
||||||
|
* dock widget.
|
||||||
|
*
|
||||||
|
* @code
|
||||||
|
* #include <kddockwidgets/Config.h>
|
||||||
|
* (...)
|
||||||
|
*
|
||||||
|
* auto func = [] (KDDockWidgets::DropLocation loc,
|
||||||
|
* const KDDockWidgets::DockWidgetBase::List &source,
|
||||||
|
* const KDDockWidgets::DockWidgetBase::List &target)
|
||||||
|
* {
|
||||||
|
* // disallows dockFoo to be docked to outter areas
|
||||||
|
* return !((loc & KDDockWidgets::DropLocation_Outter) && source.contains(dockFoo));
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* KDDockWidgets::Config::self()->setDropIndicatorAllowedFunc(func);
|
||||||
|
*
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Run "kddockwidgets_example --hide-certain-docking-indicators" to see this in action.
|
||||||
|
*/
|
||||||
|
void setDropIndicatorAllowedFunc(DropIndicatorAllowedFunc func);
|
||||||
|
|
||||||
|
///@brief Used internally by the framework. Returns the function which was passed to setDropIndicatorAllowedFunc()
|
||||||
|
///By default it's nullptr.
|
||||||
|
///@sa setDropIndicatorAllowedFunc().
|
||||||
|
DropIndicatorAllowedFunc dropIndicatorAllowedFunc() const;
|
||||||
|
|
||||||
///@brief Sets the minimum size a dock widget can have.
|
///@brief Sets the minimum size a dock widget can have.
|
||||||
/// Widgets can still provide their own min-size and it will be respected, however it can never be
|
/// Widgets can still provide their own min-size and it will be respected, however it can never be
|
||||||
/// smaller than this one.
|
/// smaller than this one.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of KDDockWidgets.
|
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>
|
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||||
@@ -180,7 +180,7 @@ bool DockWidgetBase::setFloating(bool floats)
|
|||||||
{
|
{
|
||||||
const bool alreadyFloating = isFloating();
|
const bool alreadyFloating = isFloating();
|
||||||
|
|
||||||
if ((floats && alreadyFloating) || (!floats && !alreadyFloating))
|
if (floats == alreadyFloating)
|
||||||
return true; // Nothing to do
|
return true; // Nothing to do
|
||||||
|
|
||||||
if (!floats && (Config::self().internalFlags() & Config::InternalFlag_DontShowWhenUnfloatingHiddenWindow) && !isVisible()) {
|
if (!floats && (Config::self().internalFlags() & Config::InternalFlag_DontShowWhenUnfloatingHiddenWindow) && !isVisible()) {
|
||||||
@@ -205,10 +205,10 @@ bool DockWidgetBase::setFloating(bool floats)
|
|||||||
|
|
||||||
frame->detachTab(this);
|
frame->detachTab(this);
|
||||||
} else {
|
} else {
|
||||||
d->frame()->titleBar()->makeWindow();
|
titleBar()->makeWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lastGeo = d->lastPositions().lastFloatingGeometry();
|
auto lastGeo = d->lastPosition()->lastFloatingGeometry();
|
||||||
if (lastGeo.isValid()) {
|
if (lastGeo.isValid()) {
|
||||||
if (auto fw = floatingWindow())
|
if (auto fw = floatingWindow())
|
||||||
fw->setSuggestedGeometry(lastGeo, SuggestedGeometryHint_PreserveCenter);
|
fw->setSuggestedGeometry(lastGeo, SuggestedGeometryHint_PreserveCenter);
|
||||||
@@ -237,6 +237,17 @@ QString DockWidgetBase::uniqueName() const
|
|||||||
|
|
||||||
QString DockWidgetBase::title() const
|
QString DockWidgetBase::title() const
|
||||||
{
|
{
|
||||||
|
if (d->isMDIWrapper()) {
|
||||||
|
// It's just a wrapper to help implementing Option_MDINestable. Return the title of the real dock widget we're hosting.
|
||||||
|
auto dropAreaGuest = qobject_cast<DropArea*>(widget());
|
||||||
|
Q_ASSERT(dropAreaGuest);
|
||||||
|
if (dropAreaGuest->hasSingleFrame()) {
|
||||||
|
return dropAreaGuest->frames().constFirst()->title();
|
||||||
|
} else {
|
||||||
|
return qApp->applicationName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return d->title;
|
return d->title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,7 +381,7 @@ QStringList DockWidgetBase::affinities() const
|
|||||||
|
|
||||||
void DockWidgetBase::show()
|
void DockWidgetBase::show()
|
||||||
{
|
{
|
||||||
if (isWindow() && (d->m_lastPositions.wasFloating() || !d->m_lastPositions.isValid())) {
|
if (isWindow() && (d->m_lastPosition->wasFloating() || !d->m_lastPosition->isValid())) {
|
||||||
// Create the FloatingWindow already, instead of waiting for the show event.
|
// Create the FloatingWindow already, instead of waiting for the show event.
|
||||||
// This reduces flickering on some platforms
|
// This reduces flickering on some platforms
|
||||||
d->morphIntoFloatingWindow();
|
d->morphIntoFloatingWindow();
|
||||||
@@ -465,7 +476,7 @@ bool DockWidgetBase::isInSideBar() const
|
|||||||
|
|
||||||
bool DockWidgetBase::hasPreviousDockedLocation() const
|
bool DockWidgetBase::hasPreviousDockedLocation() const
|
||||||
{
|
{
|
||||||
return d->m_lastPositions.isValid();
|
return d->m_lastPosition->isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize DockWidgetBase::lastOverlayedSize() const
|
QSize DockWidgetBase::lastOverlayedSize() const
|
||||||
@@ -488,7 +499,7 @@ void DockWidgetBase::setFloatingGeometry(QRect geometry)
|
|||||||
if (isOpen() && isFloating()) {
|
if (isOpen() && isFloating()) {
|
||||||
window()->setGeometry(geometry);
|
window()->setGeometry(geometry);
|
||||||
} else {
|
} else {
|
||||||
d->m_lastPositions.setLastFloatingGeometry(geometry);
|
d->m_lastPosition->setLastFloatingGeometry(geometry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,7 +509,7 @@ FloatingWindow *DockWidgetBase::Private::morphIntoFloatingWindow()
|
|||||||
return fw; // Nothing to do
|
return fw; // Nothing to do
|
||||||
|
|
||||||
if (q->isWindow()) {
|
if (q->isWindow()) {
|
||||||
QRect geo = m_lastPositions.lastFloatingGeometry();
|
QRect geo = m_lastPosition->lastFloatingGeometry();
|
||||||
if (geo.isNull()) {
|
if (geo.isNull()) {
|
||||||
geo = q->geometry();
|
geo = q->geometry();
|
||||||
|
|
||||||
@@ -513,6 +524,7 @@ FloatingWindow *DockWidgetBase::Private::morphIntoFloatingWindow()
|
|||||||
auto frame = Config::self().frameworkWidgetFactory()->createFrame();
|
auto frame = Config::self().frameworkWidgetFactory()->createFrame();
|
||||||
frame->addWidget(q);
|
frame->addWidget(q);
|
||||||
geo.setSize(geo.size().boundedTo(frame->maxSizeHint()));
|
geo.setSize(geo.size().boundedTo(frame->maxSizeHint()));
|
||||||
|
FloatingWindow::ensureRectIsOnScreen(geo);
|
||||||
auto floatingWindow =
|
auto floatingWindow =
|
||||||
Config::self().frameworkWidgetFactory()->createFloatingWindow(frame, nullptr, geo);
|
Config::self().frameworkWidgetFactory()->createFloatingWindow(frame, nullptr, geo);
|
||||||
floatingWindow->show();
|
floatingWindow->show();
|
||||||
@@ -531,8 +543,75 @@ void DockWidgetBase::Private::maybeMorphIntoFloatingWindow()
|
|||||||
|
|
||||||
MDILayoutWidget *DockWidgetBase::Private::mdiLayout() const
|
MDILayoutWidget *DockWidgetBase::Private::mdiLayout() const
|
||||||
{
|
{
|
||||||
if (auto mw = mainWindow())
|
auto p = const_cast<QObject *>(q->parent());
|
||||||
return mw->mdiLayoutWidget();
|
while (p) {
|
||||||
|
if (qobject_cast<const QWindow*>(p)) {
|
||||||
|
// Ignore QObject hierarchies spanning though multiple windows
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qobject_cast<LayoutWidget*>(p)) {
|
||||||
|
// We found a layout
|
||||||
|
if (auto mdiLayout = qobject_cast<MDILayoutWidget*>(p)) {
|
||||||
|
// And it's MDI
|
||||||
|
return mdiLayout;
|
||||||
|
} else if (auto dropArea = qobject_cast<DropArea*>(p)) {
|
||||||
|
// It's a DropArea. But maybe it's a drop area that's just helping
|
||||||
|
// making the MDI windows accept drops (Option_MDINestable)
|
||||||
|
if (!dropArea->isMDIWrapper())
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
// It's a MDI wrapper, keep looking up.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p = p->parent();
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DockWidgetBase::Private::isMDIWrapper() const
|
||||||
|
{
|
||||||
|
return mdiDropAreaWrapper() != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
DropArea *DockWidgetBase::Private::mdiDropAreaWrapper() const
|
||||||
|
{
|
||||||
|
if (auto dropAreaGuest = qobject_cast<DropArea *>(q->widget())) {
|
||||||
|
if (dropAreaGuest->isMDIWrapper())
|
||||||
|
return dropAreaGuest;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
DockWidgetBase *DockWidgetBase::Private::mdiDockWidgetWrapper() const
|
||||||
|
{
|
||||||
|
if (isMDIWrapper()) {
|
||||||
|
// We are the wrapper
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto p = const_cast<QObject *>(q->parent());
|
||||||
|
while (p) {
|
||||||
|
if (qobject_cast<const QWindow*>(p)) {
|
||||||
|
// Ignore QObject hierarchies spanning though multiple windows
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qobject_cast<LayoutWidget*>(p)) {
|
||||||
|
if (auto dropArea = qobject_cast<DropArea*>(p)) {
|
||||||
|
if (dropArea->isMDIWrapper())
|
||||||
|
return dropArea->mdiDockWidgetWrapper();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
p = p->parent();
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -602,7 +681,7 @@ void DockWidgetBase::Private::updateFloatAction()
|
|||||||
QScopedValueRollback<bool> recursionGuard(m_updatingFloatAction, true); // Guard against recursiveness
|
QScopedValueRollback<bool> recursionGuard(m_updatingFloatAction, true); // Guard against recursiveness
|
||||||
|
|
||||||
if (q->isFloating()) {
|
if (q->isFloating()) {
|
||||||
floatAction->setEnabled(m_lastPositions.isValid());
|
floatAction->setEnabled(m_lastPosition->isValid());
|
||||||
floatAction->setChecked(true);
|
floatAction->setChecked(true);
|
||||||
floatAction->setToolTip(tr("Dock"));
|
floatAction->setToolTip(tr("Dock"));
|
||||||
} else {
|
} else {
|
||||||
@@ -645,7 +724,7 @@ void DockWidgetBase::Private::close()
|
|||||||
&& q->isVisible()) { // only user-closing is interesting to save the geometry
|
&& q->isVisible()) { // only user-closing is interesting to save the geometry
|
||||||
// We check for isVisible so we don't save geometry if you call close() on an already closed
|
// We check for isVisible so we don't save geometry if you call close() on an already closed
|
||||||
// dock widget
|
// dock widget
|
||||||
m_lastPositions.setLastFloatingGeometry(q->window()->geometry());
|
m_lastPosition->setLastFloatingGeometry(q->window()->geometry());
|
||||||
}
|
}
|
||||||
|
|
||||||
saveTabIndex();
|
saveTabIndex();
|
||||||
@@ -668,14 +747,14 @@ void DockWidgetBase::Private::close()
|
|||||||
|
|
||||||
bool DockWidgetBase::Private::restoreToPreviousPosition()
|
bool DockWidgetBase::Private::restoreToPreviousPosition()
|
||||||
{
|
{
|
||||||
if (!m_lastPositions.isValid())
|
if (!m_lastPosition->isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Layouting::Item *item = m_lastPositions.lastItem();
|
Layouting::Item *item = m_lastPosition->lastItem();
|
||||||
|
|
||||||
LayoutWidget *layout = DockRegistry::self()->layoutForItem(item);
|
LayoutWidget *layout = DockRegistry::self()->layoutForItem(item);
|
||||||
Q_ASSERT(layout);
|
Q_ASSERT(layout);
|
||||||
layout->restorePlaceholder(q, item, m_lastPositions.lastTabIndex());
|
layout->restorePlaceholder(q, item, m_lastPosition->lastTabIndex());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -683,14 +762,14 @@ void DockWidgetBase::Private::maybeRestoreToPreviousPosition()
|
|||||||
{
|
{
|
||||||
// This is called when we get a QEvent::Show. Let's see if we have to restore it to a previous position.
|
// This is called when we get a QEvent::Show. Let's see if we have to restore it to a previous position.
|
||||||
|
|
||||||
if (!m_lastPositions.isValid())
|
if (!m_lastPosition->isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Layouting::Item *layoutItem = m_lastPositions.lastItem();
|
Layouting::Item *layoutItem = m_lastPosition->lastItem();
|
||||||
if (!layoutItem)
|
if (!layoutItem)
|
||||||
return; // nothing to do, no last position
|
return; // nothing to do, no last position
|
||||||
|
|
||||||
if (m_lastPositions.wasFloating())
|
if (m_lastPosition->wasFloating())
|
||||||
return; // Nothing to do, it was floating before, now it'll just get visible
|
return; // Nothing to do, it was floating before, now it'll just get visible
|
||||||
|
|
||||||
Frame *frame = this->frame();
|
Frame *frame = this->frame();
|
||||||
@@ -720,7 +799,7 @@ int DockWidgetBase::Private::currentTabIndex() const
|
|||||||
|
|
||||||
void DockWidgetBase::Private::saveTabIndex()
|
void DockWidgetBase::Private::saveTabIndex()
|
||||||
{
|
{
|
||||||
m_lastPositions.saveTabIndex(currentTabIndex(), q->isFloating());
|
m_lastPosition->saveTabIndex(currentTabIndex(), q->isFloating());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockWidgetBase::Private::show()
|
void DockWidgetBase::Private::show()
|
||||||
@@ -732,10 +811,9 @@ void DockWidgetBase::Private::show()
|
|||||||
void DockWidgetBase::onParentChanged()
|
void DockWidgetBase::onParentChanged()
|
||||||
{
|
{
|
||||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||||
// TODO: In v1.4, remove this part and use the signal emitting the arg
|
|
||||||
Q_EMIT parentChanged();
|
Q_EMIT parentChanged();
|
||||||
#else
|
#else
|
||||||
Q_EMIT parentChanged(this);
|
Q_EMIT QQuickItem::parentChanged(parentItem());
|
||||||
#endif
|
#endif
|
||||||
d->updateToggleAction();
|
d->updateToggleAction();
|
||||||
d->updateFloatAction();
|
d->updateFloatAction();
|
||||||
@@ -826,14 +904,26 @@ int DockWidgetBase::userType() const
|
|||||||
|
|
||||||
void DockWidgetBase::setMDIPosition(QPoint pos)
|
void DockWidgetBase::setMDIPosition(QPoint pos)
|
||||||
{
|
{
|
||||||
if (MDILayoutWidget *layout = d->mdiLayout())
|
if (MDILayoutWidget *layout = d->mdiLayout()) {
|
||||||
layout->moveDockWidget(this, pos);
|
if (auto wrapperDW = d->mdiDockWidgetWrapper()) {
|
||||||
|
// Case of using Option_MDINestable. We need to layout the actual top level DW
|
||||||
|
layout->moveDockWidget(wrapperDW, pos);
|
||||||
|
} else {
|
||||||
|
layout->moveDockWidget(this, pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockWidgetBase::setMDISize(QSize size)
|
void DockWidgetBase::setMDISize(QSize size)
|
||||||
{
|
{
|
||||||
if (MDILayoutWidget *layout = d->mdiLayout())
|
if (MDILayoutWidget *layout = d->mdiLayout()) {
|
||||||
layout->resizeDockWidget(this, size);
|
if (auto wrapperDW = d->mdiDockWidgetWrapper()) {
|
||||||
|
// Case of using Option_MDINestable. We need to layout the actual top level DW
|
||||||
|
layout->resizeDockWidget(wrapperDW, size);
|
||||||
|
} else {
|
||||||
|
layout->resizeDockWidget(this, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockWidgetBase::setMDIZ(int z)
|
void DockWidgetBase::setMDIZ(int z)
|
||||||
@@ -917,12 +1007,12 @@ DockWidgetBase::Private::Private(const QString &dockName, DockWidgetBase::Option
|
|||||||
void DockWidgetBase::Private::addPlaceholderItem(Layouting::Item *item)
|
void DockWidgetBase::Private::addPlaceholderItem(Layouting::Item *item)
|
||||||
{
|
{
|
||||||
Q_ASSERT(item);
|
Q_ASSERT(item);
|
||||||
m_lastPositions.addPosition(item);
|
m_lastPosition->addPlaceholderItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
LastPositions &DockWidgetBase::Private::lastPositions()
|
Position::Ptr &DockWidgetBase::Private::lastPosition()
|
||||||
{
|
{
|
||||||
return m_lastPositions;
|
return m_lastPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
Frame *DockWidgetBase::Private::frame() const
|
Frame *DockWidgetBase::Private::frame() const
|
||||||
@@ -940,6 +1030,6 @@ void DockWidgetBase::Private::saveLastFloatingGeometry()
|
|||||||
{
|
{
|
||||||
if (q->isFloating() && q->isVisible()) {
|
if (q->isFloating() && q->isVisible()) {
|
||||||
// It's getting docked, save last floating position
|
// It's getting docked, save last floating position
|
||||||
lastPositions().setLastFloatingGeometry(q->window()->geometry());
|
lastPosition()->setLastFloatingGeometry(q->window()->geometry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user