Compare commits
162 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e79c68a7d | ||
|
|
d80325ec8f | ||
|
|
e9925785ab | ||
|
|
81efda2d11 | ||
|
|
36eef80192 | ||
|
|
306bf26f66 | ||
|
|
e07fb7f121 | ||
|
|
bc86cfcb1f | ||
|
|
63bb7e31cd | ||
|
|
1840d50fc0 | ||
|
|
c6fd4e4bc4 | ||
|
|
46210203f7 | ||
|
|
5a2d000ddd | ||
|
|
c73c26e5cb | ||
|
|
39c3e4fd13 | ||
|
|
011d83b7d9 | ||
|
|
26f1b75976 | ||
|
|
309a90d3a6 | ||
|
|
946e1e977e | ||
|
|
7f1347f15d | ||
|
|
2e498f644b | ||
|
|
ee0272e036 | ||
|
|
4aa87c1758 | ||
|
|
3b1158b82f | ||
|
|
1aee98bebd | ||
|
|
b5a6433950 | ||
|
|
077264fd54 | ||
|
|
bee653cf80 | ||
|
|
e1363aadaa | ||
|
|
43877ca712 | ||
|
|
f7cc54ad38 | ||
|
|
538f318fac | ||
|
|
f0376fa7a2 | ||
|
|
0d2bccc15e | ||
|
|
842b89c36d | ||
|
|
1d74c67bd4 | ||
|
|
ea0dd04bd9 | ||
|
|
a5dbab096b | ||
|
|
f1f555d5ab | ||
|
|
5b60a929ab | ||
|
|
f4404dcbe0 | ||
|
|
dd81e02d94 | ||
|
|
f4643aeefd | ||
|
|
e563ffb673 | ||
|
|
4cceec82ac | ||
|
|
4b868e2078 | ||
|
|
875544a449 | ||
|
|
a2f4c972a6 | ||
|
|
2b0a6e5d06 | ||
|
|
5f7e645ed6 | ||
|
|
59c90c01f9 | ||
|
|
92063ab61b | ||
|
|
003ec5aa5b | ||
|
|
02bf43b468 | ||
|
|
50e1285839 | ||
|
|
3fb6574322 | ||
|
|
fa2501d5e4 | ||
|
|
0fe58fd160 | ||
|
|
01f3042f48 | ||
|
|
6719dd2b9e | ||
|
|
08c058b214 | ||
|
|
e4502d4f64 | ||
|
|
db928a0fca | ||
|
|
5582f37a18 | ||
|
|
a28e152a37 | ||
|
|
d6dea6f426 | ||
|
|
d29f9fdd0d | ||
|
|
a2a80df5df | ||
|
|
48ce3a972f | ||
|
|
9fae250897 | ||
|
|
4dd703dcb2 | ||
|
|
e46b5b2edf | ||
|
|
7febcf2170 | ||
|
|
012ed4cf1d | ||
|
|
18283c4d1a | ||
|
|
2bb46b1cdf | ||
|
|
113263a4a1 | ||
|
|
a6ca44cde6 | ||
|
|
894be60a75 | ||
|
|
244a1bec24 | ||
|
|
51d78ba20b | ||
|
|
8291025dfa | ||
|
|
6ea1d4ca58 | ||
|
|
771bf10951 | ||
|
|
67a3270324 | ||
|
|
cd859d6725 | ||
|
|
092b4afe4a | ||
|
|
f8d0ffe7ba | ||
|
|
10f47a701f | ||
|
|
d3224ed266 | ||
|
|
2ccb5391bb | ||
|
|
5c0c9799a4 | ||
|
|
5ccbb5b056 | ||
|
|
fc04455e93 | ||
|
|
4ae8f461cb | ||
|
|
17539e5b88 | ||
|
|
e53b9c71da | ||
|
|
9275f852d6 | ||
|
|
dd8f46880f | ||
|
|
e9159a08bd | ||
|
|
cf89891e4f | ||
|
|
1cc8824f84 | ||
|
|
b73c526c57 | ||
|
|
add577c46f | ||
|
|
9ddd65ea71 | ||
|
|
b15afa9231 | ||
|
|
f8dfde2784 | ||
|
|
6e0898a31e | ||
|
|
8b98dafba2 | ||
|
|
a123437d03 | ||
|
|
616c871da7 | ||
|
|
925c9725b3 | ||
|
|
1a173a7c72 | ||
|
|
a959da46db | ||
|
|
a9c70d086c | ||
|
|
48bacb2811 | ||
|
|
6b846fcdff | ||
|
|
fdc97fecaf | ||
|
|
86983d58f5 | ||
|
|
58f7edb0bc | ||
|
|
302bbeceb0 | ||
|
|
cd9e16398c | ||
|
|
1e1ea8db34 | ||
|
|
7ac3ea1fcf | ||
|
|
3f661d0322 | ||
|
|
8dad079df5 | ||
|
|
1727e50489 | ||
|
|
1ab9688f58 | ||
|
|
613b1b8524 | ||
|
|
ae5edc9ebf | ||
|
|
d0c15b5da2 | ||
|
|
ccbd15c922 | ||
|
|
7b9673e4e2 | ||
|
|
7fbcbbacdf | ||
|
|
d1f48b0685 | ||
|
|
9ee6b91f61 | ||
|
|
e6c89c0564 | ||
|
|
8b97088c70 | ||
|
|
e5809c06c7 | ||
|
|
23b69d4e9e | ||
|
|
0f468033fb | ||
|
|
468074cda8 | ||
|
|
7acbe0c62e | ||
|
|
2c1a70280a | ||
|
|
d2fa5efafe | ||
|
|
a437bc5d07 | ||
|
|
2447bb12c8 | ||
|
|
1082d5e8e1 | ||
|
|
3b1ac9a2d0 | ||
|
|
4635405fb5 | ||
|
|
c481875e55 | ||
|
|
62f50f9458 | ||
|
|
c86252665c | ||
|
|
d141863ffb | ||
|
|
e99b9678e4 | ||
|
|
e0a034748d | ||
|
|
c3377431cc | ||
|
|
be0f72ca25 | ||
|
|
31598d8334 | ||
|
|
5e64463a8c | ||
|
|
27ffb64eb4 | ||
|
|
c7dc7bdb3d |
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -82,9 +82,9 @@ endif()
|
||||
|
||||
set(${PROJECT_NAME}_VERSION_MAJOR 1)
|
||||
set(${PROJECT_NAME}_VERSION_MINOR 2)
|
||||
set(${PROJECT_NAME}_VERSION_PATCH 0)
|
||||
set(${PROJECT_NAME}_VERSION_PATCH 1)
|
||||
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
|
||||
set(${PROJECT_NAME}_SOVERSION "1.2")
|
||||
set(${PROJECT_NAME}_SOVERSION "1.3")
|
||||
|
||||
include(FeatureSummary)
|
||||
|
||||
@@ -104,10 +104,12 @@ endif()
|
||||
option(${PROJECT_NAME}_TESTS "Build the tests" OFF)
|
||||
option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON)
|
||||
option(${PROJECT_NAME}_DOCS "Build the API documentation" OFF)
|
||||
option(${PROJECT_NAME}_WERROR "Use -Werror (will be true for developer-mode unconditionally)" OFF)
|
||||
|
||||
#Always build the test harness in developer-mode
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
set(${PROJECT_NAME}_TESTS ON)
|
||||
set(${PROJECT_NAME}_WERROR ON)
|
||||
endif()
|
||||
|
||||
#option(${PROJECT_NAME}_QTQUICK "Build for QtQuick instead of QtWidgets" OFF)
|
||||
@@ -137,18 +139,26 @@ include(QtInstallPaths) #to set QT_INSTALL_FOO variables
|
||||
macro(set_compiler_flags targetName)
|
||||
if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
target_compile_definitions(${targetName} PUBLIC DOCKS_DEVELOPER_MODE PRIVATE QT_FORCE_ASSERTS)
|
||||
if(NOT MSVC AND NOT ${PROJECT_NAME}_QT6) # We're not warnings clean with Qt6 yet
|
||||
target_compile_options(${targetName} PRIVATE -Wall -Wextra -Werror -Wno-error=deprecated-declarations)
|
||||
if (APPLE)
|
||||
target_compile_options(${targetName} PRIVATE -Wweak-vtables)
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
target_compile_options(${targetName} PRIVATE -Wall -Wextra)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
target_compile_options(${targetName} PRIVATE -Wweak-vtables)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Enable -Werror
|
||||
if(NOT MSVC AND ${PROJECT_NAME}_WERROR)
|
||||
target_compile_options(${targetName} PRIVATE -Werror -Wno-error=deprecated-declarations)
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
find_package(Qt5Quick)
|
||||
find_package(Qt5QuickControls2)
|
||||
find_package(Qt${QT_MAJOR_VERSION}Quick)
|
||||
find_package(Qt${QT_MAJOR_VERSION}QuickControls2)
|
||||
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
|
||||
else()
|
||||
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS)
|
||||
@@ -233,7 +243,6 @@ if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
add_test(NAME tst_multisplitter COMMAND tst_multisplitter)
|
||||
endif()
|
||||
|
||||
add_test(NAME tst_docks COMMAND tst_docks)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
133
CMakePresets.json
Normal file
133
CMakePresets.json
Normal file
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"version": 1,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "dev-qtwidgets",
|
||||
"displayName": "dev-qtwidgets",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-dev-qtwidgets",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||
"ECM_ENABLE_SANITIZERS" : "'address;undefined'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "clazy-qtwidgets",
|
||||
"displayName": "clazy-qtwidgets",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-clazy-qtwidgets",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"KDDockWidgets_WERROR": "ON"
|
||||
},
|
||||
"environment": {
|
||||
"CXX": "clazy"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "qtwidgets",
|
||||
"displayName": "qtwidgets",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-qtwidgets",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "qtquick",
|
||||
"displayName": "qtquick",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-qtquick",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"KDDockWidgets_QTQUICK": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dev-qtquick",
|
||||
"displayName": "dev-qtquick",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-dev-qtquick",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"KDDockWidgets_QTQUICK": "ON",
|
||||
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||
"ECM_ENABLE_SANITIZERS" : "'address;undefined'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "python",
|
||||
"displayName": "python",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-python",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"KDDockWidgets_PYTHON_BINDINGS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "static-qtwidgets",
|
||||
"displayName": "static-qtwidgets",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-static-qtwidgets",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"KDDockWidgets_STATIC": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "static-qtquick",
|
||||
"displayName": "static-qtquick",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-static-qtquick",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"KDDockWidgets_STATIC": "ON",
|
||||
"KDDockWidgets_QTQUICK": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "qtwidgets6",
|
||||
"displayName": "qtwidgets6",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-qtwidgets6",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"KDDockWidgets_QT6": "ON"
|
||||
},
|
||||
"environment": {
|
||||
"PATH": "$env{HOME}/Qt/6.0.0/gcc_64/bin:$penv{PATH}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dev-qtwidgets6",
|
||||
"displayName": "dev-qtwidgets6",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-dev-qtwidgets6",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"KDDockWidgets_QT6": "ON",
|
||||
"KDDockWidgets_DEVELOPER_MODE": "ON",
|
||||
"ECM_ENABLE_SANITIZERS" : "'address;undefined'"
|
||||
},
|
||||
"environment": {
|
||||
"PATH": "$env{HOME}/Qt/6.0.0/gcc_64/bin:$penv{PATH}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "qtquick6",
|
||||
"displayName": "qtquick6",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-qtquick6",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"KDDockWidgets_QTQUICK": "ON",
|
||||
"KDDockWidgets_QT6": "ON"
|
||||
},
|
||||
"environment": {
|
||||
"PATH": "$env{HOME}/Qt/6.0.0/gcc_64/bin:$penv{PATH}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
* v1.3.0 (unreleased)
|
||||
- [TODO] QtQuick support
|
||||
- Added static DockWidgetBase::byName() (#126)
|
||||
- The enum KDDockWidgets::AddingOption has been deprecated, use
|
||||
KDDockWidgets::InitialVisibilityOption instead
|
||||
- You can now pass a preferred initial size to MainWindow::addDockWidget() (#95)
|
||||
|
||||
* v1.2.1 (unreleased)
|
||||
- Support for resizing dock widgets when they are in overlay/popup mode (autohide/sidebar feature)
|
||||
|
||||
* v1.2.0 (17 December 2020)
|
||||
- Wayland support
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
The KDDockWidgets software is Copyright (C) 2018-2020 Klaralvdalens Datakonsult AB.
|
||||
The KDDockWidgets software is Copyright (C) 2018-2021 Klaralvdalens Datakonsult AB.
|
||||
|
||||
You may use, distribute and copy the KDDockWidgets software under the terms of
|
||||
the GNU General Public License version 2 or under the terms of GNU General
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
KDDockWidgets is (C) 2018-2020, Klarälvdalens Datakonsult AB, and is licensed
|
||||
KDDockWidgets is (C) 2018-2021, Klarälvdalens Datakonsult AB, and is licensed
|
||||
according to the terms of the:
|
||||
GNU General Public License version 2.0 (see LICENSES/GPL-2.0-only.txt)
|
||||
or the
|
||||
|
||||
@@ -6,9 +6,13 @@ KDDockWidgets works with WebAssembly with the following known limitations:
|
||||
- Classic drop indicators are not supported, only the segmented ones. This is because
|
||||
WASM doesn't support windows with translucency.
|
||||
|
||||
- It's slow while dragging Windows and resizing.
|
||||
- Might be slow on Linux, depending on your browser, while dragging or resizing windows.
|
||||
Please file a bug with Qt, as it's out of scope for KDDW to fix.
|
||||
|
||||
Demo:
|
||||
=====
|
||||
|
||||
A demo is available at https://demos.kdab.com/wasm/kddockwidgets/dockwidgets.html
|
||||
|
||||
Build tips for KDDW:
|
||||
====================
|
||||
@@ -20,7 +24,7 @@ Build tips for KDDW:
|
||||
|
||||
Builds tips for your own app:
|
||||
=============================
|
||||
- Link to KDDW (libkddockwidgets.so, or similar)
|
||||
- Link to KDDW (libkddockwidgets.a, or similar)
|
||||
- As the build is static, don't forget to initialize KDDW's resources:
|
||||
```
|
||||
#ifdef QT_STATIC
|
||||
|
||||
3
README-troubleshooting
Normal file
3
README-troubleshooting
Normal file
@@ -0,0 +1,3 @@
|
||||
# PySide: `ImportError: DLL load failed while importing KDDockWidgets`
|
||||
|
||||
If you're getting this error with Python see issue #114 and the proposed solution there.
|
||||
41
README.md
41
README.md
@@ -24,6 +24,9 @@ You will find more information in these places:
|
||||
* [online detailed browsable API reference](https://docs.kdab.com/kddockwidgets)
|
||||
* [our example programs](examples/)
|
||||
|
||||
We also have an [in browser demo](https://demos.kdab.com/wasm/kddockwidgets/dockwidgets.html). Note
|
||||
however that this demo isn't fully featured, as it's running on Qt for WebAssembly.
|
||||
|
||||
Features
|
||||
========
|
||||
- Provide advanced docking that QDockWidgets doesn't support
|
||||
@@ -61,6 +64,8 @@ Features
|
||||
- Optional minimize and maximize button on the title bar
|
||||
- FloatingWindows can be utility windows or full native
|
||||
|
||||
Screen capture
|
||||
==============
|
||||

|
||||
|
||||
|
||||
@@ -100,16 +105,31 @@ The installation directory defaults to `c:\KDAB\KDDockWidgets-<version>` on Wind
|
||||
and `/usr/local/KDAB/KDDockWidgets-<version>` on non-Windows. You can change this
|
||||
location by passing the option `-DCMAKE_INSTALL_PREFIX=/install/path` to cmake.
|
||||
|
||||
Using
|
||||
=====
|
||||
From your CMake project, add
|
||||
|
||||
find_package(KDDockWidgets CONFIG)
|
||||
|
||||
and link to the imported target `KDAB::kddockwidgets`.
|
||||
That's all you need to do (the imported target also brings in the include directories)
|
||||
|
||||
You may also need to modify the `CMAKE_MODULE_PATH` environment variable depending
|
||||
on where you installed KDDockWidgets.
|
||||
|
||||
|
||||
Python Bindings
|
||||
================
|
||||
Make sure you have pyside2, shiboken2 and shiboken2-generator installed.
|
||||
As this time, you cannot get shiboken2-generator because the wheels are not on PyPi.
|
||||
To use the wheels do this:
|
||||
% pip3 install \
|
||||
--index-url=http://download.qt.io/official_releases/QtForPython/ \
|
||||
--trusted-host download.qt.io \
|
||||
shiboken2 pyside2 shiboken2_generator
|
||||
|
||||
```
|
||||
% pip3 install \
|
||||
--index-url=http://download.qt.io/official_releases/QtForPython/ \
|
||||
--trusted-host download.qt.io \
|
||||
shiboken2 pyside2 shiboken2_generator
|
||||
```
|
||||
|
||||
For more info visit https://doc.qt.io/qtforpython/shiboken2/gettingstarted.html
|
||||
|
||||
@@ -134,15 +154,19 @@ $ python3 main.py
|
||||
```
|
||||
|
||||
|
||||
Supported Qt versions
|
||||
======================
|
||||
Supported Qt versions and toolchains
|
||||
=====================================
|
||||
KDDockWidgets requires Qt >= 5.9 (or >=5.12 if Python bindings are enabled).
|
||||
The QtQuick support will require Qt >= 5.15.
|
||||
Qt 6 will be support as long as QTBUG-88611 is finished, most likely for 6.1.
|
||||
Qt 6 is supported.
|
||||
|
||||
Regarding compilers, whatever toolchain is able to build Qt 5.9 should also be
|
||||
fine. Note however that MSVC 2013 isn't supported anymore due to compiler crashes.
|
||||
|
||||
|
||||
Licensing
|
||||
=========
|
||||
KDDockWidgets is (C) 2018-2020, Klarälvdalens Datakonsult AB, and is licensed according to
|
||||
KDDockWidgets is (C) 2018-2021, Klarälvdalens Datakonsult AB, and is licensed according to
|
||||
the terms of the [GPL 2.0](LICENSES/GPL-2.0-only.txt) or [GPL 3.0](LICENSES/GPL-3.0-only.txt).
|
||||
|
||||
Contact KDAB at <info@kdab.com> to inquire about commercial licensing.
|
||||
@@ -178,3 +202,4 @@ Stay up-to-date with KDAB product announcements:
|
||||
|
||||
* [KDAB Newsletter](https://news.kdab.com)
|
||||
* [KDAB Blogs](https://www.kdab.com/category/blogs)
|
||||
* [KDAB on Twitter](https://twitter.com/KDABQt)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
|
||||
134
cmake/Python/FindPySide6.cmake
Normal file
134
cmake/Python/FindPySide6.cmake
Normal file
@@ -0,0 +1,134 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# PYSIDE_BASEDIR - Top of the PySide6 installation
|
||||
# PYSIDE_INCLUDE_DIR - Directories to include to use PySide6
|
||||
# PYSIDE_LIBRARY - Files to link against to use PySide6
|
||||
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide6
|
||||
#
|
||||
# You can install PySide6 from Qt repository with
|
||||
# pip3 install --index-url=https://download.qt.io/official_releases/QtForPython --trusted-host download.qt.io pyside6
|
||||
|
||||
set(PYSIDE6_FOUND FALSE)
|
||||
|
||||
# extract python library basename
|
||||
list(GET Python3_LIBRARIES 0 PYTHON_LIBRARY_FILENAME)
|
||||
get_filename_component(PYTHON_LIBRARY_FILENAME ${PYTHON_LIBRARY_FILENAME} NAME)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "if True:
|
||||
import os, sys
|
||||
try:
|
||||
import PySide6.QtCore as QtCore
|
||||
print(os.path.dirname(QtCore.__file__))
|
||||
except Exception as error:
|
||||
print(error, file=sys.stderr)
|
||||
exit()
|
||||
"
|
||||
OUTPUT_VARIABLE PYSIDE6_BASEDIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if(PYSIDE6_BASEDIR)
|
||||
set(PYSIDE_BASEDIR ${PYSIDE6_BASEDIR} CACHE PATH "Top level install of PySide6" FORCE)
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "if True:
|
||||
import os
|
||||
import PySide6.QtCore as QtCore
|
||||
print(os.path.basename(QtCore.__file__).split('.', 1)[1])
|
||||
"
|
||||
OUTPUT_VARIABLE PYSIDE6_SUFFIX
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "if True:
|
||||
import os
|
||||
import PySide6.QtCore as QtCore
|
||||
print(';'.join(map(str, QtCore.__version_info__)))
|
||||
"
|
||||
OUTPUT_VARIABLE PYSIDE6_SO_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
list(GET PYSIDE6_SO_VERSION 0 PYSIDE6_SO_MACRO_VERSION)
|
||||
list(GET PYSIDE6_SO_VERSION 1 PYSIDE6_SO_MICRO_VERSION)
|
||||
list(GET PYSIDE6_SO_VERSION 2 PYSIDE6_SO_MINOR_VERSION)
|
||||
string(REPLACE ";" "." PYSIDE6_SO_VERSION "${PYSIDE6_SO_VERSION}")
|
||||
|
||||
if(NOT APPLE)
|
||||
set(PYSIDE6_SUFFIX "${PYSIDE6_SUFFIX}.${PYSIDE6_SO_MACRO_VERSION}.${PYSIDE6_SO_MICRO_VERSION}")
|
||||
else()
|
||||
string(REPLACE ".so" "" PYSIDE6_SUFFIX ${PYSIDE6_SUFFIX})
|
||||
set(PYSIDE6_SUFFIX "${PYSIDE6_SUFFIX}.${PYSIDE6_SO_MACRO_VERSION}.${PYSIDE6_SO_MICRO_VERSION}.dylib")
|
||||
endif()
|
||||
|
||||
set(PYSIDE6_FOUND TRUE)
|
||||
message(STATUS "PySide6 base dir: ${PYSIDE6_BASEDIR}" )
|
||||
message(STATUS "PySide6 suffix: ${PYSIDE6_SUFFIX}")
|
||||
endif()
|
||||
|
||||
if (PYSIDE6_FOUND)
|
||||
#PySide
|
||||
#===============================================================================
|
||||
find_path(PYSIDE_INCLUDE_DIR
|
||||
pyside.h
|
||||
PATHS ${PYSIDE6_BASEDIR}/include ${PYSIDE6_CUSTOM_PREFIX}/include/PySide6
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# Platform specific library names
|
||||
if(MSVC)
|
||||
SET(PYSIDE_LIBRARY_BASENAMES "pyside6.abi3.lib")
|
||||
elseif(CYGWIN)
|
||||
SET(PYSIDE_LIBRARY_BASENAMES "")
|
||||
elseif(WIN32)
|
||||
SET(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}")
|
||||
else()
|
||||
SET(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}")
|
||||
endif()
|
||||
|
||||
find_file(PYSIDE_LIBRARY
|
||||
${PYSIDE_LIBRARY_BASENAMES}
|
||||
PATHS ${PYSIDE6_BASEDIR} ${PYSIDE6_CUSTOM_PREFIX}/lib
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
find_path(PYSIDE_TYPESYSTEMS
|
||||
typesystem_core.xml
|
||||
PATHS ${PYSIDE6_BASEDIR}/typesystems ${PYSIDE6_CUSTOM_PREFIX}/share/PySide6/typesystems
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
if(PYSIDE6_FOUND)
|
||||
message(STATUS "PySide include dir: ${PYSIDE_INCLUDE_DIR}")
|
||||
message(STATUS "PySide library: ${PYSIDE_LIBRARY}")
|
||||
message(STATUS "PySide typesystems: ${PYSIDE_TYPESYSTEMS}")
|
||||
message(STATUS "PySide6 version: ${PYSIDE6_SO_VERSION}")
|
||||
|
||||
# Create PySide6 target
|
||||
add_library(PySide6::pyside6 SHARED IMPORTED GLOBAL)
|
||||
if(MSVC)
|
||||
set_property(TARGET PySide6::pyside6 PROPERTY
|
||||
IMPORTED_IMPLIB ${PYSIDE_LIBRARY})
|
||||
endif()
|
||||
set_property(TARGET PySide6::pyside6 PROPERTY
|
||||
IMPORTED_LOCATION ${PYSIDE_LIBRARY})
|
||||
set_property(TARGET PySide6::pyside6 APPEND PROPERTY
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
${PYSIDE_INCLUDE_DIR}
|
||||
${PYSIDE_INCLUDE_DIR}/QtCore/
|
||||
${PYSIDE_INCLUDE_DIR}/QtGui/
|
||||
${PYSIDE_INCLUDE_DIR}/QtWidgets/
|
||||
${Python3_INCLUDE_DIRS}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
find_package_handle_standard_args(PySide6
|
||||
REQUIRED_VARS PYSIDE6_BASEDIR PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_TYPESYSTEMS
|
||||
VERSION_VAR PYSIDE6_SO_VERSION
|
||||
)
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
|
||||
165
cmake/Python/FindShiboken6.cmake
Normal file
165
cmake/Python/FindShiboken6.cmake
Normal file
@@ -0,0 +1,165 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
|
||||
# SHIBOKEN_LIBRARY - Files to link against to use SHIBOKEN
|
||||
# SHIBOKEN_BINARY - Executable name
|
||||
# SHIBOKEN_BUILD_TYPE - Tells if Shiboken was compiled in Release or Debug mode.
|
||||
|
||||
# You can install Shiboken from Qt repository with
|
||||
# pip3 install --index-url=https://download.qt.io/official_releases/QtForPython --trusted-host download.qt.io shiboken6-generator
|
||||
|
||||
|
||||
set(SHIBOKEN_FOUND FALSE)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "if True:
|
||||
import os
|
||||
try:
|
||||
import shiboken6_generator
|
||||
print(shiboken6_generator.__path__[0])
|
||||
except:
|
||||
exit()
|
||||
"
|
||||
OUTPUT_VARIABLE SHIBOKEN_GENERATOR_BASEDIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "if True:
|
||||
import os
|
||||
try:
|
||||
import shiboken6
|
||||
print(shiboken6.__path__[0])
|
||||
except:
|
||||
exit()
|
||||
"
|
||||
OUTPUT_VARIABLE SHIBOKEN_BASEDIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "if True:
|
||||
import os
|
||||
import shiboken6
|
||||
print(';'.join(filter(None, map(str, shiboken6.__version_info__))))
|
||||
"
|
||||
OUTPUT_VARIABLE SHIBOKEN_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
list(GET SHIBOKEN_VERSION 0 SHIBOKEN_MACRO_VERSION)
|
||||
list(GET SHIBOKEN_VERSION 1 SHIBOKEN_MICRO_VERSION)
|
||||
list(GET SHIBOKEN_VERSION 2 SHIBOKEN_MINOR_VERSION)
|
||||
string(REPLACE ";" "." SHIBOKEN_VERSION "${SHIBOKEN_VERSION}")
|
||||
|
||||
message(STATUS "ShibokenGenerator base dir: ${SHIBOKEN_GENERATOR_BASEDIR}")
|
||||
message(STATUS "Shiboken base dir: ${SHIBOKEN_BASEDIR}")
|
||||
message(STATUS "Shiboken custom path: ${SHIBOKEN_CUSTOM_PATH}")
|
||||
|
||||
if(SHIBOKEN_BASEDIR)
|
||||
find_path(SHIBOKEN_INCLUDE_DIR
|
||||
shiboken.h
|
||||
PATHS ${SHIBOKEN_CUSTOM_PATH} ${SHIBOKEN_GENERATOR_BASEDIR}/include
|
||||
NO_DEFAULT_PATH)
|
||||
if(MSVC)
|
||||
SET(SHIBOKEN_LIBRARY_BASENAMES "shiboken6.abi3.lib")
|
||||
elseif(CYGWIN)
|
||||
SET(SHIBOKEN_LIBRARY_BASENAMES "")
|
||||
elseif(WIN32)
|
||||
SET(SHIBOKEN_LIBRARY_BASENAMES "libshiboken6.${PYSIDE2_SUFFIX}")
|
||||
elseif(APPLE)
|
||||
SET(SHIBOKEN_LIBRARY_BASENAMES
|
||||
libshiboken6.abi3.dylib
|
||||
libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.dylib
|
||||
libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}.dylib
|
||||
libshiboken6.abi3.${SHIBOKEN_VERSION}.dylib
|
||||
)
|
||||
else()
|
||||
SET(SHIBOKEN_LIBRARY_BASENAMES
|
||||
libshiboken6.abi3.so
|
||||
libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION}
|
||||
libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}
|
||||
libshiboken6.abi3.so.${SHIBOKEN_VERSION}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (NOT SHIBOKEN_INCLUDE_DIR)
|
||||
return()
|
||||
endif()
|
||||
set(SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_CUSTOM_PATH})
|
||||
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_BASEDIR})
|
||||
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_GENERATOR_BASEDIR})
|
||||
find_file(SHIBOKEN_LIBRARY
|
||||
${SHIBOKEN_LIBRARY_BASENAMES}
|
||||
PATHS ${SHIBOKEN_SEARCH_PATHS}
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
find_program(SHIBOKEN_BINARY
|
||||
shiboken6
|
||||
PATHS ${SHIBOKEN_SEARCH_PATHS}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
endif()
|
||||
if (SHIBOKEN_INCLUDE_DIR AND SHIBOKEN_LIBRARY AND SHIBOKEN_BINARY)
|
||||
set(SHIBOKEN_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(SHIBOKEN_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
if(MSVC)
|
||||
# On Windows we must link to python3.dll that is a small library that links against python3x.dll
|
||||
# that allow us to choose any python3x.dll at runtime
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "if True:
|
||||
for lib in '${Python3_LIBRARIES}'.split(';'):
|
||||
if '/' in lib:
|
||||
prefix, py = lib.rsplit('/', 1)
|
||||
if py.startswith('python3'):
|
||||
print(prefix + '/python3.lib')
|
||||
break
|
||||
"
|
||||
OUTPUT_VARIABLE PYTHON_LIMITED_LIBRARIES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
else()
|
||||
# On Linux and MacOs our modules should not link with any python library
|
||||
# that must be handled by the main process
|
||||
set(PYTHON_LIMITED_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
if (SHIBOKEN_FOUND)
|
||||
message(STATUS "Shiboken include dir: ${SHIBOKEN_INCLUDE_DIR}")
|
||||
message(STATUS "Shiboken library: ${SHIBOKEN_LIBRARY}")
|
||||
message(STATUS "Shiboken binary: ${SHIBOKEN_BINARY}")
|
||||
message(STATUS "Shiboken version: ${SHIBOKEN_VERSION}")
|
||||
|
||||
# Create shiboke2 target
|
||||
add_library(Shiboken6::libshiboken SHARED IMPORTED GLOBAL)
|
||||
if(MSVC)
|
||||
set_property(TARGET Shiboken6::libshiboken PROPERTY
|
||||
IMPORTED_IMPLIB ${SHIBOKEN_LIBRARY})
|
||||
endif()
|
||||
set_property(TARGET Shiboken6::libshiboken PROPERTY
|
||||
IMPORTED_LOCATION ${SHIBOKEN_LIBRARY})
|
||||
set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${SHIBOKEN_INCLUDE_DIR} ${Python3_INCLUDE_DIRS})
|
||||
set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES ${PYTHON_LIMITED_LIBRARIES})
|
||||
|
||||
# Generator target
|
||||
add_executable(Shiboken6::shiboken IMPORTED GLOBAL)
|
||||
set_property(TARGET Shiboken6::shiboken PROPERTY
|
||||
IMPORTED_LOCATION ${SHIBOKEN_BINARY})
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(Shiboken6
|
||||
REQUIRED_VARS SHIBOKEN_BASEDIR SHIBOKEN_INCLUDE_DIR SHIBOKEN_LIBRARY SHIBOKEN_BINARY
|
||||
VERSION_VAR SHIBOKEN_VERSION
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
|
||||
157
cmake/Python/PySide6ModuleBuild.cmake
Normal file
157
cmake/Python/PySide6ModuleBuild.cmake
Normal file
@@ -0,0 +1,157 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if (NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX)
|
||||
SET(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE FILEPATH "Custom path to install python bindings.")
|
||||
endif()
|
||||
|
||||
message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}")
|
||||
|
||||
if (WIN32)
|
||||
set(PATH_SEP "\;")
|
||||
else()
|
||||
set(PATH_SEP ":")
|
||||
endif()
|
||||
if (NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
|
||||
get_target_property(QtCore_is_framework Qt6::Core FRAMEWORK)
|
||||
if (QtCore_is_framework)
|
||||
# Get the path to the framework dir.
|
||||
list(GET Qt6Core_INCLUDE_DIRS 0 QT_INCLUDE_DIR)
|
||||
get_filename_component(QT_FRAMEWORK_INCLUDE_DIR "${QT_INCLUDE_DIR}/../" ABSOLUTE)
|
||||
|
||||
# QT_INCLUDE_DIR points to the QtCore.framework directory, so we need to adjust this to point
|
||||
# to the actual include directory, which has include files for non-framework parts of Qt.
|
||||
get_filename_component(QT_INCLUDE_DIR "${QT_INCLUDE_DIR}/../../include" ABSOLUTE)
|
||||
endif()
|
||||
|
||||
# Flags that we will pass to shiboken-generator
|
||||
# --generator-set=shiboken: tells the generator that we want to use shiboken to generate code,
|
||||
# a doc generator is also available
|
||||
# --enable-parent-ctor-heuristic: Enable heuristics to detect parent relationship on constructors,
|
||||
# this try to guess parent ownership based on the arguments of the constructors
|
||||
# --enable-pyside-extensionsL: This will generate code for Qt based classes, adding extra attributes,
|
||||
# like signal, slot;
|
||||
# --enable-return-value-heuristic: Similar as --enable-parent-ctor-heuristic this use some logic to guess
|
||||
# parent child relationship based on the returned argument
|
||||
# --use-isnull-as-nb_nonzero: If a class have an isNull() const method, it will be used to compute
|
||||
# the value of boolean casts.
|
||||
# Example, QImage::isNull() will be used when on python side you do `if (myQImage)`
|
||||
set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken
|
||||
--enable-parent-ctor-heuristic
|
||||
--enable-pyside-extensions
|
||||
--enable-return-value-heuristic
|
||||
--use-isnull-as-nb_nonzero
|
||||
-std=c++${CMAKE_CXX_STANDARD})
|
||||
|
||||
# 2017-04-24 The protected hack can unfortunately not be disabled, because
|
||||
# Clang does produce linker errors when we disable the hack.
|
||||
# But the ugly workaround in Python is replaced by a shiboken change.
|
||||
if(WIN32 OR DEFINED AVOID_PROTECTED_HACK)
|
||||
set(GENERATOR_EXTRA_FLAGS ${GENERATOR_EXTRA_FLAGS} --avoid-protected-hack)
|
||||
add_definitions(-DAVOID_PROTECTED_HACK)
|
||||
endif()
|
||||
|
||||
macro(make_path varname)
|
||||
# accepts any number of path variables
|
||||
string(REPLACE ";" "${PATH_SEP}" ${varname} "${ARGN}")
|
||||
endmacro()
|
||||
|
||||
# Creates a PySide module target based on the arguments
|
||||
# This will:
|
||||
# 1 - Create a Cmake custom-target that call shiboken-generator passign the correct arguments
|
||||
# 2 - Create a Cmake library target called "Py${LIBRARY_NAME}" the output name of this target
|
||||
# will be changed to match PySide template
|
||||
# Args:
|
||||
# LIBRARY_NAME - The name of the output module
|
||||
# TYPESYSTEM_PATHS - A list of paths where shiboken should look for typesystem files
|
||||
# INCLUDE_PATHS - Include pahts necessary to parse your class. *This is not the same as build*
|
||||
# OUTPUT_SOURCES - The files that will be generated by shiboken
|
||||
# TARGET_INCLUDE_DIRS - This will be passed to target_include_directories
|
||||
# TARGET_LINK_LIBRARIES - This will be passed to target_link_libraries
|
||||
# GLOBAL_INCLUDE - A header-file that contains alls classes that will be generated
|
||||
# TYPESYSTEM_XML - The target binding typesystem (that should be the full path)
|
||||
# DEPENDS - This var will be passed to add_custom_command(DEPENDS) so a new generation will be
|
||||
# trigger if one of these files changes
|
||||
# MODULE_OUTPUT_DIR - Where the library file should be stored
|
||||
macro(CREATE_PYTHON_BINDINGS
|
||||
LIBRARY_NAME
|
||||
TYPESYSTEM_PATHS
|
||||
INCLUDE_PATHS
|
||||
OUTPUT_SOURCES
|
||||
TARGET_INCLUDE_DIRS
|
||||
TARGET_LINK_LIBRARIES
|
||||
GLOBAL_INCLUDE
|
||||
TYPESYSTEM_XML
|
||||
DEPENDS
|
||||
MODULE_OUTPUT_DIR)
|
||||
|
||||
# Transform the path separators into something shiboken understands.
|
||||
make_path(shiboken_include_dirs ${INCLUDE_PATHS})
|
||||
make_path(shiboken_typesystem_dirs ${TYPESYSTEM_PATHS})
|
||||
get_property(raw_python_dir_include_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
|
||||
make_path(python_dir_include_dirs ${raw_python_dir_include_dirs})
|
||||
set(shiboken_include_dirs "${shiboken_include_dirs}${PATH_SEP}${python_dir_include_dirs}")
|
||||
|
||||
set(shiboken_framework_include_dirs_option "")
|
||||
if(CMAKE_HOST_APPLE)
|
||||
set(shiboken_framework_include_dirs "${QT_FRAMEWORK_INCLUDE_DIR}")
|
||||
make_path(shiboken_framework_include_dirs ${shiboken_framework_include_dirs})
|
||||
set(shiboken_framework_include_dirs_option "--framework-include-paths=${shiboken_framework_include_dirs}")
|
||||
endif()
|
||||
set_property(SOURCE ${OUTPUT_SOURCES} PROPERTY SKIP_AUTOGEN ON)
|
||||
add_custom_command(OUTPUT ${OUTPUT_SOURCES}
|
||||
COMMAND $<TARGET_PROPERTY:Shiboken6::shiboken,LOCATION> ${GENERATOR_EXTRA_FLAGS}
|
||||
${GLOBAL_INCLUDE}
|
||||
--include-paths=${shiboken_include_dirs}
|
||||
--typesystem-paths=${shiboken_typesystem_dirs}
|
||||
${shiboken_framework_include_dirs_option}
|
||||
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
|
||||
${TYPESYSTEM_XML}
|
||||
DEPENDS ${TYPESYSTEM_XML} ${DEPENDS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "Running generator for ${LIBRARY_NAME} binding...")
|
||||
|
||||
set(TARGET_NAME "Py${LIBRARY_NAME}")
|
||||
set(MODULE_NAME "${LIBRARY_NAME}")
|
||||
add_library(${TARGET_NAME} MODULE ${OUTPUT_SOURCES})
|
||||
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
PREFIX ""
|
||||
OUTPUT_NAME ${MODULE_NAME}
|
||||
LIBRARY_OUTPUT_DIRECTORY ${MODULE_OUTPUT_DIR}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
endif()
|
||||
|
||||
target_include_directories(${TARGET_NAME} PUBLIC
|
||||
${TARGET_INCLUDE_DIRS}
|
||||
${PYSIDE_EXTRA_INCLUDES}
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
${TARGET_LINK_LIBRARIES}
|
||||
PySide6::pyside6
|
||||
Shiboken6::libshiboken
|
||||
)
|
||||
target_compile_definitions(${TARGET_NAME}
|
||||
PRIVATE Py_LIMITED_API=0x03050000
|
||||
)
|
||||
if(APPLE)
|
||||
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY
|
||||
LINK_FLAGS "-undefined dynamic_lookup")
|
||||
endif()
|
||||
install(TARGETS ${TARGET_NAME}
|
||||
LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/${TARGET_NAME})
|
||||
endmacro()
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2016-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2016-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Allen Winter <allen.winter@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
#
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
|
||||
157
dev-scripts/build-all.dart
Normal file
157
dev-scripts/build-all.dart
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is an helper script which simply reads CMakePresets.json and builds those
|
||||
* presets. It's just for quickly checking that every supported setup builds
|
||||
* without having to wait for CI (or in case you don't have access to KDAB CI)
|
||||
*
|
||||
* Usage:
|
||||
* $ dart build-all.dart <kddw-source-directory> [--unity] [--tests]
|
||||
*/
|
||||
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
|
||||
String s_sourceDirectory = "";
|
||||
bool s_testUnityVariations = false;
|
||||
bool s_runTests = true;
|
||||
|
||||
class Preset {
|
||||
final String name;
|
||||
final String buildDir;
|
||||
Preset.fromJson(var jsonData)
|
||||
: name = jsonData['name'],
|
||||
buildDir = jsonData['binaryDir'] {
|
||||
}
|
||||
|
||||
String buildDirectory() {
|
||||
return buildDir.replaceAll("\${sourceDir}", s_sourceDirectory);
|
||||
}
|
||||
|
||||
List<String> cmakeConfigArguments(bool isUnityBuild) {
|
||||
return [
|
||||
"-G",
|
||||
"Ninja",
|
||||
"-B",
|
||||
buildDirectory(),
|
||||
"-S",
|
||||
s_sourceDirectory,
|
||||
"--preset=" + name,
|
||||
'-DKDDockWidgets_UNITY_BUILD=${isUnityBuild ? "ON" : "OFF"}'
|
||||
];
|
||||
}
|
||||
|
||||
List<String> cmakeBuildArguments() {
|
||||
return ["--build", buildDirectory()];
|
||||
}
|
||||
|
||||
// Builds twice. One with unity build and one without.
|
||||
Future<bool> build() async {
|
||||
if (!await buildSingle(true)) return false;
|
||||
if (s_testUnityVariations) if (!await buildSingle(false)) return false;
|
||||
if (s_runTests && !await runTests()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<bool> buildSingle(bool isUnityBuild) async {
|
||||
if (!await runCMake(cmakeConfigArguments(isUnityBuild))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!await runCMake(cmakeBuildArguments())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<bool> runTests() async {
|
||||
print("Running: ctest");
|
||||
|
||||
final savedCwd = Directory.current;
|
||||
Directory.current = buildDirectory();
|
||||
ProcessResult result = await Process.run('ctest', ["-j8"]);
|
||||
Directory.current = savedCwd;
|
||||
|
||||
if (result.exitCode != 0) {
|
||||
print(result.stdout);
|
||||
print(result.stderr);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the contents of the CMakePresets.json file
|
||||
String cmakePresetsJson(presetsFile) {
|
||||
var file = File(presetsFile);
|
||||
if (!file.existsSync()) {
|
||||
throw Exception('Not existent file');
|
||||
}
|
||||
return file.readAsStringSync();
|
||||
}
|
||||
|
||||
List<Preset> readPresets(var presetsFile) {
|
||||
var presets = List<Preset>();
|
||||
|
||||
final jsonData = jsonDecode(cmakePresetsJson(presetsFile));
|
||||
for (var presetData in jsonData['configurePresets']) {
|
||||
presets.add(Preset.fromJson(presetData));
|
||||
}
|
||||
return presets;
|
||||
}
|
||||
|
||||
Future<bool> runCMake(var cmd) async {
|
||||
print("Running: cmake " + cmd.join(' '));
|
||||
ProcessResult result = await Process.run('cmake', cmd);
|
||||
if (result.exitCode != 0) {
|
||||
print(result.stdout);
|
||||
print(result.stderr);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<int> main(List<String> arguments) async {
|
||||
if (arguments.length == 0) {
|
||||
print("Usage: build-all.dart <src-directory> [--unity] [--tests]");
|
||||
return 1;
|
||||
}
|
||||
|
||||
s_sourceDirectory = arguments[0];
|
||||
s_testUnityVariations = arguments.contains("--unity");
|
||||
s_runTests = arguments.contains("--tests");
|
||||
final presetsFile = s_sourceDirectory + '/CMakePresets.json';
|
||||
|
||||
if (FileSystemEntity.typeSync(presetsFile) == FileSystemEntityType.notFound) {
|
||||
print('ERROR: CMakePresets.json file not found in the source directory');
|
||||
return 1;
|
||||
}
|
||||
|
||||
var presets = readPresets(presetsFile);
|
||||
for (var preset in presets) {
|
||||
if (preset.name == 'python')
|
||||
continue; // TODO: blacklisted as it's not building on my setup yet
|
||||
|
||||
if (!await preset.build()) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
print("Success!!");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Allen Winter <allen.winter@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Allen Winter <allen.winter@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
// clazy:excludeall=missing-qobject-macro,ctor-missing-parent-argument
|
||||
|
||||
class MyTitleBar : public KDDockWidgets::TitleBarWidget
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -15,8 +15,11 @@
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
class CustomWidgetFactory : public KDDockWidgets::DefaultWidgetFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KDDockWidgets::TitleBar *createTitleBar(KDDockWidgets::Frame *frame) const override;
|
||||
KDDockWidgets::TitleBar *createTitleBar(KDDockWidgets::FloatingWindow *fw) const override;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
// clazy:excludeall=qstring-allocations
|
||||
// clazy:excludeall=qstring-allocations,ctor-missing-parent-argument,detaching-member
|
||||
|
||||
static MyWidget *newMyWidget()
|
||||
{
|
||||
@@ -135,26 +135,26 @@ void MyMainWindow::createDockWidgets()
|
||||
|
||||
|
||||
// MainWindow::addDockWidget() attaches a dock widget to the main window:
|
||||
addDockWidget(m_dockwidgets[0], KDDockWidgets::Location_OnTop);
|
||||
addDockWidget(m_dockwidgets.at(0), KDDockWidgets::Location_OnTop);
|
||||
|
||||
// Here, for finer granularity we specify right of dockwidgets[0]:
|
||||
addDockWidget(m_dockwidgets[1], KDDockWidgets::Location_OnRight, m_dockwidgets[0]);
|
||||
addDockWidget(m_dockwidgets.at(1), KDDockWidgets::Location_OnRight, m_dockwidgets.at(0));
|
||||
|
||||
addDockWidget(m_dockwidgets[2], KDDockWidgets::Location_OnLeft);
|
||||
addDockWidget(m_dockwidgets[3], KDDockWidgets::Location_OnBottom);
|
||||
addDockWidget(m_dockwidgets[4], KDDockWidgets::Location_OnBottom);
|
||||
addDockWidget(m_dockwidgets.at(2), KDDockWidgets::Location_OnLeft);
|
||||
addDockWidget(m_dockwidgets.at(3), KDDockWidgets::Location_OnBottom);
|
||||
addDockWidget(m_dockwidgets.at(4), KDDockWidgets::Location_OnBottom);
|
||||
|
||||
// Tab two dock widgets together
|
||||
m_dockwidgets[3]->addDockWidgetAsTab(m_dockwidgets[5]);
|
||||
m_dockwidgets[3]->addDockWidgetAsTab(m_dockwidgets.at(5));
|
||||
|
||||
// 6 is floating, as it wasn't added to the main window via MainWindow::addDockWidget().
|
||||
// and we tab 7 with it.
|
||||
m_dockwidgets[6]->addDockWidgetAsTab(m_dockwidgets[7]);
|
||||
m_dockwidgets[6]->addDockWidgetAsTab(m_dockwidgets.at(7));
|
||||
|
||||
// Floating windows also support nesting, here we add 8 to the bottom of the group
|
||||
m_dockwidgets[6]->addDockWidgetToContainingWindow(m_dockwidgets[8], KDDockWidgets::Location_OnBottom);
|
||||
m_dockwidgets[6]->addDockWidgetToContainingWindow(m_dockwidgets.at(8), KDDockWidgets::Location_OnBottom);
|
||||
|
||||
auto floatingWindow = m_dockwidgets[6]->window();
|
||||
auto floatingWindow = m_dockwidgets.at(6)->window();
|
||||
floatingWindow->move(100, 100);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -34,6 +34,7 @@ protected:
|
||||
|
||||
class MyWidget1 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget1(QWidget *parent = nullptr);
|
||||
protected:
|
||||
@@ -42,6 +43,7 @@ protected:
|
||||
|
||||
class MyWidget2 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget2(QWidget *parent = nullptr);
|
||||
protected:
|
||||
@@ -50,6 +52,7 @@ protected:
|
||||
|
||||
class MyWidget3 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget3(QWidget *parent = nullptr);
|
||||
protected:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -147,17 +147,19 @@ int main(int argc, char **argv)
|
||||
MainWindowOptions options = MainWindowOption_None;
|
||||
auto flags = KDDockWidgets::Config::self().flags();
|
||||
#if defined(DOCKS_DEVELOPER_MODE)
|
||||
auto internalFlags = KDDockWidgets::Config::self().internalFlags();
|
||||
|
||||
options = parser.isSet(centralFrame) ? MainWindowOption_HasCentralFrame
|
||||
: MainWindowOption_None;
|
||||
|
||||
if (parser.isSet(noQtTool))
|
||||
flags |= KDDockWidgets::Config::Flag_internal_DontUseQtToolWindowsForFloatingWindows;
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows;
|
||||
|
||||
if (parser.isSet(keepAbove))
|
||||
flags |= KDDockWidgets::Config::Flag_KeepAboveIfNotUtilityWindow;
|
||||
|
||||
if (parser.isSet(noParentForFloating))
|
||||
flags |= KDDockWidgets::Config::Flag_internal_DontUseParentForFloatingWindows;
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseParentForFloatingWindows;
|
||||
|
||||
if (parser.isSet(nativeTitleBar))
|
||||
flags |= KDDockWidgets::Config::Flag_NativeTitleBar;
|
||||
@@ -167,9 +169,9 @@ int main(int argc, char **argv)
|
||||
|
||||
# if defined(Q_OS_WIN)
|
||||
if (parser.isSet(noAeroSnap))
|
||||
flags |= KDDockWidgets::Config::Flag_internal_NoAeroSnap;
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_NoAeroSnap;
|
||||
# endif
|
||||
|
||||
Config::self().setInternalFlags(internalFlags);
|
||||
#endif
|
||||
|
||||
if (parser.isSet(autoHideSupport))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -35,6 +35,7 @@ protected:
|
||||
|
||||
class MyWidget1 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget1(QWidget *parent = nullptr);
|
||||
protected:
|
||||
@@ -43,6 +44,7 @@ protected:
|
||||
|
||||
class MyWidget2 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget2(QWidget *parent = nullptr);
|
||||
protected:
|
||||
@@ -51,6 +53,7 @@ protected:
|
||||
|
||||
class MyWidget3 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget3(QWidget *parent = nullptr);
|
||||
protected:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -62,6 +62,10 @@ int main(int argc, char **argv)
|
||||
QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"));
|
||||
dock4->setWidget(widget4);
|
||||
|
||||
auto dock5 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock5"));
|
||||
auto widget5 = new MyWidget(QStringLiteral(":/assets/base.png"),
|
||||
QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"));
|
||||
dock5->setWidget(widget5);
|
||||
|
||||
// 3. Add them to the main window
|
||||
mainWindow.addDockWidget(dock1, KDDockWidgets::Location_OnLeft);
|
||||
@@ -70,8 +74,13 @@ int main(int argc, char **argv)
|
||||
// 4. Add dock3 to the right of dock2
|
||||
mainWindow.addDockWidget(dock3, KDDockWidgets::Location_OnRight, dock2);
|
||||
|
||||
// 5. dock4 will be its own top level (floating window)
|
||||
dock4->show();
|
||||
// 5. dock4 is docked at the bottom, with 200px height
|
||||
const QSize preferredSize(QSize(/*ignored*/0, 200));
|
||||
mainWindow.addDockWidget(dock4, KDDockWidgets::Location_OnBottom, nullptr, preferredSize);
|
||||
|
||||
|
||||
// 5. dock5 will be its own top level (floating window)
|
||||
dock5->show();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
@@ -50,13 +50,14 @@ int main(int argc, char *argv[])
|
||||
auto flags = KDDockWidgets::Config::self().flags();
|
||||
|
||||
#if defined(DOCKS_DEVELOPER_MODE)
|
||||
auto internalFlags = KDDockWidgets::Config::self().internalFlags();
|
||||
parser.process(app);
|
||||
|
||||
if (parser.isSet(noQtTool))
|
||||
flags |= KDDockWidgets::Config::Flag_internal_DontUseQtToolWindowsForFloatingWindows;
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows;
|
||||
|
||||
if (parser.isSet(noParentForFloating))
|
||||
flags |= KDDockWidgets::Config::Flag_internal_DontUseParentForFloatingWindows;
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseParentForFloatingWindows;
|
||||
|
||||
if (parser.isSet(nativeTitleBar))
|
||||
flags |= KDDockWidgets::Config::Flag_NativeTitleBar;
|
||||
@@ -65,9 +66,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
# if defined(Q_OS_WIN)
|
||||
if (parser.isSet(noAeroSnap))
|
||||
flags |= KDDockWidgets::Config::Flag_internal_NoAeroSnap;
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_NoAeroSnap;
|
||||
# endif
|
||||
|
||||
KDDockWidgets::Config::self().setInternalFlags(internalFlags);
|
||||
#endif
|
||||
|
||||
KDDockWidgets::Config::self().setFlags(flags);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -11,8 +11,17 @@
|
||||
|
||||
set(PYTHON_VERSION "3.7" CACHE STRING "Use specific python version to build the project.")
|
||||
find_package(Python3 ${PYTHON_VERSION} REQUIRED COMPONENTS Interpreter Development)
|
||||
find_package(Shiboken2 REQUIRED)
|
||||
find_package(PySide2 ${Qt5Widgets_VERSION} EXACT REQUIRED)
|
||||
include(PySide2ModuleBuild)
|
||||
|
||||
if (${PROJECT_NAME}_QT6)
|
||||
find_package(Shiboken6 REQUIRED)
|
||||
find_package(PySide6 ${Qt5Widgets_VERSION} EXACT REQUIRED)
|
||||
include(PySide6ModuleBuild)
|
||||
set(PYSIDE_MAJOR_VERSION "6")
|
||||
else()
|
||||
find_package(Shiboken2 REQUIRED)
|
||||
find_package(PySide2 ${Qt5Widgets_VERSION} EXACT REQUIRED)
|
||||
include(PySide2ModuleBuild)
|
||||
set(PYSIDE_MAJOR_VERSION "2")
|
||||
endif()
|
||||
|
||||
add_subdirectory(PyKDDockWidgets)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -20,9 +20,6 @@ set(PyKDDockWidgets_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindowbase_wrapper.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindow_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindow_wrapper.h
|
||||
# namespace wrapper
|
||||
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_wrapper.h
|
||||
# global module wrapper
|
||||
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_module_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_python.h
|
||||
@@ -47,9 +44,9 @@ set(PyKDDockWidgets_target_include_directories
|
||||
# Libraries that will be necessary to link the target, this will used in the command 'target_link_libraries'
|
||||
set(PyKDDockWidgets_target_link_libraries
|
||||
KDAB::kddockwidgets
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Widgets
|
||||
Qt${QT_MAJOR_VERSION}::Core
|
||||
Qt${QT_MAJOR_VERSION}::Gui
|
||||
Qt${QT_MAJOR_VERSION}::Widgets
|
||||
)
|
||||
|
||||
# changes on these files should trigger a new generation
|
||||
@@ -75,7 +72,7 @@ create_python_bindings(
|
||||
)
|
||||
|
||||
# Make module import from build dir work
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/__init__.py)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/__init__.py @ONLY)
|
||||
|
||||
# install
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/PyKDDockWidgets)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -9,17 +9,16 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
import sys
|
||||
|
||||
__all__ = ['KDDockWidgets']
|
||||
|
||||
# Preload PySide2 libraries to avoid missing libraries while loading KDDockWidgets
|
||||
try:
|
||||
from PySide2 import QtCore
|
||||
from PySide@PYSIDE_MAJOR_VERSION@ import QtCore
|
||||
# Create a alias for PySide module so we can use a single import in source files
|
||||
import PySide@PYSIDE_MAJOR_VERSION@
|
||||
sys.modules["PySide"] = PySide@PYSIDE_MAJOR_VERSION@
|
||||
except Exception:
|
||||
print("Failed to load PySide")
|
||||
raise
|
||||
|
||||
# avoid duplicate namespace, due the PYSIDE-1325 bug I will have my package like this
|
||||
# PyKDDockWidgets.KDDockWidgets.KDDockWidgets.MainWindow
|
||||
# To avoid this I add a WORKAROUND to reduce it
|
||||
from .KDDockWidgets import KDDockWidgets as _priv
|
||||
KDDockWidgets = _priv
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -6,17 +6,22 @@
|
||||
typesystem because it already include gui and core typesystem -->
|
||||
<load-typesystem name="typesystem_widgets.xml" generate="no"/>
|
||||
|
||||
<rejection class="KDDockWidgets" function-name="qt_getEnumName"/>
|
||||
<rejection class="KDDockWidgets" function-name="qt_getEnumMetaObject"/>
|
||||
|
||||
<!-- Our classes are declared in a namespace, so we should define this -->
|
||||
<namespace-type name="KDDockWidgets">
|
||||
|
||||
<namespace-type name="KDDockWidgets" visible="no">
|
||||
<!-- this is used in a public virtual pure function we need to declare it
|
||||
otherwise shiboken will ignore the function and will fail to create a wrapper -->
|
||||
<primitive-type name="DropAreaWithCentralFrame"/>
|
||||
<primitive-type name="SideBar"/>
|
||||
<primitive-type name="InitialOption"/>
|
||||
|
||||
<!-- Some plublic enum and flags -->
|
||||
<enum-type name="Location"/>
|
||||
<enum-type name="MainWindowOption" flags="MainWindowOptions"/>
|
||||
<enum-type name="AddingOption"/>
|
||||
<enum-type name="InitialVisibilityOption"/>
|
||||
<enum-type name="RestoreOption" flags="RestoreOptions"/>
|
||||
<enum-type name="DefaultSizeMode"/>
|
||||
<enum-type name="FrameOption" flags="FrameOptions"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -9,9 +9,10 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
from PySide2 import QtCore, QtWidgets, QtGui
|
||||
from PyKDDockWidgets import KDDockWidgets
|
||||
|
||||
from PySide import QtCore, QtWidgets, QtGui
|
||||
|
||||
from MyWidget1 import MyWidget1
|
||||
from MyWidget2 import MyWidget2
|
||||
from MyWidget3 import MyWidget3
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -9,7 +9,9 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
from PySide2 import QtWidgets, QtGui, QtCore
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui, QtCore
|
||||
|
||||
class MyWidget(QtWidgets.QWidget):
|
||||
s_images = {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -9,7 +9,9 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
from PySide2 import QtWidgets, QtGui
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -9,8 +9,10 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
from PySide2 import QtWidgets, QtGui, QtCore
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui, QtCore
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
class MyWidget2(MyWidget):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -9,7 +9,9 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
from PySide2 import QtWidgets, QtGui, QtCore
|
||||
import PyKDDockWidgets
|
||||
|
||||
from PySide import QtWidgets, QtGui, QtCore
|
||||
|
||||
from MyWidget import MyWidget
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -9,11 +9,11 @@
|
||||
# Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
#
|
||||
|
||||
|
||||
from PySide2 import QtWidgets, QtCore
|
||||
from PyKDDockWidgets import KDDockWidgets
|
||||
from MyMainWindow import MyMainWindow
|
||||
|
||||
from PySide import QtWidgets, QtCore
|
||||
|
||||
import sys
|
||||
import rc_assets
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# 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
|
||||
@@ -48,6 +48,8 @@ set(DOCKSLIBS_SRCS
|
||||
private/FloatingWindow_p.h
|
||||
private/Logging.cpp
|
||||
private/Logging_p.h
|
||||
private/TabWidget.cpp
|
||||
private/TabWidget_p.h
|
||||
private/TitleBar.cpp
|
||||
private/TitleBar_p.h
|
||||
private/SideBar.cpp
|
||||
@@ -108,6 +110,7 @@ set(DOCKS_INSTALLABLE_PRIVATE_INCLUDES
|
||||
private/TitleBar_p.h
|
||||
private/WindowBeingDragged_p.h
|
||||
private/DockRegistry_p.h
|
||||
private/TabWidget_p.h
|
||||
)
|
||||
|
||||
set(DOCKS_INSTALLABLE_PRIVATE_WIDGET_INCLUDES
|
||||
@@ -118,7 +121,6 @@ set(DOCKS_INSTALLABLE_PRIVATE_WIDGET_INCLUDES
|
||||
private/widgets/FrameWidget_p.h
|
||||
private/widgets/TabBarWidget_p.h
|
||||
private/widgets/TabWidgetWidget_p.h
|
||||
private/widgets/TabWidget_p.h
|
||||
)
|
||||
|
||||
if(${PROJECT_NAME}_QTQUICK)
|
||||
@@ -131,6 +133,10 @@ if(${PROJECT_NAME}_QTQUICK)
|
||||
private/quick/QWidgetAdapter_quick_p.h
|
||||
private/quick/FloatingWindowQuick.cpp
|
||||
private/quick/FloatingWindowQuick_p.h
|
||||
private/quick/TabWidgetQuick.cpp
|
||||
private/quick/TabWidgetQuick_p.h
|
||||
private/quick/TabBarQuick.cpp
|
||||
private/quick/TabBarQuick_p.h
|
||||
private/quick/TitleBarQuick.cpp
|
||||
private/quick/TitleBarQuick_p.h
|
||||
private/quick/QmlTypes.cpp
|
||||
@@ -163,8 +169,6 @@ else()
|
||||
private/multisplitter/Widget_qwidget.h
|
||||
private/multisplitter/Separator_qwidget.cpp
|
||||
private/multisplitter/Separator_qwidget.h
|
||||
private/widgets/TabWidget.cpp
|
||||
private/widgets/TabWidget_p.h
|
||||
private/widgets/TabBarWidget.cpp
|
||||
private/widgets/TabBarWidget_p.h
|
||||
private/widgets/FloatingWindowWidget.cpp
|
||||
@@ -229,7 +233,12 @@ else()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR IS_CLANG_BUILD)
|
||||
target_compile_options(kddockwidgets PRIVATE -Wshadow -Wconversion -fvisibility=hidden)
|
||||
target_compile_options(kddockwidgets PRIVATE -Wshadow -fvisibility=hidden)
|
||||
|
||||
# Disable -Wconversion for Qt6. The qsizetype to int conversions are harmless
|
||||
if (NOT ${PROJECT_NAME}_QT6)
|
||||
target_compile_options(kddockwidgets PRIVATE -Wconversion)
|
||||
endif()
|
||||
|
||||
if(IS_CLANG_BUILD)
|
||||
target_compile_options(kddockwidgets PRIVATE -Wweak-vtables)
|
||||
@@ -243,7 +252,7 @@ else()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(kddockwidgets PRIVATE Qt${QT_MAJOR_VERSION}::GuiPrivate Dwmapi)
|
||||
target_link_libraries(kddockwidgets PRIVATE Qt${QT_MAJOR_VERSION}::GuiPrivate dwmapi)
|
||||
elseif(NOT APPLE AND NOT EMSCRIPTEN AND NOT ${PROJECT_NAME}_QT6)
|
||||
find_package(Qt${QT_MAJOR_VERSION}X11Extras)
|
||||
target_link_libraries(kddockwidgets PUBLIC Qt${QT_MAJOR_VERSION}::X11Extras)
|
||||
@@ -308,7 +317,9 @@ if(${PROJECT_NAME}_DEVELOPER_MODE)
|
||||
# Under developer mode since kddw might be a sub-folder of a project setting a different value for QT_DISABLE_DEPRECATED_BEFORE
|
||||
target_compile_definitions(kddockwidgets PRIVATE QT_DISABLE_DEPRECATED_BEFORE=0x060000)
|
||||
|
||||
if (NOT ${PROJECT_NAME}_QTQUICK) # TODO: We can support it
|
||||
option(KDDockWidgets_LINTER "Build the layout linter" ON)
|
||||
|
||||
if (NOT ${PROJECT_NAME}_QTQUICK AND KDDockWidgets_LINTER) # TODO: We can support it
|
||||
add_executable(kddockwidgets_linter layoutlinter_main.cpp)
|
||||
target_link_libraries(kddockwidgets_linter kddockwidgets Qt${QT_MAJOR_VERSION}::Widgets)
|
||||
endif()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
TabbingAllowedFunc m_tabbingAllowedFunc = nullptr;
|
||||
FrameworkWidgetFactory *m_frameworkWidgetFactory = nullptr;
|
||||
Flags m_flags = Flag_Default;
|
||||
InternalFlags m_internalFlags = InternalFlag_None;
|
||||
qreal m_draggedWindowOpacity = Q_QNAN;
|
||||
};
|
||||
|
||||
@@ -172,6 +173,46 @@ TabbingAllowedFunc Config::tabbingAllowedFunc() const
|
||||
return d->m_tabbingAllowedFunc;
|
||||
}
|
||||
|
||||
void Config::setAbsoluteWidgetMinSize(QSize size)
|
||||
{
|
||||
if (!DockRegistry::self()->isEmpty(/*excludeBeingDeleted=*/ false)) {
|
||||
qWarning() << Q_FUNC_INFO << "Only use this function at startup before creating any DockWidget or MainWindow";
|
||||
return;
|
||||
}
|
||||
|
||||
Layouting::Item::hardcodedMinimumSize = size;
|
||||
}
|
||||
|
||||
QSize Config::absoluteWidgetMinSize() const
|
||||
{
|
||||
return Layouting::Item::hardcodedMinimumSize;
|
||||
}
|
||||
|
||||
void Config::setAbsoluteWidgetMaxSize(QSize size)
|
||||
{
|
||||
if (!DockRegistry::self()->isEmpty(/*excludeBeingDeleted=*/ false)) {
|
||||
qWarning() << Q_FUNC_INFO << "Only use this function at startup before creating any DockWidget or MainWindow";
|
||||
return;
|
||||
}
|
||||
|
||||
Layouting::Item::hardcodedMaximumSize = size;
|
||||
}
|
||||
|
||||
QSize Config::absoluteWidgetMaxSize() const
|
||||
{
|
||||
return Layouting::Item::hardcodedMaximumSize;
|
||||
}
|
||||
|
||||
Config::InternalFlags Config::internalFlags() const
|
||||
{
|
||||
return d->m_internalFlags;
|
||||
}
|
||||
|
||||
void Config::setInternalFlags(InternalFlags flags)
|
||||
{
|
||||
d->m_internalFlags = flags;
|
||||
}
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTQUICK
|
||||
void Config::setQmlEngine(QQmlEngine *qmlEngine)
|
||||
{
|
||||
@@ -239,11 +280,16 @@ void Config::Private::fixFlags()
|
||||
|
||||
#if defined(DOCKS_DEVELOPER_MODE)
|
||||
// We allow to disable aero-snap during development
|
||||
if (m_flags & Flag_internal_NoAeroSnap) {
|
||||
if (m_internalFlags & InternalFlag_NoAeroSnap) {
|
||||
// The only way to disable AeroSnap
|
||||
m_flags = m_flags & ~Flag_AeroSnapWithClientDecos;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_flags & Flag_DontUseUtilityFloatingWindows) {
|
||||
m_internalFlags |= InternalFlag_DontUseParentForFloatingWindows;
|
||||
m_internalFlags |= InternalFlag_DontUseQtToolWindowsForFloatingWindows;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
45
src/Config.h
45
src/Config.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QQmlEngine;
|
||||
class QSize;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace KDDockWidgets
|
||||
@@ -73,22 +74,28 @@ public:
|
||||
Flag_TitleBarHasMaximizeButton = 256, ///< The title bar will have a maximize/restore button when floating. This is mutually-exclusive with the floating button (since many apps behave that way).
|
||||
Flag_TitleBarIsFocusable = 512, ///< You can click the title bar and it will focus the last focused widget in the focus scope. If no previously focused widget then it focuses the user's dock widget guest, which should accept focus or use a focus proxy.
|
||||
Flag_LazyResize = 1024, ///< The dock widgets are resized in a lazy manner. The actual resize only happens when you release the mouse button.
|
||||
|
||||
// These two are internal, for testing purposes across platforms. Use Flag_DontUseUtilityFloatingWindows instead.
|
||||
Flag_internal_DontUseQtToolWindowsForFloatingWindows = 0x800, ///< FloatingWindows will use Qt::Window instead of Qt::Tool. Internal, use Flag_DontUseUtilityFloatingWindows instead.
|
||||
Flag_internal_DontUseParentForFloatingWindows = 0x1000, ///< FloatingWindows won't have a parent top-level. Internal, use Flag_DontUseUtilityFloatingWindows instead.
|
||||
|
||||
Flag_DontUseUtilityFloatingWindows = Flag_internal_DontUseQtToolWindowsForFloatingWindows | Flag_internal_DontUseParentForFloatingWindows,
|
||||
Flag_DontUseUtilityFloatingWindows = 0x1000,
|
||||
Flag_TitleBarHasMinimizeButton = 0x2000 | Flag_DontUseUtilityFloatingWindows, ///< The title bar will have a minimize button when floating. This implies Flag_DontUseUtilityFloatingWindows too, otherwise they wouldn't appear in the task bar.
|
||||
Flag_TitleBarNoFloatButton = 0x4000, ///< The TitleBar won't show the float button
|
||||
Flag_AutoHideSupport = 0x8000 | Flag_TitleBarNoFloatButton, ///< Supports minimizing dock widgets to the side-bar.
|
||||
///< By default it also turns off the float button, but you can remove Flag_TitleBarNoFloatButton to have both.
|
||||
Flag_KeepAboveIfNotUtilityWindow = 0x10000, ///< Only meaningful if Flag_DontUseUtilityFloatingWindows is set. If floating windows are normal windows, you might still want them to keep above and not minimize when you focus the main window.
|
||||
Flag_internal_NoAeroSnap = 0x20000, ///< Internal flag, only for development. Disables Aero-snap.
|
||||
Flag_Default = Flag_AeroSnapWithClientDecos ///< The defaults
|
||||
};
|
||||
Q_DECLARE_FLAGS(Flags, Flag)
|
||||
|
||||
///@internal
|
||||
///Internal flags for addtional tunning.
|
||||
///@warning Not for public consumption, support will be limited.
|
||||
enum InternalFlag {
|
||||
InternalFlag_None = 0, ///< The default
|
||||
InternalFlag_NoAeroSnap = 1, ///< Only for development. Disables Aero-snap.
|
||||
InternalFlag_DontUseParentForFloatingWindows = 2, ///< FloatingWindows won't have a parent top-level.
|
||||
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.
|
||||
};
|
||||
Q_DECLARE_FLAGS(InternalFlags, InternalFlag)
|
||||
|
||||
///@brief returns the chosen flags
|
||||
Flags flags() const;
|
||||
|
||||
@@ -187,6 +194,28 @@ public:
|
||||
///@sa setTabbingAllowedFunc().
|
||||
TabbingAllowedFunc tabbingAllowedFunc() const;
|
||||
|
||||
///@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
|
||||
/// smaller than this one.
|
||||
void setAbsoluteWidgetMinSize(QSize size);
|
||||
QSize absoluteWidgetMinSize() const;
|
||||
|
||||
///@brief Sets the maximum size a dock widget can have.
|
||||
/// Widgets can still provide their own max-size and it will be respected, however it can never be
|
||||
/// bigger than this one.
|
||||
void setAbsoluteWidgetMaxSize(QSize size);
|
||||
QSize absoluteWidgetMaxSize() const;
|
||||
|
||||
///@internal
|
||||
///@brief returns the internal flags.
|
||||
///@warning Not for public consumption, support will be limited.
|
||||
InternalFlags internalFlags() const;
|
||||
|
||||
///@internal
|
||||
///@brief setter for the internal flags
|
||||
///@warning Not for public consumption, support will be limited.
|
||||
void setInternalFlags(InternalFlags flags);
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTQUICK
|
||||
///@brief Sets the QQmlEngine to use. Applicable only when using QtQuick.
|
||||
void setQmlEngine(QQmlEngine *);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -25,6 +25,8 @@ QT_BEGIN_NAMESPACE
|
||||
class QCloseEvent;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
namespace KDDockWidgets {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "Utils_p.h"
|
||||
#include "DockRegistry_p.h"
|
||||
#include "DropArea_p.h"
|
||||
#include "multisplitter/Item_p.h"
|
||||
#include "Config.h"
|
||||
#include "TitleBar_p.h"
|
||||
#include "FrameworkWidgetFactory.h"
|
||||
@@ -133,6 +132,7 @@ public:
|
||||
bool m_updatingToggleAction = false;
|
||||
bool m_updatingFloatAction = false;
|
||||
bool m_isForceClosing = false;
|
||||
QSize m_lastOverlayedSize = QSize(0, 0);
|
||||
};
|
||||
|
||||
DockWidgetBase::DockWidgetBase(const QString &name, Options options)
|
||||
@@ -141,7 +141,6 @@ DockWidgetBase::DockWidgetBase(const QString &name, Options options)
|
||||
{
|
||||
d->init();
|
||||
DockRegistry::self()->registerDockWidget(this);
|
||||
qCDebug(creation) << "DockWidget" << this;
|
||||
|
||||
if (name.isEmpty())
|
||||
qWarning() << Q_FUNC_INFO << "Name can't be null";
|
||||
@@ -153,13 +152,11 @@ DockWidgetBase::DockWidgetBase(const QString &name, Options options)
|
||||
DockWidgetBase::~DockWidgetBase()
|
||||
{
|
||||
DockRegistry::self()->unregisterDockWidget(this);
|
||||
qCDebug(creation) << "~DockWidget" << this;
|
||||
delete d;
|
||||
}
|
||||
|
||||
void DockWidgetBase::addDockWidgetAsTab(DockWidgetBase *other, AddingOption addingOption)
|
||||
void DockWidgetBase::addDockWidgetAsTab(DockWidgetBase *other, InitialOption option)
|
||||
{
|
||||
qCDebug(addwidget) << Q_FUNC_INFO << other;
|
||||
if (other == this) {
|
||||
qWarning() << Q_FUNC_INFO << "Refusing to add dock widget into itself" << other;
|
||||
return;
|
||||
@@ -202,14 +199,17 @@ void DockWidgetBase::addDockWidgetAsTab(DockWidgetBase *other, AddingOption addi
|
||||
}
|
||||
|
||||
other->setParent(nullptr);
|
||||
frame->addWidget(other, addingOption);
|
||||
frame->addWidget(other, option);
|
||||
}
|
||||
|
||||
void DockWidgetBase::addDockWidgetToContainingWindow(DockWidgetBase *other, Location location, DockWidgetBase *relativeTo)
|
||||
void DockWidgetBase::addDockWidgetToContainingWindow(DockWidgetBase *other,
|
||||
Location location,
|
||||
DockWidgetBase *relativeTo,
|
||||
InitialOption initialOption)
|
||||
{
|
||||
qCDebug(addwidget) << Q_FUNC_INFO << other << location << relativeTo;
|
||||
if (qobject_cast<MainWindowBase*>(window())) {
|
||||
qWarning() << Q_FUNC_INFO << "Just use MainWindow::addWidget() directly. This function is for floating nested windows only.";
|
||||
if (auto mainWindow = qobject_cast<MainWindowBase*>(window())) {
|
||||
// It's inside a main window. Simply use the main window API.
|
||||
mainWindow->addDockWidget(other, location, relativeTo, initialOption);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ void DockWidgetBase::addDockWidgetToContainingWindow(DockWidgetBase *other, Loca
|
||||
morphIntoFloatingWindow();
|
||||
|
||||
if (auto fw = floatingWindow()) {
|
||||
fw->dropArea()->addDockWidget(other, location, relativeTo);
|
||||
fw->dropArea()->addDockWidget(other, location, relativeTo, initialOption);
|
||||
} else {
|
||||
qWarning() << Q_FUNC_INFO << "Couldn't find floating nested window";
|
||||
}
|
||||
@@ -238,7 +238,6 @@ void DockWidgetBase::addDockWidgetToContainingWindow(DockWidgetBase *other, Loca
|
||||
void DockWidgetBase::setWidget(QWidgetOrQuick *w)
|
||||
{
|
||||
Q_ASSERT(w);
|
||||
qCDebug(addwidget) << Q_FUNC_INFO << w;
|
||||
if (w == d->widget)
|
||||
return;
|
||||
|
||||
@@ -276,6 +275,12 @@ bool DockWidgetBase::setFloating(bool floats)
|
||||
if ((floats && alreadyFloating) || (!floats && !alreadyFloating))
|
||||
return true; // Nothing to do
|
||||
|
||||
if (!floats && (Config::self().internalFlags() & Config::InternalFlag_DontShowWhenUnfloatingHiddenWindow) && !isVisible()) {
|
||||
// Mimics behaviour of QDockWidget, which you might need during porting.
|
||||
// Not something we suggest though. For KDDW, setFloating(false) means dock, and that implies showing.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (floats) {
|
||||
d->saveTabIndex();
|
||||
if (isTabbed()) {
|
||||
@@ -387,6 +392,9 @@ void DockWidgetBase::setIcon(const QIcon &icon, IconPlaces places)
|
||||
if (places & IconPlace::TabBar)
|
||||
d->tabBarIcon = icon;
|
||||
|
||||
if (places & IconPlace::ToggleAction)
|
||||
d->toggleAction->setIcon(icon);
|
||||
|
||||
Q_EMIT iconChanged();
|
||||
}
|
||||
|
||||
@@ -398,6 +406,9 @@ QIcon DockWidgetBase::icon(IconPlace place) const
|
||||
if (place == IconPlace::TabBar)
|
||||
return d->tabBarIcon;
|
||||
|
||||
if (place == IconPlace::ToggleAction)
|
||||
return d->toggleAction->icon();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -517,11 +528,18 @@ bool DockWidgetBase::hasPreviousDockedLocation() const
|
||||
return d->m_lastPositions.isValid();
|
||||
}
|
||||
|
||||
QSize DockWidgetBase::lastOverlayedSize() const
|
||||
{
|
||||
return d->m_lastOverlayedSize;
|
||||
}
|
||||
|
||||
DockWidgetBase *DockWidgetBase::byName(const QString &uniqueName)
|
||||
{
|
||||
return DockRegistry::self()->dockByName(uniqueName);
|
||||
}
|
||||
|
||||
FloatingWindow *DockWidgetBase::morphIntoFloatingWindow()
|
||||
{
|
||||
qCDebug(creation) << "DockWidget::morphIntoFloatingWindow() this=" << this
|
||||
<< "; visible=" << isVisible();
|
||||
|
||||
if (auto fw = floatingWindow())
|
||||
return fw; // Nothing to do
|
||||
|
||||
@@ -573,7 +591,6 @@ FloatingWindow *DockWidgetBase::floatingWindow() const
|
||||
|
||||
void DockWidgetBase::addPlaceholderItem(Layouting::Item *item)
|
||||
{
|
||||
qCDebug(placeholder) << Q_FUNC_INFO << this << item;
|
||||
Q_ASSERT(item);
|
||||
d->m_lastPositions.addPosition(item);
|
||||
}
|
||||
@@ -680,7 +697,6 @@ void DockWidgetBase::Private::close()
|
||||
m_lastPositions.setLastFloatingGeometry(q->window()->geometry());
|
||||
}
|
||||
|
||||
qCDebug(hiding) << "DockWidget::close" << this;
|
||||
saveTabIndex();
|
||||
|
||||
// Do some cleaning. Widget is hidden, but we must hide the tab containing it.
|
||||
@@ -715,7 +731,6 @@ void DockWidgetBase::Private::maybeRestoreToPreviousPosition()
|
||||
return;
|
||||
|
||||
Layouting::Item *layoutItem = m_lastPositions.lastItem();
|
||||
qCDebug(placeholder) << Q_FUNC_INFO << layoutItem << m_lastPositions;
|
||||
if (!layoutItem)
|
||||
return; // nothing to do, no last position
|
||||
|
||||
@@ -727,7 +742,6 @@ void DockWidgetBase::Private::maybeRestoreToPreviousPosition()
|
||||
if (frame && frame->QWidgetAdapter::parentWidget() == DockRegistry::self()->layoutForItem(layoutItem)) {
|
||||
// There's a frame already. Means the DockWidget was hidden instead of closed.
|
||||
// Nothing to do, the dock widget will simply be shown
|
||||
qCDebug(placeholder) << Q_FUNC_INFO << "Already had frame.";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -735,7 +749,6 @@ void DockWidgetBase::Private::maybeRestoreToPreviousPosition()
|
||||
|
||||
if (q->parentWidget()) {
|
||||
// The QEvent::Show is due to it being made floating. Nothing to restore.
|
||||
qCDebug(placeholder) << Q_FUNC_INFO << "Already had parentWidget";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -762,7 +775,12 @@ void DockWidgetBase::Private::show()
|
||||
|
||||
void DockWidgetBase::onParentChanged()
|
||||
{
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
// TODO: In v1.4, remove this part and use the signal emitting the arg
|
||||
Q_EMIT parentChanged();
|
||||
#else
|
||||
Q_EMIT parentChanged(this);
|
||||
#endif
|
||||
d->updateToggleAction();
|
||||
d->updateFloatAction();
|
||||
}
|
||||
@@ -796,6 +814,19 @@ void DockWidgetBase::onHidden(bool spontaneous)
|
||||
}
|
||||
}
|
||||
|
||||
bool DockWidgetBase::onResize(QSize newSize)
|
||||
{
|
||||
if (isOverlayed()) {
|
||||
if (auto frame = this->frame()) {
|
||||
d->m_lastOverlayedSize = frame->QWidgetAdapter::size();
|
||||
} else {
|
||||
qWarning() << Q_FUNC_INFO << "Overlayed dock widget without frame shouldn't happen";
|
||||
}
|
||||
}
|
||||
|
||||
return QWidgetAdapter::onResize(newSize);
|
||||
}
|
||||
|
||||
void DockWidgetBase::onCloseEvent(QCloseEvent *e)
|
||||
{
|
||||
e->accept(); // By default we accept, means DockWidget closes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
#include <QVector>
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
QT_END_NAMESPACE
|
||||
@@ -36,75 +38,6 @@ namespace Layouting {
|
||||
class Item;
|
||||
}
|
||||
|
||||
#if defined(QT_WIDGETS_LIB)
|
||||
# include <QAction>
|
||||
#else
|
||||
// A QAction for QtQuick. Just so it compiles, for now
|
||||
class QAction : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using QObject::QObject;
|
||||
|
||||
bool isChecked() const {
|
||||
return m_isChecked ;
|
||||
}
|
||||
|
||||
void setCheckable(bool is) {
|
||||
m_isCheckable = is;
|
||||
}
|
||||
|
||||
void setText(const QString &text) {
|
||||
m_text = text;
|
||||
}
|
||||
|
||||
void setToolTip(const QString &text) {
|
||||
m_toolTip = text;
|
||||
}
|
||||
|
||||
QString toolTip() const {
|
||||
returm m_toolTip;
|
||||
}
|
||||
|
||||
bool enabled() const {
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
void setEnabled(bool enabled) {
|
||||
m_enabled = enabled;
|
||||
}
|
||||
|
||||
bool checked() const {
|
||||
return m_checked;
|
||||
}
|
||||
|
||||
void setChecked(bool checked) {
|
||||
m_checked = checked;
|
||||
}
|
||||
|
||||
bool isEnabled() const {
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
void toggle() {
|
||||
m_enabled = !m_enabled;
|
||||
Q_EMIT toggled(m_enabled);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
bool toggled(bool);
|
||||
private:
|
||||
QString m_text;
|
||||
QString m_toolTip;
|
||||
|
||||
bool m_isChecked = false;
|
||||
bool m_isCheckable = false;
|
||||
bool m_enabled = false;
|
||||
bool m_checked = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
namespace KDDockWidgets {
|
||||
|
||||
struct LastPositions;
|
||||
@@ -141,7 +74,7 @@ public:
|
||||
///@brief DockWidget options to pass at construction time
|
||||
enum Option {
|
||||
Option_None = 0, ///< No option, the default
|
||||
Option_NotClosable = 1, /// The DockWidget can't be closed on the [x], only programatically
|
||||
Option_NotClosable = 1, ///< The DockWidget can't be closed on the [x], only programatically
|
||||
Option_NotDockable = 2 ///< The DockWidget can't be docked, it's always floating
|
||||
};
|
||||
Q_DECLARE_FLAGS(Options, Option)
|
||||
@@ -149,7 +82,8 @@ public:
|
||||
enum class IconPlace {
|
||||
TitleBar = 1,
|
||||
TabBar = 2,
|
||||
All = TitleBar | TabBar
|
||||
ToggleAction = 4,
|
||||
All = ToggleAction | TitleBar | TabBar
|
||||
};
|
||||
Q_ENUM(IconPlace)
|
||||
Q_DECLARE_FLAGS(IconPlaces, IconPlace)
|
||||
@@ -167,26 +101,15 @@ public:
|
||||
///@brief destructor
|
||||
~DockWidgetBase() override;
|
||||
|
||||
/**
|
||||
* @brief Constructs a dock widget from its serialized form.
|
||||
* @internal
|
||||
*/
|
||||
static DockWidgetBase *deserialize(const LayoutSaver::DockWidget::Ptr &);
|
||||
|
||||
/**
|
||||
* @brief Serializes this dock widget into an intermediate form
|
||||
*/
|
||||
LayoutSaver::DockWidget::Ptr serialize() const;
|
||||
|
||||
/**
|
||||
* @brief docks @p other widget into this one. Tabs will be shown if not already.
|
||||
* @param other The other dock widget to dock into this one.
|
||||
* @param addingOption Allows to specify an AddingOption. Which is useful to add the dock widget
|
||||
* @param initialOption Allows to specify an InitialOption. Which is useful to add the dock widget
|
||||
* as hidden, recording only a placeholder in the tab. So it's restored to tabbed when eventually
|
||||
* shown.
|
||||
* @sa MainWindow::addDockWidget(), DockWidget::addDockWidgetToContainingWindow()
|
||||
*/
|
||||
void addDockWidgetAsTab(DockWidgetBase *other, AddingOption addingOption = AddingOption_None);
|
||||
void addDockWidgetAsTab(DockWidgetBase *other, InitialOption initialOption = {});
|
||||
|
||||
/**
|
||||
* @brief docks @p other widget into the window that contains this one.
|
||||
@@ -196,11 +119,13 @@ public:
|
||||
*
|
||||
* @param other The other dock widget to dock into the window.
|
||||
* @param location The location to dock.
|
||||
* @param relativeTo The dock widget that the @p location is relative to. If null then the window is considered.
|
||||
* @param relativeTo The dock widget that the @p location is relative to. If null then the window is considered
|
||||
* @param initialOption Allows to specify some extra options that are used while docking.
|
||||
* @sa MainWindow::addDockWidget(), DockWidget::addDockWidgetAsTab()
|
||||
*/
|
||||
void addDockWidgetToContainingWindow(DockWidgetBase *other, KDDockWidgets::Location location,
|
||||
DockWidgetBase *relativeTo = nullptr);
|
||||
DockWidgetBase *relativeTo = nullptr,
|
||||
InitialOption initialOption = {});
|
||||
|
||||
/**
|
||||
* @brief sets the widget which this dock widget hosts.
|
||||
@@ -307,7 +232,7 @@ public:
|
||||
|
||||
/**
|
||||
* @brief Sets an icon to show on title bars and tab bars.
|
||||
* @param places Specifies where the icon will be shown (TitleBar, TabBar or both)
|
||||
* @param places Specifies where the icon will be shown (TitleBar, TabBar, ToggleAction, or All)
|
||||
*
|
||||
* By default there's no icon set.
|
||||
*
|
||||
@@ -316,7 +241,7 @@ public:
|
||||
void setIcon(const QIcon &icon, IconPlaces places = IconPlace::All);
|
||||
|
||||
/**
|
||||
* @brief Returns the dock widget's titlebar or tabbar icon (depending on the passed @p place)
|
||||
* @brief Returns the dock widget's titlebar, tabbar, or toggle action icon (depending on the passed @p place)
|
||||
*
|
||||
* By default it's null.
|
||||
*
|
||||
@@ -440,9 +365,21 @@ public:
|
||||
/// When you call dockWidget->setFloating(false) it will only dock if it knows where to.
|
||||
bool hasPreviousDockedLocation() const;
|
||||
|
||||
/// @brief returns the last size the widget has when overlayed
|
||||
/// Empty otherwise
|
||||
QSize lastOverlayedSize() const;
|
||||
|
||||
|
||||
/// @brief Returns a dock widget by its name
|
||||
/// This is the same name you passed to DockWidget CTOR.
|
||||
/// nullptr is returned if the dock widget isn't found.
|
||||
static DockWidgetBase* byName(const QString &uniqueName);
|
||||
|
||||
Q_SIGNALS:
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
///@brief signal emitted when the parent changed
|
||||
void parentChanged();
|
||||
#endif
|
||||
|
||||
///@brief signal emitted when the DockWidget is shown. As in QEvent::Show.
|
||||
void shown();
|
||||
@@ -473,7 +410,7 @@ Q_SIGNALS:
|
||||
void isOverlayedChanged(bool);
|
||||
|
||||
///@brief emitted when isFloating changes
|
||||
bool isFloatingChanged(bool);
|
||||
void isFloatingChanged(bool);
|
||||
|
||||
///@brief emitted when this dock widget is removed from a side-bar.
|
||||
///Only relevant for the auto-hide/sidebar feature
|
||||
@@ -491,8 +428,10 @@ protected:
|
||||
void onParentChanged();
|
||||
void onShown(bool spontaneous);
|
||||
void onHidden(bool spontaneous);
|
||||
|
||||
#ifndef PYTHON_BINDINGS //Pyside bug: https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1327
|
||||
void onCloseEvent(QCloseEvent *e) override;
|
||||
bool onResize(QSize newSize) override;
|
||||
#endif
|
||||
|
||||
#if defined(DOCKS_DEVELOPER_MODE)
|
||||
@@ -529,6 +468,17 @@ private:
|
||||
friend class KDDockWidgets::MainWindowBase;
|
||||
friend class KDDockWidgets::FrameQuick;
|
||||
|
||||
/**
|
||||
* @brief Constructs a dock widget from its serialized form.
|
||||
* @internal
|
||||
*/
|
||||
static DockWidgetBase *deserialize(const LayoutSaver::DockWidget::Ptr &);
|
||||
|
||||
/**
|
||||
* @brief Serializes this dock widget into an intermediate form
|
||||
*/
|
||||
LayoutSaver::DockWidget::Ptr serialize() const;
|
||||
|
||||
/**
|
||||
* @brief the Frame which contains this dock widgets.
|
||||
*
|
||||
@@ -569,4 +519,73 @@ private:
|
||||
}
|
||||
Q_DECLARE_METATYPE(KDDockWidgets::Location)
|
||||
|
||||
#if defined(QT_WIDGETS_LIB)
|
||||
# include <QAction>
|
||||
#else
|
||||
// A QAction for QtQuick. Just so it compiles, for now
|
||||
class QAction : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using QObject::QObject;
|
||||
|
||||
bool isChecked() const {
|
||||
return m_isChecked ;
|
||||
}
|
||||
|
||||
void setCheckable(bool is) {
|
||||
m_isCheckable = is;
|
||||
}
|
||||
|
||||
void setText(const QString &text) {
|
||||
m_text = text;
|
||||
}
|
||||
|
||||
void setToolTip(const QString &text) {
|
||||
m_toolTip = text;
|
||||
}
|
||||
|
||||
QString toolTip() const {
|
||||
returm m_toolTip;
|
||||
}
|
||||
|
||||
bool enabled() const {
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
void setEnabled(bool enabled) {
|
||||
m_enabled = enabled;
|
||||
}
|
||||
|
||||
bool checked() const {
|
||||
return m_checked;
|
||||
}
|
||||
|
||||
void setChecked(bool checked) {
|
||||
m_checked = checked;
|
||||
}
|
||||
|
||||
bool isEnabled() const {
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
void toggle() {
|
||||
m_enabled = !m_enabled;
|
||||
Q_EMIT toggled(m_enabled);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
bool toggled(bool);
|
||||
private:
|
||||
QString m_text;
|
||||
QString m_toolTip;
|
||||
|
||||
bool m_isChecked = false;
|
||||
bool m_isCheckable = false;
|
||||
bool m_enabled = false;
|
||||
bool m_checked = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -29,7 +29,7 @@
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
// Our Private inherits from QObject since FocusScope can't (Since Frame is already QObject)
|
||||
class FocusScope::Private : public QObject
|
||||
class FocusScope::Private : public QObject //clazy:exclude=missing-qobject-macro (breaks unity build with earlier cmake due to including .moc here.)
|
||||
{
|
||||
public:
|
||||
Private(FocusScope *qq, QWidgetAdapter *thisWidget)
|
||||
@@ -109,7 +109,7 @@ void FocusScope::Private::setIsFocused(bool is)
|
||||
emitDockWidgetFocusChanged();
|
||||
|
||||
if (!m_inCtor) // Hack so we don't call pure-virtual
|
||||
Q_EMIT q->isFocusedChanged();
|
||||
/* Q_EMIT */ q->isFocusedChangedCallback();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ void FocusScope::Private::onFocusObjectChanged(QObject *obj)
|
||||
if (is && m_lastFocusedInScope != widget && !qobject_cast<TitleBar*>(obj)) {
|
||||
m_lastFocusedInScope = widget;
|
||||
setIsFocused(is);
|
||||
Q_EMIT q->focusedWidgetChanged();
|
||||
/* Q_EMIT */ q->focusedWidgetChangedCallback();
|
||||
} else {
|
||||
setIsFocused(is);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -27,6 +27,7 @@ namespace KDDockWidgets
|
||||
///@brief Allows to implement a similar functionality to QtQuick's FocusScope item, in QtWidgets
|
||||
class DOCKS_EXPORT FocusScope
|
||||
{
|
||||
Q_DISABLE_COPY(FocusScope)
|
||||
public:
|
||||
///@brief constructor
|
||||
explicit FocusScope(QWidgetAdapter *thisWidget);
|
||||
@@ -48,9 +49,10 @@ public:
|
||||
void focus(Qt::FocusReason = Qt::OtherFocusReason);
|
||||
|
||||
/*Q_SIGNALS:*/
|
||||
protected:
|
||||
///@brief reimplement in the 1st QObject derived class
|
||||
virtual void isFocusedChanged() = 0;
|
||||
virtual void focusedWidgetChanged() = 0;
|
||||
virtual void isFocusedChangedCallback() = 0;
|
||||
virtual void focusedWidgetChangedCallback() = 0;
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "indicators/ClassicIndicators_p.h"
|
||||
#include "indicators/NullIndicators_p.h"
|
||||
#include "Utils_p.h"
|
||||
#include "TabWidget_p.h"
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
# include "widgets/TabWidget_p.h"
|
||||
# include "widgets/FrameWidget_p.h"
|
||||
# include "widgets/TitleBarWidget_p.h"
|
||||
# include "widgets/TabBarWidget_p.h"
|
||||
@@ -36,11 +36,15 @@
|
||||
# include "DockWidgetQuick.h"
|
||||
# include "quick/FrameQuick_p.h"
|
||||
# include "quick/TitleBarQuick_p.h"
|
||||
# include "quick/TabWidgetQuick_p.h"
|
||||
# include "quick/TabBarQuick_p.h"
|
||||
# include "quick/FloatingWindowQuick_p.h"
|
||||
# include "quick/RubberBandQuick.h"
|
||||
# include "multisplitter/Separator_quick.h"
|
||||
#endif
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
DropIndicatorType DefaultWidgetFactory::s_dropIndicatorType = DropIndicatorType::Classic;
|
||||
@@ -181,16 +185,12 @@ DropIndicatorOverlayInterface *DefaultWidgetFactory::createDropIndicatorOverlay(
|
||||
|
||||
TabBar *DefaultWidgetFactory::createTabBar(TabWidget *parent) const
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
Q_ASSERT(false);
|
||||
return nullptr;
|
||||
return new TabBarQuick(parent);
|
||||
}
|
||||
|
||||
TabWidget *DefaultWidgetFactory::createTabWidget(Frame *parent) const
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
Q_ASSERT(false);
|
||||
return nullptr;
|
||||
return new TabWidgetQuick(parent);
|
||||
}
|
||||
|
||||
Layouting::Separator *DefaultWidgetFactory::createSeparator(Layouting::Widget *parent) const
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "KDDockWidgets.h"
|
||||
#include "QWidgetAdapter.h"
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief A factory class for allowing the user to customize some internal widgets.
|
||||
@@ -43,6 +45,7 @@ class Frame;
|
||||
class DropArea;
|
||||
class SideBar;
|
||||
class TabBar;
|
||||
class TabWidgetQuick;
|
||||
|
||||
/**
|
||||
* @brief A factory class for allowing the user to customize some internal widgets.
|
||||
@@ -94,16 +97,16 @@ public:
|
||||
///@param floatingWindow Just forward to TitleBar's constructor.
|
||||
virtual TitleBar* createTitleBar(FloatingWindow *floatingWindow) const = 0;
|
||||
|
||||
///@brief Called internally by the framework to create a TabBar
|
||||
/// Override to provide your own TabBar sub-class.
|
||||
///@param parent Just forward to TabBar's's constructor.
|
||||
virtual TabBar* createTabBar(TabWidget *parent = nullptr) const = 0;
|
||||
|
||||
///@brief Called internally by the framework to create a TabWidget
|
||||
/// Override to provide your own TabWidget sub-class.
|
||||
///@param parent Just forward to TabWidget's constructor.
|
||||
virtual TabWidget* createTabWidget(Frame *parent) const = 0;
|
||||
|
||||
///@brief Called internally by the framework to create a TabBar
|
||||
/// Override to provide your own TabBar sub-class.
|
||||
///@param parent Just forward to TabBar's's constructor.
|
||||
virtual TabBar* createTabBar(TabWidget *parent = nullptr) const = 0;
|
||||
|
||||
///@brief Called internally by the framework to create a Separator
|
||||
/// Override to provide your own Separator sub-class. The Separator allows
|
||||
/// the user to resize nested dock widgets.
|
||||
@@ -157,13 +160,14 @@ private:
|
||||
*/
|
||||
class DOCKS_EXPORT DefaultWidgetFactory : public FrameworkWidgetFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DefaultWidgetFactory() = default;
|
||||
Frame *createFrame(QWidgetOrQuick *parent, FrameOptions) const override;
|
||||
TitleBar *createTitleBar(Frame *) const override;
|
||||
TitleBar *createTitleBar(FloatingWindow *) const override;
|
||||
TabBar *createTabBar(TabWidget *parent) const override;
|
||||
TabWidget *createTabWidget(Frame *parent) const override;
|
||||
TabBar *createTabBar(TabWidget *parent) const override;
|
||||
Layouting::Separator *createSeparator(Layouting::Widget *parent = nullptr) const override;
|
||||
FloatingWindow *createFloatingWindow(MainWindowBase *parent = nullptr) const override;
|
||||
FloatingWindow *createFloatingWindow(Frame *frame, MainWindowBase *parent = nullptr) const override;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -22,14 +22,23 @@
|
||||
#include "Qt5Qt6Compat_p.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// Only on Windows, where this is popular. On linux the Qt::Tool windows need reparenting. Untested on macOS.
|
||||
# define KDDOCKWIDGETS_SUPPORTS_NESTED_MAINWINDOWS
|
||||
#endif
|
||||
|
||||
namespace Layouting {
|
||||
class Item;
|
||||
class ItemBoxContainer;
|
||||
}
|
||||
|
||||
namespace KDDockWidgets
|
||||
{
|
||||
class MultiSplitter;
|
||||
class DropArea;
|
||||
|
||||
enum Location {
|
||||
Location_None,
|
||||
Location_OnLeft, ///> Left docking location
|
||||
@@ -44,9 +53,105 @@ namespace KDDockWidgets
|
||||
};
|
||||
Q_DECLARE_FLAGS(MainWindowOptions, MainWindowOption)
|
||||
|
||||
///@internal
|
||||
///@brief Describes some sizing strategies for the layouting engine.
|
||||
///This is internal. The public API for dealing with sizing is InitialOption.
|
||||
///@sa InitialOption
|
||||
enum class DefaultSizeMode {
|
||||
ItemSize, ///< Simply uses the Item::size() of the item being added. Actual used size might be smaller if our window isn't big enough.
|
||||
Fair, ///< Gives an equal relative size as the items that are already in the layout
|
||||
FairButFloor, ///< Equal to fair, but if the item we're adding is smaller than the fair suggestion, then that small size is used.
|
||||
None, ///< Don't do any sizing
|
||||
};
|
||||
|
||||
///@brief Only here for source-compat with v1.2. Do not use.
|
||||
///Use InitialVisibilityOption instead.
|
||||
enum AddingOption {
|
||||
AddingOption_None = 0, ///> No option set
|
||||
AddingOption_StartHidden ///< Don't show the dock widget when adding it
|
||||
AddingOption_None = 0,
|
||||
AddingOption_StartHidden
|
||||
};
|
||||
|
||||
enum class InitialVisibilityOption {
|
||||
StartVisible = 0, ///< The dock widget is made visible when docked
|
||||
StartHidden ///< Don't show the dock widget when adding it
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Struct describing the preferred dock widget size and visibility when adding it to a layout
|
||||
*
|
||||
* You can pass this to MainWindowBase::addDockWidget() to give an hint of your preferred size
|
||||
* and visibility.
|
||||
*
|
||||
* See bellow the documentation for InitialOption::visibility and InitialOption::preferredSize.
|
||||
*
|
||||
* @sa MainWindowBase::addDockWidget()
|
||||
*/
|
||||
struct InitialOption
|
||||
{
|
||||
// Implicit ctors for convenience:
|
||||
|
||||
InitialOption() = default;
|
||||
|
||||
InitialOption(InitialVisibilityOption v)
|
||||
: visibility(v) {}
|
||||
|
||||
InitialOption(QSize size)
|
||||
: preferredSize(size) {}
|
||||
|
||||
InitialOption(InitialVisibilityOption v, QSize size)
|
||||
: visibility(v)
|
||||
, preferredSize(size)
|
||||
{}
|
||||
|
||||
QT_DEPRECATED_X("AddingOption is deprecated and will be removed in v1.5. Use InitialVisibilityOption instead.")
|
||||
InitialOption(AddingOption opt)
|
||||
: visibility(opt == AddingOption_StartHidden ? InitialVisibilityOption::StartHidden
|
||||
: InitialVisibilityOption::StartVisible)
|
||||
{
|
||||
}
|
||||
|
||||
bool startsHidden() const {
|
||||
return visibility == InitialVisibilityOption::StartHidden;
|
||||
}
|
||||
|
||||
int preferredLength(Qt::Orientation o) const {
|
||||
return o == Qt::Horizontal ? preferredSize.width()
|
||||
: preferredSize.height();
|
||||
}
|
||||
|
||||
bool hasPreferredLength(Qt::Orientation o) const {
|
||||
return preferredLength(o) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Allows a dock widget to be docked as hidden.
|
||||
*
|
||||
* Next time you call DockWidget::show() it will be shown at that place. This avoids
|
||||
* flickering, as no show()/hide() workarounds are needed.
|
||||
*/
|
||||
const InitialVisibilityOption visibility = InitialVisibilityOption::StartVisible;
|
||||
|
||||
/**
|
||||
* @brief Allows to control the size a dock widget should get when docked.
|
||||
*
|
||||
* If an invalid or empty size is passed then KDDW's default heuristics are applied.
|
||||
*
|
||||
* Note that usually only the width or the height will be honoured: For example, when adding a
|
||||
* dock widget to the left then only the preferred width will be taken into account, as the
|
||||
* height will simply fill the whole layout.
|
||||
*/
|
||||
const QSize preferredSize;
|
||||
|
||||
private:
|
||||
friend class Layouting::Item;
|
||||
friend class Layouting::ItemBoxContainer;
|
||||
friend class KDDockWidgets::MultiSplitter;
|
||||
friend class KDDockWidgets::DropArea;
|
||||
|
||||
InitialOption(DefaultSizeMode mode)
|
||||
: sizeMode(mode) {}
|
||||
|
||||
const DefaultSizeMode sizeMode = DefaultSizeMode::Fair;
|
||||
};
|
||||
|
||||
///@internal
|
||||
@@ -65,15 +170,6 @@ namespace KDDockWidgets
|
||||
};
|
||||
Q_DECLARE_FLAGS(RestoreOptions, RestoreOption)
|
||||
|
||||
///@brief When a widget is added we need to figure out what's a decent size for it
|
||||
///This enum specifies the different ways to calculate it
|
||||
enum class DefaultSizeMode {
|
||||
ItemSize, ///< Simply uses the Item::size() of the item being added. Actual used size might be smaller if our window isn't big enough.
|
||||
Fair, ///< Gives an equal relative size as the items that are already in the layout
|
||||
FairButFloor, ///< Equal to fair, but if the item is smaller than the fair suggestion, then that small size is used.
|
||||
SizePolicy, ///< Uses the item's sizeHint() and sizePolicy()
|
||||
};
|
||||
|
||||
enum class DropIndicatorType {
|
||||
Classic, ///< The default
|
||||
Segmented, ///< Segmented indicators
|
||||
@@ -126,6 +222,16 @@ namespace KDDockWidgets
|
||||
}
|
||||
}
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
///@internal
|
||||
inline QDebug operator<<(QDebug d, KDDockWidgets::InitialOption o)
|
||||
{
|
||||
d << o.startsHidden();
|
||||
return d;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(KDDockWidgets::FrameOptions)
|
||||
Q_DECLARE_METATYPE(KDDockWidgets::InitialVisibilityOption)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# This file is part of KDDockWidgets.
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
# Author: Jean-Michaël Celerier <jean-michael.celerier@kdab.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "Logging_p.h"
|
||||
#include "Frame_p.h"
|
||||
#include "Position_p.h"
|
||||
#include "multisplitter/Item_p.h"
|
||||
#include "FrameworkWidgetFactory.h"
|
||||
#include "MainWindowBase.h"
|
||||
#include "FloatingWindow_p.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -272,7 +272,9 @@ public:
|
||||
s_currentLayoutBeingRestored = this;
|
||||
|
||||
const QList<QScreen*> screens = qApp->screens();
|
||||
for (int i = 0; i < screens.size(); ++i) {
|
||||
const int numScreens = screens.size();
|
||||
screenInfo.reserve(numScreens);
|
||||
for (int i = 0; i < numScreens; ++i) {
|
||||
ScreenInfo info;
|
||||
info.index = i;
|
||||
info.geometry = screens[i]->geometry();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QPainter>
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument,missing-qobject-macro
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
class MainWindow::Private
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "Utils_p.h"
|
||||
#include "SideBar_p.h"
|
||||
#include "Logging_p.h"
|
||||
#include "Item_p.h"
|
||||
#include "WidgetResizeHandler_p.h"
|
||||
#include "FrameworkWidgetFactory.h"
|
||||
#include "DropAreaWithCentralFrame_p.h"
|
||||
|
||||
@@ -45,9 +45,11 @@ public:
|
||||
return m_options & MainWindowOption_HasCentralFrame;
|
||||
}
|
||||
|
||||
WidgetResizeHandler::CursorPositions allowedResizeSides(SideBarLocation loc) const;
|
||||
|
||||
QRect rectForOverlay(Frame *, SideBarLocation) const;
|
||||
SideBarLocation preferredSideBar(DockWidgetBase *) const;
|
||||
void updateOverlayGeometry();
|
||||
void updateOverlayGeometry(bool reusePreviousSize = false);
|
||||
void clearSideBars();
|
||||
|
||||
QString name;
|
||||
@@ -95,7 +97,8 @@ void MainWindowBase::addDockWidgetAsTab(DockWidgetBase *widget)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowBase::addDockWidget(DockWidgetBase *dw, Location location, DockWidgetBase *relativeTo, AddingOption option)
|
||||
void MainWindowBase::addDockWidget(DockWidgetBase *dw, Location location,
|
||||
DockWidgetBase *relativeTo, InitialOption option)
|
||||
{
|
||||
if (dw->options() & DockWidgetBase::Option_NotDockable) {
|
||||
qWarning() << Q_FUNC_INFO << "Refusing to dock non-dockable widget" << dw;
|
||||
@@ -158,6 +161,27 @@ void MainWindowBase::layoutParentContainerEqually(DockWidgetBase *dockWidget)
|
||||
dropArea()->layoutParentContainerEqually(dockWidget);
|
||||
}
|
||||
|
||||
WidgetResizeHandler::CursorPositions MainWindowBase::Private::allowedResizeSides(SideBarLocation loc) const
|
||||
{
|
||||
// When a sidebar is on top, you can only resize its bottom.
|
||||
// and so forth...
|
||||
|
||||
switch (loc) {
|
||||
case SideBarLocation::North:
|
||||
return WidgetResizeHandler::CursorPosition_Bottom;
|
||||
case SideBarLocation::East:
|
||||
return WidgetResizeHandler::CursorPosition_Left;
|
||||
case SideBarLocation::West:
|
||||
return WidgetResizeHandler::CursorPosition_Right;
|
||||
case SideBarLocation::South:
|
||||
return WidgetResizeHandler::CursorPosition_Top;
|
||||
case SideBarLocation::None:
|
||||
return WidgetResizeHandler::CursorPosition_Undefined;
|
||||
}
|
||||
|
||||
return WidgetResizeHandler::CursorPosition_Undefined;
|
||||
}
|
||||
|
||||
QRect MainWindowBase::Private::rectForOverlay(Frame *frame, SideBarLocation location) const
|
||||
{
|
||||
SideBar *sb = q->sideBar(location);
|
||||
@@ -215,21 +239,21 @@ QRect MainWindowBase::Private::rectForOverlay(Frame *frame, SideBarLocation loca
|
||||
return rect;
|
||||
}
|
||||
|
||||
static SideBarLocation opposedSideBarLocationForBorder(Layouting::Item::LayoutBorderLocation loc)
|
||||
static SideBarLocation opposedSideBarLocationForBorder(Layouting::LayoutBorderLocation loc)
|
||||
{
|
||||
switch (loc) {
|
||||
case Layouting::Item::LayoutBorderLocation_North:
|
||||
case Layouting::LayoutBorderLocation_North:
|
||||
return SideBarLocation::South;
|
||||
case Layouting::Item::LayoutBorderLocation_East:
|
||||
case Layouting::LayoutBorderLocation_East:
|
||||
return SideBarLocation::West;
|
||||
case Layouting::Item::LayoutBorderLocation_West:
|
||||
case Layouting::LayoutBorderLocation_West:
|
||||
return SideBarLocation::East;
|
||||
case Layouting::Item::LayoutBorderLocation_South:
|
||||
case Layouting::LayoutBorderLocation_South:
|
||||
return SideBarLocation::North;
|
||||
case Layouting::Item::LayoutBorderLocation_All:
|
||||
case Layouting::Item::LayoutBorderLocation_Verticals:
|
||||
case Layouting::Item::LayoutBorderLocation_Horizontals:
|
||||
case Layouting::Item::LayoutBorderLocation_None:
|
||||
case Layouting::LayoutBorderLocation_All:
|
||||
case Layouting::LayoutBorderLocation_Verticals:
|
||||
case Layouting::LayoutBorderLocation_Horizontals:
|
||||
case Layouting::LayoutBorderLocation_None:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -237,21 +261,21 @@ static SideBarLocation opposedSideBarLocationForBorder(Layouting::Item::LayoutBo
|
||||
return SideBarLocation::None;
|
||||
}
|
||||
|
||||
static SideBarLocation sideBarLocationForBorder(Layouting::Item::LayoutBorderLocations loc)
|
||||
static SideBarLocation sideBarLocationForBorder(Layouting::LayoutBorderLocations loc)
|
||||
{
|
||||
switch (loc) {
|
||||
case Layouting::Item::LayoutBorderLocation_North:
|
||||
case Layouting::LayoutBorderLocation_North:
|
||||
return SideBarLocation::North;
|
||||
case Layouting::Item::LayoutBorderLocation_East:
|
||||
case Layouting::LayoutBorderLocation_East:
|
||||
return SideBarLocation::East;
|
||||
case Layouting::Item::LayoutBorderLocation_West:
|
||||
case Layouting::LayoutBorderLocation_West:
|
||||
return SideBarLocation::West;
|
||||
case Layouting::Item::LayoutBorderLocation_South:
|
||||
case Layouting::LayoutBorderLocation_South:
|
||||
return SideBarLocation::South;
|
||||
case Layouting::Item::LayoutBorderLocation_All:
|
||||
case Layouting::Item::LayoutBorderLocation_Verticals:
|
||||
case Layouting::Item::LayoutBorderLocation_Horizontals:
|
||||
case Layouting::Item::LayoutBorderLocation_None:
|
||||
case Layouting::LayoutBorderLocation_All:
|
||||
case Layouting::LayoutBorderLocation_Verticals:
|
||||
case Layouting::LayoutBorderLocation_Horizontals:
|
||||
case Layouting::LayoutBorderLocation_None:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -268,45 +292,45 @@ SideBarLocation MainWindowBase::Private::preferredSideBar(DockWidgetBase *dw) co
|
||||
return SideBarLocation::None;
|
||||
}
|
||||
|
||||
const Layouting::Item::LayoutBorderLocations borders = item->adjacentLayoutBorders();
|
||||
const Layouting::LayoutBorderLocations borders = item->adjacentLayoutBorders();
|
||||
const qreal aspectRatio = dw->width() / (dw->height() * 1.0);
|
||||
|
||||
/// 1. It's touching all borders
|
||||
if (borders == Layouting::Item::LayoutBorderLocation_All) {
|
||||
if (borders == Layouting::LayoutBorderLocation_All) {
|
||||
return aspectRatio > 1.0 ? SideBarLocation::South
|
||||
: SideBarLocation::East;
|
||||
}
|
||||
|
||||
/// 2. It's touching 3 borders
|
||||
for (auto borderLoc : { Layouting::Item::LayoutBorderLocation_North, Layouting::Item::LayoutBorderLocation_East,
|
||||
Layouting::Item::LayoutBorderLocation_West, Layouting::Item::LayoutBorderLocation_South }) {
|
||||
if (borders == (Layouting::Item::LayoutBorderLocation_All & ~borderLoc))
|
||||
for (auto borderLoc : { Layouting::LayoutBorderLocation_North, Layouting::LayoutBorderLocation_East,
|
||||
Layouting::LayoutBorderLocation_West, Layouting::LayoutBorderLocation_South }) {
|
||||
if (borders == (Layouting::LayoutBorderLocation_All & ~borderLoc))
|
||||
return opposedSideBarLocationForBorder(borderLoc);
|
||||
}
|
||||
|
||||
/// 3. It's touching left and right borders
|
||||
if ((borders & Layouting::Item::LayoutBorderLocation_Verticals) == Layouting::Item::LayoutBorderLocation_Verticals) {
|
||||
if ((borders & Layouting::LayoutBorderLocation_Verticals) == Layouting::LayoutBorderLocation_Verticals) {
|
||||
// We could measure the distance to the top though.
|
||||
return SideBarLocation::South;
|
||||
}
|
||||
|
||||
/// 4. It's touching top and bottom borders
|
||||
if ((borders & Layouting::Item::LayoutBorderLocation_Horizontals) == Layouting::Item::LayoutBorderLocation_Horizontals) {
|
||||
if ((borders & Layouting::LayoutBorderLocation_Horizontals) == Layouting::LayoutBorderLocation_Horizontals) {
|
||||
// We could measure the distance to the left though.
|
||||
return SideBarLocation::East;
|
||||
}
|
||||
|
||||
// 5. It's in a corner
|
||||
if (borders == (Layouting::Item::LayoutBorderLocation_West | Layouting::Item::LayoutBorderLocation_South)) {
|
||||
if (borders == (Layouting::LayoutBorderLocation_West | Layouting::LayoutBorderLocation_South)) {
|
||||
return aspectRatio > 1.0 ? SideBarLocation::South
|
||||
: SideBarLocation::West;
|
||||
} else if (borders == (Layouting::Item::LayoutBorderLocation_East | Layouting::Item::LayoutBorderLocation_South)) {
|
||||
} else if (borders == (Layouting::LayoutBorderLocation_East | Layouting::LayoutBorderLocation_South)) {
|
||||
return aspectRatio > 1.0 ? SideBarLocation::South
|
||||
: SideBarLocation::East;
|
||||
} else if (borders == (Layouting::Item::LayoutBorderLocation_West | Layouting::Item::LayoutBorderLocation_North)) {
|
||||
} else if (borders == (Layouting::LayoutBorderLocation_West | Layouting::LayoutBorderLocation_North)) {
|
||||
return aspectRatio > 1.0 ? SideBarLocation::North
|
||||
: SideBarLocation::West;
|
||||
} else if (borders == (Layouting::Item::LayoutBorderLocation_East | Layouting::Item::LayoutBorderLocation_North)) {
|
||||
} else if (borders == (Layouting::LayoutBorderLocation_East | Layouting::LayoutBorderLocation_North)) {
|
||||
return aspectRatio > 1.0 ? SideBarLocation::North
|
||||
: SideBarLocation::East;
|
||||
}
|
||||
@@ -324,7 +348,7 @@ SideBarLocation MainWindowBase::Private::preferredSideBar(DockWidgetBase *dw) co
|
||||
: SideBarLocation::West;
|
||||
}
|
||||
|
||||
void MainWindowBase::Private::updateOverlayGeometry()
|
||||
void MainWindowBase::Private::updateOverlayGeometry(bool reusePreviousSize)
|
||||
{
|
||||
if (!m_overlayedDockWidget)
|
||||
return;
|
||||
@@ -335,7 +359,46 @@ void MainWindowBase::Private::updateOverlayGeometry()
|
||||
return;
|
||||
}
|
||||
|
||||
m_overlayedDockWidget->frame()->QWidgetAdapter::setGeometry(rectForOverlay(m_overlayedDockWidget->frame(), sb->location()));
|
||||
const QRect defaultGeometry = rectForOverlay(m_overlayedDockWidget->frame(), sb->location());
|
||||
QRect newGeometry = defaultGeometry;
|
||||
|
||||
Frame *frame = m_overlayedDockWidget->frame();
|
||||
|
||||
if (reusePreviousSize) {
|
||||
// Let's try to honour the previous overlay size
|
||||
switch (sb->location()) {
|
||||
case SideBarLocation::North: {
|
||||
const int maxHeight = q->height() - frame->pos().y() - 10; // gap
|
||||
newGeometry.setHeight(qMin(frame->height(), maxHeight));
|
||||
break;
|
||||
}
|
||||
case SideBarLocation::South: {
|
||||
const int maxHeight = sb->pos().y() - m_dropArea->pos().y() - 10; // gap
|
||||
const int bottom = newGeometry.bottom();
|
||||
newGeometry.setHeight(qMin(frame->height(), maxHeight));
|
||||
newGeometry.moveBottom(bottom);
|
||||
break;
|
||||
}
|
||||
case SideBarLocation::East: {
|
||||
const int maxWidth = sb->pos().x() - m_dropArea->pos().x() - 10; // gap
|
||||
const int right = newGeometry.right();
|
||||
newGeometry.setWidth(qMin(frame->width(), maxWidth));
|
||||
newGeometry.moveRight(right);
|
||||
break;
|
||||
}
|
||||
case SideBarLocation::West: {
|
||||
const int maxWidth = q->width() - frame->pos().x() - 10; // gap
|
||||
newGeometry.setWidth(qMin(frame->height(), maxWidth));
|
||||
break;
|
||||
}
|
||||
case SideBarLocation::None:
|
||||
qWarning() << Q_FUNC_INFO << "Unexpected sidebar value";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
m_overlayedDockWidget->frame()->QWidgetAdapter::setGeometry(newGeometry);
|
||||
}
|
||||
|
||||
void MainWindowBase::Private::clearSideBars()
|
||||
@@ -386,7 +449,7 @@ void MainWindowBase::overlayOnSideBar(DockWidgetBase *dw)
|
||||
return;
|
||||
|
||||
const SideBar *sb = sideBarForDockWidget(dw);
|
||||
if (sb == nullptr) {
|
||||
if (!sb) {
|
||||
qWarning() << Q_FUNC_INFO << "You need to add the dock widget to the sidebar before you can overlay it";
|
||||
return;
|
||||
}
|
||||
@@ -402,7 +465,12 @@ void MainWindowBase::overlayOnSideBar(DockWidgetBase *dw)
|
||||
auto frame = Config::self().frameworkWidgetFactory()->createFrame(this, FrameOption_IsOverlayed);
|
||||
d->m_overlayedDockWidget = dw;
|
||||
frame->addWidget(dw);
|
||||
d->updateOverlayGeometry();
|
||||
d->updateOverlayGeometry(/*reusePreviousSize=*/ false);
|
||||
|
||||
// Uncomment once I'm happy with the resizing
|
||||
auto resizeHandler = new WidgetResizeHandler(true, frame);
|
||||
resizeHandler->setAllowedResizeSides(d->allowedResizeSides(sb->location()));
|
||||
|
||||
frame->QWidgetAdapter::show();
|
||||
|
||||
Q_EMIT dw->isOverlayedChanged(true);
|
||||
@@ -485,7 +553,7 @@ void MainWindowBase::setUniqueName(const QString &uniqueName)
|
||||
void MainWindowBase::onResized(QResizeEvent *)
|
||||
{
|
||||
if (d->m_overlayedDockWidget)
|
||||
d->updateOverlayGeometry();
|
||||
d->updateOverlayGeometry(/*reusePreviousSize=*/ true);
|
||||
}
|
||||
|
||||
bool MainWindowBase::deserialize(const LayoutSaver::MainWindow &mw)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -74,11 +74,14 @@ public:
|
||||
* @param dockWidget The dock widget to add into this MainWindow
|
||||
* @param location the location where to dock
|
||||
* @param relativeTo In case we're docking in relation to another dock widget
|
||||
* @param option AddingOptions
|
||||
* @param initialOption Allows to specify an InitialOption. Which is useful to add the dock widget
|
||||
* as hidden, recording only a placeholder in the tab. So it's restored to tabbed when eventually
|
||||
* shown.
|
||||
*/
|
||||
void addDockWidget(DockWidgetBase *dockWidget,
|
||||
KDDockWidgets::Location location,
|
||||
DockWidgetBase *relativeTo = nullptr, AddingOption option = KDDockWidgets::AddingOption());
|
||||
DockWidgetBase *relativeTo = nullptr,
|
||||
InitialOption initialOption = {});
|
||||
|
||||
/**
|
||||
* @brief Returns the unique name that was passed via constructor.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
@@ -73,6 +73,7 @@ namespace KDDockWidgets {
|
||||
class LayoutGuestWidget : public KDDockWidgets::QWidgetAdapter
|
||||
, public LayoutGuestWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LayoutGuestWidget(QWidgetOrQuick *parent)
|
||||
: QWidgetAdapter(parent)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
@@ -20,6 +20,8 @@ namespace Qt5Qt6Compat {
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
|
||||
#define QQUICKITEMgeometryChanged geometryChange
|
||||
|
||||
using QEnterEvent = QEnterEvent;
|
||||
using qintptr = ::qintptr;
|
||||
using qhashtype = size_t;
|
||||
@@ -34,8 +36,9 @@ inline QPoint eventGlobalPos(QMouseEvent *ev)
|
||||
return ev->globalPosition().toPoint();
|
||||
}
|
||||
|
||||
#else
|
||||
// Qt 5:
|
||||
#else // Qt 5:
|
||||
|
||||
#define QQUICKITEMgeometryChanged geometryChanged
|
||||
|
||||
using QEnterEvent = QEvent;
|
||||
using qintptr = long;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "../../../../private/widgets/TabWidget_p.h"
|
||||
#include "../../KDDockWidgets.h"
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
SPDX-FileCopyrightText: 2020-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
|
||||
|
||||
12
src/fwd_headers/kddockwidgets/private/LayoutSaver_p.h
Normal file
12
src/fwd_headers/kddockwidgets/private/LayoutSaver_p.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-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.
|
||||
*/
|
||||
|
||||
#include "../../../LayoutSaver_p.h"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user