Compare commits

...

873 Commits

Author SHA1 Message Date
Allen Winter
9990300006 distro/qt5-kddockwidgets.spec - add BuildRequires for SUSE
libqt5-qtbase-private-headers-devel is needed
2021-11-24 12:32:06 -05:00
Allen Winter
573e82e9eb update 1.5.0 release date 2021-11-24 12:20:15 -05:00
Allen Winter
07a135a10a ECMGeneratePriFile.cmake - restore "Fix issues with pri file"
commit b81c32b1c9
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date:   Mon Dec 28 20:46:28 2020 -0500
2021-11-24 12:14:16 -05:00
Sergio Martins
fc172b66f8 Explain that changing window manager flags isn't portable
This restriction comes from Qt itself, not from KDDW.
Relates to bug #256

I will however try to reproduce it
2021-11-24 11:16:36 +00:00
Sergio Martins
2be0d5d1d9 Add a warning about using private headers and ABI compat 2021-11-24 10:04:52 +00:00
Allen Winter
3007b46892 ready for 1.5 release 2021-11-22 08:16:54 -05:00
Allen Winter
1419db80a2 OBS distro fixes 2021-11-19 18:03:22 -05:00
Allen Winter
5376ceec7e prep for the 1.5.0 release 2021-11-19 15:39:19 -05:00
Allen Winter
d3a3e7502e appveyor.yml - temporarily disable testing on Windows
until I have the time to figure out a proper solution
2021-11-19 12:22:20 -05:00
Allen Winter
50c3f9b899 appveyor.yml - add bin to PATH on Windows
to fix 'ctest' on Windows
2021-11-19 11:00:44 -05:00
Allen Winter
8845fae147 appveyor.yml - fix typo 2021-11-19 10:23:55 -05:00
Allen Winter
0c291116b9 appveyor.yml - install mesa on ubuntu 2021-11-19 10:05:07 -05:00
Allen Winter
f0fa0281bf CMakeLists.txt - fix default install location on Windows 2021-11-19 09:59:56 -05:00
Allen Winter
313a17a96c appveyor.yml - add Qt to PATH 2021-11-19 08:58:07 -05:00
Allen Winter
9e2b1d3e44 move github CI to appveyor for all platforms 2021-11-19 08:33:43 -05:00
Allen Winter
a82a283b4b CMakeLists.txt - increase min Qt to version 5.15 2021-11-18 09:06:50 -05:00
Sergio Martins
b6770217bb README: Mention 5.15 is required
5.12 no longer compiles
2021-11-18 14:01:59 +00:00
Sergio Martins
c8b22e7ea5 Fix "Unpin" button not showing up in overlayed widgets 2021-11-18 12:15:23 +00:00
Sergio Martins
8dcaaaf853 tests|Qt6: Ignore benign warning coming from QQC material style
Needs to be fixed in Qt
2021-11-17 17:00:16 +00:00
Sergio Martins
32ecdb5b37 README-QtQuick: Bump the patch revisions of min supported Qt
Probably works with earlier, but not tested
2021-11-17 15:59:46 +00:00
Sergio Martins
099c7eafc8 tests: Fix QtQuick tests
normal geometry isn't supported for QWindow, only QWidget.
2021-11-17 15:41:50 +00:00
Sergio Martins
f872d6fbc1 tests: Fix issue found by ASAN
We need to ungrab the window before deleting it.
2021-11-17 15:12:06 +00:00
Sergio Martins
3e21787efb qtquick: Fully qualify setPersistentCentralWidget() arguments
So it works from QtQuick too
2021-11-17 14:13:01 +00:00
Allen Winter
58fcd8d04d conan/conanfile.py - change to version 1.5.0 2021-11-15 09:57:14 -05:00
Allen Winter
95d5146fce CMakeLists.txt - increase version for release candidate 2021-11-15 09:51:21 -05:00
Sergio Martins
ea6adafc13 Fix QtQuick build
Fixes #254
2021-11-09 09:45:15 +00:00
Allen Winter
f65cb2c0ce README.md - minor 2021-11-04 17:20:51 -04:00
Sergio Martins
fbde2bd202 cmake: Allow to not create "docs" target
Fixes integrating KDDW as sub-repo of other projects that
already define "docs" target. It would conflict.

namespacing the target name would be another optionm but in doubt
keep things simple
2021-11-03 09:14:25 +00:00
Sergio Martins
0cee15c0d3 Don't do relative positioning restore if main window changed screen
We only shift floating windows position for simple cases.
Fixes floating windows being restored out of bounds in some cases.
2021-11-02 19:11:29 +00:00
Sergio Martins
4b56a336a0 Fix build on macOS 2021-10-19 14:34:27 +01:00
Sergio Martins
56bec0db04 Replace KDDOCKWIDGETS_RUBBERBAND_IS_TOPLEVEL with config option
This way one doesn't need to rebuild KDDW to make the rubber band
top-level.

Added it as internal option, as this will seldom be used.
2021-10-17 11:17:41 +01:00
Allen Winter
dd979d191f CMakeLists.txt, python/CMakeLists.txt - some restructuring 2021-10-13 17:33:32 -04:00
Sergio Martins
a5f37f851b Fix relative inner resizing not working properly
When we resize the main window then we also resize the inner
dock widgets in the same proportion (based on saved percentages),
during a resize we should not recompute those percentages due to
rounding errors.

They were being recomputed by mistake, since only the root Item
was blocking them, but the function recurses into inner items

Fixes #186
2021-10-13 18:33:45 +01:00
Sergio Martins
052d8680dc Add a test for #186
Was hard to reproduce, doesn't happen with many other layouts
2021-10-13 15:37:02 +01:00
Sergio Martins
21e8aae823 Add a test for #238
Which I can't reproduce yet, but at least tests another case.
2021-10-12 18:36:50 +01:00
Sergio Martins
0e866079da qtquick: Fix parentChanged() passing the wrong argument
QQuickItem::parentChanged(QQuickItem *parent) passes the *new*
parent, not *this*

Fixes #243 which is actually invalid, but uncovered this bug.
For #243 you can just use sender(), or connect to a lambda that
captures the dock widget.
2021-10-12 11:46:16 +01:00
Sergio Martins
a8bd6ba840 Fix corrupt layout when restoring old JSON
If the old *.json file doesn't know about some new docked widget
then we need to float it before restoring the main window

Fixes #237
2021-10-12 11:16:15 +01:00
Sergio Martins
96aefdd3c7 Make tst_restoreNonExistingDockWidget more minimal
dock1 isn't required

And it's ok that dock2 remains open, the bug is actually that it
doesn't get resized when we resize the main window
2021-10-11 00:50:53 +01:00
Sergio Martins
753fe57b30 Add a failing test for bug #237 2021-10-11 00:25:10 +01:00
Sergio Martins
9587c1b1e3 Add a test for issue #245
I can't repro still. Will wait for more feedback from reporter.
2021-10-10 19:32:27 +01:00
Sergio Martins
bc1b296440 README: Explain that StyleSheets are not supported
It's intentional.

Closes #246
2021-10-10 19:20:00 +01:00
Allen Winter
5626b0120d PySide[2,6]ModuleBuild.cmake - restore noisy compiler warnings removal
somehow got lost
2021-10-05 17:08:32 -04:00
Allen Winter
e5d2f5f857 PySide[2,6]ModuleBuild.cmake - restore noisy compiler warnings removal
somehow got lost
2021-10-03 16:54:26 -04:00
Allen Winter
3eb52c46b1 python/examples/main.py - add instructions to generate rc_assets.py 2021-09-30 15:57:22 -04:00
Allen Winter
aaa64bf769 Merge pull request #248 from KDAB/pyside6-unittest
Fixed unit test for PySide6
2021-09-30 15:49:17 -04:00
Renato Araujo
b7b1d6d4e9 Fixed unit test for PySide6 2021-09-30 06:04:52 -07:00
Allen Winter
a90417de55 python/examples-qt6/main.py - uncomment rc_assets
commented by mistake
2021-09-29 17:17:54 -04:00
Allen Winter
73f08df224 Merge pull request #247 from KDAB/python38
Fixed module import for python 3.8
2021-09-29 16:41:26 -04:00
Renato Araujo Oliveira Filho
db9babbdca Fixed module import for python 3.8 2021-09-29 13:36:16 -07:00
Allen Winter
463dd2261e various - spelling fixes 2021-09-28 16:45:44 -04:00
Allen Winter
4dd66969af examples/dockwidgets/MyTitleBar_CSS.h - add multiple include guard 2021-09-28 16:36:55 -04:00
Allen Winter
2c98003219 CMakeLists.txt,python/tests/CMakeLists.txt - minor coding style 2021-09-28 16:28:51 -04:00
Allen Winter
dd853a8f72 python/tests/ - add copyright+license header 2021-09-28 16:24:35 -04:00
Allen Winter
88d5e6b29d Merge pull request #242 from KDAB/python-unittest
Fixed import module for windows and python 3.7
2021-09-28 16:03:40 -04:00
Renato Araujo
71e5d8cc31 Fixed import module for windows and python 3.7
create unit test
2021-09-28 14:45:52 -03:00
Allen Winter
15b3843172 ../KDAB/modules/PySide6ModuleBuild.cmake - set INSTALL_PATH for Mac
on Mac we need to set the rpath to "@loader_path"
2021-09-27 16:42:07 -04:00
Allen Winter
3cffe3b3be ../KDAB/modules/PySide2ModuleBuild.cmake - set INSTALL_PATH for Mac
on Mac we need to set the rpath to "@loader_path"
2021-09-27 16:27:54 -04:00
Allen Winter
9dd87b7777 python/PyKDDockWidgets/CMakeLists.txt - fix TARGET_SONAME_FILE
TARGET_SONAME_FILE isn't supported on Windows
2021-09-27 15:46:23 -04:00
Allen Winter
b057cf905b python/examples-qt6/main.py - uncomment rc_assets
commented by mistake
2021-09-27 12:59:59 -04:00
Allen Winter
d7943d30d8 cmake/KDAB/modules/PySide6ModuleBuild.cmake - add rpath property
follow PySide2ModuleBuild.cmake
2021-09-27 12:59:19 -04:00
Renato Araujo Oliveira Filho
1826d68841 Install library so into python module dir
We do the same a PySide and install the target library into the python
module this. This way the bindings can work without need to export
system paths.
2021-09-25 11:02:18 +01:00
Allen Winter
dc1e5103e2 docs/api/CMakeLists.txt - use INSTALL_DOC_DIR
install api docs files to ${INSTALL_DOC_DIR},
not to ${CMAKE_INSTALL_DOCDIR}
2021-09-20 17:28:48 -04:00
Sergio Martins
33c5647e57 Don't create duplicate central frame with restoring
When using MainWindowOption_HasCentralFrame we have a persistent
central frame which is never destroyed. When restoring a layout
we shouldn't create it, as it exists already.
2021-09-20 12:26:45 +01:00
Waqar Ahmed
f6f772edc5 Fix leaks in kddockwidgets_example 2021-09-17 11:27:09 +01:00
Allen Winter
7e460d8f34 examples/main.py, examples-qt6/main.py - uncomment import
uncomment the import rc_assets (commented by mistake)
2021-09-12 11:24:28 -04:00
Waqar Ahmed
7af2095f2f Allow switching tabs via context menu in the tabs area
This change allows you to switch tabs via the context menu. The context
menu only shows up if you click on the empty area beside the tabs.

Can be tested with `--allow-switch-tabs-via-menu` option in the example.

Fixes #232
Signed-off-by: Waqar Ahmed <waqar.ahmed@kdab.com>
2021-09-11 12:46:23 +01:00
Waqar Ahmed
8307598d5d tests: Fix tests, only repro in some distros 2021-09-11 12:17:50 +01:00
Waqar Ahmed
13fe276dbe Fix possible division by zero 2021-09-11 12:05:00 +01:00
Sergio Martins
13a5a472cd Fix build 2021-09-08 23:17:39 +01:00
Sergio Martins
b5c11ce199 example: Add an example about using stylesheets 2021-09-08 23:14:47 +01:00
Sergio Martins
83c8c22736 Add a TitleBar::isFocused property so we can use with qss
This has nothing to do with QWidget::hasFocus, but regarding our
focus scope support
2021-09-08 22:31:51 +01:00
Sergio Martins
c8ca7bf9e1 Allow TitleBarWidget to honour the stylesheet background color 2021-09-08 20:22:20 +01:00
Milian Wolff
0184deb54d Don't set CMAKE_MODULE/SHARED_LINKER_FLAGS in PARENT_SCOPE 2021-09-08 18:01:47 +02:00
Milian Wolff
389042f3cc Unbreak clang+asan build
Don't set -Wl,--no-undefined in such a configuration as it's not
supported, contrary to gcc+asan.
2021-09-08 16:13:03 +01:00
Sergio Martins
736358a71f cmake: Introduce KDDockWidgets_X11EXTRAS option, default ON
Use -DKDDockWidgets_X11EXTRAS=OFF to disable it, if you don't want
to link to Qt5X11Extras.

I've added a new option instead of relying on auto-detection, because
I want to make it difficult to disable it when on X11, it's opt-out.

X11Extras is needed when window managers don't have compositors, in
that case we use icons without transparency.
2021-09-07 12:19:20 +01:00
Sergio Martins
bffe671679 Fix QtQuick build 2021-09-04 20:11:35 +01:00
Sergio Martins
fafc0b7946 Fix "normal geometry" not being restored
When restoring a maximized window, calling QWidget::showNormal()
on it wouldn't set it's previous non-maximized size.

QWidget::normalGeometry() doesn't have a setter, so use private API.
2021-09-04 19:59:03 +01:00
Sergio Martins
3574feea98 Added isNormalWindowState()
As QWidget doesn't have it.
2021-09-04 13:38:06 +01:00
Sergio Martins
25b48920bb Make FloatingWindow::normalGeometry() virtual
So it can be overridden by QtQuick, since there's no "normal geometry"
for QWindow.

Also useful to workaround window manager bugs in a class derived from FloatingWindow.
2021-09-03 15:33:46 +01:00
Sergio Martins
e22ca48674 Fix QtQuick build 2021-09-03 00:18:42 +01:00
Sergio Martins
3b9773f872 Add support for restoring minimized/maximized floating window state 2021-09-02 18:32:35 +01:00
Sergio Martins
3e3cf10fff Allow to override FloatingWindow maximization/minimization
So users can workaround bugs in window managers / Qt, such as QTBUG-95478

The custom behavior needs to be done in a FloatingWindow sub-class,
as a generic workaround which doesn't break other window managers isn't
possible
2021-09-02 18:08:13 +01:00
Sergio Martins
421b401b4f qtquick: Added QWidgetAdapter::isMinimized() 2021-09-02 17:31:05 +01:00
Sergio Martins
a0c97e3388 Fix layout save restore when using MainWindowOption_HasCentralWidget
Those checks don't make sense anymore
2021-09-02 11:05:57 +01:00
Sergio Martins
d2a3968897 tests: Add tests for MainWindowOption_HasCentralWidget 2021-09-02 10:53:08 +01:00
Sergio Martins
4ea7953a76 Don't allow to overlay central widget 2021-09-02 10:52:56 +01:00
Sergio Martins
0cc0972eea Don't allow to close/float/tab persistent central widget
Fixes corner cases with MainWindowOption_HasCentralWidget
2021-09-02 10:30:34 +01:00
Sergio Martins
77b5d1630d Added DockWidget::isPersistentCentralDockWidget() 2021-09-02 10:24:43 +01:00
Sergio Martins
f962989484 Fix MainWindow::addDockWidgetAsTab with MainWindowOption_HasCentralWidget
When using central widget no tabs are supported
2021-09-02 10:17:37 +01:00
Sergio Martins
1ccdf445eb Introduce MainWindowOption_HasCentralWidget
You can now set an arbitrary widget as "central widget".
It's similar to MainWindowOption_HasCentralFrame, however the widget
won't be detachable and won't show tabs.

Similar to what you'd get with QMainWindow central widget concept.

Example:
    QWidget *myWidget = new MyWidget();
    mainWindow->setPersistentCentralWidget(myWidget);

Fixes #225
2021-08-30 10:12:46 +01:00
Sergio Martins
3fb8861eee Remove "EXPERIMENTAL" comment from MDI option
MDI doesn't have known bugs
2021-08-29 17:43:21 +01:00
Allen Winter
78381badd1 docs/api/Doxyfile.cmake - not generating latex
hard-code LATEX_CMD_NAME to latex since we won't
be generating the latex documentation; else we
have an ununitialized variable for @LATEX_COMPILER@
2021-08-25 15:26:32 -04:00
Allen Winter
8b1a9f2a41 README.md - Add info about Using in Qt6 projects 2021-08-24 09:24:30 -04:00
Sergio Martins
9ee52a0011 Merge branch '1.4' 2021-08-22 16:34:25 +01:00
Sergio Martins
240169ce23 Fix bug where the central frame would be detached
We don't allow detaching the central frame.
Fixes #228
2021-08-22 16:33:19 +01:00
Allen Winter
97a431f367 docs/api/Doxyfile.cmake - set PAPER_TYPE to a4
a4wide is no longer supported
2021-08-19 12:29:44 -04:00
Allen Winter
3769ad9615 python/PyKDDockWidgets/CMakeLists.txt - link to Python3 dev libs 2021-08-19 11:28:18 -04:00
Allen Winter
8332ab3ddc CMakeLists.txt - add LINKER_FLAGS fo various platforms
set CMAKE_SHARED_LINKER_FLAGS and CMAKE_SHARED_LINKER_FLAGS
- Linker warnings should be treated as errors
- Do not allow undefined symbols, even in non-symbolic shared libraries
2021-08-19 11:23:54 -04:00
Allen Winter
3b4a2f134f docs/api/Doxyfile.cmake - don't use fullpaths to makeindex
@MAKEINDEX@ expands to the fullpath /usr/bin/makeindex
breaks 'make pdf' in build/docs/api/latex
2021-08-19 11:23:34 -04:00
Allen Winter
5899e3716c CMakeLists.txt - Enable hidden visibility by default
"It's just good practice, catching some problems with missing
export macros that would otherwise only affect Windows,
and reducing the number of exported symbols on Unix."
2021-08-16 17:34:08 -04:00
Allen Winter
25bc05ae40 docs/api/CMakeLists.txt - introduce user variable QCH_INSTALL_DIR
provide a user settable variable (as in -DQCH_INSTALL_DIR=/path)
to override the qch file default installation location.
2021-08-16 17:29:48 -04:00
Allen Winter
f42629a6e5 docs/api/CMakeLists.txt - install the doxygen tagsfile 2021-08-16 17:28:58 -04:00
Allen Winter
192cb2daaa buildsystem - a bit of re-organizing the docs/api CMake 2021-08-16 17:28:09 -04:00
Allen Winter
63cc87af2d docs/api/Doxyfile.cmake - update and consistency 2021-08-16 17:25:31 -04:00
Allen Winter
3e1ea3ec67 Changelog - mention Qt6 co-installability 2021-08-16 17:21:26 -04:00
Allen Winter
c27a09c13c Merge branch '1.4' 2021-08-16 13:28:02 -04:00
Allen Winter
b3486ebca8 CONTRIBUTORS.txt - update 2021-08-16 13:27:43 -04:00
Albert Astals Cid
6a7230e546 Update qt6-kddockwidgets.spec for new paths 2021-08-12 15:39:43 +02:00
Allen Winter
ca173de71d CMakeLists.txt - fix typo "set(d fault_build_type)" 2021-08-12 07:35:40 -04:00
Allen Winter
5732e8ed14 CMakeLists.txt - minor reorganizing 2021-08-11 19:49:19 -04:00
Albert Astals Cid
5cc7a0864b Fix KDDockWidgetsConfig to require the proper Qt version
And for Qt5X11Extras we only require it if building the Qt5 one
2021-08-11 16:26:10 +02:00
Albert Astals Cid
e4671f175c Install the qt6 cmake targets in prefix lib/cmake/KDDockWidgets-qt6
So it does not collide with the qt5 files
2021-08-11 16:19:05 +02:00
Albert Astals Cid
17fd6b2454 Make Make qt5/qt6 documentation coinstallable 2021-08-11 15:44:19 +02:00
Albert Astals Cid
7ed3945d58 Make qt5/qt6 includes coinstallable
Even if they are "the same file" it's always good to not have packages
trying to install over the same files.

Since we don't want users to have to change their existing
  #include <kddockwidgets/DockWidget.h>

We install the qt6 includes in include/kddockwidgets-qt6/kddockwidgets
and change the cmake target INTERFACE_INCLUDE_DIRECTORIES to be
   "${_IMPORT_PREFIX}/include/kddockwidgets-qt6"
so everything is transparent for the user
2021-08-11 15:22:29 +02:00
Allen Winter
35de0a2fef python/examples-qt6 - PySide6 and PyKDDockWidgetsQt6 version 2021-08-10 08:52:54 -04:00
Allen Winter
8a0e475f21 python/examples - "PySide" => "PySide2" 2021-08-10 08:43:12 -04:00
Allen Winter
63d14f2345 python/CMakeLists.txt - fix typo 2021-08-10 08:35:40 -04:00
Allen Winter
e91849759c python/CMakeLists.txt - use PyKDDockWidgetsQt6 namespace for Qt6
follow PySide6 naming convention
2021-08-10 08:29:50 -04:00
Allen Winter
ee3a3af408 Merge branch '1.4' 2021-08-10 08:21:11 -04:00
Allen Winter
c470c89fc6 PySide6ModuleBuild.cmake - sync 2021-08-10 08:20:32 -04:00
Allen Winter
73cfa64ebb python/PyKDDockWidgets/__init__.py.cmake - minor comment fix 2021-08-10 08:18:48 -04:00
Sergio Martins
ffe5d5f6cb Merge branch '1.4' 2021-08-10 10:05:13 +01:00
Sergio Martins
aff4450b42 cmake: Install QWidgetAdapter_quick_p.h too
Fixes #224
2021-08-10 10:04:11 +01:00
Allen Winter
d40580c550 buildsystem - rename QT_MAJOR_VERSION to Qt_VERSION_MAJOR
as this is consistent with CMake style and other projects
2021-08-04 16:18:31 -04:00
Allen Winter
8e19b81eb9 cmake/KDAB/modules/KDQtInstallPaths.cmake - sync 2021-08-04 16:17:27 -04:00
Kevin Funk
d5191696e1 cmake: Remove explicit policy version settings
These are NEW by default already for the required CMake version
2021-08-04 07:55:54 +02:00
Allen Winter
1d01466181 Merge branch '1.4' 2021-08-03 07:18:37 -04:00
Allen Winter
1cead0e2b8 python/CMakeLists.txt - adapt to new upstream FindPySide 2021-08-03 07:17:50 -04:00
Allen Winter
aff4d426b8 Merge branch '1.4' 2021-08-02 19:15:00 -04:00
Allen Winter
4597cdeda8 cmake/Python - sync 2021-08-02 19:13:46 -04:00
Allen Winter
2e7f0bf51d cmake/KDAB/module - sync 2021-08-02 19:11:39 -04:00
Allen Winter
fa551b84f6 Merge branch '1.4' 2021-08-01 11:19:17 -04:00
Allen Winter
ce105212ab Doxyfile.cmake - more setting consistency 2021-08-01 11:18:21 -04:00
Allen Winter
31d4b62181 cmake/KDAB/modules/KDQtInstallPaths.cmake - sync 2021-07-30 13:04:12 -04:00
Allen Winter
7ec542a211 post-merge cleaning
rearrange top-level CMakeLists.txt
2021-07-29 17:04:45 -04:00
Allen Winter
e615d1c618 Merge branch '1.4' 2021-07-29 16:47:45 -04:00
Allen Winter
ce349d0fcd buildsystem - improve installing to non-KDAB location 2021-07-29 16:42:07 -04:00
Allen Winter
c86813b1cb CMakeLists.txt - remove CMake option KDDockWidgets_UNINSTALL
no longer needed since the uninstall target is created
only for "rooted" projects (ie. non-submodules)
2021-07-29 12:59:15 -04:00
Allen Winter
1fe651aaa7 CMakeLists.txt - re-organize. implement PROJECT_IS_ROOT
set KDDockWidget_IS_ROOT for detecting if this project
is being used inside another parent-parent (eg. submodule)
If not IS_ROOT then we don't build tests, examples, etc.
2021-07-29 12:56:39 -04:00
Allen Winter
ba7809236b CMakeLists.txt - follow using PYSIDE_CUSTOM_PREFIX 2021-07-29 12:55:09 -04:00
Allen Winter
84814b3c59 FindPySide2.cmake,FindPySide6.cmake - sync 2021-07-29 12:54:09 -04:00
Allen Winter
73ca6e6671 buildsystem - install the Python bindings into standard "site-packages"
Follow Python standards and install the bindings into
<prefix>/lib/pythonX.Y/site-packages

sync the Python cmake files with KDAB repository
2021-07-23 12:05:02 -04:00
Sergio Martins
a26759f340 Remove .uncrustify file, as we use clang-format now 2021-07-22 10:13:32 -07:00
Sérgio Martins
200ef12b4a Fix close icon being too dark
Fixes #208
2021-07-22 18:11:53 +01:00
Allen Winter
990fac9a0a open for 1.5 - new features 2021-07-16 13:02:05 -04:00
Allen Winter
31ec4cdecb Merge branch '1.4' 2021-07-16 12:59:32 -04:00
Allen Winter
1d968bd902 CMakeLists.txt, Changelog - open for 1.4.1 2021-07-16 12:59:12 -04:00
Allen Winter
69a632cfc2 conan/conanfile.py - Qt5.12 is required since 1.4.0 2021-07-16 12:53:21 -04:00
Allen Winter
9a784f1222 ready for 1.4.0 release 2021-07-16 11:13:13 -04:00
Allen Winter
4a390696d5 CMakeLists.txt - Set default CMAKE_BUILD_TYPE to Release for non-dev
In non-developer situations default CMAKE_BUILD_TYPE=Release
2021-07-16 09:42:43 -04:00
Allen Winter
68aaccadab CMakeLists.txt - move the python bindings buildtype check 2021-07-16 09:38:56 -04:00
Allen Winter
3940228b59 various cmake files - minor coding style 2021-07-16 09:18:03 -04:00
Allen Winter
f8abe48c82 CMakeLists.txt - add more doc 2021-07-16 09:11:00 -04:00
Sergio Martins
86db81e5b7 README-QtQuick: Remove sentence about failing Qt6 tests
It was a false-positive, everything passes
2021-07-15 23:53:01 +01:00
Sergio Martins
34676f016f qtquick: Blacklist a Qt6 test
Works fine manually.
Qt6 refactored input event handling, which broke our Tests::doubleClickOn(QWindow).
2021-07-15 23:50:06 +01:00
Sergio Martins
4448891315 tests: Increase timeout when trying to active dock widgets
When running with ASAN everything is slower.
Added a warning to tests fail sooner if this happens.
2021-07-15 20:50:58 +01:00
Sergio Martins
fc1f12b77c cmake: Qt6 QtQuick clangcl preset needs help finding Qt6 plugins
The same was already done to the regular msvc one
2021-07-15 20:18:55 +01:00
Sergio Martins
a50057f5d2 cmake: Fix running the clangcl Qt6 presets on Windows
They need to set PATH
2021-07-15 20:14:48 +01:00
Sergio Martins
d7b32e475e cmake: Normalize preset build dir of my clangcl preset 2021-07-15 20:11:30 +01:00
Allen Winter
e32aaccaac Merge branch '1.4' 2021-07-15 13:30:58 -04:00
Allen Winter
8b695eec79 .codespellrc - codespell config 2021-07-15 10:26:20 -04:00
Allen Winter
c85904c67e 2 more misspelling fixes for contractions. 2021-07-15 10:25:53 -04:00
Allen Winter
22a709a39e fix more misspellings 2021-07-15 10:14:04 -04:00
Allen Winter
4f4a5de700 fix misspellings found by codespell 2021-07-15 09:46:53 -04:00
Sergio Martins
08ecbb2ca6 qtquick: Mention Qt6+qtquick has failing tests 2021-07-15 10:59:23 +01:00
Sergio Martins
048b494874 cmake: Fix dev-qtquick6 preset
When running it, we need to set the correct qml import path,
otherwise it picks up Qt 5.
2021-07-14 23:31:57 +01:00
Allen Winter
1539d7233b make/ECMGenerateHeaders.cmake - avoid uninit value
see upstream MR at:
https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/161
2021-07-14 16:00:32 -04:00
Sergio Martins
214dbdf359 qtquick: Fix clazy-connect-not-normalized 2021-07-14 16:10:07 +01:00
Allen Winter
473ce60340 cmake/ECM/modules/ECMGenerateHeaders.cmake - add missing 2021-07-13 18:39:58 -04:00
Allen Winter
74ba8c6bd2 src/CMakeLists.txt - coding style
consistent indentation, etc.
2021-07-13 16:59:53 -04:00
Allen Winter
11a1023e79 src/CMakeLists.txt - generate and install camelcase headers
for public headers and exported classes only
2021-07-13 16:58:25 -04:00
Sergio Martins
3302401a36 Merge branch '1.4' 2021-07-13 17:34:58 +01:00
Sergio Martins
3c5f07ac79 Update ChangeLog 2021-07-13 17:34:00 +01:00
Renato Araujo Oliveira Filho
c0c1383254 Python: Create bindings for InitialOption
Added bindings for missing enums
Added InitialOption as value type

Task-Id: #198
2021-07-13 17:33:50 +01:00
Renato Araujo Oliveira Filho
ec4a4d1c86 Python: Create bindings for InitialOption
Added bindings for missing enums
Added InitialOption as value type

Task-Id: #198
2021-07-13 17:33:09 +01:00
Sergio Martins
5ef330f479 vscode: Fix the build dir paths
They changed in the cmake preset
2021-07-13 17:32:54 +01:00
Allen Winter
bbdbadd630 CMakeLists.txt - add missing option() and feature_summary()
also some minor coding style and some more comments
2021-07-13 08:20:50 -04:00
Allen Winter
80a1483617 QtQuick support is no longer expermental 2021-07-13 08:06:30 -04:00
Sergio Martins
13a7d27046 vscode: Fix the build dir paths
They changed in the cmake preset
2021-07-13 08:27:21 +01:00
Sergio Martins
8800c02403 Fix persistent central frame becoming invisible
Wouldn't affect functionality but would have a different color.
Fixes #220
2021-07-13 08:19:05 +01:00
Allen Winter
dd9ec48979 DragController.cpp - fix multi-line comment [-Werror=comment]
caused by clang-format
2021-07-12 17:37:59 -04:00
Allen Winter
262d703608 cmake/ECM - sync with upstream
except for ECMEnableSanitizers.cmake which has local
changes we intend to upstream, if accepted.
2021-07-12 17:21:15 -04:00
Allen Winter
5629e1dfc2 .clang-format - set ColumnLimit to 0
else clang-format grows lines for you
2021-07-12 17:07:55 -04:00
Allen Winter
7001aa58ce clang-format on code base 2021-07-12 17:05:37 -04:00
Allen Winter
d87898b59e private/DragController.cpp - don't include QWindow more than once 2021-07-12 17:04:15 -04:00
Allen Winter
d1078adad2 .clang-format - SortIncludes: false 2021-07-12 16:41:32 -04:00
Allen Winter
e4f0fae7e5 .clang-format - ColumnLimit: 150
because SPDX tag lines are longer than 100 already
2021-07-12 16:38:08 -04:00
Sergio Martins
4b06706d61 Port away from deprecated QWidget::isTopLevel()
Fixes Qt6 warnings about it
2021-07-10 07:18:27 -07:00
Sergio Martins
7e1331bd76 cmake|Qt6: Add presets for clang-cl 2021-07-10 06:56:36 -07:00
Sergio Martins
f735f25fb0 cmake|qtquick: Add a preset for building with clang-cl 2021-07-10 06:52:35 -07:00
Sergio Martins
750c089ab0 windows: Use -Werror for clang-cl too 2021-07-10 06:49:14 -07:00
Sergio Martins
3088f33837 Fix non-windows build 2021-07-10 06:44:48 -07:00
Sergio Martins
1d598d2585 windows: Fix all clang-cl warnings
Mostly int vs uint conversions.
In preparation to add -Werror
2021-07-10 06:43:04 -07:00
Sergio Martins
768c51f01c windows: Fix a -Wunused-lambda-capture warning 2021-07-10 06:27:23 -07:00
Sergio Martins
a2e2b32fc3 cmake: Don't pass -fvisibility=hidden to clang-cl
It's not supported
2021-07-10 06:22:24 -07:00
Sergio Martins
a6abf73669 cmake: Add a preset for clang-cl
clang has different warnings, so would like to build with it in
CI too.
2021-07-10 13:57:48 +01:00
Sergio Martins
a6e62ec74d qtquick|tests: trying to stabilize a test in CI
Can't repro locally.
2021-07-10 13:44:15 +01:00
Sergio Martins
93441a5754 cmake: Use unity build for our release builds
Unity is much faster to build, specially on Windows
2021-07-10 13:38:24 +01:00
Sergio Martins
fe57686715 cmake: Remove "-qtwidgets" suffix from preset names
Only variants need a suffix (python, qtquick, static, etc).
The default is a qtwidgets build
2021-07-10 13:22:27 +01:00
Sergio Martins
330f5aebdf cmake: Add -Wundef 2021-07-09 22:26:01 +01:00
Sergio Martins
02c17e59dd relax a warning about not finding dock widget to restore
If the user provided a factory and it returns nullptr on purpose
then don't warn, it's intentional by the user
2021-07-06 23:12:49 +01:00
Sergio Martins
be8af12a90 cmake: Remove unneeded custom preset settings
I have this locally now, as it didn't have any kddw specific config
and I'm using it cross project, so makes more sense to have it
in a central location outside of kddw.
2021-07-05 22:51:09 +01:00
Sergio Martins
238193f56b qtquick: DockWidget now receives QQmlEngine as param
If nullptr then the usual Config::qmlEngine() will be used.
2021-07-04 18:41:52 +01:00
Sergio Martins
54233085a4 tests: Add a warning to the blacklist
Don't abort on:
"Populating font family aliases took"
2021-07-03 21:51:02 +01:00
Sergio Martins
2241b938c9 qtquick|minor: Decouple a bit more from Config::self().qmlEngine()
Moves it up one layer, will be easier to remove
2021-07-03 17:26:59 +01:00
Sergio Martins
631d036c26 qtquick: Exclude two clazy-old-style-connect warnings
Those two cases are fine and required
2021-07-03 16:44:04 +01:00
Sergio Martins
d70f795dea qtquick: Fix a -Wclazy-func-args-by-value 2021-07-03 16:39:25 +01:00
Sergio Martins
0be99d3e79 qtquick: Fix -Wclazy-missing-qobject-macro 2021-07-03 16:33:21 +01:00
Sergio Martins
45aab49be7 qtquick: Fix -Wclazy-fully-qualified-moc-types
Might even fix a few bugs as QML is very picky about this
2021-07-03 16:31:15 +01:00
Sergio Martins
2c66238791 qtquick: Fix a -Wclazy-returning-void-expression and missing Q_EMIT 2021-07-03 16:27:36 +01:00
Sergio Martins
bec1ddae67 qtquick: Fix a -Wclazy-range-loop-reference 2021-07-03 16:27:30 +01:00
Sergio Martins
913d3b263d cmake: Don't build the examples when using the clazy preset
The clazy warning set is more strict for the library than for the
examples. For CI purposes and -Werror it's the library that matters.
2021-07-03 16:24:15 +01:00
Sergio Martins
614e20a183 cmake: Add a preset for clazy qtquick 2021-07-03 16:19:28 +01:00
Sergio Martins
f9f270980d tests: Fix flaky test
The center indicator isn't exactly at the center of the window,
so this would fail sometimes. This is a quick workaround.
Will all API to the dock indicator interface if this isn't enough.
2021-07-03 10:46:26 +01:00
Sergio Martins
763b878ca1 qtquick|README: Mention that C++17 is required 2021-07-02 22:58:03 +01:00
Sergio Martins
d3d040adee qtquick: Fix tab current widget being wrong when current is removed
When the current dock widget is removed we need to assign another
one. QTabBar does this automatically.

Fixes #215
2021-07-02 22:54:20 +01:00
Sergio Martins
31f5cc10cf qtquick: Add qWarning() when there's no current index in tabWidget 2021-07-02 22:34:46 +01:00
Sergio Martins
38c9a3d9c6 qtquick: Require C++17
Fixes build due to not finding <optional>
2021-07-02 22:33:34 +01:00
Sergio Martins
362f2d5750 qtquick: Add a failing test for #215 2021-07-02 16:56:40 +01:00
Sergio Martins
463b6a1322 qtquick: Fix using initial visibility option
Needs to be fully qualified.
Added an example.

Fixes #212
2021-07-02 16:41:49 +01:00
Sergio Martins
00a95ac468 Fix invisible tabbar from eating hover events
Fixes #214
2021-07-02 16:15:04 +01:00
Sergio Martins
966f30e356 qtquick: Fix dock widgets not getting title
Title can be set before onComplete(), so we need to remember it

Fixes #218
2021-07-02 15:05:55 +01:00
Sergio Martins
f0217f53c2 qtquick: Update README with warning against QtGraphicalEffects 2021-07-02 00:02:23 +01:00
Sergio Martins
ced1c4dcc8 TabWidgetWidget: Don't hardcode margins, so we support DPI != 96
For people using font DPI instead of DPR
2021-07-01 22:17:31 +01:00
Sergio Martins
e1578436d0 Added Flag_ShowButtonsOnTabBarIfTitleBarHidden 2021-07-01 18:08:41 +01:00
Sergio Martins
701df72db6 Remove some ifdefs regarding 5.9
The one missing QT_VERSION_CHECK was even wrong and triggering
even with Qt 5.15.
2021-07-01 16:54:44 +01:00
Sergio Martins
c4ebef1f1e Remove an ifdef only relevant to older Qt 2021-07-01 16:50:01 +01:00
Allen Winter
6f0eb7a2f2 Merge branch '1.3' 2021-06-30 12:19:37 -04:00
Allen Winter
be6c3ca2df move OBS files into a distro folder, add qt6 project 2021-06-30 12:19:09 -04:00
Sergio Martins
18b49686f1 tests|qtquick: Remove the XFAIL, fixed by #211 2021-06-29 00:15:48 +01:00
Eism
02d4611501 Fixed toggling dock widgets 2021-06-29 00:16:14 +01:00
Sergio Martins
2fe8117e80 tests: Add a QVERIFY 2021-06-28 23:46:58 +01:00
Sergio Martins
457ea402d5 qtquick|example: Fix toggling not working on non-current tab
A non-current tab isn't visible, its dock widget is however opened.
Relates to #211
2021-06-28 23:30:05 +01:00
Sergio Martins
89623eb8b4 tests|qtquick: Add a test for weirdness reported in #211
Not the exact issue from #211, but more tests will follow
2021-06-28 22:27:11 +01:00
Sergio Martins
df02382387 cmake: Add a personal preset config
So I can build on my mac from my linux box
2021-06-28 21:04:07 +01:00
Allen Winter
7470d62b7c Merge branch '1.3' 2021-06-26 09:42:06 -04:00
Allen Winter
9eb9018f47 docs/api/CMakeLists.txt - fix link from mainpage to README-bindings 2021-06-26 09:40:44 -04:00
Allen Winter
d7bcbe666c Require Qt5.12 or higher 2021-06-26 08:46:52 -04:00
Sergio Martins
aaa5b4ba26 README: Mention 6.1 is the first Qt6 version we support
Nobody is using 6.0 in production, so let's forget about it
2021-06-25 23:28:28 +01:00
Allen Winter
720dad1ed6 clean comment of double words "to to" and "the the" 2021-06-25 10:21:33 -04:00
Sergio Martins
6417db6d91 Added Config::InternalFlag_DisableTranslucency
In case one doesn't want to use the env variable
2021-06-25 14:38:19 +01:00
Sergio Martins
ec681e99ca Disable translucency when KDDW_NO_TRANSLUCENCY env var is set
Useful for running on weird window managers which don't support
transparent windows.
2021-06-25 14:31:00 +01:00
Sergio Martins
47ef203643 qtquick|minor: Remove a call to Config::self().qmlEngine() 2021-06-23 19:03:40 +01:00
Sergio Martins
844aa2f36a qtquick|minor: Move qml engine one level up 2021-06-23 18:37:34 +01:00
Sergio Martins
e2e8f10948 Fix QtQuick tests 2021-06-22 23:40:40 +01:00
Sergio Martins
1c49e2297a Fix QtQuick build 2021-06-22 23:22:02 +01:00
Sergio Martins
6f031e3c33 Windows: Fix initial FloatingWindow size in HDPI
When:
- Screen A (100%), B (150%)
- MainWindow on screen B
- Trying to open a floating window on screen A (via setGeometry())

The Qt Windows QPA would error out when setting the geometry and it
would be too small.

The solution is to call setGeometry() before we create the QWindow.

Too much of an edge case to risk putting this on 1.3 branch.
Will be in 1.4.0.

Fixes #191
2021-06-22 23:09:38 +01:00
Sergio Martins
f74fd52d53 DebugWindow: When dumping windows don't dump the DebugWindow itself 2021-06-22 17:27:27 +01:00
Sergio Martins
2d4cef670b Fix build with qtquick 2021-06-21 08:50:36 +01:00
Sergio Martins
dfaf455624 Add support for the rubber bands to be top-level
Worksaround a bug where they can't be transparent when embedded
in a MFC application
2021-06-20 21:26:43 +01:00
Allen Winter
5d2e09de36 .reuse/dep5 - add more files 2021-06-19 10:34:45 -04:00
Allen Winter
c86de50032 .resuse/dep5 - REUSE copyright+license for artwork, etc 2021-06-19 09:55:48 -04:00
Sergio Martins
5ff720f432 Export DropArea, has some useful symbols 2021-06-18 17:51:36 +01:00
Sergio Martins
6f7e47324c Minor: improve an include 2021-06-18 17:50:42 +01:00
Sergio Martins
b68f81779c Fix possible crash
Observed with an MFC application
2021-06-18 16:02:33 +01:00
Sergio Martins
4c1b433269 Fix a -Wclazy-fully-qualified-moc-types error 2021-06-17 22:02:35 +01:00
Sergio Martins
7c63da18ed Remove some dead code
Both if branches already return something
2021-06-17 13:03:00 +01:00
Sergio Martins
6f2e5ecc3b Add a missing qglobal.h include 2021-06-17 13:00:48 +01:00
Sergio Martins
759cf33f08 Windows: Link to Dwmapi.lib via pragma
So I don't have to figure out some exotic non-cmake build systems

It's more self-contained this way anyway.
2021-06-16 12:41:40 +01:00
Sergio Martins
77279d21ef Fixed a MSVC warning about unreachable code 2021-06-16 12:32:25 +01:00
Sergio Martins
46872fdfe8 Fix build if each header is built individually, probably
This header is included by QWidgetAdapter.h, but if some exotic
build system builds QWidgetAdapter_widgets_p.h individially then
we need to forward declare some functions
2021-06-15 21:35:55 +01:00
Sergio Martins
79fe9c2875 cmake: Remove private/ from our PRIVATE include path
Because some build systems don't support public/private includes,
and would require us to add private/ to the public include path.

This allows for an easier integration with some more exotic
build systems
2021-06-15 19:53:05 +01:00
Allen Winter
f04ea37ac2 appveyor.yml - disable email notification on build_success 2021-06-15 12:04:01 -04:00
Sergio Martins
d2db92f1e7 Remove private/multisplitter/ from private include path
It's not needed.
Even wrong since then ../LayoutSaver_p.h would work
2021-06-15 16:46:07 +01:00
Sergio Martins
206433e430 Fix embedding in non-KDDW QMainWindow
Supports the case of having our KDDW MainWindow parented to another
main window. Was broken on Windows.
2021-06-14 06:43:06 +01:00
Allen Winter
fb1f3fa931 CMakeLists.txt - ECM doesn't support generating pri files for Qt6 yet 2021-06-09 09:12:14 -04:00
Allen Winter
3d106ae2f1 python/CMakeLists.txt - fix for Qt6Widgets_VERSION 2021-06-08 19:01:31 -04:00
Sergio Martins
05f0a6463b Remove unnused AnimatedIndicators 2021-06-08 16:53:12 +01:00
Allen Winter
7b5d5d0f31 buildsystem - fix some --warn-uninitialized 2021-06-08 10:44:33 -04:00
Allen Winter
20174989a6 Merge branch '1.3' 2021-06-08 09:20:33 -04:00
Allen Winter
80d48adc07 docs/api/Doxyfile.cmake - set PROJECT_NUMBER to major.minor
don't use the patch level in the PROJECT_NUMBER
2021-06-08 09:19:53 -04:00
Allen Winter
3454185df4 Merge branch '1.3' 2021-06-07 17:14:25 -04:00
Allen Winter
9de0868c74 open for 1.3.2 (unknown yet if there will be such a thing) 2021-06-07 17:13:07 -04:00
Allen Winter
66cb6c7dee kddockwidgets.spec - fix for CentOS 2021-06-07 16:32:17 -04:00
Allen Winter
1ce67b1c8f prep for 1.3.1 release 2021-06-07 16:09:03 -04:00
Allen Winter
a9bb5b2f42 README.md - in Using section talk about CMAKE_PREFIX_PATH
was mistakenly CMAKE_MODULE_PATH
2021-06-07 16:01:27 -04:00
Allen Winter
97ca7fd2a0 CONTRIBUTORS: sync with master 2021-06-07 15:32:42 -04:00
Roman Pudashkin
b85e291d40 need to remove the old filter instead of the new one 2021-06-05 16:09:04 +01:00
Allen Winter
b3e3752789 .travis.yml, appveyor.yml - tweak email notification
notify on failures only
2021-05-28 08:41:16 -04:00
Sergio Martins
7cd6928b87 README: Add a travis "Build Passing" label 2021-05-25 22:07:33 +01:00
Sergio Martins
bb1b3c7b7b Fix non-windows developer build
Build was complaining about unused function
2021-05-25 14:06:14 +01:00
Allen Winter
49c7cea3a5 .travis.yml - apt install libqt5x11extras5-dev 2021-05-25 08:54:33 -04:00
Allen Winter
64f5009297 .travis.yml appveyor.yml - add travis-ci and appveyor CI 2021-05-25 08:48:01 -04:00
Eism
0ab701bab6 qtquick: Fix detecting top level geometry
For QtQuick we want the QWindow geometry. For QtWidget it just works,
as the top level widget as the same geometry as the window, unlike
QQuickItem.

Fixes issue #199
2021-05-24 11:45:37 +01:00
Sergio Martins
1721415799 Fix more warnings at shutdown 2021-05-23 22:42:26 +01:00
Sergio Martins
26269459db qtquick: Fix some warnings at shutdown 2021-05-23 22:37:42 +01:00
Sergio Martins
675da6b2e2 qtquick: Fix test on linux
Querying drop indicator doesn't work if indicator window
isn't visible, so actually do a full drag.

For issue #199
2021-05-23 22:06:05 +01:00
Sergio Martins
517bfca259 Add a unit-test for issue #199 2021-05-23 12:20:20 +01:00
Eism
3e30685eb4 Expose MainWindowBase::windowGeometry(), so it can be used
Just moves the code from private to public.
For issue #199
2021-05-23 11:34:53 +01:00
Roman Pudashkin
95cbba4618 qtquick: Fix crash by using deleteLater()
For issue #200
2021-05-22 10:22:58 +01:00
Sergio Martins
d89c6b9c06 qtquick|windows: Fix potential crash with offscreen QPA
Which also fixes a test. Now all tests pass.
The explanation was added in a comment.
2021-05-21 23:46:42 +01:00
Sergio Martins
4bda994d5c qtquick: Fix Qt6 warning about "mouse" being injected 2021-05-21 16:44:30 +01:00
Sergio Martins
2b4f6f33af qtquick: Fix Qt6 build 2021-05-21 16:38:12 +01:00
Sergio Martins
62500a322f qtquick: Fix calling titleBarFilename() function
Probably worked before, but the argument was bogus, as the
function doesn't accept arguments
2021-05-21 09:47:09 +01:00
Sergio Martins
ae58a8b9df Fix boolean variables being accessed before initialization
As detected by ASAN:
ClassicIndicators.cpp:66:12: runtime error: load of value 190, which is not a valid value for type 'bool'
2021-05-21 09:24:58 +01:00
Sergio Martins
2a8732fdcd cmake: Add preset for qtquick developer-build 2021-05-20 23:40:23 +01:00
Sergio Martins
19931ec18e cmake: Fix my Qt6 builds 2021-05-20 23:38:47 +01:00
Sergio Martins
b981fc4b7d qtquick: Fix tst_dockWindowWithTwoSideBySideFramesIntoCenter()
Moving windows around is async for QtQuick and needs a wait
2021-05-20 22:44:58 +01:00
Sergio Martins
4b2f268921 qtquick: fix tst_positionWhenShown on Windows 2021-05-20 22:44:26 +01:00
Sergio Martins
7fb5a8d444 Merge branch '1.3' 2021-05-20 18:54:18 +01:00
Sergio Martins
913cc16371 Fix failing test on Windows due to the button hack
During tests, our mouse button isn't really pressed, as we
send fake press events. Only use the workaround in production.
2021-05-20 18:47:32 +01:00
Sergio Martins
4e8a9ff8ed tests: fix a flaky test on Windows
The drop area doesn't fill the floating window, so the
center was off and the drop didn't happen

Additionally, disabled AeroSnap, for debugging purposes, so we can
actually see the window moving, otherwise it doesn't move, since
we can't fake a native drag. It's just a visual bonus, doesn't
affect the correctness.
2021-05-20 18:28:23 +01:00
Sergio Martins
68034de1a7 cmake: Fix ASAN not actually being enabled
Was only enabled for the tests.
Needed to move it up.
2021-05-20 16:41:10 +01:00
Sergio Martins
f67d8615ca cmake: Remove manually setting ASAN on Windows
It's done by ECM now
2021-05-20 16:30:23 +01:00
Sergio Martins
4483c921ea ECM: Added MSVC sanitizer support
Written by me, will squash it once upstream has it.
There's some patches in review upstream.
2021-05-20 16:19:48 +01:00
Sergio Martins
e8732ecfc0 ECM: sync sanitizers with upstream 2021-05-20 16:19:06 +01:00
Sergio Martins
71a538651a Enable ASAN on Windows too 2021-05-18 16:00:54 -07:00
Sergio Martins
18c9963124 qtquick|tests: Fix tst_lastFloatingPositionIsRestored
We need to compare the position of the Window
2021-05-18 15:00:21 -07:00
Sergio Martins
cd0f2f4e33 Introduced Config::setDropIndicatorsInhibited(bool)
Allows you to disable support for drop indicators while dragging
2021-05-18 18:00:04 +01:00
Sergio Martins
fc028ec0be Minor refactoring 2021-05-18 17:49:14 +01:00
Sergio Martins
2dbdb9f7eb qtquick: Fix restoring QWindow's geometry
We need to resize the QWindow.

Fixes issue #196
2021-05-17 22:46:56 +01:00
Sergio Martins
50f6e76e81 qtquick|examples: Don't call them "MainWindow"
Rather "main layout", as they are not top-levels, unlike for
QWidgets

As suggested in issue #196
2021-05-17 22:27:34 +01:00
Sergio Martins
c6af93adcb qtquick: When saving geometry, save the QWindow geometry
As that's what we'll restore. The "MainWindow" isn't an actual
main window, and it's parented in some QtQuick hierarchy.

Will help with issue #196, which isn't fixed yet.
Should be fixed in the restore part next.
2021-05-17 22:20:44 +01:00
Sergio Martins
bd985781b9 Minor refactoring 2021-05-17 22:13:17 +01:00
Sergio Martins
70ecdaf54c Add a failing test for issue #196 2021-05-17 21:12:59 +01:00
Allen Winter
a04287b9b3 README - adjust copyright date 2021-05-16 11:08:08 -04:00
Allen Winter
be8d00f0c8 buildsystem - KD namespace the KDAB cmake modules 2021-05-16 11:03:21 -04:00
Allen Winter
b08797c400 docs/api/footer.html - add Copyright and generatedby 2021-05-16 10:58:01 -04:00
Sergio Martins
2836edd32d qtquick: Add a test to see that main window position is restored
Will improve it with QtQuick corner cases
2021-05-10 23:04:37 +01:00
Allen Winter
92f6886217 Merge branch '1.3' 2021-05-10 15:40:46 -04:00
Allen Winter
0c9518dc74 .krazy - skip CMakePresets.json
the json formatter saves it without a trailing newline
no need to test this generated file
2021-05-10 15:40:00 -04:00
Allen Winter
944ee7c7dc Merge branch '1.3' 2021-05-10 12:58:13 -04:00
Allen Winter
917dbf09f6 README.md, README-bindings.md - breakout python bindings readme.
The python bindings info is getting long and detailed
so move to its own README.
2021-05-10 12:56:59 -04:00
Sergio Martins
d732be4e17 Merge branch '1.3' into master 2021-05-04 23:41:23 +01:00
Sergio Martins
18dbbb291a Cancel drag when Qt doesn't detect that mouse was released
On Windows there can be a case where Qt doesn't receive the mouse
release event. When releasing very fast after starting the drag.

Fixes #166
2021-05-04 23:36:50 +01:00
Sergio Martins
3bb7922f2c comments++ 2021-05-02 13:05:27 +01:00
Sergio Martins
4aedba3b2b Minor: Pass QPoint by value, as it's a small POD class 2021-05-02 13:01:27 +01:00
Eism
99c0e99b26 Implemented the method for adjusting the position of a dragged item 2021-05-02 13:00:43 +01:00
Sergio Martins
28ab554cb3 comments++ 2021-05-02 12:49:07 +01:00
Sergio Martins
cd80a47c93 qtquick|tests: Fix tst_layoutEqually
Resizing QtQuick's QWindow is async, doesn't propagate the size
immediately to the content QQuickItem.

Meaning we were passing a too small/old size to the layout.
Add qMin() so we don't pass sizes that are smaller than the layout's
min-size.
2021-05-02 12:30:53 +01:00
Sergio Martins
eb05b54b0e Added DockWidgetInstantiator::close() 2021-05-02 11:35:16 +01:00
Sergio Martins
bbbce6f694 qtquick: Fix close() not hidding the widget
QtQuick will emit a "visibleChanged(true)" when setting nullptr,
which we need to inhibit so it behaves like QtWidgets.
2021-05-02 11:22:26 +01:00
Sergio Martins
ba0d515330 qtquick: Don't run tst_maxSizedFloatingWindow
We only support max-size constraints for QtWidgets, for now.
2021-05-02 00:19:47 +01:00
Sergio Martins
69154c0384 qtquick: Make setParent(nullptr) to hide the widget too
As done for QtWidgets.

Fixes a case where closing the dock widget wouldn't hide it.

As reported by Roman
2021-05-02 00:11:58 +01:00
Sergio Martins
66ac5e9d2f qtquick: Install DockWidgetQuick.h too 2021-05-01 20:46:01 +01:00
Sergio Martins
4924b951cc qtquick: Don't include private header in public header
Q_PROPERTIES in Qt6 don't support forward declarations.
Return a QObject instead.
2021-05-01 20:38:06 +01:00
Allen Winter
96f7def396 Merge branch '1.3' 2021-05-01 15:38:38 -04:00
Sergio Martins
4556f1c949 quick|cmake: Don't install a few qtwidgets includes
Install their qtquick counterparts instead
2021-05-01 20:20:59 +01:00
Sergio Martins
a4cca3bcc2 Merge pull request #195 from RomanPudashkin/setTabbingAllowedFunc_fix
Fixed the API for disabling the tab indicator
2021-05-01 20:10:44 +01:00
Sergio Martins
6254c2089f Add two new contributors 2021-05-01 20:05:46 +01:00
Sergio Martins
89f50769b6 cmake: Remove unneeded build presets
The default/implicit one is enough for those cases
2021-05-01 19:59:14 +01:00
Sergio Martins
a24f5e31b9 Merge pull request #192 from RomanPudashkin/setMaximumSize_fix
Fixed changing of the maximum size for widgets
2021-05-01 20:00:26 +01:00
Allen Winter
b338f183e1 CONTRIBUTORS.txt - added more contributors 2021-05-01 12:30:48 -04:00
Sergio Martins
8ab8e0524b Workaround Qt bug which broke the focus chain
Focusing a tab widget would focus an hidden tab bar, which makes
the propagation stop

Fixes #180
2021-04-30 15:59:27 +01:00
Sergio Martins
affb48f44d Fix restoring side-bar widget when it was deleted previously
We need to consult the user's widget factory, just as we do
for other cases where the dock widget is missing
2021-04-29 21:36:56 +01:00
Sergio Martins
d5b2336b69 refactoring: Move the dockWidgetFactoryFunc() call
It's now an impl-detail of DockRegistry::dockByName().
Just pass DockByNameFlag::CreateIfNotFound.

Allows this functionality to be used in other places
2021-04-29 21:29:58 +01:00
Sergio Martins
580e3a6a2c Coding style: Replace a bool argument with an enum
Since we'll be adding more enumerators
2021-04-29 21:20:26 +01:00
Roman Pudashkin
e3d5203f1a fixed the API for disabling the tab indicator 2021-04-29 21:50:17 +02:00
Sergio Martins
9e42b11272 Minor coding styling 2021-04-29 18:15:45 +01:00
Sergio Martins
ce93c3b739 qtquick: Fix memory leak 2021-04-29 18:15:33 +01:00
Sergio Martins
6a8e00bfa2 tests: Test restoring with DeleteOnClose and sidebar widgets
sidebar dock widgets which were deleted should still call
the user's dock widget factory

To be done next
2021-04-29 18:06:41 +01:00
Sergio Martins
0b5a99860f qtquick: Fix calling QWindow::setTitle()
For QtWidgets, it happens fine in FloatingWindow's constructor,
because we get the corresponding QWindow already. But for QtQuick
the QWindow is only created afterwards, so we have to delay
setting the title.
2021-04-29 17:18:35 +01:00
Sergio Martins
3f012a2ef1 Remove a bogus setWindowTitle()
Setting a widget would change the top-level window title!
By luck people set the widget before docking, but doesn't have
to be that way.
2021-04-29 16:23:22 +01:00
RomanPudashkin
a102e4ae1e fixed changing of the maximum size 2021-04-29 13:20:56 +02:00
Sergio Martins
03f5817488 Merge branch '1.3' 2021-04-28 22:08:57 +01:00
Sergio Martins
0f2edfdb4e Fix hidding the pin/auto-hide icon when side-by-side in floating
An else {} branch was missing.

Also just simplify the code, and call supportsAutoHideButton()
which wasn't being used.

Also removed some bogus updateAutoHideButton() calls from
the CTOR, needs to use singleShot() since the method is virtual,
the derived class isn't constructed yet
2021-04-28 22:06:42 +01:00
Sergio Martins
d289134b15 Add a unit-test for disabling RelativeFloatingWindowGeometry
Fixes #175
2021-04-28 21:27:47 +01:00
Sergio Martins
7475c7cc71 Remove unneeded include 2021-04-28 21:15:08 +01:00
Sergio Martins
7958eeeded Fully qualify LayoutSaver_p.h includes
Now that it's installed
2021-04-28 21:13:44 +01:00
Sergio Martins
f29f773555 Add a LayoutSaver_p.h fwd header 2021-04-28 21:10:23 +01:00
Sergio Martins
a113205881 Install LayoutSaver_p.h
Moved it into private/ too, not sure why it was in src/

For issue #175
2021-04-28 21:08:41 +01:00
Sergio Martins
7830ccb017 Move LayoutSaver::Private to the header 2021-04-28 21:00:26 +01:00
Sergio Martins
6a205a5406 Move some Layout::Private method definitions out of the class
In preparation to move the class to an header
2021-04-28 20:55:16 +01:00
Sergio Martins
d91a42930d Expose LayoutSaver::Private 2021-04-28 18:01:37 +01:00
Sergio Martins
6f3df707f4 Split RestoreOption_RelativeToMainWindow into more granular options
Mostly so we can have RestoreOption_RelativeToMainWindow but
without restoring floating windows

Said options are internal (for now?), we'll need more feedback before
turning them public (since once public forever public)

For issue #175

We'll add some private API so users can change the flags in the next
commit
2021-04-28 17:43:24 +01:00
Sergio Martins
f388b11d0d Added MainWindowBase::frameCountChanged()
So you can know when the layout added or removed dock widgets
Fixes #190
2021-04-28 16:28:04 +01:00
Sergio Martins
66d12fef82 fix build 2021-04-27 23:56:58 +01:00
Sergio Martins
83c744041e Merge branch '1.3' 2021-04-27 23:52:17 +01:00
Sergio Martins
dcac39a35f Don't restore window's maximized state when using RestoreOption_RelativeToMainWindow
We don't restore main window's geometry either
Fixes issue #184
2021-04-27 23:50:40 +01:00
Sergio Martins
c4d3ba71b2 Fix crash due to MainWindow not clearing m_overlayedDockWidget
When we close the overlayed widget we need to clear this variable

Added 1 real fix and a prophylactic check too.
2021-04-27 23:49:26 +01:00
Sergio Martins
74c74593e2 Don't restore window's maximized state when using RestoreOption_RelativeToMainWindow
We don't restore main window's geometry either
Fixes issue #184
2021-04-26 19:19:06 +01:00
Sergio Martins
62591bc360 quick: Use logical dpi factor of 1 for now
Only physical dpi scaling suported currently
2021-04-25 21:24:56 +01:00
Sergio Martins
1fca162fb2 quick|example: Enable hpdi scaling 2021-04-25 10:47:07 +01:00
Sergio Martins
82967435ea Added QtQuickHelpers::logicalDpiFactor() 2021-04-25 10:37:47 +01:00
Sergio Martins
7738354be1 Minor coding style fix 2021-04-25 10:26:09 +01:00
Sergio Martins
0d2166770e quick: Add a QtQuickHelpers class into the context
Will have some useful stuff there. Don't have a better place to put them.
2021-04-25 10:24:07 +01:00
Sergio Martins
9d7de9ea4d Fix sizing of widgets that skip LayoutSaver's restore
LayoutWidget::onResize() was bailing out early, but the actual
restore hadn't even started
2021-04-23 19:39:07 +01:00
Sergio Martins
5aa3ba25cc cmake: Add a Gammaray friendly preset
ASAN doesn't like Gammaray injection
2021-04-23 19:01:10 +01:00
Sergio Martins
b330f902fd tests: Move class into the header
File is getting too big
2021-04-23 18:03:49 +01:00
Sergio Martins
aa76dfba02 LayoutSaver: Support the user's factory func doing remapping
While restoring a layout, we expect all widgets to exist already,
but we allow the user to create them delayed, by providing
us a factory function.

What we're supporting in this commit is the ability of the user's
factory function returning a dock widget with an ID different
than the one that was requested. We then save that mapping so the
rest of the layout restore works with the new ID.
2021-04-23 14:55:01 +01:00
Sergio Martins
b3c2d87a9b Remove unused MULTISPLITTER_LAYOUT_MAGIC_MARKER 2021-04-23 14:35:29 +01:00
Sergio Martins
cc1347adf8 qtquick: Don't use native windows drop shadow with round corners
When using the Windows native drop shadow, the client area needs
to be rectangular, otherwise a white line appears at the top
2021-04-23 11:47:37 +01:00
Sergio Martins
df0a80b320 qtquick: Config::InternalFlag_UseTransparentFloatingWindow
Don't use a transparent floating window by default.
This matches QtWidgets behaviour.

It's only use would be to get round corners, but doesn't work well
with Window's drop shadow
2021-04-23 11:39:57 +01:00
Sergio Martins
26f7557834 cmake: Disable CCACHE when running the clazy preset 2021-04-23 09:50:51 +01:00
Sergio Martins
e6c2f29532 cmake: Specify which clazy checks to use
Trivial now with cmake presets
2021-04-22 15:44:16 +01:00
Sergio Martins
37cc16fe17 Fix a -Wsign-conversion warning
error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
2021-04-21 20:35:56 +01:00
Sergio Martins
c7ac88836a Fix some clazy errors
Mostly about using qualified names for methods called from QML
2021-04-21 20:25:45 +01:00
Sergio Martins
536e048f1c Fix build with Qt 5.9
The needed overload was introduced in Qt 5.10 only
2021-04-21 19:08:30 +01:00
Sergio Martins
4671848428 vscode: Also add C_Cpp.autocompleteAddParentheses to the other workspaces 2021-04-20 23:03:36 +01:00
Sergio Martins
4449785e2c vscode: Enable C_Cpp.autocompleteAddParentheses 2021-04-20 23:02:35 +01:00
Sergio Martins
39deb9ee83 tests: Minor refactoring, reduce copy-paste 2021-04-20 23:02:07 +01:00
Sergio Martins
2266f4a75c Fix FloatingWindow max size when there's tabbed dock widget
We don't support this case yet
2021-04-20 22:56:26 +01:00
Sergio Martins
06b680f603 Also update FloatingWindow's max size when children change constraints
A dock widget can change its max size later in life, so we need
to react to that
2021-04-20 22:52:08 +01:00
Sergio Martins
ec6be7d1a5 Fix potential crash 2021-04-20 22:51:43 +01:00
Sergio Martins
37040bfc9e Also update FloatingWindow max-size when adding nested dock widgets
We only support FLoatingWindow max-size when there's 1 frame.
When adding more, we need to remove the max size
2021-04-20 22:34:36 +01:00
Sergio Martins
1f4f7ec0e5 FloatingWindow now honours max size of the docked widget
Only if there's a single dock widget though.
Tabbed cases are more complicated as QStackedLayout doesn't
propagate size constraints
2021-04-20 21:00:33 +01:00
Sergio Martins
a31571ab2c Bound FloatingWindow::maxSizeHint()
Can't be bigger than Qt's hardcoded limit
Fixes a warning emitted by Qt
2021-04-20 20:57:14 +01:00
Sergio Martins
714ef2adb8 cmake: Fix a preset name
We don't have dev-qtquick6.
Should probably be added.
2021-04-20 20:22:24 +01:00
Sergio Martins
e447bbf03b vscode: Don't specify tasks
The cmake extension takes care of this
2021-04-20 20:18:32 +01:00
Sergio Martins
3846b638fb cmake: Add build presets too
This is new in cmake 3.20 and makes the vscode experience much better
2021-04-20 20:16:44 +01:00
Sergio Martins
6ae8a203d9 qtquick: Fix build 2021-04-20 19:43:26 +01:00
Sergio Martins
1dbd491738 Minor: Move a comment to another place 2021-04-20 19:16:14 +01:00
Sergio Martins
e8693edb33 Minor refactoring: Factor out the FloatingWindow max size code
Created FloatingWindow::maxSizeHint()
2021-04-20 19:13:32 +01:00
Sergio Martins
5cbad00cb5 Minor coding style: bail out early 2021-04-20 18:47:34 +01:00
Sergio Martins
c6e4deb0ca Merge branch '1.3' 2021-04-19 09:47:43 +01:00
Sergio Martins
693fb84a3e Fix DockWidgetBase::isFocusChanged() not being emitted
The previous commit fixed that the dock widget wasn't
getting focused on tab change, but didn't fix the signal.

When changing tabs, FocusScope::setFocused() would bailout
early because it was already focused, so never emitted
the signal for the new focused dock widget.

Refactored the code a bit and it's more robust now.
Setting the current focused widget is now centralized in
DockRegistry. Before it was split in two different places.

Fixes issue #188
2021-04-19 09:42:59 +01:00
Sergio Martins
b0a7d5d4a0 Merge branch '1.3' 2021-04-19 00:16:39 +01:00
Sergio Martins
818acc0ff1 Fix edge case when focusing FocusScope and tab bar is focused
When we focus a FocusScope we focus the last focused widget
inside that scope. But it could happen that the last focused widget
was the tab bar itself, which isn't very useful.

Fixes issue #188
2021-04-19 00:15:15 +01:00
Sergio Martins
819fec6061 Implement missing function body 2021-04-18 23:56:21 +01:00
Allen Winter
4ea8c98243 cmake/QtInstallPaths.cmake - don't cache the QT_FOO variables
makes changing Qt versions easier
2021-04-16 07:55:40 -04:00
Sergio Martins
95317a7336 Add signal DockWidget::aboutToDeleteOnClose()
It's emitted when the dock widget is going about deleted due to
the DeleteOnClose functionality
2021-04-14 15:24:15 +01:00
Allen Winter
9b6abfbbc3 src/private/quick/MainWindowInstantiator_p.h - fix include guard 2021-04-12 08:41:13 -04:00
Sergio Martins
4bee3023d2 SegmentedIndicators: Don't show inner segments when having only 1 frame 2021-04-12 10:52:48 +01:00
Sergio Martins
45f12db8d3 windows: Fix place of export macro for namespace 2021-04-12 10:02:50 +01:00
Sergio Martins
9956b3fed3 qt6: Fix KDDW build on Windows
Namespace needs to be exported due to Q_NAMESPACE
2021-04-12 09:57:49 +01:00
Sergio Martins
374e837aa9 Allow to style SegmentedIndicator 2021-04-09 17:01:20 +01:00
Sergio Martins
6ffd3e574f qtquick: Add support for LayoutSaver
You can now instantiate LayoutSaver {} in QML and save/restore
layouts
2021-04-08 23:23:24 +01:00
Sergio Martins
8a3706f6cb docs: document LayoutSaver's internals
explains the 2-phase restore
2021-04-08 20:46:13 +01:00
Sergio Martins
faa16ad910 docs: Add some doxygen to LayoutSaver 2021-04-08 20:39:23 +01:00
Sergio Martins
eb69e25622 qtquick: More invokables 2021-04-08 20:33:48 +01:00
Sergio Martins
b006bb0c3c vscode: Remove empty MIModes
On MSVC they are not required, and the editor highlights them
as wrong
2021-04-08 19:58:00 +01:00
Sergio Martins
02ed50b336 vscode: Add launches for qtwidgets 2021-04-08 19:47:39 +01:00
Sergio Martins
f0023bc084 README-QtQuick: Mention workaround for lagging windows 2021-04-08 12:23:26 +01:00
Sergio Martins
6502f7760d README-QtQuick: Mention there's some slowness in some rare setups 2021-04-08 11:53:42 +01:00
Sergio Martins
7606691ea3 QtQuick: Add more properties to DockWidgetInstantiator 2021-04-08 10:28:21 +01:00
Sergio Martins
257a1e9474 vscode: Remove tests_launcher from launchers
It's not something devs need to run manually
2021-04-07 22:44:36 +01:00
Sergio Martins
9f02ccbb48 qtquick: Add more properties to DockWidgetBase.h 2021-04-07 22:42:33 +01:00
Sergio Martins
a18199e9a2 vscode: Add launches for qtquick 2021-04-07 22:41:44 +01:00
Sergio Martins
cdd6f998c4 qtquick: Add a missing Q_ENUM 2021-04-07 22:20:15 +01:00
Sergio Martins
df21b6fc6f qtquick Add a bunch of invokables to the MainWindowInstantiator_p.h 2021-04-07 22:16:54 +01:00
Sergio Martins
edf7dee78e qtquick: Add more properties and Q_INVOKABLE to main window 2021-04-07 22:05:51 +01:00
Sergio Martins
f723e5ea59 qtquick: Add some properties to main window 2021-04-07 21:48:05 +01:00
Sergio Martins
748243f512 qtquick: Allow to call addDockWidget() from QML 2021-04-05 22:56:08 +01:00
Sergio Martins
e7d37402d7 Rename DefaultSizeMode::None
Fixes QtQuick warnings about two different enum class having an
enumerator called "None"

Known QML limitation with "enum class"
2021-04-05 22:33:11 +01:00
Sergio Martins
7c101ae3af qtquick: comments++ 2021-04-05 20:41:59 +01:00
Sergio Martins
cf9cdd8b3b qtquick: Add some Q_INVOKABLE to MainWindowBase 2021-04-05 20:37:58 +01:00
Sergio Martins
b18783c17a qtquick: Add some Q_ENUM_NS 2021-04-05 20:36:38 +01:00
Sergio Martins
201d06d878 qtquick: Use MainWindowOption instead of int for the property too 2021-04-05 20:32:11 +01:00
Sergio Martins
742ef7d529 qtquick: Use the MainWindowOptions enum instead of int 2021-04-05 20:28:57 +01:00
Sergio Martins
3d73fc10cd qtquick: Add some Q_INVOKABLE to DockWidgetBase.h
So these methods can be called from QML
2021-04-05 18:50:25 +01:00
Sergio Martins
075c1b06f7 qtquick: Add some Q_INVOKABLE to DockRegistry
So they can be called from QML if the user wants
2021-04-05 18:42:15 +01:00
Sergio Martins
2706a3d379 qtquick: Add "Close All" option in the example 2021-04-05 18:31:56 +01:00
Sergio Martins
e476dce1d4 qtquick: Fix some undefined warnings at shutdown 2021-04-05 18:06:07 +01:00
Sergio Martins
2f25657cfa Fix QtQuick build 2021-04-05 17:08:47 +01:00
Sergio Martins
1167545199 Update Changelog 2021-04-05 16:51:36 +01:00
Sergio Martins
fcd1fae77e qtquick: Add a MenuBar to the example, allows to toggle 2021-04-05 16:48:13 +01:00
Sergio Martins
06db10561c qtquick: Use QQmlApplicationEngine in the examples
So we can add menus and such
2021-04-05 16:41:45 +01:00
Sergio Martins
ead9e8945e qtquick: Allow to add the guest widget declaratively
This is an alternative to setting source
2021-04-05 16:22:56 +01:00
Sergio Martins
15d4f77d5d Revert "qtquick: Remove unused QQuickItem::classBegin()"
This reverts commit e4fdf33cfc.
Looks like it's needed.

Need to debug why calling QQuickItem::classBegin cause the main window
to not show anything
2021-04-05 15:59:59 +01:00
Sergio Martins
c903a64726 Use a QQuickItem as MainWindowInstantiator's parent
This is simpler, no need for QWidgetAdapter
2021-04-05 15:47:12 +01:00
Sergio Martins
8fa63a8773 qtquick: Remove unneeded private import 2021-04-05 15:06:57 +01:00
Sergio Martins
8a0e6c90b9 qtquick: the user will now use "MainWindowLayout" instead of "MainWindow"
As MainWindow wasn't actually a window.

While for QtWidgets it makes sense for it to be a QMainWindow, in
QtQuick let's make it easy to embed a dock widget layout.

Also, our MainWindowQuick doesn't have any menus and what not that
QMainWindow has.
2021-04-05 15:04:27 +01:00
Sergio Martins
e4fdf33cfc qtquick: Remove unused QQuickItem::classBegin()
No need to override it
2021-04-05 14:56:06 +01:00
Sergio Martins
548e38fca0 qtquick: Don't create two main windows with the same name 2021-04-05 14:48:51 +01:00
Sergio Martins
c804c806e1 Add DockRegistry::containsMainWindow(uniqueName) 2021-04-05 14:48:43 +01:00
Sergio Martins
7c291691aa qtquick: Fix customtitlebar example 2021-04-05 14:43:51 +01:00
Sergio Martins
cec8cf25ef Rename MainWindowWrapper to MainWindowInstantiator
Makes it consistent with DockWidgetInstantiator.
Creates the main window onComplete, no need for the user
to call init() explicitly anymore
2021-04-05 14:42:46 +01:00
Sergio Martins
5a2812ecf3 qtquick: Fix undefined variable error in example 2021-04-05 14:35:40 +01:00
Sergio Martins
0f09ba717f qtquick: Move the "Another" button into the main window 2021-04-05 14:09:59 +01:00
Sergio Martins
1026abbbf4 qtquick: Make DockWidgetInstantiator a QQuickItem instead of only QObject
Can be put in Repeater now
2021-04-05 13:57:57 +01:00
Sergio Martins
5b578c86e8 qtquick: Fix build 2021-04-05 13:50:15 +01:00
Sergio Martins
d7e4a782c1 qtquick: Add missing signal
Fixes tests
2021-04-05 06:43:59 +01:00
Sergio Martins
d65dfeceb0 Fix QtQuick developer build 2021-04-05 06:34:44 +01:00
Sergio Martins
e9a7a3a5f5 Merge branch '1.3' 2021-04-05 06:27:45 +01:00
Jacob Young
8504252142 Handle tab icon updates
Closes PR #135
2021-04-05 06:26:47 +01:00
Sergio Martins
19730ab6a4 Fix crash when using MainWindow::layoutEqually()
When distributing space we should honour the other widgets
min-size too, and not give too much

Since the layouting code is complex, this won't be backported to
1.3
2021-03-31 15:23:24 +01:00
Sergio Martins
44ae75110b Added MainWindowBase::closeAllDockWidgets() 2021-03-31 10:51:20 +01:00
Sergio Martins
4ab2a93d59 Merge branch '1.3' 2021-03-31 10:01:18 +01:00
Sergio Martins
f82ea82403 Harden Item::layoutEqually()
Could cause an infinit loop if the layout was corrupted
2021-03-31 10:00:28 +01:00
Sergio Martins
fff6c004e0 Pass -warn-uninitialized to cmake 2021-03-26 13:46:02 +00:00
Allen Winter
75c7744e59 move the class private header up in the include order 2021-03-23 08:36:24 -04:00
Allen Winter
1e8bdba2dd minor spelling fix 2021-03-23 07:47:31 -04:00
Allen Winter
2587831855 src/MainWindowMDI.cpp - add trailing newline 2021-03-23 07:46:27 -04:00
Allen Winter
f00a283722 fix SPDX-FileCopyrightText: and Author: lines 2021-03-23 07:44:37 -04:00
Sergio Martins
e3b333aca8 Make DockWidget::raise() raise the frame in MDI mode 2021-03-18 15:08:54 +00:00
Sergio Martins
c9602c2b0a Merge branch '1.3' into master 2021-03-15 18:25:25 +00:00
Sergio Martins
c660c80a15 Added DockWidgetBase::frameGeometryChanged() 2021-03-15 18:25:01 +00:00
Sergio Martins
6f889d1c3b Fix indicator overlay z-order when using Flag_KeepAboveIfNotUtilityWindow
The overlay window needs to be on top

Fixes #181
2021-03-15 18:23:00 +00:00
Sergio Martins
80577832d7 Add a file with QtQuick TODO items
Will be updating this as I go.

Mostly only more elegant API is needed at this point.

Closing #49 as all questions were answered.

Fixes #49
2021-03-14 15:41:57 +00:00
Allen Winter
7a18ef77cd buildsystem - fix more cmake --warn-unitialized
* PROJECT_VERSION - explicitly set for ECMSetupVersion
* SHIBOKEN_CUSTOM_PATH - init (rename to SHIBOKEN_CUSTOM_PREFIX)
* PYSIDE2_CUSTOM_PREFIX - init
* PYSIDE_EXTRA_INCLUDES (removed, not used)

Task-Id: KDDW-30
2021-03-13 17:27:47 -05:00
Allen Winter
e29f7cb1d3 CMakeLists.txt - fixup a bit of documentation 2021-03-13 17:08:55 -05:00
Sergio Martins
8970274810 cmake: Fix some --warn-uninitialized warning 2021-03-13 09:51:06 +00:00
Sergio Martins
d57fd8bfd3 cmake: Uncomment the QtQuick option
People can try it now
2021-03-13 09:39:23 +00:00
Sergio Martins
8507866891 cmake: Remove the fat warning about QtQuick
It can be tried now
2021-03-13 09:37:31 +00:00
Sergio Martins
425d53fbe3 cmake: Remove unused ${RESOURCES_QUICK} variable 2021-03-13 09:35:56 +00:00
Sergio Martins
b0cb983830 qtquick: relax the warning about removing dock widget twice
can happen due to benign reentrancy
2021-03-10 13:38:22 +00:00
Sergio Martins
02515d8956 MDI: Fix dock widget size getting out of sync with the layout item
When resizing with mouse, update the layout item too.

Wasn't a big deal, as this is MDI, layout doesn't do much. But
last used geometries werent being saved
2021-03-09 20:30:41 +00:00
Sergio Martins
447b4337dd Add DockWidget::frameGeometry() 2021-03-09 17:55:36 +00:00
Sergio Martins
633daf124e Fix some warnings about shadowing methods 2021-03-09 15:43:36 +00:00
Sergio Martins
446560931b MDI: Fix docked widget geometries not being remembered when floating
We shouldn't move the Frame directly. Instead, do it through the
layout, which will then remember the last docked geometry
2021-03-07 16:56:37 +00:00
Sergio Martins
9fe11a7ad5 qtwidgets|MDI: Fix showing resize handles
if there was no frame being resized it would be nullptr, and hence
enter that block.

QtQuick not affected since it uses mouse areas to change the cursor
shape
2021-03-05 12:19:16 +00:00
Sergio Martins
b099994ac5 qtquick|MDI: Remove the QtQuick special case
Now behaves as QtWidgets
2021-03-05 12:05:19 +00:00
Sergio Martins
a8d56ef4e6 qtquick6: Fix build 2021-03-04 13:57:25 +00:00
Sergio Martins
1f8d212dee Qt6: Fix build
Types in properties can't be forward declared anymore
2021-03-04 13:27:58 +00:00
Sergio Martins
64ea87f4cc Add missing fwd header for Frame_p.h 2021-03-04 13:27:32 +00:00
Sergio Martins
e6fef433d5 Added DockWidgetQuick::frame() 2021-03-03 17:59:43 +00:00
Sergio Martins
2f212031b3 qtquick|MDI: Don't set a size smaller than its min 2021-03-03 17:03:06 +00:00
Sergio Martins
586ab710f6 qtquick: Expose the tabbar height property 2021-03-03 16:36:23 +00:00
Sergio Martins
d263ae649e Allow to configure the MDI popup threshold 2021-03-03 16:33:32 +00:00
Sergio Martins
c81ca45e41 qtquick|MDI: Improvements for resizing 2021-03-03 15:21:22 +00:00
Sergio Martins
9ce50fa305 qtquick: Minor refactoring, deal in CursorPosition 2021-03-03 14:59:24 +00:00
Sergio Martins
f0240deaeb qtquick: Use Q_NAMESPACE for the KDDockWidgets namespace 2021-03-03 14:40:24 +00:00
Sergio Martins
017f06dcfb qtquick|MDI: Improvements for the resize handler
More margin, fixed sizes of some handlers and fixed z order
2021-03-03 13:47:14 +00:00
Sergio Martins
54f17cb546 qtquick: Remove unneeded mouse area from frame
Just to simplify things. Let's just have the resize handlers.
A target can have many event sources.
2021-03-03 13:22:12 +00:00
Sergio Martins
f174ab6ebc qtquick: Create ResizeHandlerHelper.qml to save some code 2021-03-03 12:57:37 +00:00
Sergio Martins
263f936690 Fix dock widgets in MDI getting bogus sizes
Setting the Item's min-size would resize the guest while the
guest was being set
2021-03-03 12:20:40 +00:00
Sergio Martins
bd903a0353 qtquick: Fix Frame's minimum size
It wasn't accounting for the margins, and the "heightWhenVisible"
property was Nan, making the entire expression be 0
2021-03-03 10:08:37 +00:00
Sergio Martins
5040d3a6b6 qtquick: Allow to update the size constraints from QML 2021-03-03 10:02:45 +00:00
Sergio Martins
3684da776d Added DockWidgetQuick::frameVisualItem() 2021-03-03 09:27:27 +00:00
Sergio Martins
bc17c8e5b3 MDI: Don't active other resize handlers when resize in progress
When we're resizing a docked dock widget, the other dock widget's
resize handlers should be disabled
2021-03-02 22:21:12 +00:00
Sergio Martins
778c647782 qtquick: Register Frame 2021-03-02 22:14:07 +00:00
Sergio Martins
2a91f6279b qtquick: Minor code refactoring
Uses less code
2021-03-02 22:05:48 +00:00
Sergio Martins
4ef2ddbfec Add DockRegistry::frameInMDIResize()
Only emitted in a MDI layout. Emitted when one dockwidget is
being resized
2021-03-02 22:00:54 +00:00
Sergio Martins
ff06f0cc73 Fix build 2021-03-02 21:06:57 +00:00
Sergio Martins
a37ab34fae qtquick|MDI: When dragging don't trigger the resize drag handlers
MouseArea.enabled, even if false, will change the cursor shape.
So explicitly change the cursor to ArrowShape
2021-03-02 20:58:44 +00:00
Sergio Martins
cb2ffe66af qtquick|MDI: Fix resizing inner MDI dock widgets
It was flaky. The mouse move events came from global event filter
but the mouse press came from the Frame's mouse area. Sometimes the
QQuickWindow wouldn't deliver the press to the frame if it was done
outside, while the moves were changing the cursor shape since
we had a treshold

Now we guarantee that whenever the cursor changes the resize
will really happen
2021-03-02 14:40:42 +00:00
Sergio Martins
16b0770d72 qtquick: Fix minor qml warning 2021-03-02 14:31:15 +00:00
Sergio Martins
3fe44ee735 qtquick: Enable transparency for the floating window
You can now have windows with round corners
2021-03-02 12:19:51 +00:00
Sergio Martins
40d1a72300 qtquick: Fix QtQuick min-sizes not working when wrapped 2021-03-02 11:02:15 +00:00
Sergio Martins
4d428d42f6 Added DockWidgetBase::setMDIZ(int z)
Sets the Z order of the dockwidget within the MDI layout
2021-03-02 10:43:07 +00:00
Sergio Martins
7e9896263b Update .gitignore 2021-03-02 10:22:57 +00:00
Sergio Martins
cf0665c9b6 Added DockWidgetBase::setMDISize()
Only for dock widgets in MDI layout, where they are freely resizable
2021-03-02 10:21:29 +00:00
Sergio Martins
93c011c69d Added DockWidgetBase::setMDIPosition(QPoint pos)
Moves the window within the layout.
Only applies to MDI layouts.
2021-03-01 23:41:53 +00:00
Sergio Martins
f50c0b9d06 qtquick: Fix typo 2021-03-01 23:24:29 +00:00
Sergio Martins
6fc79d942b qtquick: add a way to disable the default mouse redirectors
So user can use his own
2021-03-01 23:23:04 +00:00
Sergio Martins
d01228d9ff Fixes cases where actualTitleBarChanged() wasn't emitted 2021-03-01 23:02:56 +00:00
Sergio Martins
b58d766d54 qtquick: Add Q_INVOKABLE to DockWidgetBase::setFloating() 2021-03-01 22:38:23 +00:00
Sergio Martins
79cbb96a38 Remove some unneeded qDebug 2021-03-01 22:34:15 +00:00
Sergio Martins
aabaeacb81 Improve a warning 2021-03-01 22:30:31 +00:00
Sergio Martins
3ab3e6d41b qtquick: Don't allow to have two redirectors for the same source
One event source can only have one redirector
2021-03-01 22:23:46 +00:00
Sergio Martins
f2f4afd0bb qtquick: Allow the user to customize the titlebar margins 2021-03-01 20:50:46 +00:00
Sergio Martins
0d62c43b9e qtquick: keep the original parent of the guest around
For debug purposes
2021-03-01 19:58:00 +00:00
Sergio Martins
1614d5702c Allow to call DockWidget::setWidget(nullptr)
In case you need to change ownership
2021-03-01 19:56:46 +00:00
Sergio Martins
610b9542e9 qtquick: Expose the event source for debug purposes 2021-03-01 17:13:54 +00:00
Sergio Martins
946f32a274 qtquick: debug++ 2021-03-01 17:12:09 +00:00
Sergio Martins
c7a6bc015e qtquick: Minor performance optimization
Only check the properties for mouse events
2021-03-01 16:54:32 +00:00
Sergio Martins
19fd1635e6 Remove userType() from public API for now
If added, will need to be through overloads, to not break source
compat. Will add them once there's a need.
2021-03-01 16:34:22 +00:00
Sergio Martins
74b034a195 Merge branch '1.3'
Fixes #172
2021-03-01 15:48:45 +00:00
David Faure
581139d099 SideBarButton: use color roles from the widget palette 2021-03-01 16:42:59 +01:00
Sergio Martins
e5492ea906 qtquick: Allow to override the mouse redirector 2021-03-01 14:50:14 +00:00
Sergio Martins
623133a0dc qtquick: Add DockWidgetQuick::actualTitleBar()
It's a pointer o either Frame::titleBar() or FloatingWindow::titleBar().
It's the same as Frame::actualTitleBar().
2021-03-01 14:35:14 +00:00
Sergio Martins
6baa8f2dbb qtquicl: Fix invisible tab bar eating mouse events 2021-03-01 14:19:39 +00:00
Sergio Martins
d2739d7218 qtquick: disable tabbar mouse area if tabbar hidden 2021-03-01 13:15:30 +00:00
Sergio Martins
5702101935 Add a Q_PROPERTY for Frame::actualTitleBar() 2021-03-01 12:50:25 +00:00
Sergio Martins
35d45a7523 qtquick: Fix some places which weren't forwarding userType 2021-02-28 20:44:19 +00:00
Sergio Martins
e37c1f0e8c qtquick: Pass the userType all the way to titleBarFilename() 2021-02-28 20:33:46 +00:00
Sergio Martins
ac0d35ef12 Fix clazy warning 2021-02-28 19:03:16 +00:00
Sergio Martins
15e63381a9 Added DockWidgetBase::setUserType(int)
This is an opaque value which KDDW won't try to interpret or do
anything with it other than forward it to the FrameworkWidgetFactory.

Which if specialized by the user he can have different title bars
for different said "dock widget types"
2021-02-28 18:57:35 +00:00
Sergio Martins
aa49ddacd5 qtquick: Allow the user to change the contents margin for Frame 2021-02-28 18:13:55 +00:00
Sergio Martins
f68e876bcb qtquick: Make the setWidget(QQuickItem) overload also fill parent 2021-02-28 16:05:44 +00:00
Sergio Martins
6b82ded399 qtquick: Allow derived FloatingWindow to override margins 2021-02-28 16:04:28 +00:00
Sergio Martins
000e67a09e qtquick: Register DockWidgetBase 2021-02-28 15:26:05 +00:00
Sergio Martins
1b6aa4c3d1 qtquick: Inject the dock registry into the context
Useful to call from QML if needed
2021-02-28 15:01:05 +00:00
Sergio Martins
8912a2c842 Remove debug 2021-02-28 14:50:12 +00:00
Sergio Martins
4de50db68c Added DockWidgetQuick::setWidget(QQuickItem*) overload
And expose it to QML
2021-02-28 14:48:09 +00:00
Sergio Martins
6b95e4aac9 Allow to add to MDI area and start as hidden
It will remember its position
2021-02-28 00:51:12 +00:00
Sergio Martins
c27658822e Add MainWindowMDI::addDockWidget() taking QPointF 2021-02-28 00:24:08 +00:00
Sergio Martins
8ec980c1e8 Add convenience DockRegistry::mdiMainWindowByName() 2021-02-28 00:20:33 +00:00
Sergio Martins
a952c5829a qtquick: Add MainWindowMDI.qml
A convenience wrapper
2021-02-27 23:48:15 +00:00
Sergio Martins
20e1b55a8a qtquick: make sure our QML types are registered early on 2021-02-27 15:52:31 +00:00
Allen Winter
a2605868db Merge branch '1.3' 2021-02-26 18:30:03 -05:00
Allen Winter
67be35b9f8 CMakeLists.txt - don't create the dummy docs target
it can conflict when used as a submodule
2021-02-26 18:29:10 -05:00
Allen Winter
b15eb1e62f Merge branch '1.3' 2021-02-26 17:09:08 -05:00
Allen Winter
d2e3ec0448 buildsystem - add a 'docs' target
only available with cmake -DKDDockWidgets_DOCS=true
2021-02-26 17:07:58 -05:00
Allen Winter
828c403fe5 Merge branch '1.3' 2021-02-26 16:40:18 -05:00
Allen Winter
53d3bc86ea conan - support build_with_qt6 2021-02-26 16:35:33 -05:00
Allen Winter
6ed8742cc1 buildsystem - install library with "-qt6" when built for Qt6 2021-02-26 16:35:08 -05:00
Sergio Martins
7bd047f6e6 qtquick: Make DockWidget.qml be a Rectangle
So user can change its color
2021-02-26 19:29:30 +00:00
Sergio Martins
482757b1cc qtquick: Don't hardcode "FloatingWindow.qml"
Allow the user to specify their impl
2021-02-26 19:21:42 +00:00
Sergio Martins
c143f832c6 qtquick: Don't hardcode "Frame.qml"
Allow the user to specify their impl
2021-02-26 19:12:53 +00:00
Sergio Martins
67a173ef53 qtquick: Don't hardcode "DockWidget.qml"
Allow the user to specify their impl
2021-02-26 18:57:31 +00:00
Sergio Martins
c2c37488a3 Merge branch '1.3' 2021-02-26 17:26:35 +00:00
Sergio Martins
8c1840b9cf Fix popups in overlayed dockwidgets not working 2021-02-26 17:26:04 +00:00
Sergio Martins
1088e37cd4 Improve warning 2021-02-26 17:00:22 +00:00
Sergio Martins
4d6c3dac3d qtquick: Warn there's no QQmlEngine set 2021-02-26 16:58:58 +00:00
Sergio Martins
adf29873ef Define KDDOCKWIDGETS_QTQUICK when linking against QtQuick KDDW
This is added when building, but also needs to be in the public
interface
2021-02-26 16:47:04 +00:00
Sergio Martins
772afe29ea Merge branch '1.3' 2021-02-26 15:45:46 +00:00
Sergio Martins
9c78953800 Fix tests on linux
Native title bar is specific to Windows
2021-02-26 15:38:00 +00:00
Sergio Martins
ff67b9bcbc Merge branch '1.3' into master 2021-02-26 15:20:32 +00:00
Sergio Martins
103de4f910 Update ChangeLog 2021-02-26 15:15:29 +00:00
Sergio Martins
7c3f06f98f When using a native title bar make floating window geometry smaller
When undocking a dock widget, the size of the dock widget should
be maintained

Fixes #174
2021-02-26 15:12:43 +00:00
Sergio Martins
6ac77a7662 Use the flags instead of the enum 2021-02-26 14:36:22 +00:00
Sergio Martins
610b85d01a Minor readability improv: replace bool with enum
CC issue #174
2021-02-26 14:32:55 +00:00
Sergio Martins
d4d222ebd3 Update ChangeLog 2021-02-25 22:01:54 +00:00
Sergio Martins
5cbed1d34b if native title bar + Qt::Tool, double-click should redock
When using the native Windows title bar with Qt::Tool, double-clicking
the title bar should redock the window.

Fixes #173
2021-02-25 21:59:43 +00:00
Sergio Martins
ba4a2eef5c Also cancel a drag if we receive a non-client double click 2021-02-25 21:58:12 +00:00
Sergio Martins
acdf03fc84 Merge branch '1.3' into master 2021-02-24 13:56:28 +00:00
Sergio Martins
a6f19e07c4 Fixed Flag_NativeTitleBar not hidding the client title bars
When restoring the layout the native title bar would be visible
Fixes #170
2021-02-24 13:52:44 +00:00
Sergio Martins
f07301bb1e Update ChangeLog 2021-02-24 12:10:38 +00:00
Sergio Martins
2116e3741b Improve restoring layout when RestoreOption_RelativeToMainWindow is used
Doesn't make much sense to apply a scalling factor to the floating window's
position. Instead we should apply the factor to the delta position between
the main window and the floating window

Fixes #171
2021-02-23 21:02:01 +00:00
Sergio Martins
1f11c732ed Remove unused function 2021-02-23 20:16:32 +00:00
Sergio Martins
e42bee27a4 Remove unused function 2021-02-23 20:14:25 +00:00
Sergio Martins
b36dcf1325 Fix macOS developer-build due to unused variable 2021-02-22 10:46:56 +00:00
Sergio Martins
421746c943 Margins now honour logical dpi and update when changing screen 2021-02-22 00:02:57 +00:00
Sergio Martins
f544ac58e6 Apply the logical DPI factor to the MainWindow contents margins 2021-02-21 23:42:11 +00:00
Sergio Martins
6047275cfa Add a localDpiFactor helper
As we don't do everything via QStyle. layout margins for example
still need a manual factor
2021-02-21 23:02:49 +00:00
Sergio Martins
630d832f50 Emit DockRegistry::windowChangedScreen()
We now have a signal we can connect to adapt sizes to logical
dpi changes
2021-02-21 19:45:35 +00:00
Sergio Martins
e0a34465d8 MDI: Raise dock widget when clicking on it 2021-02-21 16:26:16 +00:00
Sergio Martins
443a4049c3 qtquick|MDI: Also support raising non top-level windows
If we drag mdi windows around they'll raise now
2021-02-21 15:44:56 +00:00
Sergio Martins
54980e7585 Fix Qt6 build on Windows 2021-02-20 21:42:44 +00:00
Sergio Martins
14ff8bb26b Fix mingw build 2021-02-19 11:33:01 +00:00
Sergio Martins
615bb0ee3f Fix linux developer-build 2021-02-19 11:25:02 +00:00
Sergio Martins
986fd8c13b CustomFrame: Don't use QWindow::fromWinId()
as that creates a new QWindow
2021-02-18 18:43:43 +00:00
Sergio Martins
ec1cc27815 Added DockRegistry::windowForHandle() 2021-02-18 18:39:35 +00:00
Sergio Martins
3874e2d886 CustomFrame: Added a recursion guard 2021-02-18 18:32:14 +00:00
Sergio Martins
1afcf21529 CustomFrame: Same some cpu cycles in case we don't care about the events 2021-02-18 18:21:32 +00:00
Sergio Martins
4c0f3bd7cb Fix build with older compilers 2021-02-18 17:50:14 +00:00
Sergio Martins
9aafa2a662 CustomFrame: the native event handling now honours the features 2021-02-18 15:50:12 +00:00
Sergio Martins
029ba1202e CustomFrame: Add a NativeFeatures enum
Replaces the htCaptionRect. As we don't want to pass many arguments,
instead just pass a struct which describes which native features
to enable
2021-02-18 15:14:52 +00:00
Sergio Martins
b5043b2b87 CustomFrame: Move the features enum up 1 level 2021-02-18 14:40:20 +00:00
Sergio Martins
52ce80fd97 CustomFrame: Use an enum instead of bool return in our callback 2021-02-18 14:22:26 +00:00
Sergio Martins
cd19c5eb38 CustomFrame: Allow to specify a callback for QWindow opt-in
Which QWindows should get a custom frame is up to you. Just
return true in the callback.
2021-02-18 14:10:40 +00:00
Sergio Martins
0d101d779f Fix unused variable warning 2021-02-18 11:29:02 +00:00
Milian Wolff
1ff6f43eac Allow disabling the uninstall target
Prevents clashes when kddockwidgets is included as a submodule
into a project that already defines an uninstall target.
2021-02-17 20:47:49 +01:00
Sergio Martins
98d892f643 CustomFrame: Apply the drop-shadow code initially 2021-02-17 19:46:56 +00:00
Milian Wolff
cc80afff7d Fix compile on Linux 2021-02-17 20:36:37 +01:00
Milian Wolff
91ad74e3ad Relay status tip events to the parent of FloatingWindow
That allows the status bar of the main window - if available - to
show the event contents.
2021-02-17 20:36:37 +01:00
Sergio Martins
b128d25fbe Added convenience FloatingWindow::mainWindow() 2021-02-17 19:35:54 +00:00
Sergio Martins
8b23769ccc Remove some debug code 2021-02-17 18:17:48 +00:00
Sergio Martins
13f84ab518 Fix QtQuick build 2021-02-17 18:14:57 +00:00
Sergio Martins
feadc1ff9e Add a CustomFrameHelper class
So we can reuse the custom frame for arbitrary windows
2021-02-17 18:02:51 +00:00
Sergio Martins
f75c3a123e Merge branch '1.3' into master 2021-02-17 17:44:05 +00:00
Sergio Martins
12dfe49d9b Fix unused variable warning 2021-02-17 17:14:10 +00:00
Sergio Martins
545618964d Only apply the async mouse compensation when undocking
Not needed when moving regular windows
2021-02-17 17:01:03 +00:00
Sergio Martins
a6f3f21b70 Added Draggable::isWindow() 2021-02-17 16:54:15 +00:00
Sergio Martins
e6135f49fb Make WidgetResizeHandler::handleWindowsNativeEvent() more generic
Decoupled it from the KDDW specific parts. Can now be used
by non FloatingWindow widgets
2021-02-16 20:28:59 +00:00
Sergio Martins
cd3a1c869e Add missing include 2021-02-16 19:32:00 +00:00
Sergio Martins
8bb21b12aa Add a fwd header for WidgetResizeHandler_p.h too 2021-02-16 19:29:19 +00:00
Sergio Martins
f500791ba3 FloatingWindow: This setup code is windows only 2021-02-15 22:15:26 +00:00
Sergio Martins
4ebc4e9546 Fix Linux build 2021-02-15 22:09:27 +00:00
Sergio Martins
94ee2e55fd Move FloatingWindow::setupWindow() into a reusable function
So other QWindow can use this
2021-02-15 22:03:44 +00:00
Sergio Martins
e3c370eb6b Revert "Move FloatingWindow::setupWindow() into a reusable function"
This reverts commit 6fea5af585.
Need to fix the windows build first
2021-02-15 10:43:15 -08:00
Sergio Martins
6fea5af585 Move FloatingWindow::setupWindow() into a reusable function
So other QWindow can use this
2021-02-15 18:29:19 +00:00
Sergio Martins
e9e149d55e Remove unused include 2021-02-15 17:48:13 +00:00
Sergio Martins
bb5d98164f fix windows build 2021-02-15 09:45:55 -08:00
Sergio Martins
8941f41d1c Moved NCHITTESTEventFilter to WidgetResizeHandler
It's a better fit there.
2021-02-15 17:36:22 +00:00
Sergio Martins
d45e17b603 Minor styling: Remove one level of ifdefing 2021-02-15 17:32:05 +00:00
Sergio Martins
c2b3e6b36e Remove some unneeded debug info 2021-02-15 17:28:29 +00:00
Sergio Martins
b8405c01f1 Export WidgetResizeHandler 2021-02-15 17:25:49 +00:00
Sergio Martins
3d191da07e Remove the unity build option, there's already a CMake way
-DCMAKE_UNITY_BUILD should do the same thing.
Disabling it by default since the project is too small for the gains,
and because it screws up the compile_commands.json which I need
for vscode
2021-02-14 23:28:46 +00:00
Sergio Martins
aeb61993a4 Use QT6_DIR in the presets file
Removes the hardcoded "gcc"
2021-02-14 23:08:06 +00:00
Sergio Martins
3679e1da3a Pass a QStyleOption in Button::sizeHint()
Allows to use the logical dpi of the screen the widget is in
2021-02-14 22:41:02 +00:00
Sergio Martins
52aefd23f0 Improve comments 2021-02-14 22:40:23 +00:00
Sergio Martins
76a2b84925 Windows: Support scalable icons without requiring AA_EnableHighDpiScaling 2021-02-14 22:22:04 +00:00
Sergio Martins
a89b2c7ed1 Add a comment 2021-02-14 19:54:49 +00:00
Sergio Martins
5dd4eb2d20 Honour the logical DPI for sizing title bar buttons
Some Linux window managers manipulate the logical DPI instead of
the device pixel ratio.
2021-02-14 19:39:05 +00:00
Sergio Martins
600661a570 Minor: Move Button::paintEvent() into the .cpp file 2021-02-14 19:22:41 +00:00
Sergio Martins
92f6453d26 Minor refactoring
Adds scalingFactorIsSupported(dpr) to utils, to workaround a bug
on earlier Qt
2021-02-14 19:17:15 +00:00
Sergio Martins
8bf3aa9b4d Use sizeHint() for title bar buttons
In preparation for using style pixel metrics, which is more
HDPI friendly
2021-02-14 18:43:49 +00:00
Sergio Martins
c52db1945b Minor rename for readability 2021-02-14 17:52:36 +00:00
Sergio Martins
09a10cd791 Minor rename for readability 2021-02-14 17:42:35 +00:00
Sergio Martins
07fd577894 MDI|qtquick: Fix resize cursor not being shown
the docked widgets were resizable but the cursor didn't change
shape
2021-02-14 17:41:01 +00:00
Sergio Martins
ed900b8531 MDI|qtquick: Allow to resize the docked windows with mouse
Was already possible for QtWidgets. For QtQuick we weren't
receiving the mouse events in Frame.
2021-02-14 17:26:03 +00:00
Sergio Martins
fa010357b3 Add Frame::isMDIChanged() signal 2021-02-14 17:21:28 +00:00
Sergio Martins
da6ffc85ef Fix transparency of QtQuick MDI example 2021-02-14 16:33:02 +00:00
Sergio Martins
b7c23087e1 MDI|qtquick: Don't use private API in the example 2021-02-14 13:30:34 +00:00
Sergio Martins
656f482cad qtquick: fix build 2021-02-14 13:17:45 +00:00
Sergio Martins
5e03003b94 Add MDI to the ChangeLog 2021-02-14 13:05:34 +00:00
Sergio Martins
48b5b27d42 Introduce MainWindowMDI
User no longer needs to use private API
2021-02-14 13:02:48 +00:00
Sergio Martins
fccb815d5a Fix QtQuick build 2021-02-13 18:56:18 +00:00
Sergio Martins
544d3b026a MDI windows will now poput into floating mode
when dragged behond the edges
Please enter the commit message for your changes. Lines starting
2021-02-13 18:30:59 +00:00
Sergio Martins
15ff882919 MDI: Raise window when we're dragging it
Otherwise it's appearing under others, possibly
2021-02-13 16:29:32 +00:00
Sergio Martins
18d405bdfb MDI: Don't let windows escape its parent 2021-02-13 16:19:05 +00:00
Sergio Martins
4379e7c544 MDI|Item: Allow widget to resize itself outside of the layout domain
With a normal KDDW layout, we don't allow the user to arbitrarily
resize widgets, all the resizes are done via dragging Separator,
which interacts closly with the layout.

With MDI however there's no separators. The user is resizing the
widget and the layout doesn't know about it, and it's fine for MDI
2021-02-13 14:17:42 +00:00
Sergio Martins
51e2be9b7b MDI: Don't paint the titlebar over the frame 2021-02-13 14:06:24 +00:00
Sergio Martins
f2b21d04b3 mdi example: Show KDAB logo 2021-02-13 14:02:22 +00:00
Sergio Martins
a73f35af22 MDI: Implement internal move
You can now move internal windows around without them becoming
floating
2021-02-13 13:03:14 +00:00
Sergio Martins
7b3ef03924 Add Draggable::isMDI() 2021-02-13 12:16:28 +00:00
Sergio Martins
a4d03c1514 Add a mdi-example
Don't want the main example to be too complex
2021-02-13 12:01:01 +00:00
Allen Winter
eccdee0081 buildsystem - add an uninstall target
uses the KDE extra-cmake-module ECMUninstallTarget.cmake
2021-02-12 15:18:01 -05:00
Sergio Martins
48f3390d71 Delete resize handler when floating a MDI dock widget
When it's floating it will use native resizing, or the resize handler
from the floating window. Not its own.
2021-02-11 20:09:22 +00:00
Sergio Martins
df6f1e6c8f Added Frame::isMDI() 2021-02-11 20:00:54 +00:00
Sergio Martins
3c95081aee MDI: Support internal resize
You can now resize docked MDI widgets
2021-02-11 19:37:05 +00:00
Sergio Martins
329a980510 WidgetResizeHandler: Fix case if parent's target wasn't top-level
By luck parentGeometry was in global space. Force it to be in global
space, as the target might be more nested.

Will be used by MDI, where Frame's parent is the MDI layout
2021-02-11 19:35:40 +00:00
Sergio Martins
d8605e9ce3 Minor styling: Reduce nesting, process invariant early 2021-02-11 19:15:36 +00:00
Sergio Martins
7dcc6dc114 Frame now takes care of its own resize handler
No need to set it from outside
2021-02-11 18:56:45 +00:00
Sergio Martins
64db52fd17 Move the CursorPositions header to the enums header instead
Otherwise will have to include WidgetResizeHandler_p.h
where I don't want to. And make it an installed header etc.
2021-02-11 18:52:21 +00:00
Sergio Martins
c0957024ec Remove some unneeded qDebug 2021-02-10 22:25:45 +00:00
Sergio Martins
649571a2eb Minor styling for the MDI example 2021-02-10 20:16:19 +00:00
Sergio Martins
60adb0d50b qtquick: Add a MDI example
Instead of poluting the normal example
2021-02-10 20:06:50 +00:00
Sergio Martins
f751d7c24e TitleBar is now HDPI aware even without the Qt::AA_ properties set
It will just query the style, which is already HDPI aware.
2021-02-10 15:17:04 +00:00
Sergio Martins
5ec5ade62f qtquick: Add a MDI example 2021-02-10 00:19:29 +00:00
Sergio Martins
788c497cbb Don't crash if it's a MDI layout 2021-02-10 00:01:47 +00:00
Sergio Martins
f6c274b82f qtquick: Remove unneeded dependency to DockArea 2021-02-09 23:50:52 +00:00
Sergio Martins
5a6b4a6fdd Don't use transparent titlebar if docked MDI
As the dock widgets can overlap over eachother
2021-02-09 23:27:10 +00:00
Sergio Martins
ef212b8c0f Added TitleBar::isMDI() 2021-02-09 22:38:16 +00:00
Sergio Martins
aa2f46fd00 Added TitleBar::mainWindow() 2021-02-09 22:15:31 +00:00
Sergio Martins
a30808e6b7 Implement ItemFreeContainer::removeItem() 2021-02-09 20:17:59 +00:00
Sergio Martins
f23c55dfec Implement ItemFreeContainer::restore() 2021-02-09 19:56:12 +00:00
Sergio Martins
583d3188ca Implement ItemFreeContainer::clear() 2021-02-09 19:51:53 +00:00
Sergio Martins
ae81f64d07 MDI: Comment that these methods don't make sense for MDI 2021-02-09 19:47:51 +00:00
Sergio Martins
8dca2e346c Add experimental MDI support 2021-02-09 19:25:28 +00:00
Sergio Martins
b995986318 Decouple MainWindow a bit more from DropArea 2021-02-09 18:04:11 +00:00
Sergio Martins
0579b6dcd3 Add a basic MDI layout
Not fully functional yet, and no API for end user yet.
2021-02-09 17:44:49 +00:00
Sergio Martins
4d147c7ff3 Remove two drop area dependencies 2021-02-09 17:34:40 +00:00
Sergio Martins
baf5f088dc Remove more unneeded references to DropArea
reference its base class instead
2021-02-09 16:58:24 +00:00
Sergio Martins
2adaacb922 Remove unused AnimatedIndicators files 2021-02-09 16:54:23 +00:00
Sergio Martins
bc6870f4ee Move the serialize/deserialize functions into base class 2021-02-09 16:52:16 +00:00
Sergio Martins
c6abaf22c1 Decouple WindowBeingDragged from DropArea 2021-02-09 16:41:26 +00:00
Sergio Martins
e04e066177 Remove unneeded DropArea::numFrames() 2021-02-09 16:34:58 +00:00
Sergio Martins
6ad01f4994 Make Frame deal in LayoutWidget instead of its derived class DropArea 2021-02-09 16:32:42 +00:00
Sergio Martins
f6ad75e214 Rename Frame::setDropArea() to Frame::setLayoutWidget()
Made it private too.
2021-02-09 16:29:29 +00:00
Sergio Martins
a76864450e Remove unneeded Frame::dropArea() 2021-02-09 16:25:56 +00:00
Sergio Martins
3fe9994322 Remove some debug statements which are unneeded 2021-02-09 16:25:19 +00:00
Sergio Martins
3bcfcc40c0 Minor decoupling between DropArea and DockWidgetBase 2021-02-09 16:23:49 +00:00
Sergio Martins
92b54f949b More MultiSplitter decoupling 2021-02-09 16:17:49 +00:00
Sergio Martins
a73746fe8b tests: Use the MultiSplitter base class in a few places 2021-02-09 16:12:22 +00:00
Sergio Martins
da1fddffe1 Decouple MultiSplitter from MainWindow and FloatingWidget
They deal in its base class instead (LayoutWidget)
2021-02-09 16:05:56 +00:00
Sergio Martins
e3b0feb967 DockWidgetBase.cpp uses MultiSplitter's base class now 2021-02-09 15:54:47 +00:00
Sergio Martins
4e6811cfdc qtquick: Fix build 2021-02-09 15:47:54 +00:00
Sergio Martins
cc47e46e1f Move lots of methods from MultiSplitter to its base class
Should be almost done now
2021-02-09 15:45:22 +00:00
Sergio Martins
4246d99b93 DockRegistry now deals in LayoutWidget
Instead of its derived class MultiSplitter
2021-02-09 15:40:44 +00:00
Sergio Martins
ba38e3c1aa Move lots of methods from MultiSplitter to its base class 2021-02-09 15:38:30 +00:00
Sergio Martins
83aa64928d Remove duplicate connect 2021-02-09 15:22:12 +00:00
Sergio Martins
5fbff7211b Move lots of methods from MultiSplitter to its base class 2021-02-09 15:09:07 +00:00
Sergio Martins
eb67f19e3e Placeholders now receive LayoutWidget instead of the derived class 2021-02-09 14:41:31 +00:00
Sergio Martins
2130a31dfd Add another base class to MultiSplitter
MultiSplitter is the QWidget that holds the layout. But we also
want to support other types of layouts, such as MDI.
2021-02-09 12:37:08 +00:00
Sergio Martins
f3ce208ec1 Merge branch '1.3' 2021-02-09 10:52:55 +00:00
Sergio Martins
146478eb5e cmake: No need to build the fuzzer during development 2021-02-09 10:52:28 +00:00
Sergio Martins
05413d5a99 Open master for 1.4 2021-02-09 10:44:28 +00:00
Allen Winter
eac726fcb8 open for 1.3.1 2021-02-08 17:05:21 -05:00
Allen Winter
b25af85234 kddockwidgets.spec - OBS fix 2021-02-08 16:42:51 -05:00
Allen Winter
02167a0788 CMakeLists.txt - ECMGeneratePriFile needs CMake v3.12 or above 2021-02-08 16:15:25 -05:00
Allen Winter
54cce9aa41 OBS - update for 1.3.0 release 2021-02-08 15:35:43 -05:00
Allen Winter
73cdc7136c README.md - a bit of formatting, spelling fixes 2021-02-08 15:25:06 -05:00
Allen Winter
1567a2b847 docs/api/CMakeLists.txt - copy some files needed by the markdown
The markdown to html conversion by doxygen doesn't copy
some files referred to in the README.md
2021-02-08 15:24:11 -05:00
Allen Winter
9fe795f8dd README.md, CONTRIBUTORS.txt - thank you contributors
those who have signed the KDAB Copyright License Agreement
2021-02-08 12:29:06 -05:00
Allen Winter
0d6cfd183d .krazy - exclude the postfix checker 2021-02-08 12:28:45 -05:00
Allen Winter
bba36d041b minor for Krazy 2021-02-08 12:11:46 -05:00
Sergio Martins
710716f658 Update ChangeLog regarding v1.3.0 release date 2021-02-08 12:15:30 +00:00
Sergio Martins
b39798ac24 qtquick: Fix build 2021-02-08 11:22:25 +00:00
Sergio Martins
1f8fbb8518 Export the DockWidgetBase pimpl for unit-tests 2021-02-08 03:16:50 -08:00
Sergio Martins
51dc666181 Added DockWidget::setFloatingGeometry()
Closes #144
2021-02-07 17:26:01 +00:00
Sergio Martins
2a6e716e07 Fix typo in README 2021-02-07 17:04:09 +00:00
Allen Winter
01d68f30e4 docs/api/Doxyfile.cmake - add reimp alias 2021-02-07 07:41:08 -05:00
Allen Winter
1b73d01de8 src/DockWidgetQuick.h - minor doxygen fix 2021-02-07 07:36:55 -05:00
Allen Winter
a421cb0b01 various - include private header first, remove header dupes 2021-02-07 07:07:49 -05:00
Allen Winter
2177336d65 minor spelling 2021-02-07 06:56:49 -05:00
Allen Winter
059a8cc38f TabWidgetQuick_p.h,TabWidgetQuick.cpp - update copyright year 2021-02-07 06:50:03 -05:00
Sergio Martins
4c33cd6409 Sidebar overlays now maintain their size when toggled
Fixes #155
2021-02-06 22:55:14 +00:00
Sergio Martins
ea48d52447 refactor MainWindowBase::updateOverlayGeometry()
Receives a size instead of a bool now.
2021-02-06 22:30:21 +00:00
Sergio Martins
85f4be750a Remove bogus sizing 2021-02-06 21:43:05 +00:00
Sergio Martins
0ba37a347b Save last overlayed location
For issue #155
2021-02-06 20:12:39 +00:00
Sergio Martins
6ee1900331 Add a test for issue #155 2021-02-06 19:43:26 +00:00
Sergio Martins
44bf1ef322 qtquick: Move dummy QAction class into the pimpl header
No need for it to be in the public header
2021-02-06 18:20:44 +00:00
Sergio Martins
863691c313 Remove some private API from DockWidgetBase.h
Moved it into the pimpl
2021-02-06 16:32:13 +00:00
Sergio Martins
97d7cbf657 ChangeLog: Mention we have experimental QtQuick support 2021-02-06 15:56:13 +00:00
Allen Winter
3089535de6 CMakeLists.txt, conan/conanfile.py - this is version 1.3.0 2021-02-06 10:31:17 -05:00
Sergio Martins
36818093c6 Merge branch '1.2' 2021-02-06 15:20:08 +00:00
Allen Winter
e5857df439 conan/conanfile.py - upgrade version number 2021-02-06 10:09:32 -05:00
Allen Winter
42d25dc1a5 fwd_headers/kddockwidgets/KDDockWidgets.h - update copyright year 2021-02-06 10:07:55 -05:00
Sergio Martins
3b5e78bfba ChangeLog: Add release date of 1.2.1 2021-02-06 13:02:50 +00:00
Sergio Martins
639dce7c53 Remove the QtQuick presets from the 1.2 branch
It's for master only
2021-02-06 12:46:18 +00:00
Sergio Martins
882f54647c ChangeLog removed mention to 1.3 from the 1.2 branch 2021-02-06 12:43:56 +00:00
Sergio Martins
38443048b8 Merge branch '1.2' 2021-02-05 16:42:07 +00:00
Sergio Martins
621c3dbeca Also clear the overlay internals when floating an overlay
Fixes a crash.

Relates to #162
2021-02-05 16:32:41 +00:00
Sergio Martins
f1e4f7ecda Add another test 2021-02-05 14:34:12 +00:00
Sergio Martins
249d1b6790 Remove from the sidebar when floating a widget
Fixes #162
2021-02-05 12:35:03 +00:00
Sergio Martins
894e0fd03a Added test for issue #162 2021-02-05 11:49:52 +00:00
Allen Winter
ec1f009914 CLA - switch to a form-fillable PDF version 2021-02-04 16:26:34 -05:00
Allen Winter
697417b906 CLA - switch to a form-fillable PDF version 2021-02-04 16:17:53 -05:00
Sergio Martins
dadf57c184 Merge branch '1.2' 2021-02-04 19:59:29 +00:00
Sergio Martins
7caa83be19 Also hide overlay when clicking on empty space of a main window 2021-02-04 19:56:35 +00:00
Sergio Martins
e745d38b1e Improve the test a bit
clicking on the bottom is not very effective as that's where the
bottom sidebar is
2021-02-04 19:52:21 +00:00
Sergio Martins
6d389315bf Add test for issue #157 2021-02-04 19:31:31 +00:00
Sergio Martins
024d56505a Merge branch '1.2' 2021-02-04 13:30:35 +00:00
Sergio Martins
daec97ad66 Don't require QtX11Extras for WASM
Fixes #163
2021-02-04 13:30:04 +00:00
Sergio Martins
a98daead1d README: Improve paragraph about reporting bugs
Mention that sha1 and which operating system are important too
2021-02-03 13:34:33 +00:00
Sergio Martins
2c5cf77cf2 Fix build with cmake Visual Studio generator
Fixes #156
2021-02-02 23:02:04 +00:00
Sergio Martins
a6b9a82e9c Fix crash when hosting QQuickWidget
There's no need to check if invisible widgets are candidates
for docking. There's usually no downside either, except that
QQuickWidget is very sensitive with when its platform window
is created, so don't force the creation.

Will cherry-pick to 1.2 if no regression is found

Fixes #150
2021-01-31 13:05:20 +00:00
Sergio Martins
02cf9d1cd2 Make FloatingWindowWidget::m_vlayout protected
So users can override
2021-01-30 14:28:30 +00:00
Sergio Martins
cde814b216 Add a static FloatingWindow::s_windowFlagsOverride member
The user can now change which window flags FloatingWindow will get,
as his own risk.

Not doing it via public API such as FrameworkWidgetFactory as I don't
want to encourage or support this. The amount of combinations that
can go wrong is open ended.

Fixes #149
2021-01-30 13:59:42 +00:00
Sergio Martins
5f435cd8c7 minor comment: Don't mention deprecated flag 2021-01-30 13:40:07 +00:00
Sergio Martins
6ccd98ca01 Move DockWidgetBase::eventFilter() into the private class
Fixes issue #151 where the user is overriding eventFilter too
and getting into some edge cases.

Could be worked around in user code, but it's always good to have
less protected and private API in public classes.
2021-01-29 20:20:01 +00:00
Sergio Martins
799f2a81a7 Remember previous tab position when toggling float
This was already the case, but didn't work in case the tabs
were re-oredered by the user manually

Fixes #154
2021-01-29 19:15:23 +00:00
Sergio Martins
eb9fa6f567 Add unit-test for issue #154 2021-01-29 19:07:32 +00:00
Sergio Martins
9ebd595202 Remove stray debug 2021-01-29 18:32:23 +00:00
Sergio Martins
b50d301f44 Add DockWidget::tabIndex() 2021-01-29 18:32:10 +00:00
Sergio Martins
b01b8908ea qtquick: Fix build
That test is QtWidgets only
2021-01-29 18:23:37 +00:00
Sergio Martins
78c2cdddc4 minor: Make indexOfDockWidget() take a const dock widget
So it can be called from const places
2021-01-29 18:22:20 +00:00
Sergio Martins
1eaac74fb0 README: reword the getting involved section a bit
Explain that patches as images are not good when reporting bugs
2021-01-29 12:02:14 +00:00
Sergio Martins
ee759a5459 Don't trigger "Delete on Close" when sending to the sidebar 2021-01-28 22:40:41 +00:00
Sergio Martins
e9d19805d7 Add a force close to DockWidgetBase::Private
So we can add an argument there, without changing public API
2021-01-28 22:19:21 +00:00
Sergio Martins
1f74ba43f0 Add some includes to DockWidgetBase_p.h
It's not included directly, but let's be nice to IDEs.
2021-01-28 21:54:45 +00:00
Sergio Martins
bc1e686455 Create DockWidgetBase_p.h and move the pimpl there
So we can reuse the pimpl and not have to expose public API
for implementation details
2021-01-28 21:44:12 +00:00
Allen Winter
5cc0552c57 Merge pull request #153 from KDAB/fix-missing-source
Added missing layout_saver wrapper file in the source list
2021-01-28 10:01:38 -05:00
Renato Araujo Oliveira Filho
6c06bc6af8 Added missing layout_saver wrapper file in the source list 2021-01-28 11:30:25 -03:00
Sergio Martins
2193c131a8 Merge branch '1.2'
Should fix #152
2021-01-27 23:38:51 +00:00
Sergio Martins
9a38626af5 Allow more private includes to be used from installed dir 2021-01-27 23:31:59 +00:00
Sergio Martins
f0c243f6d1 Add KDDockWidgets.h fwd_header 2021-01-27 23:27:04 +00:00
Sergio Martins
f0441f1a08 Normalize some dock_exports.h includes
In case these files are ever included from an installed location
2021-01-27 23:00:32 +00:00
Sergio Martins
8a9d9f9fce Merge branch '1.2' 2021-01-27 22:55:36 +00:00
Sergio Martins
db06c496cf Remove dependencies to LayoutSaver_p.h
Only the impl needs to include it
2021-01-27 22:51:41 +00:00
Sergio Martins
2aa97e6565 Add a fwd header for DragController_p.h 2021-01-27 22:28:57 +00:00
Sergio Martins
68597cac22 install two more private includes 2021-01-27 22:27:46 +00:00
Sergio Martins
afa543ec79 Fix .clang-format
Was complaining about Cpp14 not being a valid enumerator
2021-01-27 22:07:26 +00:00
Sergio Martins
d1df6e910b Add a .clang-format file 2021-01-27 22:00:06 +00:00
Sergio Martins
74ae567ced vscode: Update workspace files
formats code you've changed now
2021-01-27 21:32:06 +00:00
Allen Winter
8d657c5b18 Merge branch '1.2' 2021-01-27 11:59:27 -05:00
Allen Winter
802bdc102f src/CMakeLists.txt - fix Windows library versioning
was broken for RelWithDebInfo builds
2021-01-27 11:55:51 -05:00
Sergio Martins
218d18793d Remove some unneeded horizontal line from MyCentralWidget
The difference is minimal and probably looks very bad with dark
and custom themes.

Let's minimize the amount of hardcoded styling.
2021-01-26 19:32:10 +00:00
Sergio Martins
723c29e33b Merge pull request #119 from JPatriceR/add-LayoutSaver-python-binding
Add binding for LayoutSaver class
2021-01-26 14:58:56 +00:00
Sergio Martins
2e248c6658 README: Add a paragraph about versioning and API/ABI compat 2021-01-26 14:36:30 +00:00
Sergio Martins
7fbd66d54c Merge branch '1.2' 2021-01-26 14:26:26 +00:00
Sergio Martins
4bede063ae Make DockWidgetBase::eventFilter() protected
The users might want to override it

Fixes #148 and restores source compat with v1.1
2021-01-26 14:25:30 +00:00
Sergio Martins
cbc5fec119 Added Config::setDisabledPaintEvents()
Makes our internal widgets not override QWidget::paintEvent(),
which gives full power to the user to stylesheets.

Was already possible, but required the user to override the
internal widgets via the widget factory

For issue #146
2021-01-24 10:51:58 +00:00
Sergio Martins
81927b088b Add CustomizableWidget enum 2021-01-24 10:15:02 +00:00
Sergio Martins
5556edd83b vscode: prefix the vscode workspaces with "code."
Easier to open on command line if they have the same prefix
2021-01-23 12:41:31 +00:00
Sergio Martins
2834532b5f example: Add a keyboard shortcut to toggle dock widgets visiblity 2021-01-21 16:22:43 +00:00
Sergio Martins
17638bc29f Fix regression with DockWidget::toggleAction()
Added unit-test too.
While we're processing the toggle action triggering isOpen() is
always false.
2021-01-21 16:16:29 +00:00
Jean-Patrice Laude
67b48cc417 Add binding for LayoutSaver class 2021-01-20 16:53:32 +01:00
Sergio Martins
451996016a Merge pull request #128 from CE-Programming/fix/pri
Fix issues with pri file.
2021-01-19 22:38:37 +00:00
Sergio Martins
52b9a9223d Update ChangeLog 2021-01-19 22:25:00 +00:00
Sergio Martins
d5b80b0bbd Fix offset when dragging too fast
On Windows, when we start a drag, we switch to native dragging in
mid-flight, so that AeroSnap still works

Fixes #121
2021-01-19 22:23:20 +00:00
Sergio Martins
ae14e49338 Add a comment, explains why we switch to native drag 2021-01-19 21:53:35 +00:00
Sergio Martins
c23bce9829 Minor coding style: Remove nested ifdef 2021-01-19 21:50:31 +00:00
Sergio Martins
40a549ca29 Fix double delete screwing with lastPositions()
Fixes #141
2021-01-18 23:37:17 +00:00
Sergio Martins
cac435a2a5 tests: Add missing cleanup 2021-01-18 22:52:54 +00:00
Sergio Martins
b81f50402a qtquick: Fix build 2021-01-18 20:42:41 +00:00
Sergio Martins
44587cb947 Don't require LayoutSaver_p.h to be installed
It's impl detail that doesn't need to be installed
2021-01-18 20:37:22 +00:00
Sergio Martins
54314273a0 Merge branch '1.2' 2021-01-18 19:40:18 +00:00
Sergio Martins
de068dc6ff Use less relative includes, some of them were wrong
The example now includes them, so we can detect build failures
if they get wrong again

Fixes #140
2021-01-18 18:57:15 +00:00
Allen Winter
64f537ad1e Merge branch '1.2' 2021-01-18 10:15:07 -05:00
Allen Winter
312c89f884 src/CMakeLists.txt - fix kddockwidgets_version.h install destination 2021-01-18 10:14:37 -05:00
Renato Araujo Oliveira Filho
d9fd7eb3a5 Fix python bindings build
Task-Id: KDABCI-692
2021-01-18 10:10:51 -05:00
Allen Winter
af9206f350 Merge pull request #142 from KDAB/python-build-fix
Fix python bindings build
2021-01-18 10:07:04 -05:00
Allen Winter
7c99bb084e Merge branch '1.2' 2021-01-18 10:05:27 -05:00
Allen Winter
1a2757b00a Generate and install kddockwidgets_version.h
defines a version string and other useful versioning macros

Issue#138
2021-01-18 10:03:21 -05:00
Renato Araujo Oliveira Filho
1e7a2110b1 Fix python bindings build
Task-Id: KDABCI-692
2021-01-18 11:58:42 -03:00
Sergio Martins
243146fe49 Update ChangeLog 2021-01-17 23:24:58 +00:00
Sergio Martins
370d139dfc Fix Flag_NativeTitleBar
It shouldn't use the FloatingWindow::isInDragArea() code path
2021-01-17 23:11:41 +00:00
Sergio Martins
c4e7db34a4 Minor readability improvement 2021-01-17 22:51:37 +00:00
Sergio Martins
a4f6b72157 Fix FloatingWindow::isInDragArea() returning false even with HTCAPTION
If the last clicked position is HTCAPTION then we're sure we're
dragging. Problem with comparing the rect is that mouse events are
async, and by the time we use the mouse event pos the window is already
somewhere else. So just use HTCAPTION, which is 100% correct.

Fixes #103
2021-01-17 16:28:11 +00:00
Sergio Martins
de3ca6dba5 vscode: Remove launch.json
We'll do this per workspace file instead
2021-01-17 14:10:19 +00:00
Sergio Martins
bdfcfdd0fe Update ChangeLog 2021-01-16 22:39:11 +00:00
Sergio Martins
dbf357ce66 Fix restoring window maximized state
Fixes #81
2021-01-16 22:37:30 +00:00
Sergio Martins
e950cf7fc3 tests: Add a test for issue #81 2021-01-16 21:38:36 +00:00
Sergio Martins
8dfad1c910 vscode: Update the workspace files
Now autogenerated from CMakePresets.json.
Added the Qt6 one too.
2021-01-16 19:40:36 +00:00
Sergio Martins
107d4e973c Remove a script I'm no longer using 2021-01-16 15:50:27 +00:00
Sergio Martins
e33766a4fa examples: Illustrate Config::Flag_CloseOnlyCurrentTab 2021-01-16 13:19:37 +00:00
Sergio Martins
6a550c6c4a Added Config::Flag_CloseOnlyCurrentTab
When clicking on the TitleBar's close button it closes all the
dock widgets in the tab, by default. With the new option it will
close only the current tab
2021-01-16 13:06:29 +00:00
Sergio Martins
a0fc2a8ce7 Minor logic readability fix
They are mutually exclusive
2021-01-16 12:00:43 +00:00
Sergio Martins
ab257b3468 float docked widgets that have LayoutSaverOption::Skip before restore 2021-01-15 21:30:38 +00:00
Sergio Martins
e6bdb28484 Added convenience DockWidgetBase::skipsRestore() 2021-01-15 20:17:45 +00:00
Sergio Martins
c52446f3b0 Merge branch '1.2' 2021-01-15 09:27:17 +00:00
Sergio Martins
9cadfb26d9 Fix toggleAction() when dock widget is in the sidebar
It should toggle the overlay, not dock the widget

Fixes #139
2021-01-15 09:24:11 +00:00
Sergio Martins
7d5ea8f908 tests++ 2021-01-15 09:20:58 +00:00
Sergio Martins
161b33370e Add more tests 2021-01-15 09:04:05 +00:00
Sergio Martins
8dd7a90b34 Add convenience DockWidgetBase::isInSideBar() 2021-01-15 08:52:17 +00:00
Sergio Martins
7ff865a36f tests: Add test for #139 2021-01-15 08:44:21 +00:00
Sergio Martins
d0b8ee606a Honour LayoutSaverOption::Skip for floating windows with many dock widgets
If all dock widgets in the floating window have the Skip flag then the
FloatingWindow can too
2021-01-14 18:33:29 +00:00
Sergio Martins
c6c3b16fd2 LayoutSaver: Add some utility functions 2021-01-14 18:11:29 +00:00
Sergio Martins
64a6cbb2e4 Add all|anyDockWidgetsHave overloads taking a LayoutSaverOption 2021-01-14 18:01:54 +00:00
Sergio Martins
e1cf532437 tests: Add an XFAIL for a LayoutSaverOption::Skip case 2021-01-14 17:57:37 +00:00
Sergio Martins
67f2127710 Add one more unit-test regarding DeleteOnClose 2021-01-14 17:51:02 +00:00
Sergio Martins
9111b424a1 TitleBar: Also update the auto/hide button
For completeness, doesn't mean it's actually needed.
For issue #137.
2021-01-14 11:39:15 +00:00
Sergio Martins
772b51216f Merge branch '1.2' 2021-01-13 23:15:03 +00:00
Sergio Martins
a79a2f5ecb Fix restoring non-closable state
For issue #137

A simpler solution than on master, doesn't include the refactoring.
2021-01-13 23:13:39 +00:00
Sergio Martins
585c0d64ed Fix close button enable state not being restored with LayoutSaver
Fixes #137
2021-01-13 23:07:49 +00:00
Sergio Martins
7ddb95a417 Add a single TitleBar::updateButtons()
updateCloseButton() can now be private
2021-01-13 23:07:49 +00:00
Sergio Martins
02648eb54e Update ChangeLog re PySide6 2021-01-13 22:51:18 +00:00
Sergio Martins
54a1050fbb Add unit-test for issue #137 2021-01-13 22:23:44 +00:00
Sergio Martins
f997b2d2f0 qtquick: Fix build 2021-01-13 13:31:33 +00:00
Sergio Martins
8f61e57b57 Add DockWidget::Option::Option_DeleteOnClose 2021-01-13 12:54:18 +00:00
Sergio Martins
cfcff6f2d7 Minor rename 2021-01-12 22:49:07 +00:00
Sergio Martins
44d7cc0588 Add FloatingWindow::allDockWidgetsHave(option) and the any* variant 2021-01-12 22:42:38 +00:00
Sergio Martins
c91275d091 vscode: Use workspace files instead of project settings
So we can build for QtQuick too with different settings
2021-01-12 15:20:29 +00:00
Sergio Martins
69c88919c0 cmake: Export a compile_commands.json which helps vscode
Need to disable unity build otherwise intellisense can't find
our source files in the compile_commands.json. Only for the dev-*
presets anyway
2021-01-12 14:25:11 +00:00
Sergio Martins
e0e6f55868 Introduce DockWidgetBase::LayoutSaverOptions enum
The first enumerator is "Skip", meaning the dock widget won't
be affected by save/restore. It won't disappear while restoring,
and won't be shown if already hidden. (only applies to floating widgets)
2021-01-11 23:33:32 +00:00
Sergio Martins
7698584ee0 Fix potential invalid index when restoring layout
We save the index of each FloatingWindow when saving a layout,
but when restoring we might not want to restore all FloatingWindows,
for example, if we use a LayoutSaver with another affinity.

So, the index in Position::deserialize() should be a index to
LayoutSaver::Layout::floatingWindows, and not to DockRegistry::self()->floatingWindows()
since the later might be smaller.
2021-01-11 21:55:47 +00:00
Sergio Martins
d034722ba9 LayoutSaver: Add some utilities 2021-01-11 21:16:02 +00:00
Sergio Martins
e1e07c95ba Merge pull request #134 from KDAB/python6
Added PySide6 support
2021-01-11 19:35:53 +00:00
Jacob Young
b81c32b1c9 Fix issues with pri file. 2021-01-07 20:43:47 -05:00
285 changed files with 14048 additions and 6143 deletions

73
.clang-format Normal file
View File

@@ -0,0 +1,73 @@
---
BasedOnStyle: WebKit
Language: Cpp
Standard: Cpp11
IndentWidth: 4
SpacesBeforeTrailingComments: 1
TabWidth: 8
UseTab: Never
SortIncludes: false
ContinuationIndentWidth: 4
MaxEmptyLinesToKeep: 3
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
ForEachMacros:
- forever # avoids { wrapped to next line
- foreach
- Q_FOREACH
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortEnumsOnASingleLine: false # requires clang-format 11
AlignAfterOpenBracket: true
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackParameters: true
ColumnLimit: 0
Cpp11BracedListStyle: false
DerivePointerBinding: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerBindsToType: false
SpaceAfterTemplateKeyword: false
IndentFunctionDeclarationAfterType: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: true
SpacesInParentheses: false
...

4
.codespellrc Normal file
View File

@@ -0,0 +1,4 @@
[codespell]
skip = ./build-*,.git,*.svg,rc_assets.py
interactive = 3
ignore-words-list = overlay,overlayed

6
.gitignore vendored
View File

@@ -58,3 +58,9 @@ kddockwidgets_minimal_example
/CMakeDoxygenDefaults.cmake /CMakeDoxygenDefaults.cmake
/Testing /Testing
/layout_tst* /layout_tst*
/x64
/src/kddockwidgets_version.h
*.vcxproj*
*.sln
*.dir
.vscode

6
.krazy
View File

@@ -7,7 +7,7 @@ EXTRA kdabcopyright-reuse,kdabcontactus,fosslicense-reuse
#EXTRA defines,null #EXTRA defines,null
#exclude checks now being done by clazy or clang-tools #exclude checks now being done by clazy or clang-tools
EXCLUDE strings,explicit,normalize,passbyvalue,operators,nullstrcompare,nullstrassign,doublequote_chars,qobject,sigsandslots,staticobjects,dpointer,inline EXCLUDE strings,explicit,normalize,passbyvalue,operators,nullstrcompare,nullstrassign,doublequote_chars,qobject,sigsandslots,staticobjects,dpointer,inline,postfixop
#exclude more checks #exclude more checks
EXCLUDE style EXCLUDE style
@@ -16,6 +16,8 @@ SKIP Doxyfile.cmake
#skip CMake files #skip CMake files
SKIP /KDDockWidgetsConfig.cmake.in SKIP /KDDockWidgetsConfig.cmake.in
#skip more files
SKIP CMakePresets.json
#skip the borrowed code in the cmake subdir #skip the borrowed code in the cmake subdir
SKIP /cmake/Qt5Portability.cmake|/cmake/ECM/|/cmake/InstallLocation.cmake SKIP /cmake/InstallLocation.cmake|/cmake/ECM/|/cmake/KDAB/

18
.reuse/dep5 Normal file
View File

@@ -0,0 +1,18 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: KDDockWidgets
Upstream-Contact: <info@kdab.com>
Source: https://www.github.com/KDAB/KDDockWidgets
Files: *.qrc *.json *.xml *.html src/fwd_headers/*
Copyright: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
License: GPL-2.0-only OR GPL-3.0-only
#artwork
Files: screencap.gif images/* src/img/* docs/api/*.png examples/dockwidgets/assets/*.png src/img/classic_indicators/*.png
Copyright: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
License: GPL-2.0-only OR GPL-3.0-only
#3rdparty
Files: cmake/ECM/modules/*
Copyright:
License: BSD-3-Clause

View File

@@ -1,635 +0,0 @@
align_asm_colon = false
align_assign_span = 0
align_assign_thresh = 0
align_enum_equ_span = 0
align_enum_equ_thresh = 0
align_func_params = false
align_func_params_gap = 0
align_func_params_span = 0
align_func_params_thresh = 0
align_func_proto_gap = 0
align_func_proto_span = 0
align_keep_extra_space = false
align_keep_tabs = false
align_left_shift = true
align_mix_var_proto = false
align_nl_cont = false
align_number_right = false
align_oc_decl_colon = false
align_oc_msg_colon_first = false
align_oc_msg_colon_span = 0
align_oc_msg_spec_span = 0
align_on_operator = false
align_on_tabstop = false
align_pp_define_gap = 0
align_pp_define_span = 0
align_pp_define_together = false
align_right_cmt_at_col = 0
align_right_cmt_gap = 0
align_right_cmt_mix = false
align_right_cmt_span = 0
align_same_func_call_params = false
align_single_line_brace = false
align_single_line_brace_gap = 0
align_single_line_func = false
align_struct_init_span = 0
align_typedef_amp_style = 0
align_typedef_func = 0
align_typedef_gap = 0
align_typedef_span = 0
align_typedef_star_style = 0
align_var_class_gap = 0
align_var_class_span = 0
align_var_class_thresh = 0
align_var_def_amp_style = 0
align_var_def_attribute = false
align_var_def_colon = false
align_var_def_colon_gap = 0
align_var_def_gap = 0
align_var_def_inline = false
align_var_def_span = 0
align_var_def_star_style = 0
align_var_def_thresh = 0
align_var_struct_gap = 0
align_var_struct_span = 0
align_var_struct_thresh = 0
align_with_tabs = false
cmt_c_group = false
cmt_c_nl_end = false
cmt_c_nl_start = false
cmt_convert_tab_to_spaces = false
cmt_cpp_group = false
cmt_cpp_nl_end = false
cmt_cpp_nl_start = false
cmt_cpp_to_c = false
cmt_indent_multi = false
cmt_insert_before_ctor_dtor = false
cmt_insert_before_inlines = true
cmt_insert_before_preproc = false
cmt_insert_class_header = ""
cmt_insert_file_footer = ""
cmt_insert_file_header = ""
cmt_insert_func_header = ""
cmt_insert_oc_msg_header = ""
cmt_multi_check_last = true
cmt_multi_first_len_minimum = 4
cmt_reflow_mode = 0
cmt_sp_after_star_cont = 0
cmt_sp_before_star_cont = 0
cmt_star_cont = false
cmt_width = 0
code_width = 0
disable_processing_cmt = ""
eat_blanks_after_open_brace = false
eat_blanks_before_close_brace = false
enable_digraphs = false
enable_processing_cmt = ""
force_tab_after_define = false
include_category_0 = ""
include_category_1 = ""
include_category_2 = ""
indent_access_spec = -4
indent_access_spec_body = false
indent_align_assign = true
indent_align_paren = true
indent_align_string = false
indent_bool_paren = false
indent_brace = 0
indent_brace_parent = false
indent_braces = false
indent_braces_no_class = false
indent_braces_no_func = false
indent_braces_no_struct = false
indent_case_brace = 0
indent_case_shift = 0
indent_class_colon = false
indent_class_on_colon = false
indent_class = true
indent_cmt_with_tabs = false
indent_col1_comment = false
indent_columns = 4
indent_comma_paren = false
indent_constr_colon = false
indent_continue = 0
indent_cpp_lambda_body = false
indent_cpp_lambda_only_once = true
indent_ctor_init = 0
indent_ctor_init_leading = 2
indent_else_if = false
indent_extern = false
indent_first_bool_expr = false
indent_first_for_expr = false
indent_func_call_param = false
indent_func_class_param = false
indent_func_const = 0
indent_func_ctor_var_param = false
indent_func_def_force_col1 = false
indent_func_def_param = false
indent_func_param_double = false
indent_func_proto_param = false
indent_func_throw = 0
indent_ignore_asm_block = false
indent_label = 1
indent_member = 0
indent_member_single = false
indent_min_vbrace_open = 0
indent_namespace = false
indent_namespace_level = 0
indent_namespace_limit = 0
indent_namespace_single_indent = false
indent_oc_block = false
indent_oc_block_msg = 0
indent_oc_block_msg_from_brace = false
indent_oc_block_msg_from_caret = false
indent_oc_block_msg_from_colon = false
indent_oc_block_msg_from_keyword = false
indent_oc_block_msg_xcode_style = false
indent_oc_msg_colon = 0
indent_oc_msg_prioritize_first_colon = true
indent_off_after_return_new = false
indent_param = 0
indent_paren_after_func_call = false
indent_paren_after_func_decl = false
indent_paren_after_func_def = false
indent_paren_close = 0
indent_paren_nl = false
indent_paren_open_brace = false
indent_preserve_sql = false
indent_relative_single_line_comments = false
indent_semicolon_for_paren = false
indent_shift = false
indent_single_after_return = false
indent_single_newlines = false
indent_sing_line_comments = 0
indent_square_nl = false
indent_switch_case = 0
indent_switch_pp = true
indent_template_param = false
indent_ternary_operator = 2
indent_token_after_brace = true
indent_var_def_blk = 0
indent_var_def_cont = false
indent_vbrace_open_on_tabstop = false
indent_with_tabs = 0
indent_xml_string = 0
input_tab_size = 4
ls_code_width = false
ls_for_split_full = false
ls_func_split_full = false
mod_add_long_class_closebrace_comment = 0
mod_add_long_function_closebrace_comment = 0
mod_add_long_ifdef_else_comment = 0
mod_add_long_ifdef_endif_comment = 0
mod_add_long_namespace_closebrace_comment = 0
mod_add_long_switch_closebrace_comment = 0
mod_case_brace = ignore
mod_full_brace_do = ignore
mod_full_brace_for = ignore
mod_full_brace_function = ignore
mod_full_brace_if_chain = false
mod_full_brace_if_chain_only = false
mod_full_brace_if = ignore
mod_full_brace_nl = 0
mod_full_brace_nl_block_rem_mlcond = false
mod_full_brace_using = ignore
mod_full_brace_while = ignore
mod_full_paren_if_bool = false
mod_move_case_break = false
mod_paren_on_return = ignore
mod_pawn_semicolon = false
mod_remove_empty_return = false
mod_remove_extra_semicolon = false
mod_sort_import = false
mod_sort_include = false
mod_sort_oc_properties = false
mod_sort_oc_property_class_weight = 0
mod_sort_oc_property_getter_weight = 0
mod_sort_oc_property_nullability_weight = 0
mod_sort_oc_property_readwrite_weight = 0
mod_sort_oc_property_reference_weight = 0
mod_sort_oc_property_setter_weight = 0
mod_sort_oc_property_thread_safe_weight = 0
mod_sort_using = false
newlines = auto
nl_after_access_spec = 0
nl_after_annotation = ignore
nl_after_brace_close = false
nl_after_brace_open_cmt = false
nl_after_brace_open = false
nl_after_case = false
nl_after_class = 0
nl_after_do = ignore
nl_after_for = ignore
nl_after_func_body = 0
nl_after_func_body_class = 0
nl_after_func_body_one_liner = 0
nl_after_func_class_proto = 0
nl_after_func_class_proto_group = 0
nl_after_func_proto = 0
nl_after_func_proto_group = 0
nl_after_if = ignore
nl_after_label_colon = false
nl_after_multiline_comment = false
nl_after_return = false
nl_after_semicolon = false
nl_after_square_assign = ignore
nl_after_struct = 0
nl_after_switch = ignore
nl_after_synchronized = ignore
nl_after_try_catch_finally = 0
nl_after_vbrace_close = false
nl_after_vbrace_open_empty = false
nl_after_vbrace_open = false
nl_after_while = ignore
nl_around_cs_property = 0
nl_assign_brace = ignore
nl_assign_leave_one_liners = false
nl_assign_square = ignore
nl_before_access_spec = 0
nl_before_block_comment = 0
nl_before_case = false
nl_before_c_comment = 0
nl_before_class = 0
nl_before_cpp_comment = 0
nl_before_do = ignore
nl_before_for = ignore
nl_before_func_body_def = 0
nl_before_func_body_proto = 0
nl_before_func_class_def = 0
nl_before_func_class_proto = 0
nl_before_if_closing_paren = ignore
nl_before_if = ignore
nl_before_return = false
nl_before_switch = ignore
nl_before_synchronized = ignore
nl_before_throw = ignore
nl_before_while = ignore
nl_between_annotation = ignore
nl_between_get_set = 0
nl_brace_brace = ignore
nl_brace_catch = ignore
nl_brace_else = ignore
nl_brace_finally = ignore
nl_brace_fparen = ignore
nl_brace_square = ignore
nl_brace_struct_var = ignore
nl_brace_while = ignore
nl_case_colon_brace = ignore
nl_catch_brace = ignore
nl_class_brace = ignore
nl_class_colon = remove
nl_class_init_args = add
nl_class_leave_one_liners = false
nl_collapse_empty_body = false
nl_comment_func_def = 0
nl_constr_colon = ignore
nl_constr_init_args = ignore
nl_cpp_lambda_leave_one_liners = true
nl_cpp_ldef_brace = remove
nl_create_for_one_liner = false
nl_create_func_def_one_liner = false
nl_create_if_one_liner = false
nl_create_while_one_liner = false
nl_cs_property_leave_one_liners = false
nl_define_macro = false
nl_do_brace = ignore
nl_ds_struct_enum_close_brace = false
nl_ds_struct_enum_cmt = false
nl_else_brace = ignore
nl_elseif_brace = ignore
nl_else_if = ignore
nl_end_of_file = ignore
nl_end_of_file_min = 0
nl_enum_brace = ignore
nl_enum_class_identifier = ignore
nl_enum_class = ignore
nl_enum_colon_type = ignore
nl_enum_identifier_colon = ignore
nl_enum_leave_one_liners = false
nl_enum_own_lines = ignore
nl_fcall_brace = ignore
nl_fdef_brace = ignore
nl_finally_brace = ignore
nl_for_brace = ignore
nl_func_call_args_multi_line = false
nl_func_call_empty = ignore
nl_func_call_end_multi_line = false
nl_func_call_paren_empty = ignore
nl_func_call_paren = ignore
nl_func_call_start_multi_line = false
nl_func_class_scope = ignore
nl_func_decl_args = ignore
nl_func_decl_args_multi_line = false
nl_func_decl_empty = ignore
nl_func_decl_end = ignore
nl_func_decl_end_multi_line = false
nl_func_decl_end_single = ignore
nl_func_decl_start = ignore
nl_func_decl_start_multi_line = false
nl_func_decl_start_single = ignore
nl_func_def_args = ignore
nl_func_def_args_multi_line = false
nl_func_def_empty = ignore
nl_func_def_end = ignore
nl_func_def_end_multi_line = false
nl_func_def_end_single = ignore
nl_func_def_paren_empty = ignore
nl_func_def_paren = ignore
nl_func_def_start = ignore
nl_func_def_start_multi_line = false
nl_func_def_start_single = ignore
nl_func_leave_one_liners = true
nl_func_paren_empty = ignore
nl_func_paren = ignore
nl_func_proto_type_name = ignore
nl_func_scope_name = ignore
nl_func_type_name_class = ignore
nl_func_type_name = ignore
nl_func_var_def_blk = 0
nl_getset_brace = ignore
nl_getset_leave_one_liners = false
nl_if_brace = ignore
nl_if_leave_one_liners = false
nl_max = 0
nl_max_blank_in_func = 0
nl_multi_line_cond = false
nl_multi_line_define = false
nl_namespace_brace = ignore
nl_namespace_two_to_one_liner = false
nl_oc_block_brace = ignore
nl_oc_brace_catch = ignore
nl_oc_catch_brace = ignore
nl_oc_implementation_brace = ignore
nl_oc_interface_brace = ignore
nl_oc_msg_args = false
nl_oc_msg_leave_one_liner = false
nl_paren_dbrace_open = ignore
nl_property_brace = ignore
nl_remove_extra_newlines = 0
nl_return_expr = ignore
nl_scope_brace = ignore
nl_split_for_one_liner = false
nl_split_if_one_liner = false
nl_split_while_one_liner = false
nl_squeeze_ifdef = false
nl_squeeze_ifdef_top_level = false
nl_squeeze_paren_close = false
nl_start_of_file = ignore
nl_start_of_file_min = 0
nl_struct_brace = ignore
nl_switch_brace = ignore
nl_synchronized_brace = ignore
nl_template_class = ignore
nl_try_brace = ignore
nl_tsquare_brace = ignore
nl_type_brace_init_lst_close = ignore
nl_type_brace_init_lst = ignore
nl_type_brace_init_lst_open = ignore
nl_typedef_blk_end = 0
nl_typedef_blk_in = 0
nl_typedef_blk_start = 0
nl_union_brace = ignore
nl_unittest_brace = ignore
nl_using_brace = ignore
nl_var_def_blk_end = 0
nl_var_def_blk_in = 0
nl_var_def_blk_start = 0
nl_version_brace = ignore
nl_while_brace = ignore
nl_while_leave_one_liners = false
output_tab_size = 4
pos_arith = ignore
pos_assign = ignore
pos_bool = ignore
pos_class_colon = lead
pos_class_comma = lead
pos_comma = ignore
pos_compare = ignore
pos_conditional = ignore
pos_constr_colon = ignore
pos_constr_comma = ignore
pos_enum_comma = ignore
pp_define_at_level = false
pp_if_indent_code = false
pp_ignore_define_body = false
pp_indent_at_level = false
pp_indent_brace = true
pp_indent_case = true
pp_indent_count = 1
pp_indent_extern = true
pp_indent_func_def = true
pp_indent_if = 0
pp_indent = ignore
pp_indent_region = 0
pp_region_indent_code = false
pp_space_count = 0
pp_space = ignore
sp_addr = remove
sp_after_angle = ignore
sp_after_assign = ignore
sp_after_byref_func = remove
sp_after_byref = remove
sp_after_cast = ignore
sp_after_class_colon = add
sp_after_comma = add
sp_after_constr_colon = ignore
sp_after_dc = ignore
sp_after_for_colon = ignore
sp_after_invariant_paren = ignore
sp_after_mdatype_commas = ignore
sp_after_new = ignore
sp_after_newop_paren = ignore
sp_after_noexcept = ignore
sp_after_oc_at_sel = ignore
sp_after_oc_block_caret = ignore
sp_after_oc_colon = ignore
sp_after_oc_dict_colon = ignore
sp_after_oc_msg_receiver = ignore
sp_after_oc_property = ignore
sp_after_oc_return_type = ignore
sp_after_oc_scope = ignore
sp_after_oc_synchronized = ignore
sp_after_oc_type = ignore
sp_after_operator = ignore
sp_after_operator_sym_empty = ignore
sp_after_operator_sym = ignore
sp_after_ptr_block_caret = ignore
sp_after_ptr_star_func = remove
sp_after_ptr_star = remove
sp_after_ptr_star_qualifier = ignore
sp_after_semi = add
sp_after_semi_for_empty = ignore
sp_after_semi_for = force
sp_after_send_oc_colon = ignore
sp_after_sparen = ignore
sp_after_tag = ignore
sp_after_throw = ignore
sp_after_tparen_close = remove
sp_after_type_brace_init_lst_open = ignore
sp_after_type = force
sp_angle_colon = ignore
sp_angle_paren_empty = ignore
sp_angle_paren = ignore
sp_angle_shift = remove
sp_angle_word = ignore
sp_annotation_paren = ignore
sp_arith_additive = ignore
sp_arith = ignore
sp_assign_default = ignore
sp_assign = ignore
sp_attribute_paren = ignore
sp_balance_nested_parens = false
sp_before_angle = ignore
sp_before_assign = ignore
sp_before_byref_func = ignore
sp_before_byref = add
sp_before_case_colon = remove
sp_before_class_colon = add
sp_before_comma = remove
sp_before_constr_colon = ignore
sp_before_dc = ignore
sp_before_ellipsis = ignore
sp_before_for_colon = ignore
sp_before_mdatype_commas = ignore
sp_before_nl_cont = add
sp_before_oc_block_caret = ignore
sp_before_oc_colon = ignore
sp_before_oc_dict_colon = ignore
sp_before_pp_stringify = ignore
sp_before_ptr_star_func = ignore
sp_before_ptr_star = add
sp_before_semi_for_empty = ignore
sp_before_semi_for = ignore
sp_before_semi = remove
sp_before_send_oc_colon = ignore
sp_before_sparen = ignore
sp_before_square = ignore
sp_before_squares = ignore
sp_before_template_paren = ignore
sp_before_tr_emb_cmt = ignore
sp_before_type_brace_init_lst_close = ignore
sp_before_unnamed_byref = ignore
sp_before_unnamed_ptr_star = ignore
sp_between_mdatype_commas = ignore
sp_between_new_paren = ignore
sp_between_ptr_star = ignore
sp_bool = ignore
sp_brace_catch = ignore
sp_brace_else = ignore
sp_brace_finally = ignore
sp_brace_typedef = ignore
sp_case_label = ignore
sp_catch_brace = ignore
sp_catch_paren = ignore
sp_cmt_cpp_doxygen = false
sp_cmt_cpp_qttr = false
sp_cmt_cpp_start = ignore
sp_compare = ignore
sp_cond_colon_after = ignore
sp_cond_colon_before = ignore
sp_cond_colon = ignore
sp_cond_question_after = ignore
sp_cond_question_before = ignore
sp_cond_question = ignore
sp_cond_ternary_short = ignore
sp_cparen_oparen = ignore
sp_cpp_before_struct_binding = ignore
sp_cpp_cast_paren = ignore
sp_cpp_lambda_assign = ignore
sp_cpp_lambda_paren = ignore
sp_d_array_colon = ignore
sp_defined_paren = ignore
sp_deref = remove
sp_else_brace = ignore
sp_endif_cmt = ignore
sp_enum_after_assign = ignore
sp_enum_assign = ignore
sp_enum_before_assign = ignore
sp_enum_colon = ignore
sp_enum_paren = ignore
sp_extern_paren = ignore
sp_finally_brace = ignore
sp_fparen_brace = ignore
sp_fparen_brace_initializer = ignore
sp_fparen_dbrace = ignore
sp_func_call_paren_empty = ignore
sp_func_call_paren = ignore
sp_func_call_user_inside_fparen = ignore
sp_func_call_user_paren = ignore
sp_func_call_user_paren_paren = remove
sp_func_class_paren_empty = ignore
sp_func_class_paren = ignore
sp_func_def_paren_empty = ignore
sp_func_def_paren = ignore
sp_func_proto_paren_empty = ignore
sp_func_proto_paren = ignore
sp_getset_brace = ignore
sp_incdec = remove
sp_inside_angle = ignore
sp_inside_braces_empty = remove
sp_inside_braces_enum = ignore
sp_inside_braces = ignore
sp_inside_braces_oc_dict = ignore
sp_inside_braces_struct = ignore
sp_inside_fparen = ignore
sp_inside_fparens = remove
sp_inside_newop_paren_close = ignore
sp_inside_newop_paren = ignore
sp_inside_newop_paren_open = ignore
sp_inside_oc_at_sel_parens = ignore
sp_inside_paren_cast = ignore
sp_inside_paren = ignore
sp_inside_sparen_close = ignore
sp_inside_sparen = ignore
sp_inside_sparen_open = ignore
sp_inside_square = ignore
sp_inside_square_oc_array = ignore
sp_inside_tparen = ignore
sp_inside_type_brace_init_lst = ignore
sp_invariant_paren = ignore
sp_inv = remove
sp_macro_func = ignore
sp_macro = ignore
sp_member = remove
sp_not = remove
sp_num_before_tr_emb_cmt = 0
sp_oc_brace_catch = ignore
sp_oc_catch_brace = ignore
sp_oc_catch_paren = ignore
sp_paren_brace = remove
sp_paren_comma = force
sp_paren_paren = remove
sp_permit_cpp11_shift = true
sp_pp_concat = add
sp_pp_stringify = ignore
sp_ptr_star_paren = ignore
sp_range = ignore
sp_return_paren = ignore
sp_scope_paren = ignore
sp_sign = remove
sp_sizeof_paren = ignore
sp_skip_vbrace_tokens = false
sp_sparen_brace = add
sp_special_semi = ignore
sp_square_fparen = ignore
sp_super_paren = remove
sp_template_angle = ignore
sp_this_paren = remove
sp_throw_paren = ignore
sp_try_brace = ignore
sp_type_brace_init_lst = ignore
sp_type_func = ignore
sp_version_paren = ignore
sp_word_brace = add
sp_word_brace_ns = add
string_escape_char2 = 0
string_escape_char = 92
string_replace_tab_chars = false
tok_split_gte = false
use_indent_continue_only_once = false
use_indent_func_call_param = true
use_options_overriding_for_qt_macros = true
utf8_bom = ignore
utf8_byte = false
utf8_force = false
warn_level_tabs_found_in_verbatim_string_literals = 2

68
.vscode/launch.json vendored
View File

@@ -1,68 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) QtWidgets example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/kddockwidgets_example",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) QtQuick example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/kddockwidgets_example_quick",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(vs) kddockwidgets_example",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/kddockwidgets_example.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"sourceFileMap" : {
"C:\\Users\\qt\\work\\qt\\qtbase\\src" : "D:\\Qt\\5.14.2\\Src\\qtbase\\src"
}
},
{
"name": "(vs) tst_docks",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/tst_docks.exe",
"args": ["tst_moreTitleBarCornerCases", "-platform", "windows"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false
}
]
}

10
.vscode/settings.json vendored
View File

@@ -1,10 +0,0 @@
{
"C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools",
"files.associations": {
"qevent": "cpp"
},
"cmake.configureSettings": {
"KDDockWidgets_DEVELOPER_MODE" : "ON",
"KDDockWidgets_QTQUICK" : true
}
}

View File

@@ -21,7 +21,7 @@
# #
# -DKDDockWidgets_TESTS=[true|false] # -DKDDockWidgets_TESTS=[true|false]
# Build the test harness. # Build the test harness.
# Currently does nothing unless you also set KDDockWidgets_DEVELOPER_MODE=True # Currently ignored (except for Python bindings) unless KDDockWidgets_DEVELOPER_MODE=True.
# Default=false # Default=false
# #
# -DKDDockWidgets_EXAMPLES=[true|false] # -DKDDockWidgets_EXAMPLES=[true|false]
@@ -29,46 +29,54 @@
# Default=true # Default=true
# #
# -DKDDockWidgets_DOCS=[true|false] # -DKDDockWidgets_DOCS=[true|false]
# Build the API documentation. # Build the API documentation. Enables the 'docs' build target.
# Default=false # Default=false
# #
# -DKDDockWidgets_QTQUICK=[true|false]
# Build for QtQuick instead of QtWidgets.
# Default=false
#
# -DKDDockWidgets_PYTHON_BINDINGS=[true|false]
# Build/Generate python bindings. Always false for Debug builds
# (If your shiboken or pyside is installed in a non-standard locations
# try passing the SHIBOKEN_CUSTOM_PREFIX and PYSIDE_CUSTOM_PREFIX variables.)
# Default=false
#
# -DKDDockWidgets_PYTHON_BINDINGS_INSTALL_PREFIX=[path]
# Set an alternative install path for Python bindings
# Default=CMAKE_INSTALL_PREFIX
# ## DO NOT USE IF YOU ARE AN END-USER. FOR THE DEVELOPERS ONLY!!
## Special CMake Options for Developers
#
# -DKDDockWidgets_DEVELOPER_MODE=[true|false] # -DKDDockWidgets_DEVELOPER_MODE=[true|false]
# Configure the build for a developer setup. # Configure the build for a developer setup.
# Enables some features that are not geared towards end-users. # Enables some features that are not geared towards end-users.
# Forces the test harness to be built. # Forces the test harness to be built.
# Default=false # Default=false
# #
# -DKDDockWidgets_QTQUICK == IN DEVELOPMENT. DO NOT USE! == # -DKDDockWidgets_WERROR=[true|false]
# Build for QtQuick instead of QtWidgets # Compile with the -Werror gcc/clang option (always true for developer-mode)
# Default=false # Default=false
# #
# -DKDDockWidgets_PYTHON_BINDINGS=[true|false] # -DKDDockWidgets_LINTER=[true|false]
# Build/Generate python bindings. Always false for Debug builds # Build the layout linter.
# Default=false # Ignored unless KDDockWidgets_DEVELOPER_MODE=True
#
# -DKDDockWidgets_PYTHON_BINDINGS_INSTALL_PREFIX=[path]
# Set an alternative install path for Python bindings
# Default=CMAKE_INSTALL_PREFIX
#
# -DKDDockWidgets_UNITY_BUILD=[true|false]
# Build with CMake's UNITY_BUILD (requires CMake version 3.16 or higher)
# Default=true # Default=true
# #
# -DKDDockWidgets_FUZZER=[true|false]
# Build the fuzzer.
# Ignored unless KDDockWidgets_DEVELOPER_MODE=True
# Default=true
cmake_minimum_required(VERSION 3.7) cmake_minimum_required(VERSION 3.7)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
set(KDAB_INSTALL True) # Allow using a non-KDAB install location.
if((NOT DEFINED ${USE_DEFAULT_INSTALL_LOCATION}) OR (NOT ${USE_DEFAULT_INSTALL_LOCATION})) set(KDAB_INSTALL True CACHE INTERNAL "Install to default KDAB Location")
if(DEFINED CMAKE_INSTALL_PREFIX)
if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "") if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "")
set(KDAB_INSTALL False) set(KDAB_INSTALL False CACHE INTERNAL "Install to non-KDAB Location")
endif() endif()
set(USE_DEFAULT_INSTALL_LOCATION ${KDAB_INSTALL} CACHE INTERNAL "Install to default KDAB Location" FORCE)
endif() endif()
if(${CMAKE_VERSION} VERSION_LESS "3.12.0") if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
@@ -81,60 +89,95 @@ else()
endif() endif()
set(${PROJECT_NAME}_VERSION_MAJOR 1) set(${PROJECT_NAME}_VERSION_MAJOR 1)
set(${PROJECT_NAME}_VERSION_MINOR 2) set(${PROJECT_NAME}_VERSION_MINOR 5)
set(${PROJECT_NAME}_VERSION_PATCH 1) set(${PROJECT_NAME}_VERSION_PATCH 0)
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}) set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
set(${PROJECT_NAME}_SOVERSION "1.3") set(PROJECT_VERSION ${${PROJECT_NAME}_VERSION}) #PROJECT_VERSION is needed by some ECM modules
set(${PROJECT_NAME}_SOVERSION "1.5")
include(FeatureSummary) include(FeatureSummary)
option(${PROJECT_NAME}_QT6 "Build against Qt 6" OFF) option(${PROJECT_NAME}_QT6 "Build against Qt 6" OFF)
option(${PROJECT_NAME}_DEVELOPER_MODE "Developer Mode" OFF) option(${PROJECT_NAME}_DEVELOPER_MODE "Developer Mode" OFF)
option(${PROJECT_NAME}_PYTHON_BINDINGS "Build python bindings" OFF) option(${PROJECT_NAME}_PYTHON_BINDINGS "Build python bindings" OFF)
option(${PROJECT_NAME}_QTQUICK "Build for QtQuick instead of QtWidgets" OFF)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") option(${PROJECT_NAME}_STATIC "Build statically" OFF)
option(${PROJECT_NAME}_UNITY_BUILD "Build with CMake's UNITY_BUILD" ON)
endif()
if(${PROJECT_NAME}_PYTHON_BINDINGS AND (CMAKE_BUILD_TYPE MATCHES "^[Dd]eb" OR ${PROJECT_NAME}_STATIC))
message(FATAL_ERROR "** Python Bindings are disabled in debug or static builds.")
endif()
option(${PROJECT_NAME}_TESTS "Build the tests" OFF) option(${PROJECT_NAME}_TESTS "Build the tests" OFF)
option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON) option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON)
option(${PROJECT_NAME}_DOCS "Build the API documentation" OFF) option(${PROJECT_NAME}_DOCS "Build the API documentation" OFF)
option(${PROJECT_NAME}_WERROR "Use -Werror (will be true for developer-mode unconditionally)" OFF) option(${PROJECT_NAME}_WERROR "Use -Werror (will be true for developer-mode unconditionally)" OFF)
option(${PROJECT_NAME}_X11EXTRAS "On Linux, link against QtX11Extras so we can detect if the compositor supports transparency. Not applicable to other platforms or Qt6." ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/ECM/modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/KDAB/modules")
# Set a default build type if none was specified
set(default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git" OR ${PROJECT_NAME}_DEVELOPER_MODE)
set(default_build_type "Debug")
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to ${default_build_type} as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
if(${PROJECT_NAME}_QT6)
set(Qt_VERSION_MAJOR 6)
set(QT_MIN_VERSION "6.0.0")
find_package(Qt6Widgets ${QT_MIN_VERSION} REQUIRED)
find_package(Qt6Test ${QT_MIN_VERSION} REQUIRED)
set(${PROJECT_NAME}_LIBRARY_QTID "-qt6")
else()
set(Qt_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15")
find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED)
find_package(Qt5Test ${QT_MIN_VERSION} REQUIRED)
set(${PROJECT_NAME}_LIBRARY_QTID "")
endif()
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
set(${PROJECT_NAME}_DEPS "widgets")
if(${PROJECT_NAME}_QTQUICK)
find_package(Qt${Qt_VERSION_MAJOR}Quick)
find_package(Qt${Qt_VERSION_MAJOR}QuickControls2)
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} quick quickcontrols2")
else()
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS)
endif()
if(NOT WIN32 AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ${PROJECT_NAME}_QT6 AND ${PROJECT_NAME}_X11EXTRAS)
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} x11extras")
endif()
#Always build the test harness in developer-mode #Always build the test harness in developer-mode
if(${PROJECT_NAME}_DEVELOPER_MODE) if(${PROJECT_NAME}_DEVELOPER_MODE)
set(${PROJECT_NAME}_TESTS ON) set(${PROJECT_NAME}_TESTS ON)
set(${PROJECT_NAME}_WERROR ON) set(${PROJECT_NAME}_WERROR ON)
include(ECMEnableSanitizers)
endif() endif()
#option(${PROJECT_NAME}_QTQUICK "Build for QtQuick instead of QtWidgets" OFF) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(IS_CLANG_BUILD TRUE)
if (${PROJECT_NAME}_QT6)
find_package(Qt6Widgets REQUIRED)
find_package(Qt6Test REQUIRED)
set(QT_MAJOR_VERSION 6)
else() else()
find_package(Qt5Widgets 5.9 REQUIRED) set(IS_CLANG_BUILD FALSE)
find_package(Qt5Test 5.9 REQUIRED) endif()
set(QT_MAJOR_VERSION 5)
if(${PROJECT_NAME}_QTQUICK)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif() endif()
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(ECM_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/ECM/modules/") # Default to hidden visibility for symbols
set(PYTHON_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake/Python") set(CMAKE_C_VISIBILITY_PRESET hidden)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" ${ECM_MODULE_DIR} ${PYTHON_MODULE_DIR}) set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
# setup default install locations
include(InstallLocation)
include(QtInstallPaths) #to set QT_INSTALL_FOO variables
macro(set_compiler_flags targetName) macro(set_compiler_flags targetName)
if(${PROJECT_NAME}_DEVELOPER_MODE) if(${PROJECT_NAME}_DEVELOPER_MODE)
@@ -150,18 +193,31 @@ macro(set_compiler_flags targetName)
endif() endif()
# Enable -Werror # Enable -Werror
if(NOT MSVC AND ${PROJECT_NAME}_WERROR) if(${PROJECT_NAME}_WERROR AND (NOT MSVC OR IS_CLANG_BUILD)) # clang-cl accepts these too
target_compile_options(${targetName} PRIVATE -Werror -Wno-error=deprecated-declarations) target_compile_options(${targetName} PRIVATE -Werror -Wundef -Wno-error=deprecated-declarations)
endif() endif()
endmacro() endmacro()
if(${PROJECT_NAME}_QTQUICK) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) OR
find_package(Qt${QT_MAJOR_VERSION}Quick) (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE) OR
find_package(Qt${QT_MAJOR_VERSION}QuickControls2) (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32))
add_definitions(-DKDDOCKWIDGETS_QTQUICK) # Linker warnings should be treated as errors
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_MODULE_LINKER_FLAGS}")
string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" compileflags)
if("${CMAKE_CXX_FLAGS} ${${compileflags}}" MATCHES "-fsanitize")
set(sanitizers_enabled TRUE)
else() else()
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS) set(sanitizers_enabled FALSE)
endif()
# cannot enable this for clang + sanitizers
if(NOT sanitizers_enabled OR NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Do not allow undefined symbols, even in non-symbolic shared libraries
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}")
endif()
endif() endif()
if(${PROJECT_NAME}_STATIC) if(${PROJECT_NAME}_STATIC)
@@ -170,27 +226,62 @@ else()
set(${PROJECT_NAME}_LIBRARY_MODE "SHARED") set(${PROJECT_NAME}_LIBRARY_MODE "SHARED")
endif() endif()
if(USE_DEFAULT_INSTALL_LOCATION) if(KDAB_INSTALL)
if(UNIX) if(UNIX)
set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}") set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "Install to default KDAB Location")
elseif(WIN32) elseif(WIN32)
set(CMAKE_INSTALL_PREFIX "C:\\KDAB\\${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}") set(CMAKE_INSTALL_PREFIX "C:\\KDAB\\${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "Install to default KDAB Location")
endif() endif()
endif() endif()
# Generate .pri file for qmake users # setup default install locations
include(ECMGeneratePriFile) include(InstallLocation)
set(PROJECT_VERSION_STRING ${${PROJECT_NAME}_VERSION})
ecm_generate_pri_file(BASE_NAME KDDockWidgets if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
LIB_NAME kddockwidgets set(${PROJECT_NAME}_IS_ROOT_PROJECT TRUE)
FILENAME_VAR pri_filename
) message(STATUS "Building ${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} in ${CMAKE_BUILD_TYPE} mode. Installing to ${CMAKE_INSTALL_PREFIX}")
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
install(FILES LICENSE.txt README.md DESTINATION ${INSTALL_DOC_DIR}) install(FILES LICENSE.txt README.md DESTINATION ${INSTALL_DOC_DIR})
install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR}) install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR})
# Generate .pri file for qmake users
#TODO: ECM does not support Qt6 yet
if(Qt_VERSION_MAJOR EQUAL 5 AND
CMAKE_VERSION VERSION_GREATER "3.11.99" AND NOT CMAKE_CONFIGURATION_TYPES) # Not working with VS generator or older cmake versions
include(ECMGeneratePriFile)
set(PROJECT_VERSION_STRING ${${PROJECT_NAME}_VERSION})
ecm_generate_pri_file(BASE_NAME KDDockWidgets
LIB_NAME kddockwidgets
DEPS ${${PROJECT_NAME}_DEPS}
FILENAME_VAR pri_filename
INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}
)
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
endif()
else()
#Always disable tests, examples, docs when used as a submodule
set(${PROJECT_NAME}_IS_ROOT_PROJECT FALSE)
set(${PROJECT_NAME}_TESTS FALSE)
set(${PROJECT_NAME}_EXAMPLES FALSE)
set(${PROJECT_NAME}_DOCS FALSE)
endif()
if(${PROJECT_NAME}_TESTS)
enable_testing()
endif()
add_subdirectory(src) add_subdirectory(src)
if(${PROJECT_NAME}_PYTHON_BINDINGS)
if(CMAKE_BUILD_TYPE MATCHES "^[Dd]eb" OR ${PROJECT_NAME}_STATIC)
message(FATAL_ERROR "** Python Bindings are disabled in debug or static builds.")
endif()
endif()
if(${PROJECT_NAME}_PYTHON_BINDINGS) if(${PROJECT_NAME}_PYTHON_BINDINGS)
add_subdirectory(python) add_subdirectory(python)
endif() endif()
@@ -201,15 +292,14 @@ if(${PROJECT_NAME}_EXAMPLES)
else() else()
add_subdirectory(examples/dockwidgets) add_subdirectory(examples/dockwidgets)
add_subdirectory(examples/minimal) add_subdirectory(examples/minimal)
add_subdirectory(examples/minimal-mdi)
set_compiler_flags(kddockwidgets_example) set_compiler_flags(kddockwidgets_example)
set_compiler_flags(kddockwidgets_minimal_example) set_compiler_flags(kddockwidgets_minimal_example)
endif() endif()
endif() endif()
if(${PROJECT_NAME}_DEVELOPER_MODE)
include(ECMEnableSanitizers)
if(${PROJECT_NAME}_TESTS) if(${PROJECT_NAME}_TESTS)
enable_testing() if(${PROJECT_NAME}_DEVELOPER_MODE)
add_subdirectory(tests) add_subdirectory(tests)
# Require Qt5.15.1 or higher to run the tests_launcher tests on Mac # Require Qt5.15.1 or higher to run the tests_launcher tests on Mac
@@ -250,6 +340,9 @@ if(${PROJECT_NAME}_DOCS)
add_subdirectory(docs) # needs to go last, in case there are build source files add_subdirectory(docs) # needs to go last, in case there are build source files
endif() endif()
if (${PROJECT_NAME}_UNITY_BUILD) if(${PROJECT_NAME}_IS_ROOT_PROJECT)
set_target_properties(kddockwidgets PROPERTIES UNITY_BUILD ON) # Add uninstall target (not for submodules since parent projects typically have uninstall too)
include(ECMUninstallTarget)
endif() endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

View File

@@ -1,47 +1,99 @@
{ {
"version": 1, "version": 2,
"configurePresets": [ "configurePresets": [
{ {
"name": "dev-qtwidgets", "name": "dev",
"displayName": "dev-qtwidgets", "displayName": "dev",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-qtwidgets", "binaryDir": "${sourceDir}/build-dev",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON", "KDDockWidgets_DEVELOPER_MODE": "ON",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'" "ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF"
},
"warnings" : {
"uninitialized" : true
} }
}, },
{ {
"name": "clazy-qtwidgets", "name": "dev-gammaray",
"displayName": "clazy-qtwidgets", "displayName": "dev-gammaray",
"description": "A Gammaray friendly build. (No ASAN)",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-clazy-qtwidgets", "binaryDir": "${sourceDir}/build-dev-gammaray",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_WERROR": "ON" "KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF"
},
"warnings" : {
"uninitialized" : true
}
},
{
"name": "clazy",
"displayName": "clazy",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-clazy",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_WERROR": "ON",
"KDDockWidgets_EXAMPLES" : "OFF"
}, },
"environment": { "environment": {
"CXX": "clazy" "CXX": "clazy",
"CCACHE_DISABLE" : "ON"
} }
}, },
{ {
"name": "qtwidgets", "name": "clazy-qtquick",
"displayName": "qtwidgets", "displayName": "clazy-qtquick",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-qtwidgets", "binaryDir": "${sourceDir}/build-clazy-qtquick",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release" "CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_EXAMPLES" : "OFF",
"KDDockWidgets_WERROR": "ON",
"KDDockWidgets_QTQUICK": "ON"
},
"environment": {
"CXX": "clazy",
"CCACHE_DISABLE" : "ON"
} }
}, },
{ {
"name": "qtquick", "name": "release",
"displayName": "qtquick", "displayName": "release",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-qtquick", "binaryDir": "${sourceDir}/build-release",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QTQUICK": "ON" "CMAKE_UNITY_BUILD" : "ON"
}
},
{
"name": "release-no-x11extras",
"displayName": "release-no-x11extras",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release-no-x11extras",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_UNITY_BUILD" : "ON",
"KDDockWidgets_X11EXTRAS" : "OFF"
}
},
{
"name": "release-qtquick",
"displayName": "release-qtquick",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release-qtquick",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QTQUICK": "ON",
"CMAKE_UNITY_BUILD" : "ON"
} }
}, },
{ {
@@ -53,7 +105,9 @@
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QTQUICK": "ON", "KDDockWidgets_QTQUICK": "ON",
"KDDockWidgets_DEVELOPER_MODE": "ON", "KDDockWidgets_DEVELOPER_MODE": "ON",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'" "ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF"
} }
}, },
{ {
@@ -63,17 +117,19 @@
"binaryDir": "${sourceDir}/build-python", "binaryDir": "${sourceDir}/build-python",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_PYTHON_BINDINGS": "ON" "KDDockWidgets_PYTHON_BINDINGS": "ON",
"CMAKE_UNITY_BUILD" : "ON"
} }
}, },
{ {
"name": "static-qtwidgets", "name": "static",
"displayName": "static-qtwidgets", "displayName": "static",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-static-qtwidgets", "binaryDir": "${sourceDir}/build-static",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_STATIC": "ON" "KDDockWidgets_STATIC": "ON",
"CMAKE_UNITY_BUILD" : "ON"
} }
}, },
{ {
@@ -84,49 +140,178 @@
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_STATIC": "ON", "KDDockWidgets_STATIC": "ON",
"KDDockWidgets_QTQUICK": "ON" "KDDockWidgets_QTQUICK": "ON",
"CMAKE_UNITY_BUILD" : "ON"
} }
}, },
{ {
"name": "qtwidgets6", "name": "release6",
"displayName": "qtwidgets6", "displayName": "release6",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-qtwidgets6", "binaryDir": "${sourceDir}/build-release6",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QT6": "ON" "KDDockWidgets_QT6": "ON",
"CMAKE_UNITY_BUILD" : "ON",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
}, },
"environment": { "environment": {
"PATH": "$env{HOME}/Qt/6.0.0/gcc_64/bin:$penv{PATH}" "PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
} }
}, },
{ {
"name": "dev-qtwidgets6", "name": "dev6",
"displayName": "dev-qtwidgets6", "displayName": "dev6",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-qtwidgets6", "binaryDir": "${sourceDir}/build-dev6",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QT6": "ON", "KDDockWidgets_QT6": "ON",
"KDDockWidgets_DEVELOPER_MODE": "ON", "KDDockWidgets_DEVELOPER_MODE": "ON",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'" "CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"KDDockWidgets_FUZZER" : "OFF",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
}, },
"environment": { "environment": {
"PATH": "$env{HOME}/Qt/6.0.0/gcc_64/bin:$penv{PATH}" "PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
} }
}, },
{ {
"name": "qtquick6", "name": "release-qtquick6",
"displayName": "qtquick6", "displayName": "release-qtquick6",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build-qtquick6", "binaryDir": "${sourceDir}/build-release-qtquick6",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QTQUICK": "ON", "KDDockWidgets_QTQUICK": "ON",
"KDDockWidgets_QT6": "ON" "KDDockWidgets_QT6": "ON",
"CMAKE_UNITY_BUILD" : "ON",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
}, },
"environment": { "environment": {
"PATH": "$env{HOME}/Qt/6.0.0/gcc_64/bin:$penv{PATH}" "PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
}
},
{
"name": "dev-qtquick6",
"displayName": "dev-qtquick6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-qtquick6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QTQUICK": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"KDDockWidgets_QT6": "ON",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
},
"environment": {
"PATH": "$env{QT6_DIR}/bin:$penv{PATH}",
"QML2_IMPORT_PATH" : "$env{QT6_DIR}/imports:$env{QT6_DIR}/qml",
"LD_LIBRARY_PATH" : "$env{QT6_DIR}/lib"
}
},
{
"name": "dev-clangcl",
"displayName": "dev-clangcl",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-clangcl",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "ON"
},
"warnings" : {
"uninitialized" : true
},
"environment": {
"CC": "clang-cl",
"CXX": "clang-cl"
}
},
{
"name": "dev-qtquick-clangcl",
"displayName": "dev-qtquick-clangcl",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-qtquick-clangcl",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"KDDockWidgets_FUZZER" : "OFF",
"KDDockWidgets_QTQUICK": "ON"
},
"warnings" : {
"uninitialized" : true
},
"environment": {
"CC": "clang-cl",
"CXX": "clang-cl"
}
},
{
"name": "dev-clangcl6",
"displayName": "dev-clangcl6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-clangcl6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"KDDockWidgets_FUZZER" : "ON",
"KDDockWidgets_QT6": "ON",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
},
"warnings" : {
"uninitialized" : true
},
"environment": {
"CC": "clang-cl",
"CXX": "clang-cl",
"PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
}
},
{
"name": "dev-qtquick-clangcl6",
"displayName": "dev-qtquick-clangcl6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-qtquick-clangcl6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"KDDockWidgets_FUZZER" : "OFF",
"KDDockWidgets_QTQUICK": "ON",
"KDDockWidgets_QT6": "ON",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
},
"warnings" : {
"uninitialized" : true
},
"environment": {
"CC": "clang-cl",
"CXX": "clang-cl",
"PATH": "$env{QT6_DIR}/bin:$penv{PATH}",
"QML2_IMPORT_PATH" : "$env{QT6_DIR}/imports:$env{QT6_DIR}/qml",
"LD_LIBRARY_PATH" : "$env{QT6_DIR}/lib"
}
}
],
"buildPresets": [
{
"name": "clazy",
"configurePreset": "clazy",
"environment": {
"CLAZY_CHECKS" : "level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo",
"CCACHE_DISABLE" : "ON"
}
},
{
"name": "clazy-qtquick",
"configurePreset": "clazy-qtquick",
"environment": {
"CLAZY_CHECKS" : "level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo",
"CCACHE_DISABLE" : "ON"
} }
} }
] ]

8
CONTRIBUTORS.txt Normal file
View File

@@ -0,0 +1,8 @@
People who have signed the CLA:
Christian Riggenbach <criggenbach@magahugu.ch>
Jacob Young <amazingjacob@gmail.com>
Matthew Waltz <matthewwaltzis@gmail.com>
Roman Pudashkin <r.pudashkin@gmail.com>
Elnur Ismailzada <eismailzada@gmail.com>
Daniel Price <danielp@nvidia.com>

View File

@@ -1,12 +1,78 @@
* v1.3.0 (unreleased) * v1.5.0 (24 November 2021)
- [TODO] QtQuick support - Install the Python bindings to "site-packages"
- The Python bindings for Qt6 use the "PyKDDockWidgetsQt6" namespace
- Co-installable with Qt6
- Adds support for non-detachable central widget, MainWindowOption_HasCentralWidget. (#225)
- Fix corrupt layout when restoring old JSON
- Fix "Unpin" button not showing up in overlayed widgets
- Minimum Qt version is now 5.15
* v1.4.0 (16 July 2021)
- No longer supports Qt versions less than 5.12
- Experimental MDI support. By using MainWindowMDI you can now have "docked" dock widgets
which are free to be arbitrarily positioned and even overlapped inside the main window.
- TitleBar's height is now controlled by sizeHint() instead of hardcoded.
If you haven't overridden TitleBar or just inheriting from TitleBarWidget then there's nothing to do,
as TitleBarWidget already reimplements sizeHint. If you're inheriting directly from TitleBar then make
sure to provide a sizeHint.
- Added MainWindow::closeDockWidgets()
- Fixed crash in MainWindow::layoutEqually()
- QtQuick: Added more declarative API
- FloatingWindow now honours the dockwidget's max-size, if there's a single
dock widget docked. Tabbed cases are more difficult since QStackedLayout doesn't
propagate size constraints.
- Added MainWindowBase::frameCountChanged()
- Introduced Config::setDropIndicatorsInhibited(), which allows you to disable support
for drop indicators while dragging.
- Fixed embedding the main window into a non-kddw main window (#204, #168)
- Fixed crash with an MFC application
- Allows to disable translucency via the KDDW_NO_TRANSLUCENCY env var, useful
in case running on weird Window Managers.
- Added Flag_ShowButtonsOnTabBarIfTitleBarHidden, which can be used when using Flag_HideTitleBarWhenTabsVisible.
The close and float buttons will be shown directly in the tab-bar.
- Fixes persistent central frame being invisible after closing all tabs (#220)
- Added python bindings for the InitialOption struct (#198)
- Generate and install camelcase forwarding headers (public, exported classes)
- Build in Release mode by default (in non-developer situations)
* v1.3.1 (7 June 2021)
- Improve restoring layout when RestoreOption_RelativeToMainWindow is used (#171)
- Improved dragging windows across screens in mixed hdpi setups
- Fixed Flag_NativeTitleBar not hiding the client title bars when restoring (#170)
- Double clicking a native title bar of a Qt::Tool window will now redock the window (#173)
- Size of FloatingWindow now accounts for the fact that it's using Flag_NativeTitleBar and
resizes its content accordingly (#174)
- Fixed popups on overlayed dock widgets not working
- Don't restore maximized state when using RestoreOption_RelativeToMainWindow (#184)
* v1.3.0 (8 February 2021)
- Experimental QtQuick support (#49)
- Added static DockWidgetBase::byName() (#126) - Added static DockWidgetBase::byName() (#126)
- The enum KDDockWidgets::AddingOption has been deprecated, use - The enum KDDockWidgets::AddingOption has been deprecated, use
KDDockWidgets::InitialVisibilityOption instead KDDockWidgets::InitialVisibilityOption instead
- You can now pass a preferred initial size to MainWindow::addDockWidget() (#95) - You can now pass a preferred initial size to MainWindow::addDockWidget() (#95)
- Added DockWidgetBase::Option_DeleteOnClose
- Added Config::Flag_CloseOnlyCurrentTab
- PySide6 support
- Layout restorer now restores maximzied/minimized state too (#81)
- Fixed dock indicators sometimes not appearing on Windows (#103)
- Fixed Flag_NativeTitleBar not working
- Fixed drag offset when dragging too fast with mouse
- Fixed bug where last tab index position wouldn't be remembered in case user
had manually reordered tabs (#154)
- Fixed crash when hosting a QQuickWidget (#150)
- Fixed CMake Visual Studio generator not working
- Sidebar overlays now maintain their size when toggled (#155)
- Added DockWidget::setFloatingGeometry() (#144)
* v1.2.1 (unreleased) * v1.2.1 (6 February 2021)
- Support for resizing dock widgets when they are in overlay/popup mode (autohide/sidebar feature) - Support for resizing dock widgets when they are in overlay/popup mode (autohide/sidebar feature)
- Fixed title bar close button enabled state not being restored with Layout saver (#137)
- Installs a version header (kddockwidgets_version.h) that defines a version string and other useful versioning macros (#138)
- DockWidgetBase::eventFilter() is protected instead of private (regression vs v1.1) (#148)
It's recommended that you rebuild your application when updating KDDW, as MSVC encodes private/protected in the name mangling.
- Fixed WASM build on Windows (#163)
- Fixed sidebar overlay not getting hidden when clicking on the main window docking area (#157)
* v1.2.0 (17 December 2020) * v1.2.0 (17 December 2020)
- Wayland support - Wayland support

28
LICENSES/BSD-3-Clause.txt Normal file
View File

@@ -0,0 +1,28 @@
Copyright (c) <year> <owner>. All rights reserved.
This license applies to the CMake ECM modules only.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

18
README-QtQuick.md Normal file
View File

@@ -0,0 +1,18 @@
Supported Qt versions and toolchains
=====================================
KDDockWidgets for QtQuick requires a C++17 capable compiler and either
Qt >= 5.15.2 or Qt >= 6.2.1
TROUBLESHOOTING
===============
- QtGraphicalEffects is not supported, as it's buggy when moving between different QWindows.
See for example QTBUG-94943, KDDockWidgets issue #213. Also search the Qt bug tracker
for "QQuickItem: Cannot use same item on different windows at the same time"
- Very rarely, in some Nvidia/X11 setups, floating/docking has noticeable lag (like 1 second)
This could be solved by going to Nvidia's settings and making sure all monitors have
the same refresh rate and disabling "Allow Flipping". It's not known why this solves it. Might also
be a bug in Qt.

74
README-bindings.md Normal file
View File

@@ -0,0 +1,74 @@
These are the instructions for building the Python bindings for KDDockWidgets.
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
```
For more info visit https://doc.qt.io/qtforpython/shiboken2/gettingstarted.html
afterwards run 'pip3 list | grep PySide2'
Note the version *must* match the same Qt you intend to use when building KDDockWidgets.
Not supported:
- Debug builds
- static builds
- python2 bindings
- only some 32-bit platforms are supported. see https://wiki.qt.io/Qt_for_Python
Tell CMake to build the bindings by passing the `-DKDDockWidgets_PYTHON_BINDINGS=True' option,
followed by the make command.
The bindings will be installed to the passed `-DCMAKE_INSTALL_PREFIX`, which
might require setting the `PYTHONPATH` env variable to point to that path when
running applications. Alternatively, configure the bindings install location
by passing `-DKDDockWidgets_PYTHON_BINDINGS_INSTALL_PREFIX=/usr/lib/python3.8/site-packages`
to CMake (adjust to the python path on your system).
To run the KDDW python example
```
$ export PYTHONPATH=/kddw/install/path # Only if needed
$ cd python/examples/
$ rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc
$ python3 main.py
```
Build Issues
* If you see errors like "Unable to locate Clang's built-in include directory"
then first make sure you have llvm installed. If you still have problems try
setting the environment variable `LLVM_INSTALL_DIR` to point to your llvm installation.
Examples:
```
export LLVM_INSTALL_DIR=/usr/local/opt/llvm-11
set "LLVM_INSTALL_DIR=C:\Program Files\LLVM" #Windows
```
* When building the examples you may encounter errors loading shared libraries from shiboken2_generator.
Try:
```
export LD_LIBRARY_PATH=/usr/local/lib/python/dist-packages/PySide2/Qt/lib #linux
export DYLD_LIBRARY_PATH=/usr/local/lib/python/dist-packages/PySide2/Qt/lib #Mac
#adjust to wherever your PySide is installed
```
* On Windows the `libclang.dll` that ship with QtForPython is not compatible with MSVC2019.
To fix this, copy the `libclang.dll` that comes with llvm into shiboken2, like so:
```
cd C:\Python37\Lib\site-packages\shiboken2_generator
copy libclang.dll libclang.dll.save
copy "C:\Program Files\llvm\bin\libclang.dll" libclang.dll
#Python3 installation in C:\Python37 and llvm in c:\Program Files\llvm. adjust as needed
```

119
README.md
View File

@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.com/KDAB/KDDockWidgets.svg?branch=master)](https://travis-ci.com/KDAB/KDDockWidgets)
KDDockWidgets KDDockWidgets
============= =============
`KDDockWidgets` is a Qt dock widget library written by KDAB, suitable for replacing `KDDockWidgets` is a Qt dock widget library written by KDAB, suitable for replacing
@@ -29,7 +31,7 @@ however that this demo isn't fully featured, as it's running on Qt for WebAssemb
Features Features
======== ========
- Provide advanced docking that QDockWidgets doesn't support - Provide advanced docking that QDockWidget doesn't support
- Native window resize on Windows (allowing for Aero-snap even with custom title bar decorations) - Native window resize on Windows (allowing for Aero-snap even with custom title bar decorations)
- Arrow drop indicators for great drop precision - Arrow drop indicators for great drop precision
- Allow for totally different, user provided, drop indicator types - Allow for totally different, user provided, drop indicator types
@@ -46,13 +48,13 @@ Features
- Customize title bars - Customize title bars
- Customize window frames - Customize window frames
- Custom widget separators - Custom widget separators
- Crossplatform (macOS, Linux, Windows, WebAssembly, Wayland, X11/XCB, EGLFS are working) - Cross-platform (macOS, Linux, Windows, WebAssembly, Wayland, X11/XCB, EGLFS are working)
See README-Wayland.md and README-WASM.md for platform specific information. See README-Wayland.md and README-WASM.md for platform specific information.
- Layouting engine honouring min/max size constraints and some size policies - Layouting engine honouring min/max size constraints and some size policies
- PySide2 bindings - PySide2 bindings
- Clean codebase - Clean codebase
- Not mixing GUI with state with logic with animations - Not mixing GUI with state with logic with animations
- Great test coverage, even the gui and DnD operations are tested. 200 tests currently. - Great test coverage, even the GUI and DnD operations are tested. 200 tests currently.
- Fuzzer for doing random testing and finding bugs - Fuzzer for doing random testing and finding bugs
- Lazy separator resize - Lazy separator resize
- Reordering tabs with mouse - Reordering tabs with mouse
@@ -69,16 +71,12 @@ Screen capture
![Screen capture](./screencap.gif?raw=true "The docking system in action") ![Screen capture](./screencap.gif?raw=true "The docking system in action")
Roadmap
========
- QtQuick support
Trying out the examples Trying out the examples
======================= =======================
A full demo lives in `examples/dockwidgets/`, it showcasts most of the features. A full demo that showcases most of the features lives in [examples/dockwidgets](examples/dockwidgets).
A simpler example lives in `examples/minimal/`, which might be more indicated
to learn the API, as it's less overwelming than the full demo.
A simpler example can be found in [examples/minimal](examples/minimal),
which might be more indicated to learn the API, as it's less overwhelming than the full demo.
Open a terminal capable of building Qt5 applications. Open a terminal capable of building Qt5 applications.
Make sure you have cmake, ninja, compiler, Qt, etc in PATH. Make sure you have cmake, ninja, compiler, Qt, etc in PATH.
@@ -93,80 +91,83 @@ $ cmake --build . --target install
``` ```
Now build and run the example: Now build and run the example:
``` ```
$ cd path/to/kddockwidgets/examples/dockwidgets/ $ cd path/to/kddockwidgets/examples/dockwidgets/
$ cmake -G Ninja -DCMAKE_PREFIX_PATH=/path/where/to/install $ cmake -G Ninja -DCMAKE_PREFIX_PATH=/path/where/to/install
$ cmake --build . $ cmake --build .
$ ./kddockwidgets_example $ ./kddockwidgets_example
``` ```
The installation directory defaults to `c:\KDAB\KDDockWidgets-<version>` on Windows The installation directory defaults to `c:\KDAB\KDDockWidgets-<version>` on Windows
and `/usr/local/KDAB/KDDockWidgets-<version>` on non-Windows. You can change this and `/usr/local/KDAB/KDDockWidgets-<version>` on non-Windows.
location by passing the option `-DCMAKE_INSTALL_PREFIX=/install/path` to cmake.
You can change the installation location by passing the option `-DCMAKE_INSTALL_PREFIX=/install/path` to cmake.
Using Using
===== =====
From your CMake project, add From your CMake Qt5 project, add
```
find_package(KDDockWidgets CONFIG) find_package(KDDockWidgets CONFIG)
```
or for Qt6
```
find_package(KDDockWidgets-qt6 CONFIG)
```
and link to the imported target `KDAB::kddockwidgets`. and link to the imported target `KDAB::kddockwidgets`.
That's all you need to do (the imported target also brings in the include directories) 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 You may also need to modify the `CMAKE_PREFIX_PATH` environment variable depending
on where you installed KDDockWidgets. on where you installed KDDockWidgets.
Python Bindings Python Bindings
================ ================
Make sure you have pyside2, shiboken2 and shiboken2-generator installed. Please refer to [README-bindings.md](README-bindings.md).
As this time, you cannot get shiboken2-generator because the wheels are not on PyPi.
To use the wheels do this:
``` Versioning
% 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 New features go to master while the stable branch only accepts non-intrusive bug fixes.
Once QtForPython is installed you are ready to generate the PySide bindings We'll try to remain source-compatible across versions. API will get a deprecation
for KDDockwWidgets. notice before being removed in the next version. Note that this source-compatibility
effort is only for the public API. Private API (headers ending in _p.h) might change so you
shouldn't depend on them. Private API is only exposed so more advanced users can
override, for example `paintEvent()`, and not so they can change internal business logic.
Next pass `-DKDDockWidgets_PYTHON_BINDINGS=ON` to CMake, followed by the We don't promise or test binary compatibility. It's advised that you recompile
make command. your application whenever updating KDDW.
The bindings will be installed to the passed `-DCMAKE_INSTALL_PREFIX`, which
might require setting the `PYTHONPATH` env variable to point to that path when
running applications. Alternatively, configure the bindings install location
by passing `-DKDDockWidgets_PYTHON_BINDINGS_INSTALL_PREFIX=/usr/lib/python3.8/site-packages`
to CMake (adjust to the python path on your system).
To run the KDDW python example
```
$ export PYTHONPATH=/kddw/install/path # Only if needed
$ cd python/examples/
$ rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc
$ python3 main.py
```
Supported Qt versions and toolchains Supported Qt versions and toolchains
===================================== =====================================
KDDockWidgets requires Qt >= 5.9 (or >=5.12 if Python bindings are enabled). KDDockWidgets requires Qt 5.15.x or Qt6 >= 6.2.
The QtQuick support will require Qt >= 5.15.
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. Styling
========
Almost all private widgets used by KDDW can be derived by the user to give them
a custom look. That's done by providing your own FrameworkWidgetFactory. Run
"kddockwidgets_example -p" to see that in action.
Qt StyleSheets are not, and will not, be supported. See the comments in
`examples/dockwidgets/MyTitleBar_CSS.h` for why. You can however use some minimal
CSS, as shown in that example, just don't report bugs about it.
Warning: When using private headers, be sure to rebuild your application whenever you
update to a new KDDW version. Binary compatibility is only kept when using public
headers.
Licensing Licensing
========= =========
KDDockWidgets is (C) 2018-2021, Klarälvdalens Datakonsult AB, and is licensed according to KDDockWidgets is (C) 2019-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). the terms of the [GPL 2.0](LICENSES/GPL-2.0-only.txt) or [GPL 3.0](LICENSES/GPL-3.0-only.txt).
Contact KDAB at <info@kdab.com> to inquire about commercial licensing. Contact KDAB at <info@kdab.com> to inquire about commercial licensing.
@@ -174,14 +175,26 @@ Contact KDAB at <info@kdab.com> to inquire about commercial licensing.
Get Involved Get Involved
============ ============
Please submit your issue reports to our GitHub space at
https://github.com/KDAB/KDDockWidgets
When reporting bugs please make it easy for the maintainer to reproduce it. Use `examples/minimal/` or
`examples/dockwidgets/` for reproducing the problem. If you did modifications to the example in order to
reproduce then please attach the *patch* and not a picture of your changes. You can get a patch by doing
`git diff > repro.diff` at the repo root.
Also state which KDDW sha1, branch or version you're using, and which operating system.
KDAB will happily accept external contributions; however, **all** contributions require a KDAB will happily accept external contributions; however, **all** contributions require a
signed [Copyright Assignment Agreement](docs/KDDockWidgets-CopyrightAssignmentForm.docx). signed [Copyright Assignment Agreement](docs/KDDockWidgets-CopyrightAssignmentForm.pdf).
This is needed so we can continue to dual-license it.
Contact info@kdab.com for more information. Contact info@kdab.com for more information.
Please submit your contributions or issue reports from our GitHub space at Thanks to our [contributors](CONTRIBUTORS.txt).
https://github.com/KDAB/KDDockWidgets
About KDAB About KDAB
========== ==========

91
appveyor.yml Normal file
View File

@@ -0,0 +1,91 @@
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: 1.0.{build}-{branch}
# branches to build
branches:
except:
- gh-pages
# Do not build on tags (GitHub and BitBucket)
skip_tags: false
#---------------------------------#
# environment configuration #
#---------------------------------#
# Build worker image
image:
- Ubuntu
- macos
- Visual Studio 2019
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
#---------------------------------#
# build configuration #
#---------------------------------#
# build platform, i.e. x86, x64, Any CPU. This setting is optional.
platform:
- x64
# build Configuration, i.e. Debug, Release, etc.
configuration:
- Release
- Debug
install:
- sh: if [ "`uname -s`" = "Darwin" ]; then brew install ninja; else sudo apt-get -y install mesa-common-dev libglu1-mesa-dev; fi
before_build:
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
- cmd: set PATH=C:\Qt\5.15\msvc2019_64;%PATH%
- sh: if [ "`uname -s`" = "Darwin" ]; then export PATH=$HOME/Qt/5.15/clang_64/bin:$PATH; else export PATH=$HOME/Qt/5.15/gcc_64/bin:$PATH; fi
build_script:
- mkdir build
- cd build
- cmd: cmake -G Ninja -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
- sh: cmake -G Ninja -DCMAKE_BUILD_TYPE=$CONFIGURATION -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
- cmake --build .
- cmd: cmake --build . --target install
- sh: sudo cmake --build . --target install
- cmd: set PATH=.\bin;%PATH%
#temporarily disable testing on Windows
#- ctest --test-dir .
- sh: ctest --test-dir .
# to disable automatic builds
#build: off
#---------------------------------#
# tests configuration #
#---------------------------------#
# to disable automatic tests
test: off
#---------------------------------#
# deployment configuration #
#---------------------------------#
deploy: off
#---------------------------------#
# notifications #
#---------------------------------#
notifications:
# Email
- provider: Email
to:
- allen.winter@kdab.com
- sergio.martins@kdab.com
on_build_success: false
on_build_failure: true

View File

@@ -40,6 +40,7 @@
# - thread # - thread
# - leak # - leak
# - undefined # - undefined
# - fuzzer-no-link
# - fuzzer # - fuzzer
# #
# The sanitizers "address", "memory" and "thread" are mutually exclusive. You # The sanitizers "address", "memory" and "thread" are mutually exclusive. You
@@ -102,6 +103,18 @@ endmacro ()
# MACRO check_compiler_support # MACRO check_compiler_support
#------------------------------ #------------------------------
macro (enable_sanitizer_flags sanitize_option) macro (enable_sanitizer_flags sanitize_option)
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if (${sanitize_option} MATCHES "address")
set(msvc_asan_required_version "19.28")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${msvc_asan_required_version})
message(WARNING "Address sanitizer requires at least MSVC ${msvc_asan_required_version}")
else()
set(XSAN_COMPILE_FLAGS "-fsanitize=address")
endif()
else()
message(WARNING "Compiler sanitizer option \"${sanitize_option}\" not supported on MSVC yet")
endif()
else()
if (${sanitize_option} MATCHES "address") if (${sanitize_option} MATCHES "address")
check_compiler_version("4.8" "3.1") check_compiler_version("4.8" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls") set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
@@ -119,13 +132,18 @@ macro (enable_sanitizer_flags sanitize_option)
set(XSAN_LINKER_FLAGS "lsan") set(XSAN_LINKER_FLAGS "lsan")
elseif (${sanitize_option} MATCHES "undefined") elseif (${sanitize_option} MATCHES "undefined")
check_compiler_version("4.9" "3.1") check_compiler_version("4.9" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls") set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-omit-frame-pointer -fno-optimize-sibling-calls")
elseif (${sanitize_option} MATCHES "fuzzer-no-link")
check_compiler_version("99.99" "6.0")
set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer-no-link")
set(XSAN_LINKER_FLAGS "-fsanitize=fuzzer-no-link")
elseif (${sanitize_option} MATCHES "fuzzer") elseif (${sanitize_option} MATCHES "fuzzer")
check_compiler_version("99.99" "6.0") check_compiler_version("99.99" "6.0")
set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer") set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer")
else () else ()
message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.") message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.")
endif () endif ()
endif()
endmacro () endmacro ()
if (ECM_ENABLE_SANITIZERS) if (ECM_ENABLE_SANITIZERS)
@@ -149,6 +167,11 @@ if (ECM_ENABLE_SANITIZERS)
string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
endif () endif ()
endforeach() endforeach()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
foreach (CUR_SANITIZER ${ECM_ENABLE_SANITIZERS})
enable_sanitizer_flags(${CUR_SANITIZER})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}")
endforeach()
else() else()
message(STATUS "Tried to enable sanitizers (-DECM_ENABLE_SANITIZERS=${ECM_ENABLE_SANITIZERS}), \ message(STATUS "Tried to enable sanitizers (-DECM_ENABLE_SANITIZERS=${ECM_ENABLE_SANITIZERS}), \
but compiler (${CMAKE_CXX_COMPILER_ID}) does not have sanitizer support") but compiler (${CMAKE_CXX_COMPILER_ID}) does not have sanitizer support")

View File

@@ -0,0 +1,223 @@
# SPDX-FileCopyrightText: 2013 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kdemail.net>
# SPDX-FileCopyrightText: 2015 Patrick Spendrin <patrick.spendrin@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
ECMGenerateHeaders
------------------
Generate C/C++ CamelCase forwarding headers.
::
ecm_generate_headers(<camelcase_forwarding_headers_var>
HEADER_NAMES <CamelCaseName> [<CamelCaseName> [...]]
[ORIGINAL <CAMELCASE|LOWERCASE>]
[HEADER_EXTENSION <header_extension>]
[OUTPUT_DIR <output_dir>]
[PREFIX <prefix>]
[REQUIRED_HEADERS <variable>]
[COMMON_HEADER <HeaderName>]
[RELATIVE <relative_path>])
For each CamelCase header name passed to HEADER_NAMES, a file of that name
will be generated that will include a version with ``.h`` or, if set,
``.<header_extension>`` appended.
For example, the generated header ``ClassA`` will include ``classa.h`` (or
``ClassA.h``, see ORIGINAL).
If a CamelCaseName consists of multiple comma-separated files, e.g.
``ClassA,ClassB,ClassC``, then multiple camelcase header files will be
generated which are redirects to the first header file.
The file locations of these generated headers will be stored in
<camelcase_forwarding_headers_var>.
ORIGINAL specifies how the name of the original header is written: lowercased
or also camelcased. The default is LOWERCASE. Since 1.8.0.
HEADER_EXTENSION specifies what file name extension is used for the header
files. The default is "h". Since 5.48.0.
PREFIX places the generated headers in subdirectories. This should be a
CamelCase name like ``KParts``, which will cause the CamelCase forwarding
headers to be placed in the ``KParts`` directory (e.g. ``KParts/Part``). It
will also, for the convenience of code in the source distribution, generate
forwarding headers based on the original names (e.g. ``kparts/part.h``). This
allows includes like ``"#include <kparts/part.h>"`` to be used before
installation, as long as the include_directories are set appropriately.
OUTPUT_DIR specifies where the files will be generated; this should be within
the build directory. By default, ``${CMAKE_CURRENT_BINARY_DIR}`` will be used.
This option can be used to avoid file conflicts.
REQUIRED_HEADERS specifies an output variable name where all the required
headers will be appended so that they can be installed together with the
generated ones. This is mostly intended as a convenience so that adding a new
header to a project only requires specifying the CamelCase variant in the
CMakeLists.txt file; the original variant will then be added to this
variable.
COMMON_HEADER generates an additional convenience header which includes all
other header files.
The RELATIVE argument indicates where the original headers can be found
relative to CMAKE_CURRENT_SOURCE_DIR. It does not affect the generated
CamelCase forwarding files, but ecm_generate_headers() uses it when checking
that the original header exists, and to generate originally named forwarding
headers when PREFIX is set.
To allow other parts of the source distribution (eg: tests) to use the
generated headers before installation, it may be desirable to set the
INCLUDE_DIRECTORIES property for the library target to output_dir. For
example, if OUTPUT_DIR is CMAKE_CURRENT_BINARY_DIR (the default), you could do
.. code-block:: cmake
target_include_directories(MyLib PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
Example usage (without PREFIX):
.. code-block:: cmake
ecm_generate_headers(
MyLib_FORWARDING_HEADERS
HEADERS
MLFoo
MLBar
# etc
REQUIRED_HEADERS MyLib_HEADERS
COMMON_HEADER MLGeneral
)
install(FILES ${MyLib_FORWARDING_HEADERS} ${MyLib_HEADERS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
COMPONENT Devel)
Example usage (with PREFIX):
.. code-block:: cmake
ecm_generate_headers(
MyLib_FORWARDING_HEADERS
HEADERS
Foo
# several classes are contained in bar.h, so generate
# additional files
Bar,BarList
# etc
PREFIX MyLib
REQUIRED_HEADERS MyLib_HEADERS
)
install(FILES ${MyLib_FORWARDING_HEADERS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/MyLib
COMPONENT Devel)
install(FILES ${MyLib_HEADERS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/mylib
COMPONENT Devel)
Since pre-1.0.0.
#]=======================================================================]
include(CMakeParseArguments)
function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
set(options)
set(oneValueArgs ORIGINAL HEADER_EXTENSION OUTPUT_DIR PREFIX REQUIRED_HEADERS COMMON_HEADER RELATIVE)
set(multiValueArgs HEADER_NAMES)
cmake_parse_arguments(EGH "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (EGH_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ECM_GENERATE_HEADERS: ${EGH_UNPARSED_ARGUMENTS}")
endif()
if(NOT EGH_HEADER_NAMES)
message(FATAL_ERROR "Missing header_names argument to ECM_GENERATE_HEADERS")
endif()
if(NOT EGH_ORIGINAL)
# default
set(EGH_ORIGINAL "LOWERCASE")
endif()
if(NOT EGH_ORIGINAL STREQUAL "LOWERCASE" AND NOT EGH_ORIGINAL STREQUAL "CAMELCASE")
message(FATAL_ERROR "Unexpected value for original argument to ECM_GENERATE_HEADERS: ${EGH_ORIGINAL}")
endif()
if(NOT EGH_HEADER_EXTENSION)
set(EGH_HEADER_EXTENSION "h")
endif()
if(NOT EGH_OUTPUT_DIR)
set(EGH_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
endif()
# Make sure EGH_RELATIVE is /-terminated when it's not empty
if (EGH_RELATIVE AND NOT "${EGH_RELATIVE}" MATCHES "^.*/$")
set(EGH_RELATIVE "${EGH_RELATIVE}/")
endif()
set(originalprefix)
if (EGH_PREFIX)
if (NOT "${EGH_PREFIX}" MATCHES "^.*/$")
set(EGH_PREFIX "${EGH_PREFIX}/")
endif()
if (EGH_ORIGINAL STREQUAL "CAMELCASE")
set(originalprefix "${EGH_PREFIX}")
else()
string(TOLOWER "${EGH_PREFIX}" originalprefix)
endif()
endif()
foreach(_classnameentry ${EGH_HEADER_NAMES})
string(REPLACE "," ";" _classnames ${_classnameentry})
list(GET _classnames 0 _baseclass)
if (EGH_ORIGINAL STREQUAL "CAMELCASE")
set(originalbasename "${_baseclass}")
else()
string(TOLOWER "${_baseclass}" originalbasename)
endif()
set(_actualheader "${CMAKE_CURRENT_SOURCE_DIR}/${EGH_RELATIVE}${originalbasename}.${EGH_HEADER_EXTENSION}")
if (NOT EXISTS ${_actualheader})
message(FATAL_ERROR "Could not find \"${_actualheader}\"")
endif()
foreach(_CLASSNAME ${_classnames})
set(FANCY_HEADER_FILE "${EGH_OUTPUT_DIR}/${EGH_PREFIX}${_CLASSNAME}")
if (NOT EXISTS ${FANCY_HEADER_FILE})
file(WRITE ${FANCY_HEADER_FILE} "#include \"${originalprefix}${originalbasename}.${EGH_HEADER_EXTENSION}\"\n")
endif()
list(APPEND ${camelcase_forwarding_headers_var} "${FANCY_HEADER_FILE}")
if (EGH_PREFIX)
# Local forwarding header, for namespaced headers, e.g. kparts/part.h
if(EGH_ORIGINAL STREQUAL "CAMELCASE")
set(originalclassname "${_CLASSNAME}")
else()
string(TOLOWER "${_CLASSNAME}" originalclassname)
endif()
set(REGULAR_HEADER_NAME ${EGH_OUTPUT_DIR}/${originalprefix}${originalclassname}.${EGH_HEADER_EXTENSION})
if (NOT EXISTS ${REGULAR_HEADER_NAME})
file(WRITE ${REGULAR_HEADER_NAME} "#include \"${_actualheader}\"\n")
endif()
endif()
endforeach()
list(APPEND _REQUIRED_HEADERS "${_actualheader}")
endforeach()
if(EGH_COMMON_HEADER)
#combine required headers into 1 big convenience header
set(COMMON_HEADER ${EGH_OUTPUT_DIR}/${EGH_PREFIX}${EGH_COMMON_HEADER})
file(WRITE ${COMMON_HEADER} "// convenience header\n")
foreach(_header ${_REQUIRED_HEADERS})
get_filename_component(_base ${_header} NAME)
file(APPEND ${COMMON_HEADER} "#include \"${_base}\"\n")
endforeach()
list(APPEND ${camelcase_forwarding_headers_var} "${COMMON_HEADER}")
endif()
set(${camelcase_forwarding_headers_var} ${${camelcase_forwarding_headers_var}} PARENT_SCOPE)
if (EGH_REQUIRED_HEADERS)
set(${EGH_REQUIRED_HEADERS} ${${EGH_REQUIRED_HEADERS}} ${_REQUIRED_HEADERS} PARENT_SCOPE)
endif ()
endfunction()

View File

@@ -1,81 +1,88 @@
#.rst:
# ECMGeneratePriFile
# ------------------
#
# Generate a ``.pri`` file for the benefit of qmake-based projects.
#
# As well as the function below, this module creates the cache variable
# ``ECM_MKSPECS_INSTALL_DIR`` and sets the default value to ``mkspecs/modules``.
# This assumes Qt and the current project are both installed to the same
# non-system prefix. Packagers who use ``-DCMAKE_INSTALL_PREFIX=/usr`` will
# certainly want to set ``ECM_MKSPECS_INSTALL_DIR`` to something like
# ``share/qt5/mkspecs/modules``.
#
# The main thing is that this should be the ``modules`` subdirectory of either
# the default qmake ``mkspecs`` directory or of a directory that will be in the
# ``$QMAKEPATH`` environment variable when qmake is run.
#
# ::
#
# ecm_generate_pri_file(BASE_NAME <baseName>
# LIB_NAME <libName>
# [DEPS "<dep> [<dep> [...]]"]
# [FILENAME_VAR <filename_variable>]
# [INCLUDE_INSTALL_DIR <dir>]
# [LIB_INSTALL_DIR <dir>])
#
# If your CMake project produces a Qt-based library, you may expect there to be
# applications that wish to use it that use a qmake-based build system, rather
# than a CMake-based one. Creating a ``.pri`` file will make use of your
# library convenient for them, in much the same way that CMake config files make
# things convenient for CMake-based applications.
#
# ecm_generate_pri_file() generates just such a file. It requires the
# ``PROJECT_VERSION_STRING`` variable to be set. This is typically set by
# :module:`ECMSetupVersion`, although the project() command in CMake 3.0.0 and
# later can also set this.
#
# BASE_NAME specifies the name qmake project (.pro) files should use to refer to
# the library (eg: KArchive). LIB_NAME is the name of the actual library to
# link to (ie: the first argument to add_library()). DEPS is a space-separated
# list of the base names of other libraries (for Qt libraries, use the same
# names you use with the ``QT`` variable in a qmake project file, such as "core"
# for QtCore). FILENAME_VAR specifies the name of a variable to store the path
# to the generated file in.
#
# INCLUDE_INSTALL_DIR is the path (relative to ``CMAKE_INSTALL_PREFIX``) that
# include files will be installed to. It defaults to
# ``${INCLUDE_INSTALL_DIR}/<baseName>`` if the ``INCLUDE_INSTALL_DIR`` variable
# is set. If that variable is not set, the ``CMAKE_INSTALL_INCLUDEDIR`` variable
# is used instead, and if neither are set ``include`` is used. LIB_INSTALL_DIR
# operates similarly for the installation location for libraries; it defaults to
# ``${LIB_INSTALL_DIR}``, ``${CMAKE_INSTALL_LIBDIR}`` or ``lib``, in that order.
#
# Example usage:
#
# .. code-block:: cmake
#
# ecm_generate_pri_file(
# BASE_NAME KArchive
# LIB_NAME KF5KArchive
# DEPS "core"
# FILENAME_VAR pri_filename
# )
# install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
#
# A qmake-based project that wished to use this would then do::
#
# QT += KArchive
#
# in their ``.pro`` file.
#
# Since pre-1.0.0.
#=============================================================================
# SPDX-FileCopyrightText: 2014 David Faure <faure@kde.org> # SPDX-FileCopyrightText: 2014 David Faure <faure@kde.org>
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
ECMGeneratePriFile
------------------
Generate a ``.pri`` file for the benefit of qmake-based projects.
As well as the function below, this module creates the cache variable
``ECM_MKSPECS_INSTALL_DIR`` and sets the default value to ``mkspecs/modules``.
This assumes Qt and the current project are both installed to the same
non-system prefix. Packagers who use ``-DCMAKE_INSTALL_PREFIX=/usr`` will
certainly want to set ``ECM_MKSPECS_INSTALL_DIR`` to something like
``share/qt5/mkspecs/modules``.
The main thing is that this should be the ``modules`` subdirectory of either
the default qmake ``mkspecs`` directory or of a directory that will be in the
``$QMAKEPATH`` environment variable when qmake is run.
::
ecm_generate_pri_file(BASE_NAME <baseName>
LIB_NAME <libName>
[VERSION <version>] # since 5.83
[DEPS "<dep> [<dep> [...]]"]
[FILENAME_VAR <filename_variable>]
[INCLUDE_INSTALL_DIR <dir>]
[LIB_INSTALL_DIR <dir>])
If your CMake project produces a Qt-based library, you may expect there to be
applications that wish to use it that use a qmake-based build system, rather
than a CMake-based one. Creating a ``.pri`` file will make use of your
library convenient for them, in much the same way that CMake config files make
things convenient for CMake-based applications. ``ecm_generate_pri_file()``
generates just such a file.
VERSION specifies the version of the library the ``.pri`` file describes. If
not set, the value is taken from the context variable ``PROJECT_VERSION``.
This variable is usually set by the ``project(... VERSION ...)`` command or,
if CMake policy CMP0048 is not NEW, by :module:`ECMSetupVersion`.
For backward-compatibility with older ECM versions the
``PROJECT_VERSION_STRING`` variable as set by :module:`ECMSetupVersion`
will be preferred over ``PROJECT_VERSION`` if set, unless the minimum
required version of ECM is 5.83 and newer. Since 5.83.
BASE_NAME specifies the name qmake project (.pro) files should use to refer to
the library (eg: KArchive). LIB_NAME is the name of the actual library to
link to (ie: the first argument to add_library()). DEPS is a space-separated
list of the base names of other libraries (for Qt libraries, use the same
names you use with the ``QT`` variable in a qmake project file, such as "core"
for QtCore). FILENAME_VAR specifies the name of a variable to store the path
to the generated file in.
INCLUDE_INSTALL_DIR is the path (relative to ``CMAKE_INSTALL_PREFIX``) that
include files will be installed to. It defaults to
``${INCLUDE_INSTALL_DIR}/<baseName>`` if the ``INCLUDE_INSTALL_DIR`` variable
is set. If that variable is not set, the ``CMAKE_INSTALL_INCLUDEDIR`` variable
is used instead, and if neither are set ``include`` is used. LIB_INSTALL_DIR
operates similarly for the installation location for libraries; it defaults to
``${LIB_INSTALL_DIR}``, ``${CMAKE_INSTALL_LIBDIR}`` or ``lib``, in that order.
Example usage:
.. code-block:: cmake
ecm_generate_pri_file(
BASE_NAME KArchive
LIB_NAME KF5KArchive
DEPS "core"
FILENAME_VAR pri_filename
VERSION 4.2.0
)
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
A qmake-based project that wished to use this would then do::
QT += KArchive
in their ``.pro`` file.
Since pre-1.0.0.
#]=======================================================================]
# Replicate the logic from KDEInstallDirs.cmake as we can't depend on it # Replicate the logic from KDEInstallDirs.cmake as we can't depend on it
# Ask qmake if we're using the same prefix as Qt # Ask qmake if we're using the same prefix as Qt
set(_askqmake OFF) set(_askqmake OFF)
@@ -89,15 +96,24 @@ endif()
if(KDE_INSTALL_USE_QT_SYS_PATHS OR _askqmake) if(KDE_INSTALL_USE_QT_SYS_PATHS OR _askqmake)
include(ECMQueryQmake) include(ECMQueryQmake)
query_qmake(qt_install_prefix_dir QT_INSTALL_PREFIX)
query_qmake(qt_host_data_dir QT_HOST_DATA) query_qmake(qt_host_data_dir QT_HOST_DATA)
set(ECM_MKSPECS_INSTALL_DIR ${qt_host_data_dir}/mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.") if(qt_install_prefix_dir STREQUAL "${CMAKE_INSTALL_PREFIX}")
file(RELATIVE_PATH qt_host_data_dir ${qt_install_prefix_dir} ${qt_host_data_dir})
endif()
if(qt_host_data_dir STREQUAL "")
set(mkspecs_install_dir mkspecs/modules)
else()
set(mkspecs_install_dir ${qt_host_data_dir}/mkspecs/modules)
endif()
set(ECM_MKSPECS_INSTALL_DIR ${mkspecs_install_dir} CACHE PATH "The directory where mkspecs will be installed to.")
else() else()
set(ECM_MKSPECS_INSTALL_DIR mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.") set(ECM_MKSPECS_INSTALL_DIR mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.")
endif() endif()
function(ECM_GENERATE_PRI_FILE) function(ECM_GENERATE_PRI_FILE)
set(options ) set(options )
set(oneValueArgs BASE_NAME LIB_NAME DEPS FILENAME_VAR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) set(oneValueArgs BASE_NAME LIB_NAME DEPS FILENAME_VAR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR VERSION)
set(multiValueArgs ) set(multiValueArgs )
cmake_parse_arguments(EGPF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(EGPF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -106,14 +122,28 @@ function(ECM_GENERATE_PRI_FILE)
message(FATAL_ERROR "Unknown keywords given to ECM_GENERATE_PRI_FILE(): \"${EGPF_UNPARSED_ARGUMENTS}\"") message(FATAL_ERROR "Unknown keywords given to ECM_GENERATE_PRI_FILE(): \"${EGPF_UNPARSED_ARGUMENTS}\"")
endif() endif()
if(ECM_GLOBAL_FIND_VERSION VERSION_LESS 5.83.0)
set(_support_backward_compat_version_string_var TRUE)
else()
set(_support_backward_compat_version_string_var FALSE)
endif()
if(NOT EGPF_BASE_NAME) if(NOT EGPF_BASE_NAME)
message(FATAL_ERROR "Required argument BASE_NAME missing in ECM_GENERATE_PRI_FILE() call") message(FATAL_ERROR "Required argument BASE_NAME missing in ECM_GENERATE_PRI_FILE() call")
endif() endif()
if(NOT EGPF_LIB_NAME) if(NOT EGPF_LIB_NAME)
message(FATAL_ERROR "Required argument LIB_NAME missing in ECM_GENERATE_PRI_FILE() call") message(FATAL_ERROR "Required argument LIB_NAME missing in ECM_GENERATE_PRI_FILE() call")
endif() endif()
if(NOT PROJECT_VERSION_STRING) if(NOT EGPF_VERSION)
message(FATAL_ERROR "Required variable PROJECT_VERSION_STRING not set before ECM_GENERATE_PRI_FILE() call. Did you call ecm_setup_version?") if(_support_backward_compat_version_string_var)
if(NOT PROJECT_VERSION_STRING AND NOT PROJECT_VERSION)
message(FATAL_ERROR "Required variable PROJECT_VERSION_STRING or PROJECT_VERSION not set before ECM_GENERATE_PRI_FILE() call. Missing call of ecm_setup_version() or project(VERSION)?")
endif()
else()
if(NOT PROJECT_VERSION)
message(FATAL_ERROR "Required variable PROJECT_VERSION not set before ECM_GENERATE_PRI_FILE() call. Missing call of ecm_setup_version() or project(VERSION)?")
endif()
endif()
endif() endif()
if(NOT EGPF_INCLUDE_INSTALL_DIR) if(NOT EGPF_INCLUDE_INSTALL_DIR)
if(INCLUDE_INSTALL_DIR) if(INCLUDE_INSTALL_DIR)
@@ -134,9 +164,22 @@ function(ECM_GENERATE_PRI_FILE)
endif() endif()
endif() endif()
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" PROJECT_VERSION_MAJOR "${PROJECT_VERSION_STRING}") if(EGPF_VERSION)
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" PROJECT_VERSION_MINOR "${PROJECT_VERSION_STRING}") set(PRI_VERSION "${EGPF_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PROJECT_VERSION_PATCH "${PROJECT_VERSION_STRING}") else()
if(_support_backward_compat_version_string_var AND PROJECT_VERSION_STRING)
set(PRI_VERSION "${PROJECT_VERSION_STRING}")
if(NOT PROJECT_VERSION_STRING STREQUAL PROJECT_VERSION)
message(DEPRECATION "ECM_GENERATE_PRI_FILE() will no longer support PROJECT_VERSION_STRING when the required minimum version of ECM is 5.83 or newer. Set VERSION parameter or use PROJECT_VERSION instead.")
endif()
else()
set(PRI_VERSION "${PROJECT_VERSION}")
endif()
endif()
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" PRI_VERSION_MAJOR "${PRI_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" PRI_VERSION_MINOR "${PRI_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PRI_VERSION_PATCH "${PRI_VERSION}")
# Prepare the right number of "../.." to go from ECM_MKSPECS_INSTALL_DIR to the install prefix # Prepare the right number of "../.." to go from ECM_MKSPECS_INSTALL_DIR to the install prefix
# This allows to make the generated pri files relocatable (no absolute paths) # This allows to make the generated pri files relocatable (no absolute paths)
@@ -160,7 +203,6 @@ function(ECM_GENERATE_PRI_FILE)
else() else()
set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}") set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}")
endif() endif()
set(PRI_TARGET_DEFINES "")
set(PRI_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/qt_${PRI_TARGET_BASENAME}.pri) set(PRI_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/qt_${PRI_TARGET_BASENAME}.pri)
if (EGPF_FILENAME_VAR) if (EGPF_FILENAME_VAR)
@@ -168,6 +210,8 @@ function(ECM_GENERATE_PRI_FILE)
endif() endif()
set(PRI_TARGET_MODULE_CONFIG "") set(PRI_TARGET_MODULE_CONFIG "")
set(PRI_TARGET_DEFINES "")
set(PRI_TARGET_POSTFIX "")
# backward compat: it was not obvious LIB_NAME needs to be a target name, # backward compat: it was not obvious LIB_NAME needs to be a target name,
# and some projects where the target name was not the actual library output name # and some projects where the target name was not the actual library output name
# passed the output name for LIB_NAME, so .name & .module prperties are correctly set. # passed the output name for LIB_NAME, so .name & .module prperties are correctly set.
@@ -177,18 +221,22 @@ function(ECM_GENERATE_PRI_FILE)
if (target_type STREQUAL "STATIC_LIBRARY") if (target_type STREQUAL "STATIC_LIBRARY")
set(PRI_TARGET_MODULE_CONFIG "staticlib") set(PRI_TARGET_MODULE_CONFIG "staticlib")
endif() endif()
get_target_property(target_defs ${EGPF_LIB_NAME} INTERFACE_COMPILE_DEFINITIONS)
list(FILTER target_defs EXCLUDE REGEX ^QT_)
string(JOIN " " PRI_TARGET_DEFINES "${target_defs}")
set(PRI_TARGET_POSTFIX "$<TARGET_PROPERTY:${EGPF_LIB_NAME},$<UPPER_CASE:$<CONFIG>$<$<CONFIG:>:Debug>>_POSTFIX>")
endif() endif()
file(GENERATE file(GENERATE
OUTPUT ${PRI_FILENAME} OUTPUT ${PRI_FILENAME}
CONTENT CONTENT
"QT.${PRI_TARGET_BASENAME}.VERSION = ${PROJECT_VERSION_STRING} "QT.${PRI_TARGET_BASENAME}.VERSION = ${PRI_VERSION}
QT.${PRI_TARGET_BASENAME}.MAJOR_VERSION = ${PROJECT_VERSION_MAJOR} QT.${PRI_TARGET_BASENAME}.MAJOR_VERSION = ${PRI_VERSION_MAJOR}
QT.${PRI_TARGET_BASENAME}.MINOR_VERSION = ${PROJECT_VERSION_MINOR} QT.${PRI_TARGET_BASENAME}.MINOR_VERSION = ${PRI_VERSION_MINOR}
QT.${PRI_TARGET_BASENAME}.PATCH_VERSION = ${PROJECT_VERSION_PATCH} QT.${PRI_TARGET_BASENAME}.PATCH_VERSION = ${PRI_VERSION_PATCH}
QT.${PRI_TARGET_BASENAME}.name = ${PRI_TARGET_LIBNAME} QT.${PRI_TARGET_BASENAME}.name = ${PRI_TARGET_LIBNAME}
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME} QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}${PRI_TARGET_POSTFIX}
QT.${PRI_TARGET_BASENAME}.defines = ${PRI_TARGET_DEFINES} QT.${PRI_TARGET_BASENAME}.DEFINES = ${PRI_TARGET_DEFINES}
QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES} QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES}
QT.${PRI_TARGET_BASENAME}.private_includes = QT.${PRI_TARGET_BASENAME}.private_includes =
QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS} QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS}

View File

@@ -0,0 +1,212 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2012 Alexander Neundorf <neundorf@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
ECMSetupVersion
---------------
Handle library version information.
::
ecm_setup_version(<version>
VARIABLE_PREFIX <prefix>
[SOVERSION <soversion>]
[VERSION_HEADER <filename>]
[PACKAGE_VERSION_FILE <filename> [COMPATIBILITY <compat>]] )
This parses a version string and sets up a standard set of version variables.
It can optionally also create a C version header file and a CMake package
version file to install along with the library.
If the ``<version>`` argument is of the form ``<major>.<minor>.<patch>``
(or ``<major>.<minor>.<patch>.<tweak>``), The following CMake variables are
set::
<prefix>_VERSION_MAJOR - <major>
<prefix>_VERSION_MINOR - <minor>
<prefix>_VERSION_PATCH - <patch>
<prefix>_VERSION - <version>
<prefix>_SOVERSION - <soversion>, or <major> if SOVERSION was not given
For backward-compatibility also this variable is set (only if the minimum required
version of ECM is < 5.83)::
<prefix>_VERSION_STRING - <version> (use <prefix>_VERSION instead)
If CMake policy CMP0048 is not NEW, the following CMake variables will also
be set::
PROJECT_VERSION_MAJOR - <major>
PROJECT_VERSION_MINOR - <minor>
PROJECT_VERSION_PATCH - <patch>
PROJECT_VERSION - <version>
For backward-compatibility, if CMake policy CMP0048 is not NEW, also this variable is set
(only if the minimum required version of ECM is < 5.83)::
PROJECT_VERSION_STRING - <version> (use PROJECT_VERSION instead)
If the VERSION_HEADER option is used, a simple C header is generated with the
given filename. If filename is a relative path, it is interpreted as relative
to CMAKE_CURRENT_BINARY_DIR. The generated header contains the following
macros::
<prefix>_VERSION_MAJOR - <major> as an integer
<prefix>_VERSION_MINOR - <minor> as an integer
<prefix>_VERSION_PATCH - <patch> as an integer
<prefix>_VERSION_STRING - <version> as a C string
<prefix>_VERSION - the version as an integer
``<prefix>_VERSION`` has ``<patch>`` in the bottom 8 bits, ``<minor>`` in the
next 8 bits and ``<major>`` in the remaining bits. Note that ``<patch>`` and
``<minor>`` must be less than 256.
If the PACKAGE_VERSION_FILE option is used, a simple CMake package version
file is created using the write_basic_package_version_file() macro provided by
CMake. It should be installed in the same location as the Config.cmake file of
the library so that it can be found by find_package(). If the filename is a
relative path, it is interpreted as relative to CMAKE_CURRENT_BINARY_DIR. The
optional COMPATIBILITY option is forwarded to
write_basic_package_version_file(), and defaults to AnyNewerVersion.
If CMake policy CMP0048 is NEW, an alternative form of the command is
available::
ecm_setup_version(PROJECT
[VARIABLE_PREFIX <prefix>]
[SOVERSION <soversion>]
[VERSION_HEADER <filename>]
[PACKAGE_VERSION_FILE <filename>] )
This will use the version information set by the project() command.
VARIABLE_PREFIX defaults to the project name. Note that PROJECT must be the
first argument. In all other respects, it behaves like the other form of the
command.
Since pre-1.0.0.
COMPATIBILITY option available since 1.6.0.
#]=======================================================================]
include(CMakePackageConfigHelpers)
# save the location of the header template while CMAKE_CURRENT_LIST_DIR
# has the value we want
set(_ECM_SETUP_VERSION_HEADER_TEMPLATE "${CMAKE_CURRENT_LIST_DIR}/ECMVersionHeader.h.in")
function(ecm_setup_version _version)
set(options )
set(oneValueArgs VARIABLE_PREFIX SOVERSION VERSION_HEADER PACKAGE_VERSION_FILE COMPATIBILITY)
set(multiValueArgs )
cmake_parse_arguments(ESV "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(ESV_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ECM_SETUP_VERSION(): \"${ESV_UNPARSED_ARGUMENTS}\"")
endif()
set(project_manages_version FALSE)
set(use_project_version FALSE)
cmake_policy(GET CMP0048 project_version_policy)
if(project_version_policy STREQUAL "NEW")
set(project_manages_version TRUE)
if(_version STREQUAL "PROJECT")
set(use_project_version TRUE)
endif()
elseif(_version STREQUAL "PROJECT")
message(FATAL_ERROR "ecm_setup_version given PROJECT argument, but CMP0048 is not NEW")
endif()
set(should_set_prefixed_vars TRUE)
if(NOT ESV_VARIABLE_PREFIX)
if(use_project_version)
set(ESV_VARIABLE_PREFIX "${PROJECT_NAME}")
set(should_set_prefixed_vars FALSE)
else()
message(FATAL_ERROR "Required argument PREFIX missing in ECM_SETUP_VERSION() call")
endif()
endif()
if(use_project_version)
set(_version "${PROJECT_VERSION}")
set(_major "${PROJECT_VERSION_MAJOR}")
set(_minor "${PROJECT_VERSION_MINOR}")
set(_patch "${PROJECT_VERSION_PATCH}")
else()
string(REGEX REPLACE "^0*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" _major "${_version}")
string(REGEX REPLACE "^[0-9]+\\.0*([0-9]+)\\.[0-9]+.*" "\\1" _minor "${_version}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.0*([0-9]+).*" "\\1" _patch "${_version}")
endif()
if(NOT ESV_SOVERSION)
set(ESV_SOVERSION ${_major})
endif()
if(ECM_GLOBAL_FIND_VERSION VERSION_LESS 5.83.0)
set(_set_backward_compat_version_string_vars TRUE)
else()
set(_set_backward_compat_version_string_vars FALSE)
endif()
if(should_set_prefixed_vars)
set(${ESV_VARIABLE_PREFIX}_VERSION "${_version}")
set(${ESV_VARIABLE_PREFIX}_VERSION_MAJOR ${_major})
set(${ESV_VARIABLE_PREFIX}_VERSION_MINOR ${_minor})
set(${ESV_VARIABLE_PREFIX}_VERSION_PATCH ${_patch})
endif()
set(${ESV_VARIABLE_PREFIX}_SOVERSION ${ESV_SOVERSION})
if(NOT project_manages_version)
set(PROJECT_VERSION "${_version}")
set(PROJECT_VERSION_MAJOR "${_major}")
set(PROJECT_VERSION_MINOR "${_minor}")
set(PROJECT_VERSION_PATCH "${_patch}")
endif()
if(_set_backward_compat_version_string_vars)
set(PROJECT_VERSION_STRING "${PROJECT_VERSION}")
set(${ESV_VARIABLE_PREFIX}_VERSION_STRING "${${ESV_VARIABLE_PREFIX}_VERSION}")
endif()
if(ESV_VERSION_HEADER)
set(HEADER_PREFIX "${ESV_VARIABLE_PREFIX}")
set(HEADER_VERSION "${_version}")
set(HEADER_VERSION_MAJOR "${_major}")
set(HEADER_VERSION_MINOR "${_minor}")
set(HEADER_VERSION_PATCH "${_patch}")
configure_file("${_ECM_SETUP_VERSION_HEADER_TEMPLATE}" "${ESV_VERSION_HEADER}")
endif()
if(ESV_PACKAGE_VERSION_FILE)
if(NOT ESV_COMPATIBILITY)
set(ESV_COMPATIBILITY AnyNewerVersion)
endif()
write_basic_package_version_file("${ESV_PACKAGE_VERSION_FILE}" VERSION ${_version} COMPATIBILITY ${ESV_COMPATIBILITY})
endif()
if(should_set_prefixed_vars)
set(${ESV_VARIABLE_PREFIX}_VERSION_MAJOR "${${ESV_VARIABLE_PREFIX}_VERSION_MAJOR}" PARENT_SCOPE)
set(${ESV_VARIABLE_PREFIX}_VERSION_MINOR "${${ESV_VARIABLE_PREFIX}_VERSION_MINOR}" PARENT_SCOPE)
set(${ESV_VARIABLE_PREFIX}_VERSION_PATCH "${${ESV_VARIABLE_PREFIX}_VERSION_PATCH}" PARENT_SCOPE)
set(${ESV_VARIABLE_PREFIX}_VERSION "${${ESV_VARIABLE_PREFIX}_VERSION}" PARENT_SCOPE)
endif()
# always set the soversion
set(${ESV_VARIABLE_PREFIX}_SOVERSION "${${ESV_VARIABLE_PREFIX}_SOVERSION}" PARENT_SCOPE)
if(NOT project_manages_version)
set(PROJECT_VERSION "${PROJECT_VERSION}" PARENT_SCOPE)
set(PROJECT_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}" PARENT_SCOPE)
set(PROJECT_VERSION_MINOR "${PROJECT_VERSION_MINOR}" PARENT_SCOPE)
set(PROJECT_VERSION_PATCH "${PROJECT_VERSION_PATCH}" PARENT_SCOPE)
endif()
if(_set_backward_compat_version_string_vars)
set(PROJECT_VERSION_STRING "${PROJECT_VERSION_STRING}" PARENT_SCOPE)
set(${ESV_VARIABLE_PREFIX}_VERSION_STRING "${${ESV_VARIABLE_PREFIX}_VERSION}" PARENT_SCOPE)
endif()
endfunction()

View File

@@ -0,0 +1,50 @@
# SPDX-FileCopyrightText: 2015 Alex Merry <alex.merry@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
ECMUninstallTarget
------------------
Add an ``uninstall`` target.
By including this module, an ``uninstall`` target will be added to your CMake
project. This will remove all files installed (or updated) by a previous
invocation of the ``install`` target. It will not remove files created or
modified by an ``install(SCRIPT)`` or ``install(CODE)`` command; you should
create a custom uninstallation target for these and use ``add_dependency`` to
make the ``uninstall`` target depend on it:
.. code-block:: cmake
include(ECMUninstallTarget)
install(SCRIPT install-foo.cmake)
add_custom_target(uninstall_foo COMMAND ${CMAKE_COMMAND} -P uninstall-foo.cmake)
add_dependency(uninstall uninstall_foo)
The target will fail if the ``install`` target has not yet been run (so it is
not possible to run CMake on the project and then immediately run the
``uninstall`` target).
.. warning::
CMake deliberately does not provide an ``uninstall`` target by default on
the basis that such a target has the potential to remove important files
from a user's computer. Use with caution.
Since 1.7.0.
#]=======================================================================]
if (NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/ecm_uninstall.cmake.in"
"${CMAKE_BINARY_DIR}/ecm_uninstall.cmake"
IMMEDIATE
@ONLY
)
add_custom_target(uninstall
COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/ecm_uninstall.cmake"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
endif()

View File

@@ -0,0 +1,17 @@
// This file was generated by ecm_setup_version(): DO NOT EDIT!
#ifndef @HEADER_PREFIX@_VERSION_H
#define @HEADER_PREFIX@_VERSION_H
#define @HEADER_PREFIX@_VERSION_STRING "@HEADER_VERSION@"
#define @HEADER_PREFIX@_VERSION_MAJOR @HEADER_VERSION_MAJOR@
#define @HEADER_PREFIX@_VERSION_MINOR @HEADER_VERSION_MINOR@
#define @HEADER_PREFIX@_VERSION_PATCH @HEADER_VERSION_PATCH@
#define @HEADER_PREFIX@_VERSION @HEADER_PREFIX@_VERSION_CHECK(@HEADER_PREFIX@_VERSION_MAJOR, @HEADER_PREFIX@_VERSION_MINOR, @HEADER_PREFIX@_VERSION_PATCH)
/*
for example: @HEADER_PREFIX@_VERSION >= @HEADER_PREFIX@_VERSION_CHECK(1, 2, 2))
*/
#define @HEADER_PREFIX@_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
#endif

View File

@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else()
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()

View File

@@ -24,7 +24,7 @@ if(NOT INSTALL_DATADIR)
set(INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR}) set(INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR})
endif() endif()
if(NOT INSTALL_DOC_DIR) if(NOT INSTALL_DOC_DIR)
set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}) set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}${KDDockWidgets_LIBRARY_QTID})
endif() endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

View File

@@ -0,0 +1,154 @@
#
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# PYSIDE_BASEDIR - Top of the PySide2 installation
# PYSIDE_INCLUDE_DIR - Directories to include to use PySide2
# PYSIDE_LIBRARY - Files to link against to use PySide2
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide2
#
# You can install PySide2 from Qt repository with
# pip3 install --index-url=https://download.qt.io/official_releases/QtForPython --trusted-host download.qt.io pyside2
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PYSIDE2_PRIV QUIET pyside2)
endif()
set(PYSIDE2_FOUND FALSE)
if(PYSIDE2_PRIV_FOUND)
set(PYSIDE2_FOUND TRUE)
message(STATUS "Using PySide2 found in the system!")
pkg_get_variable(SHIBOKEN_BINARY
pyside2
generator_location
)
pkg_get_variable(PYSIDE2_BASEDIR
pyside2
typesystemdir
)
pkg_get_variable(PYSIDE_INCLUDE_DIR
pyside2
includedir
)
set(PYSIDE_TYPESYSTEMS ${PYSIDE2_BASEDIR})
set(PYSIDE2_SO_VERSION ${PYSIDE2_PRIV_VERSION})
set(PYSIDE_LIBRARY ${PYSIDE2_PRIV_LINK_LIBRARIES})
list(GET PYSIDE_LIBRARY 0 PYSIDE_LIBRARY)
else()
# 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 PySide2.QtCore as QtCore
print(os.path.dirname(QtCore.__file__))
except Exception as error:
print(error, file=sys.stderr)
exit()
"
OUTPUT_VARIABLE PYSIDE2_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT PYSIDE2_BASEDIR)
message(FATAL_ERROR "The PySide2 module could not be imported. Make sure you have it installed by checking the output of \"pip${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} list\"")
endif()
set(PYSIDE_BASEDIR ${PYSIDE2_BASEDIR} CACHE PATH "Top level install of PySide2" FORCE)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import PySide2.QtCore as QtCore
print(os.path.basename(QtCore.__file__).split('.', 1)[1])
"
OUTPUT_VARIABLE PYSIDE2_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import PySide2.QtCore as QtCore
print(';'.join(map(str, QtCore.__version_info__)))
"
OUTPUT_VARIABLE PYSIDE2_SO_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(GET PYSIDE2_SO_VERSION 0 PYSIDE2_SO_MACRO_VERSION)
list(GET PYSIDE2_SO_VERSION 1 PYSIDE2_SO_MICRO_VERSION)
list(GET PYSIDE2_SO_VERSION 2 PYSIDE2_SO_MINOR_VERSION)
string(REPLACE ";" "." PYSIDE2_SO_VERSION "${PYSIDE2_SO_VERSION}")
if(NOT APPLE)
set(PYSIDE2_SUFFIX "${PYSIDE2_SUFFIX}.${PYSIDE2_SO_MACRO_VERSION}.${PYSIDE2_SO_MICRO_VERSION}")
else()
string(REPLACE ".so" "" PYSIDE2_SUFFIX ${PYSIDE2_SUFFIX})
set(PYSIDE2_SUFFIX "${PYSIDE2_SUFFIX}.${PYSIDE2_SO_MACRO_VERSION}.${PYSIDE2_SO_MICRO_VERSION}.dylib")
endif()
set(PYSIDE2_FOUND TRUE)
message(STATUS "PySide2 base dir: ${PYSIDE2_BASEDIR}")
message(STATUS "PySide2 suffix: ${PYSIDE2_SUFFIX}")
#PySide
#===============================================================================
find_path(PYSIDE_INCLUDE_DIR
pyside.h
PATHS ${PYSIDE2_BASEDIR}/include ${PYSIDE_CUSTOM_PREFIX}/include/PySide2
NO_DEFAULT_PATH)
# Platform specific library names
if(MSVC)
set(PYSIDE_LIBRARY_BASENAMES "pyside2.abi3.lib")
elseif(CYGWIN)
set(PYSIDE_LIBRARY_BASENAMES "")
elseif(WIN32)
set(PYSIDE_LIBRARY_BASENAMES "libpyside2.${PYSIDE2_SUFFIX}")
else()
set(PYSIDE_LIBRARY_BASENAMES "libpyside2.${PYSIDE2_SUFFIX}")
endif()
find_file(PYSIDE_LIBRARY
${PYSIDE_LIBRARY_BASENAMES}
PATHS ${PYSIDE2_BASEDIR} ${PYSIDE_CUSTOM_PREFIX}/lib
NO_DEFAULT_PATH)
find_path(PYSIDE_TYPESYSTEMS
typesystem_core.xml
PATHS ${PYSIDE2_BASEDIR}/typesystems ${PYSIDE_CUSTOM_PREFIX}/share/PySide2/typesystems
NO_DEFAULT_PATH)
endif()
if(PYSIDE2_FOUND)
message(STATUS "PySide include dir: ${PYSIDE_INCLUDE_DIR}")
message(STATUS "PySide library: ${PYSIDE_LIBRARY}")
message(STATUS "PySide typesystems: ${PYSIDE_TYPESYSTEMS}")
message(STATUS "PySide2 version: ${PYSIDE2_SO_VERSION}")
# Create PySide2 target
add_library(PySide2::pyside2 SHARED IMPORTED GLOBAL)
if(MSVC)
set_property(TARGET PySide2::pyside2 PROPERTY IMPORTED_IMPLIB ${PYSIDE_LIBRARY})
endif()
set_property(TARGET PySide2::pyside2 PROPERTY IMPORTED_LOCATION ${PYSIDE_LIBRARY})
set_property(TARGET PySide2::pyside2 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(PySide2
REQUIRED_VARS PYSIDE2_BASEDIR PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_TYPESYSTEMS
VERSION_VAR PYSIDE2_SO_VERSION
)

View File

@@ -2,9 +2,7 @@
# SPDX-FileCopyrightText: 2020-2021 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> # Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
# #
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only # SPDX-License-Identifier: BSD-3-Clause
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
# PYSIDE_BASEDIR - Top of the PySide6 installation # PYSIDE_BASEDIR - Top of the PySide6 installation
@@ -34,6 +32,9 @@ execute_process(
OUTPUT_VARIABLE PYSIDE6_BASEDIR OUTPUT_VARIABLE PYSIDE6_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
if(NOT PYSIDE6_BASEDIR)
message(FATAL_ERROR "The PySide6 module could not be imported. Make sure you have it installed by checking the output of \"pip${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} list\"")
endif()
if(PYSIDE6_BASEDIR) if(PYSIDE6_BASEDIR)
set(PYSIDE_BASEDIR ${PYSIDE6_BASEDIR} CACHE PATH "Top level install of PySide6" FORCE) set(PYSIDE_BASEDIR ${PYSIDE6_BASEDIR} CACHE PATH "Top level install of PySide6" FORCE)
@@ -78,28 +79,28 @@ if (PYSIDE6_FOUND)
#=============================================================================== #===============================================================================
find_path(PYSIDE_INCLUDE_DIR find_path(PYSIDE_INCLUDE_DIR
pyside.h pyside.h
PATHS ${PYSIDE6_BASEDIR}/include ${PYSIDE6_CUSTOM_PREFIX}/include/PySide6 PATHS ${PYSIDE6_BASEDIR}/include ${PYSIDE_CUSTOM_PREFIX}/include/PySide6
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
# Platform specific library names # Platform specific library names
if(MSVC) if(MSVC)
SET(PYSIDE_LIBRARY_BASENAMES "pyside6.abi3.lib") set(PYSIDE_LIBRARY_BASENAMES "pyside6.abi3.lib")
elseif(CYGWIN) elseif(CYGWIN)
SET(PYSIDE_LIBRARY_BASENAMES "") set(PYSIDE_LIBRARY_BASENAMES "")
elseif(WIN32) elseif(WIN32)
SET(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}") set(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}")
else() else()
SET(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}") set(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}")
endif() endif()
find_file(PYSIDE_LIBRARY find_file(PYSIDE_LIBRARY
${PYSIDE_LIBRARY_BASENAMES} ${PYSIDE_LIBRARY_BASENAMES}
PATHS ${PYSIDE6_BASEDIR} ${PYSIDE6_CUSTOM_PREFIX}/lib PATHS ${PYSIDE6_BASEDIR} ${PYSIDE_CUSTOM_PREFIX}/lib
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
find_path(PYSIDE_TYPESYSTEMS find_path(PYSIDE_TYPESYSTEMS
typesystem_core.xml typesystem_core.xml
PATHS ${PYSIDE6_BASEDIR}/typesystems ${PYSIDE6_CUSTOM_PREFIX}/share/PySide6/typesystems PATHS ${PYSIDE6_BASEDIR}/typesystems ${PYSIDE_CUSTOM_PREFIX}/share/PySide6/typesystems
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
endif() endif()
@@ -112,11 +113,9 @@ if(PYSIDE6_FOUND)
# Create PySide6 target # Create PySide6 target
add_library(PySide6::pyside6 SHARED IMPORTED GLOBAL) add_library(PySide6::pyside6 SHARED IMPORTED GLOBAL)
if(MSVC) if(MSVC)
set_property(TARGET PySide6::pyside6 PROPERTY set_property(TARGET PySide6::pyside6 PROPERTY IMPORTED_IMPLIB ${PYSIDE_LIBRARY})
IMPORTED_IMPLIB ${PYSIDE_LIBRARY})
endif() endif()
set_property(TARGET PySide6::pyside6 PROPERTY set_property(TARGET PySide6::pyside6 PROPERTY IMPORTED_LOCATION ${PYSIDE_LIBRARY})
IMPORTED_LOCATION ${PYSIDE_LIBRARY})
set_property(TARGET PySide6::pyside6 APPEND PROPERTY set_property(TARGET PySide6::pyside6 APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES
${PYSIDE_INCLUDE_DIR} ${PYSIDE_INCLUDE_DIR}
@@ -127,7 +126,6 @@ if(PYSIDE6_FOUND)
) )
endif() endif()
find_package_handle_standard_args(PySide6 find_package_handle_standard_args(PySide6
REQUIRED_VARS PYSIDE6_BASEDIR PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_TYPESYSTEMS REQUIRED_VARS PYSIDE6_BASEDIR PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_TYPESYSTEMS
VERSION_VAR PYSIDE6_SO_VERSION VERSION_VAR PYSIDE6_SO_VERSION

View File

@@ -1,10 +1,8 @@
# #
# SPDX-FileCopyrightText: 2020-2021 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: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> # Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
# #
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only # SPDX-License-Identifier: BSD-3-Clause
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN # SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
@@ -52,6 +50,9 @@ else()
OUTPUT_VARIABLE SHIBOKEN_GENERATOR_BASEDIR OUTPUT_VARIABLE SHIBOKEN_GENERATOR_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
if(NOT SHIBOKEN_GENERATOR_BASEDIR)
message(FATAL_ERROR "The shiboken2_generator module could not be imported. Make sure you have it installed by checking the output of \"pip${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} list\"")
endif()
execute_process( execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True: COMMAND ${Python3_EXECUTABLE} -c "if True:
import os import os
@@ -64,6 +65,9 @@ else()
OUTPUT_VARIABLE SHIBOKEN_BASEDIR OUTPUT_VARIABLE SHIBOKEN_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
if(NOT SHIBOKEN_BASEDIR)
message(FATAL_ERROR "The shiboken2 module could not be imported. Make sure you have it installed by checking the output of \"pip${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} list\"")
endif()
execute_process( execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True: COMMAND ${Python3_EXECUTABLE} -c "if True:
import os import os
@@ -80,28 +84,29 @@ else()
message(STATUS "ShibokenGenerator base dir: ${SHIBOKEN_GENERATOR_BASEDIR}") message(STATUS "ShibokenGenerator base dir: ${SHIBOKEN_GENERATOR_BASEDIR}")
message(STATUS "Shiboken base dir: ${SHIBOKEN_BASEDIR}") message(STATUS "Shiboken base dir: ${SHIBOKEN_BASEDIR}")
message(STATUS "Shiboken custom path: ${SHIBOKEN_CUSTOM_PATH}") message(STATUS "Shiboken custom path: ${SHIBOKEN_CUSTOM_PREFIX}")
if(SHIBOKEN_BASEDIR) if(SHIBOKEN_BASEDIR)
find_path(SHIBOKEN_INCLUDE_DIR find_path(SHIBOKEN_INCLUDE_DIR
shiboken.h shiboken.h
PATHS ${SHIBOKEN_CUSTOM_PATH} ${SHIBOKEN_GENERATOR_BASEDIR}/include PATHS ${SHIBOKEN_CUSTOM_PREFIX} ${SHIBOKEN_GENERATOR_BASEDIR}/include
NO_DEFAULT_PATH) NO_DEFAULT_PATH
)
if(MSVC) if(MSVC)
SET(SHIBOKEN_LIBRARY_BASENAMES "shiboken2.abi3.lib") set(SHIBOKEN_LIBRARY_BASENAMES "shiboken2.abi3.lib")
elseif(CYGWIN) elseif(CYGWIN)
SET(SHIBOKEN_LIBRARY_BASENAMES "") set(SHIBOKEN_LIBRARY_BASENAMES "")
elseif(WIN32) elseif(WIN32)
SET(SHIBOKEN_LIBRARY_BASENAMES "libshiboken2.${PYSIDE2_SUFFIX}") set(SHIBOKEN_LIBRARY_BASENAMES "libshiboken2.${PYSIDE2_SUFFIX}")
elseif(APPLE) elseif(APPLE)
SET(SHIBOKEN_LIBRARY_BASENAMES set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken2.abi3.dylib libshiboken2.abi3.dylib
libshiboken2.abi3.${SHIBOKEN_MACRO_VERSION}.dylib libshiboken2.abi3.${SHIBOKEN_MACRO_VERSION}.dylib
libshiboken2.abi3.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}.dylib libshiboken2.abi3.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}.dylib
libshiboken2.abi3.${SHIBOKEN_VERSION}.dylib libshiboken2.abi3.${SHIBOKEN_VERSION}.dylib
) )
else() else()
SET(SHIBOKEN_LIBRARY_BASENAMES set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken2.abi3.so libshiboken2.abi3.so
libshiboken2.abi3.so.${SHIBOKEN_MACRO_VERSION} libshiboken2.abi3.so.${SHIBOKEN_MACRO_VERSION}
libshiboken2.abi3.so.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION} libshiboken2.abi3.so.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}
@@ -112,7 +117,7 @@ else()
if(NOT SHIBOKEN_INCLUDE_DIR) if(NOT SHIBOKEN_INCLUDE_DIR)
return() return()
endif() endif()
set(SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_CUSTOM_PATH}) set(SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_CUSTOM_PREFIX})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_BASEDIR}) list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_BASEDIR})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_GENERATOR_BASEDIR}) list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_GENERATOR_BASEDIR})
find_file(SHIBOKEN_LIBRARY find_file(SHIBOKEN_LIBRARY
@@ -133,7 +138,6 @@ else()
if(SHIBOKEN_FOUND) if(SHIBOKEN_FOUND)
endif() endif()
if(MSVC) if(MSVC)
# On Windows we must link to python3.dll that is a small library that links against python3x.dll # 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 # that allow us to choose any python3x.dll at runtime
@@ -167,17 +171,17 @@ if (SHIBOKEN_FOUND)
set_property(TARGET Shiboken2::libshiboken PROPERTY set_property(TARGET Shiboken2::libshiboken PROPERTY
IMPORTED_IMPLIB ${SHIBOKEN_LIBRARY}) IMPORTED_IMPLIB ${SHIBOKEN_LIBRARY})
endif() endif()
set_property(TARGET Shiboken2::libshiboken PROPERTY set_property(TARGET Shiboken2::libshiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_LIBRARY})
IMPORTED_LOCATION ${SHIBOKEN_LIBRARY})
set_property(TARGET Shiboken2::libshiboken APPEND PROPERTY set_property(TARGET Shiboken2::libshiboken APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SHIBOKEN_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}) INTERFACE_INCLUDE_DIRECTORIES ${SHIBOKEN_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}
)
set_property(TARGET Shiboken2::libshiboken APPEND PROPERTY set_property(TARGET Shiboken2::libshiboken APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${PYTHON_LIMITED_LIBRARIES}) INTERFACE_LINK_LIBRARIES ${PYTHON_LIMITED_LIBRARIES}
)
# Generator target # Generator target
add_executable(Shiboken2::shiboken IMPORTED GLOBAL) add_executable(Shiboken2::shiboken IMPORTED GLOBAL)
set_property(TARGET Shiboken2::shiboken PROPERTY set_property(TARGET Shiboken2::shiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_BINARY})
IMPORTED_LOCATION ${SHIBOKEN_BINARY})
endif() endif()
find_package_handle_standard_args(Shiboken2 find_package_handle_standard_args(Shiboken2

View File

@@ -2,9 +2,7 @@
# SPDX-FileCopyrightText: 2020-2021 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> # Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
# #
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only # SPDX-License-Identifier: BSD-3-Clause
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN # SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
@@ -15,7 +13,6 @@
# You can install Shiboken from Qt repository with # 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 # pip3 install --index-url=https://download.qt.io/official_releases/QtForPython --trusted-host download.qt.io shiboken6-generator
set(SHIBOKEN_FOUND FALSE) set(SHIBOKEN_FOUND FALSE)
execute_process( execute_process(
@@ -30,6 +27,9 @@ execute_process(
OUTPUT_VARIABLE SHIBOKEN_GENERATOR_BASEDIR OUTPUT_VARIABLE SHIBOKEN_GENERATOR_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
if(NOT SHIBOKEN_GENERATOR_BASEDIR)
message(FATAL_ERROR "The shiboken6_generator module could not be imported. Make sure you have it installed by checking the output of \"pip${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} list\"")
endif()
execute_process( execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True: COMMAND ${Python3_EXECUTABLE} -c "if True:
import os import os
@@ -42,6 +42,9 @@ execute_process(
OUTPUT_VARIABLE SHIBOKEN_BASEDIR OUTPUT_VARIABLE SHIBOKEN_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
if(NOT SHIBOKEN_BASEDIR)
message(FATAL_ERROR "The shiboken6 module could not be imported. Make sure you have it installed by checking the output of \"pip${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} list\"")
endif()
execute_process( execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True: COMMAND ${Python3_EXECUTABLE} -c "if True:
import os import os
@@ -58,28 +61,29 @@ string(REPLACE ";" "." SHIBOKEN_VERSION "${SHIBOKEN_VERSION}")
message(STATUS "ShibokenGenerator base dir: ${SHIBOKEN_GENERATOR_BASEDIR}") message(STATUS "ShibokenGenerator base dir: ${SHIBOKEN_GENERATOR_BASEDIR}")
message(STATUS "Shiboken base dir: ${SHIBOKEN_BASEDIR}") message(STATUS "Shiboken base dir: ${SHIBOKEN_BASEDIR}")
message(STATUS "Shiboken custom path: ${SHIBOKEN_CUSTOM_PATH}") message(STATUS "Shiboken custom path: ${SHIBOKEN_CUSTOM_PREFIX}")
if(SHIBOKEN_BASEDIR) if(SHIBOKEN_BASEDIR)
find_path(SHIBOKEN_INCLUDE_DIR find_path(SHIBOKEN_INCLUDE_DIR
shiboken.h shiboken.h
PATHS ${SHIBOKEN_CUSTOM_PATH} ${SHIBOKEN_GENERATOR_BASEDIR}/include PATHS ${SHIBOKEN_CUSTOM_PREFIX} ${SHIBOKEN_GENERATOR_BASEDIR}/include
NO_DEFAULT_PATH) NO_DEFAULT_PATH
)
if(MSVC) if(MSVC)
SET(SHIBOKEN_LIBRARY_BASENAMES "shiboken6.abi3.lib") set(SHIBOKEN_LIBRARY_BASENAMES "shiboken6.abi3.lib")
elseif(CYGWIN) elseif(CYGWIN)
SET(SHIBOKEN_LIBRARY_BASENAMES "") set(SHIBOKEN_LIBRARY_BASENAMES "")
elseif(WIN32) elseif(WIN32)
SET(SHIBOKEN_LIBRARY_BASENAMES "libshiboken6.${PYSIDE2_SUFFIX}") set(SHIBOKEN_LIBRARY_BASENAMES "libshiboken6.${PYSIDE2_SUFFIX}")
elseif(APPLE) elseif(APPLE)
SET(SHIBOKEN_LIBRARY_BASENAMES set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken6.abi3.dylib libshiboken6.abi3.dylib
libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.dylib libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.dylib
libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}.dylib libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}.dylib
libshiboken6.abi3.${SHIBOKEN_VERSION}.dylib libshiboken6.abi3.${SHIBOKEN_VERSION}.dylib
) )
else() else()
SET(SHIBOKEN_LIBRARY_BASENAMES set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken6.abi3.so libshiboken6.abi3.so
libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION} libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION}
libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION} libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}
@@ -90,7 +94,7 @@ if(SHIBOKEN_BASEDIR)
if(NOT SHIBOKEN_INCLUDE_DIR) if(NOT SHIBOKEN_INCLUDE_DIR)
return() return()
endif() endif()
set(SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_CUSTOM_PATH}) set(SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_CUSTOM_PREFIX})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_BASEDIR}) list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_BASEDIR})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_GENERATOR_BASEDIR}) list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_GENERATOR_BASEDIR})
find_file(SHIBOKEN_LIBRARY find_file(SHIBOKEN_LIBRARY
@@ -111,7 +115,6 @@ endif()
if(SHIBOKEN_FOUND) if(SHIBOKEN_FOUND)
endif() endif()
if(MSVC) if(MSVC)
# On Windows we must link to python3.dll that is a small library that links against python3x.dll # 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 # that allow us to choose any python3x.dll at runtime
@@ -145,17 +148,17 @@ if (SHIBOKEN_FOUND)
set_property(TARGET Shiboken6::libshiboken PROPERTY set_property(TARGET Shiboken6::libshiboken PROPERTY
IMPORTED_IMPLIB ${SHIBOKEN_LIBRARY}) IMPORTED_IMPLIB ${SHIBOKEN_LIBRARY})
endif() endif()
set_property(TARGET Shiboken6::libshiboken PROPERTY set_property(TARGET Shiboken6::libshiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_LIBRARY})
IMPORTED_LOCATION ${SHIBOKEN_LIBRARY})
set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SHIBOKEN_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}) INTERFACE_INCLUDE_DIRECTORIES ${SHIBOKEN_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}
)
set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${PYTHON_LIMITED_LIBRARIES}) INTERFACE_LINK_LIBRARIES ${PYTHON_LIMITED_LIBRARIES}
)
# Generator target # Generator target
add_executable(Shiboken6::shiboken IMPORTED GLOBAL) add_executable(Shiboken6::shiboken IMPORTED GLOBAL)
set_property(TARGET Shiboken6::shiboken PROPERTY set_property(TARGET Shiboken6::shiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_BINARY})
IMPORTED_LOCATION ${SHIBOKEN_BINARY})
endif() endif()
find_package_handle_standard_args(Shiboken6 find_package_handle_standard_args(Shiboken6

View File

@@ -0,0 +1,52 @@
#
# 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
#
# Assumes you've already found Qt and Qt_VERSION_MAJOR is set
#
# Create variables for all the various install paths for the Qt version in use
# Make sure to have found Qt before using this.
# sets variables like QT_INSTALL_PREFIX, QT_INSTALL_DATA, QT_INSTALL_DOCS, etc.
# run qmake -query to see a full list
if(NOT DEFINED Qt_VERSION_MAJOR)
message(FATAL_ERROR "Please set Qt_VERSION_MAJOR first (ie. set(Qt_VERSION_MAJOR 5))")
endif()
if(TARGET Qt${Qt_VERSION_MAJOR}::qmake)
get_target_property(QT_QMAKE_EXECUTABLE Qt${Qt_VERSION_MAJOR}::qmake LOCATION)
else()
message(FATAL_ERROR "No supported Qt version found. Make sure you find Qt before calling this")
endif()
execute_process(
COMMAND ${QT_QMAKE_EXECUTABLE} -query
RESULT_VARIABLE return_code
OUTPUT_VARIABLE ALL_VARS
)
if(NOT return_code EQUAL 0)
message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query")
message(FATAL_ERROR "QMake call failed: ${return_code}")
endif()
string(REPLACE "\n" ";" VARS_LIST ${ALL_VARS})
foreach(QVAL ${VARS_LIST})
if(QVAL MATCHES "QT_INSTALL_")
string(REPLACE ":" ";" QVAL_LIST ${QVAL})
list(LENGTH QVAL_LIST listlen)
list(GET QVAL_LIST 0 var)
if(WIN32 AND ${listlen} GREATER 2)
list(GET QVAL_LIST 2 path)
list(GET QVAL_LIST 1 drive)
set(path "${drive}:${path}")
else()
list(GET QVAL_LIST 1 path)
endif()
if(NOT ${var}) #if set already on the command line for example
set(${var} ${path} CACHE PATH "Qt install path for ${var}")
endif()
endif()
endforeach()

View File

@@ -1,14 +1,12 @@
# #
# SPDX-FileCopyrightText: 2020-2021 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: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> # Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
# #
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only # SPDX-License-Identifier: BSD-3-Clause
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
if(NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX) 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.") set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE FILEPATH "Custom path to install python bindings.")
endif() endif()
message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}") message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}")
@@ -18,8 +16,12 @@ if (WIN32)
else() else()
set(PATH_SEP ":") set(PATH_SEP ":")
endif() endif()
if (NOT CMAKE_CXX_STANDARD) #Qt5 requires C++14
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#remove noisy compiler warnings (as the generated code is not necessarily super-warning-free)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all -Wno-extra")
endif() endif()
# On macOS, check if Qt is a framework build. This affects how include paths should be handled. # On macOS, check if Qt is a framework build. This affects how include paths should be handled.
@@ -46,12 +48,14 @@ endif()
# --use-isnull-as-nb_nonzero: If a class have an isNull() const method, it will be used to compute # --use-isnull-as-nb_nonzero: If a class have an isNull() const method, it will be used to compute
# the value of boolean casts. # the value of boolean casts.
# Example, QImage::isNull() will be used when on python side you do `if (myQImage)` # Example, QImage::isNull() will be used when on python side you do `if (myQImage)`
set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken set(GENERATOR_EXTRA_FLAGS
--generator-set=shiboken
--enable-parent-ctor-heuristic --enable-parent-ctor-heuristic
--enable-pyside-extensions --enable-pyside-extensions
--enable-return-value-heuristic --enable-return-value-heuristic
--use-isnull-as-nb_nonzero --use-isnull-as-nb_nonzero
-std=c++${CMAKE_CXX_STANDARD}) -std=c++${CMAKE_CXX_STANDARD}
)
# 2017-04-24 The protected hack can unfortunately not be disabled, because # 2017-04-24 The protected hack can unfortunately not be disabled, because
# Clang does produce linker errors when we disable the hack. # Clang does produce linker errors when we disable the hack.
@@ -74,11 +78,11 @@ endmacro()
# Args: # Args:
# LIBRARY_NAME - The name of the output module # LIBRARY_NAME - The name of the output module
# TYPESYSTEM_PATHS - A list of paths where shiboken should look for typesystem files # 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* # INCLUDE_PATHS - Include paths necessary to parse your class. *This is not the same as build*
# OUTPUT_SOURCES - The files that will be generated by shiboken # OUTPUT_SOURCES - The files that will be generated by shiboken
# TARGET_INCLUDE_DIRS - This will be passed to target_include_directories # TARGET_INCLUDE_DIRS - This will be passed to target_include_directories
# TARGET_LINK_LIBRARIES - This will be passed to target_link_libraries # TARGET_LINK_LIBRARIES - This will be passed to target_link_libraries
# GLOBAL_INCLUDE - A header-file that contains alls classes that will be generated # GLOBAL_INCLUDE - A header-file that contains all classes that will be generated
# TYPESYSTEM_XML - The target binding typesystem (that should be the full path) # 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 # DEPENDS - This var will be passed to add_custom_command(DEPENDS) so a new generation will be
# trigger if one of these files changes # trigger if one of these files changes
@@ -130,6 +134,11 @@ macro(CREATE_PYTHON_BINDINGS
OUTPUT_NAME ${MODULE_NAME} OUTPUT_NAME ${MODULE_NAME}
LIBRARY_OUTPUT_DIRECTORY ${MODULE_OUTPUT_DIR} LIBRARY_OUTPUT_DIRECTORY ${MODULE_OUTPUT_DIR}
) )
if(APPLE)
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
elseif(NOT WIN32) #ie. linux
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()
if(WIN32) if(WIN32)
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd") set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
@@ -137,7 +146,6 @@ macro(CREATE_PYTHON_BINDINGS
target_include_directories(${TARGET_NAME} PUBLIC target_include_directories(${TARGET_NAME} PUBLIC
${TARGET_INCLUDE_DIRS} ${TARGET_INCLUDE_DIRS}
${PYSIDE_EXTRA_INCLUDES}
) )
target_link_libraries(${TARGET_NAME} target_link_libraries(${TARGET_NAME}
@@ -153,5 +161,5 @@ macro(CREATE_PYTHON_BINDINGS
LINK_FLAGS "-undefined dynamic_lookup") LINK_FLAGS "-undefined dynamic_lookup")
endif() endif()
install(TARGETS ${TARGET_NAME} install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/${TARGET_NAME}) LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX})
endmacro() endmacro()

View File

@@ -2,13 +2,11 @@
# SPDX-FileCopyrightText: 2020-2021 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> # Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
# #
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only # SPDX-License-Identifier: BSD-3-Clause
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
if(NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX) 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.") set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE FILEPATH "Custom path to install python bindings.")
endif() endif()
message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}") message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}")
@@ -18,8 +16,12 @@ if (WIN32)
else() else()
set(PATH_SEP ":") set(PATH_SEP ":")
endif() endif()
if (NOT CMAKE_CXX_STANDARD) #Qt6 requires C++17
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#remove noisy compiler warnings (as the generated code is not necessarily super-warning-free)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all -Wno-extra")
endif() endif()
# On macOS, check if Qt is a framework build. This affects how include paths should be handled. # On macOS, check if Qt is a framework build. This affects how include paths should be handled.
@@ -46,12 +48,14 @@ endif()
# --use-isnull-as-nb_nonzero: If a class have an isNull() const method, it will be used to compute # --use-isnull-as-nb_nonzero: If a class have an isNull() const method, it will be used to compute
# the value of boolean casts. # the value of boolean casts.
# Example, QImage::isNull() will be used when on python side you do `if (myQImage)` # Example, QImage::isNull() will be used when on python side you do `if (myQImage)`
set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken set(GENERATOR_EXTRA_FLAGS
--generator-set=shiboken
--enable-parent-ctor-heuristic --enable-parent-ctor-heuristic
--enable-pyside-extensions --enable-pyside-extensions
--enable-return-value-heuristic --enable-return-value-heuristic
--use-isnull-as-nb_nonzero --use-isnull-as-nb_nonzero
-std=c++${CMAKE_CXX_STANDARD}) -std=c++${CMAKE_CXX_STANDARD}
)
# 2017-04-24 The protected hack can unfortunately not be disabled, because # 2017-04-24 The protected hack can unfortunately not be disabled, because
# Clang does produce linker errors when we disable the hack. # Clang does produce linker errors when we disable the hack.
@@ -74,11 +78,11 @@ endmacro()
# Args: # Args:
# LIBRARY_NAME - The name of the output module # LIBRARY_NAME - The name of the output module
# TYPESYSTEM_PATHS - A list of paths where shiboken should look for typesystem files # 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* # INCLUDE_PATHS - Include paths necessary to parse your class. *This is not the same as build*
# OUTPUT_SOURCES - The files that will be generated by shiboken # OUTPUT_SOURCES - The files that will be generated by shiboken
# TARGET_INCLUDE_DIRS - This will be passed to target_include_directories # TARGET_INCLUDE_DIRS - This will be passed to target_include_directories
# TARGET_LINK_LIBRARIES - This will be passed to target_link_libraries # TARGET_LINK_LIBRARIES - This will be passed to target_link_libraries
# GLOBAL_INCLUDE - A header-file that contains alls classes that will be generated # GLOBAL_INCLUDE - A header-file that contains all classes that will be generated
# TYPESYSTEM_XML - The target binding typesystem (that should be the full path) # 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 # DEPENDS - This var will be passed to add_custom_command(DEPENDS) so a new generation will be
# trigger if one of these files changes # trigger if one of these files changes
@@ -130,6 +134,11 @@ macro(CREATE_PYTHON_BINDINGS
OUTPUT_NAME ${MODULE_NAME} OUTPUT_NAME ${MODULE_NAME}
LIBRARY_OUTPUT_DIRECTORY ${MODULE_OUTPUT_DIR} LIBRARY_OUTPUT_DIRECTORY ${MODULE_OUTPUT_DIR}
) )
if(APPLE)
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
elseif(NOT WIN32) #ie. linux
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()
if(WIN32) if(WIN32)
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd") set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
@@ -137,7 +146,6 @@ macro(CREATE_PYTHON_BINDINGS
target_include_directories(${TARGET_NAME} PUBLIC target_include_directories(${TARGET_NAME} PUBLIC
${TARGET_INCLUDE_DIRS} ${TARGET_INCLUDE_DIRS}
${PYSIDE_EXTRA_INCLUDES}
) )
target_link_libraries(${TARGET_NAME} target_link_libraries(${TARGET_NAME}
@@ -153,5 +161,5 @@ macro(CREATE_PYTHON_BINDINGS
LINK_FLAGS "-undefined dynamic_lookup") LINK_FLAGS "-undefined dynamic_lookup")
endif() endif()
install(TARGETS ${TARGET_NAME} install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/${TARGET_NAME}) LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX})
endmacro() endmacro()

View File

@@ -1,160 +0,0 @@
#
# 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 PySide2 installation
# PYSIDE_INCLUDE_DIR - Directories to include to use PySide2
# PYSIDE_LIBRARY - Files to link against to use PySide2
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide2
#
# You can install PySide2 from Qt repository with
# pip3 install --index-url=https://download.qt.io/official_releases/QtForPython --trusted-host download.qt.io pyside2
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PYSIDE2_PRIV QUIET pyside2)
endif()
set(PYSIDE2_FOUND FALSE)
if(PYSIDE2_PRIV_FOUND)
set(PYSIDE2_FOUND TRUE)
message(STATUS "Using PySide2 found in the system!")
pkg_get_variable(SHIBOKEN_BINARY
pyside2
generator_location
)
pkg_get_variable(PYSIDE2_BASEDIR
pyside2
typesystemdir
)
pkg_get_variable(PYSIDE_INCLUDE_DIR
pyside2
includedir
)
set(PYSIDE_TYPESYSTEMS ${PYSIDE2_BASEDIR})
set(PYSIDE2_SO_VERSION ${PYSIDE2_PRIV_VERSION})
set(PYSIDE_LIBRARY ${PYSIDE2_PRIV_LINK_LIBRARIES})
list(GET PYSIDE_LIBRARY 0 PYSIDE_LIBRARY)
else()
# 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 PySide2.QtCore as QtCore
print(os.path.dirname(QtCore.__file__))
except Exception as error:
print(error, file=sys.stderr)
exit()
"
OUTPUT_VARIABLE PYSIDE2_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(PYSIDE2_BASEDIR)
set(PYSIDE_BASEDIR ${PYSIDE2_BASEDIR} CACHE PATH "Top level install of PySide2" FORCE)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import PySide2.QtCore as QtCore
print(os.path.basename(QtCore.__file__).split('.', 1)[1])
"
OUTPUT_VARIABLE PYSIDE2_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import PySide2.QtCore as QtCore
print(';'.join(map(str, QtCore.__version_info__)))
"
OUTPUT_VARIABLE PYSIDE2_SO_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(GET PYSIDE2_SO_VERSION 0 PYSIDE2_SO_MACRO_VERSION)
list(GET PYSIDE2_SO_VERSION 1 PYSIDE2_SO_MICRO_VERSION)
list(GET PYSIDE2_SO_VERSION 2 PYSIDE2_SO_MINOR_VERSION)
string(REPLACE ";" "." PYSIDE2_SO_VERSION "${PYSIDE2_SO_VERSION}")
if(NOT APPLE)
set(PYSIDE2_SUFFIX "${PYSIDE2_SUFFIX}.${PYSIDE2_SO_MACRO_VERSION}.${PYSIDE2_SO_MICRO_VERSION}")
else()
string(REPLACE ".so" "" PYSIDE2_SUFFIX ${PYSIDE2_SUFFIX})
set(PYSIDE2_SUFFIX "${PYSIDE2_SUFFIX}.${PYSIDE2_SO_MACRO_VERSION}.${PYSIDE2_SO_MICRO_VERSION}.dylib")
endif()
set(PYSIDE2_FOUND TRUE)
message(STATUS "PySide2 base dir: ${PYSIDE2_BASEDIR}" )
message(STATUS "PySide2 suffix: ${PYSIDE2_SUFFIX}")
endif()
if (PYSIDE2_FOUND)
#PySide
#===============================================================================
find_path(PYSIDE_INCLUDE_DIR
pyside.h
PATHS ${PYSIDE2_BASEDIR}/include ${PYSIDE2_CUSTOM_PREFIX}/include/PySide2
NO_DEFAULT_PATH)
# Platform specific library names
if(MSVC)
SET(PYSIDE_LIBRARY_BASENAMES "pyside2.abi3.lib")
elseif(CYGWIN)
SET(PYSIDE_LIBRARY_BASENAMES "")
elseif(WIN32)
SET(PYSIDE_LIBRARY_BASENAMES "libpyside2.${PYSIDE2_SUFFIX}")
else()
SET(PYSIDE_LIBRARY_BASENAMES "libpyside2.${PYSIDE2_SUFFIX}")
endif()
find_file(PYSIDE_LIBRARY
${PYSIDE_LIBRARY_BASENAMES}
PATHS ${PYSIDE2_BASEDIR} ${PYSIDE2_CUSTOM_PREFIX}/lib
NO_DEFAULT_PATH)
find_path(PYSIDE_TYPESYSTEMS
typesystem_core.xml
PATHS ${PYSIDE2_BASEDIR}/typesystems ${PYSIDE2_CUSTOM_PREFIX}/share/PySide2/typesystems
NO_DEFAULT_PATH)
endif()
endif()
if(PYSIDE2_FOUND)
message(STATUS "PySide include dir: ${PYSIDE_INCLUDE_DIR}")
message(STATUS "PySide library: ${PYSIDE_LIBRARY}")
message(STATUS "PySide typesystems: ${PYSIDE_TYPESYSTEMS}")
message(STATUS "PySide2 version: ${PYSIDE2_SO_VERSION}")
# Create PySide2 target
add_library(PySide2::pyside2 SHARED IMPORTED GLOBAL)
if(MSVC)
set_property(TARGET PySide2::pyside2 PROPERTY
IMPORTED_IMPLIB ${PYSIDE_LIBRARY})
endif()
set_property(TARGET PySide2::pyside2 PROPERTY
IMPORTED_LOCATION ${PYSIDE_LIBRARY})
set_property(TARGET PySide2::pyside2 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(PySide2
REQUIRED_VARS PYSIDE2_BASEDIR PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_TYPESYSTEMS
VERSION_VAR PYSIDE2_SO_VERSION
)

View File

@@ -1,70 +0,0 @@
#
# 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
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Create variables for all the various install paths for the Qt version in use
# Make sure to have found Qt before using this.
# sets variables like QT_INSTALL_PREFIX, QT_INSTALL_DATA, QT_INSTALL_DOCS, etc.
# run qmake -query to see a full list
if(TARGET Qt${QT_MAJOR_VERSION}::qmake)
get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_MAJOR_VERSION}::qmake LOCATION)
else()
message(FATAL_ERROR "No supported Qt version found. Make sure you find Qt before calling this")
endif()
execute_process(
COMMAND ${QT_QMAKE_EXECUTABLE} -query
RESULT_VARIABLE return_code
OUTPUT_VARIABLE ALL_VARS
)
if(NOT return_code EQUAL 0)
message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query")
message(FATAL_ERROR "QMake call failed: ${return_code}")
endif()
string(REPLACE "\n" ";" VARS_LIST ${ALL_VARS})
foreach(QVAL ${VARS_LIST})
if(QVAL MATCHES "QT_INSTALL_")
string(REPLACE ":" ";" QVAL_LIST ${QVAL})
list(LENGTH QVAL_LIST listlen)
list(GET QVAL_LIST 0 var)
if(WIN32 AND ${listlen} GREATER 2)
list(GET QVAL_LIST 2 path)
list(GET QVAL_LIST 1 drive)
set(path "${drive}:${path}")
else()
list(GET QVAL_LIST 1 path)
endif()
if(NOT ${var}) #if set aleady on the command line for example
set(${var} ${path} CACHE PATH "Qt install path for ${var}")
endif()
endif()
endforeach()

View File

@@ -0,0 +1,147 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"C_Cpp.default.compileCommands": "${workspaceFolder}/build-dev-qtquick/compile_commands.json",
"C_Cpp.default.cStandard": "c17",
"files.trimTrailingWhitespace": true,
"editor.formatOnType": true,
"C_Cpp.autocompleteAddParentheses": true
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "gdb-kddockwidgets_customtitlebar_quick",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_customtitlebar_quick",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-kddockwidgets_example_mdi_quick",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_example_mdi_quick",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-kddockwidgets_example_quick",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_example_quick",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-tst_docks",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_customtitlebar_quick",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_customtitlebar_quick",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_example_mdi_quick",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_example_mdi_quick",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_example_quick",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_example_quick",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-tst_docks",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_customtitlebar_quick",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_customtitlebar_quick",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_example_mdi_quick",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_example_mdi_quick",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_example_quick",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/kddockwidgets_example_quick",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-tst_docks",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev-qtquick/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
}
]
}
}

View File

@@ -0,0 +1,147 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"C_Cpp.default.compileCommands": "${workspaceFolder}/build-dev/compile_commands.json",
"C_Cpp.default.cStandard": "c17",
"files.trimTrailingWhitespace": true,
"editor.formatOnType": true,
"C_Cpp.autocompleteAddParentheses": true
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "gdb-kddockwidgets_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-kddockwidgets_minimal_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-kddockwidgets_minimal_mdi_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_mdi_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-tst_docks",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_minimal_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_minimal_mdi_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_mdi_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-tst_docks",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_example",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_example",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_minimal_example",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_example",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_minimal_mdi_example",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_mdi_example",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-tst_docks",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
}
]
}
}

View File

@@ -0,0 +1,147 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"C_Cpp.default.compileCommands": "${workspaceFolder}/build-dev6/compile_commands.json",
"C_Cpp.default.cStandard": "c17",
"files.trimTrailingWhitespace": true,
"editor.formatOnType": true,
"C_Cpp.autocompleteAddParentheses": true
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "gdb-kddockwidgets_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-kddockwidgets_minimal_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_minimal_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-kddockwidgets_minimal_mdi_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_minimal_mdi_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "gdb-tst_docks",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_minimal_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_minimal_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-kddockwidgets_minimal_mdi_example",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_minimal_mdi_example",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "lldb-tst_docks",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "lldb",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_example",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_example",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_minimal_example",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_minimal_example",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-kddockwidgets_minimal_mdi_example",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/kddockwidgets_minimal_mdi_example",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": "msvc-tst_docks",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-dev6/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"externalConsole": false
}
]
}
}

View File

@@ -13,6 +13,9 @@ Configuration options:
* build_examples * build_examples
Build the examples. Default=True Build the examples. Default=True
* builde_python_bindings * build_python_bindings
Build/Generate python bindings (always false for Debug or static builds). Default=False Build/Generate python bindings (always false for Debug or static builds). Default=False
* build_for_qt6
Build against Qt6 rather than Qt5. Default=false (Qt5 will be used even if Qt6 is available)
(Make sure the Qt6 bin directory is found in your execute PATH)

View File

@@ -11,7 +11,7 @@ from conans import ConanFile, CMake, tools
class KDDockWidgetsConan(ConanFile): class KDDockWidgetsConan(ConanFile):
name = "kddockwidgets" name = "kddockwidgets"
version = "1.2.0" version = "1.5.0"
default_user = "kdab" default_user = "kdab"
default_channel = "stable" default_channel = "stable"
license = ("https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-2.0-only.txt", license = ("https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-2.0-only.txt",
@@ -28,14 +28,16 @@ class KDDockWidgetsConan(ConanFile):
"build_examples": [True, False], "build_examples": [True, False],
"build_tests": [True, False], "build_tests": [True, False],
"build_python_bindings": [True, False], "build_python_bindings": [True, False],
"build_for_qt6": [True, False],
} }
default_options = { default_options = {
"qt_version": "qt/[>5.9.0]@kdab/stable", "qt_version": "qt/[>5.12.0]@kdab/stable",
"build_static": False, "build_static": False,
"build_examples": True, "build_examples": True,
"build_tests": False, "build_tests": False,
"build_python_bindings": False, "build_python_bindings": False,
"build_for_qt6": False,
} }
def requirements(self): def requirements(self):
@@ -52,6 +54,7 @@ class KDDockWidgetsConan(ConanFile):
self.cmake.definitions["KDDockWidgets_EXAMPLES"] = self.options.build_examples self.cmake.definitions["KDDockWidgets_EXAMPLES"] = self.options.build_examples
self.cmake.definitions["KDDockWidgets_TESTS"] = self.options.build_tests self.cmake.definitions["KDDockWidgets_TESTS"] = self.options.build_tests
self.cmake.definitions["KDDockWidgets_PYTHON_BINDINGS"] = self.options.build_python_bindings self.cmake.definitions["KDDockWidgets_PYTHON_BINDINGS"] = self.options.build_python_bindings
self.cmake.definitions["KDDockWidgets_QT6"] = self.options.build_for_qt6
self.cmake.configure() self.cmake.configure()
self.cmake.build() self.cmake.build()

View File

@@ -1,157 +0,0 @@
/*
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;
}

View File

@@ -1,3 +1,27 @@
kddockwidgets (1.5.0) release candidate; urgency=high
* 1.5.0 final
-- Allen Winter <allen.winter@kdab.com> Mon, 24 Nov 2021 12:00:00 -0500
kddockwidgets (1.4.0) release candidate; urgency=high
* 1.4.0 final
-- Allen Winter <allen.winter@kdab.com> Fri, 16 Jul 2021 10:30:00 -0500
kddockwidgets (1.3.1) release candidate; urgency=high
* 1.3.1 final
-- Allen Winter <allen.winter@kdab.com> Mon, 07 Jun 2021 16:00:00 -0500
kddockwidgets (1.3.0) release candidate; urgency=high
* 1.3.0 final
-- Allen Winter <allen.winter@kdab.com> Mon, 08 Feb 2021 15:00:00 -0500
kddockwidgets (1.2.0) release candidate; urgency=high kddockwidgets (1.2.0) release candidate; urgency=high
* 1.2.0 final * 1.2.0 final

View File

@@ -6,7 +6,7 @@ Build-Depends: debhelper (>=9), cdbs, cmake
Standards-Version: 3.9.6 Standards-Version: 3.9.6
Homepage: https://github.com/KDAB/KDDockWidgets Homepage: https://github.com/KDAB/KDDockWidgets
Package: kddockwidgets Package: qt5-kddockwidgets
Architecture: any Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends} Depends: ${misc:Depends}, ${shlibs:Depends}
Description: KDAB's Dock Widget Framework for Qt Description: KDAB's Dock Widget Framework for Qt

View File

@@ -0,0 +1,10 @@
Format: 1.0
Source: kddockwidgets
Version: 1.5.0-1
Binary: kddockwidgets
Maintainer: Allen Winter <allen.winter@kdab.com>
Architecture: any
Build-Depends: debhelper (>=9), cdbs, cmake, qtbase5-dev, qtbase5-private-dev, libqt5x11extras5-dev, libfontconfig-dev
Files:
00000000000000000000000000000000 00000 qt5-kddockwidgets-1.5.0.tar.gz

View File

@@ -1,7 +1,7 @@
Name: kddockwidgets Name: qt5-kddockwidgets
Version: 1.2.0 Version: 1.5.0
Release: 1 Release: 1
Summary: KDAB's Dock Widget Framework for Qt Summary: KDAB's Dock Widget Framework for Qt5
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
Source1: %{name}-%{version}.tar.gz.asc Source1: %{name}-%{version}.tar.gz.asc
Source2: %{name}-rpmlintrc Source2: %{name}-rpmlintrc
@@ -14,15 +14,15 @@ Packager: Klaralvdalens Datakonsult AB (KDAB) <info@kdab.com>
BuildRequires: cmake BuildRequires: cmake
%if %{defined suse_version} %if %{defined suse_version}
BuildRequires: libqt5-qtbase-devel libqt5-qtx11extras-devel BuildRequires: libqt5-qtbase-devel libqt5-qtbase-private-headers-devel libqt5-qtx11extras-devel
%endif %endif
%if %{defined fedora} %if %{defined fedora}
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtx11extras-devel desktop-file-utils BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtx11extras-devel desktop-file-utils
%endif %endif
%if %{defined rhel} %if %{defined rhel}
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtx11extras-devel desktop-file-utils BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtx11extras-devel desktop-file-utils
%endif %endif
%description %description
@@ -79,7 +79,18 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%if 0%{?sle_version} >= 150200 && 0%{?is_opensuse}
%{_libdir}/qt5/mkspecs/modules/* %{_libdir}/qt5/mkspecs/modules/*
%endif
%if 0%{?suse_version} > 1500
%{_libdir}/qt5/mkspecs/modules/*
%endif
%if 0%{?fedora} > 28
%{_libdir}/qt5/mkspecs/modules/*
%endif
%if %{defined rhel}
%{_libdir}/qt5/mkspecs/modules/*
%endif
%dir %{_includedir}/kddockwidgets %dir %{_includedir}/kddockwidgets
%{_includedir}/kddockwidgets/* %{_includedir}/kddockwidgets/*
%dir %{_libdir}/cmake/KDDockWidgets %dir %{_libdir}/cmake/KDDockWidgets
@@ -87,6 +98,14 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
%{_libdir}/libkddockwidgets.so %{_libdir}/libkddockwidgets.so
%changelog %changelog
* Mon Nov 24 2021 Allen Winter <allen.winter@kdab.com> 1.5.0
1.5.0 final
* Fri Jul 16 2021 Allen Winter <allen.winter@kdab.com> 1.4.0
1.4.0 final
* Mon Jun 07 2021 Allen Winter <allen.winter@kdab.com> 1.3.1
1.3.1 final
* Mon Feb 08 2021 Allen Winter <allen.winter@kdab.com> 1.3.0
1.3.0 final
* Thu Dec 17 2020 Allen Winter <allen.winter@kdab.com> 1.2.0 * Thu Dec 17 2020 Allen Winter <allen.winter@kdab.com> 1.2.0
1.2.0 final 1.2.0 final
* Fri Dec 11 2020 Allen Winter <allen.winter@kdab.com> 1.1.1 * Fri Dec 11 2020 Allen Winter <allen.winter@kdab.com> 1.1.1

12
distro/qt6-debian.control Normal file
View File

@@ -0,0 +1,12 @@
Source: kddockwidgets
Section: Miscellaneous
Priority: optional
Maintainer: Allen Winter <allen.winter@kdab.com>
Build-Depends: debhelper (>=9), cdbs, cmake
Standards-Version: 3.9.6
Homepage: https://github.com/KDAB/KDDockWidgets
Package: qt6-kddockwidgets
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: KDAB's Dock Widget Framework for Qt

4
distro/qt6-debian.rules Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/make -f
DEB_CMAKE_EXTRA_FLAGS = -DKDDockWidgets_QT6=True -DCMAKE_BUILD_TYPE=Release
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk

View File

@@ -0,0 +1 @@
addFilter("E: shlib-policy-name-error")

View File

@@ -0,0 +1,10 @@
Format: 1.0
Source: kddockwidgets
Version: 1.5.0-1
Binary: kddockwidgets
Maintainer: Allen Winter <allen.winter@kdab.com>
Architecture: any
Build-Depends: debhelper (>=9), cdbs, cmake, qtbase6-dev, qtbase6-private-dev, libqt6x11extras5-dev, libfontconfig-dev
Files:
00000000000000000000000000000000 00000 qt6-kddockwidgets-1.5.0.tar.gz

View File

@@ -0,0 +1,107 @@
Name: qt6-kddockwidgets
Version: 1.5.0
Release: 1
Summary: KDAB's Dock Widget Framework for Qt6
Source0: %{name}-%{version}.tar.gz
Source1: %{name}-%{version}.tar.gz.asc
Source2: %{name}-rpmlintrc
URL: https://github.com/KDAB/KDDockWidgets
Group: System/Libraries
License: GPL-2.0-only OR GPL-3.0-only
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Vendor: Klaralvdalens Datakonsult AB (KDAB)
Packager: Klaralvdalens Datakonsult AB (KDAB) <info@kdab.com>
BuildRequires: cmake
%if %{defined suse_version}
BuildRequires: libqt6-qtbase-devel libqt6-qtbase-private-headers-devel libqt6-qtx11extras-devel
%endif
%if %{defined fedora}
BuildRequires: gcc-c++ qt6-qtbase-devel qt6-qtbase-private-devel desktop-file-utils libxkbcommon-devel
%endif
%if %{defined rhel}
BuildRequires: gcc-c++ qt6-qtbase-devel qt6-qtbase-private-devel qt6-qtx11extras-devel desktop-file-utils libxkbcommon-devel
%endif
%description
KDDockWidgets is a Qt dock widget library written by KDAB, suitable for replacing
QDockWidget and implementing advanced functionalities missing in Qt, including:
- Nesting dock widgets in a floating window and docking that group back to main window
- Docking to any main window, not only to the parent main window
- Docking to center of main window, or simply removing the concept of "central widget"
- Main window supporting detachable tabs in center widget
- Detaching arbitrary tabs from a tab bar into a dock area
- Exposing inner helper widgets so the user can customize them or provide his own
- Customize tab widgets
- Customize title bars
- Customize window frames
- Custom widget separators
...and much more
Authors:
--------
Klaralvdalens Datakonsult AB (KDAB) <info@kdab.com>
%define debug_package %{nil}
%global __debug_install_post %{nil}
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
This package contains header files and associated tools and libraries to
develop programs using kddockwidgets.
%prep
%autosetup
%build
cmake . -DCMAKE_INSTALL_PREFIX=/usr -DKDDockWidgets_QT6=True -DCMAKE_BUILD_TYPE=Release
%__make %{?_smp_mflags}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%install
%make_install
%clean
%__rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_prefix}/share/doc/KDDockWidgets-qt6
%{_libdir}/libkddockwidgets-qt6.so.*
%files devel
%defattr(-,root,root,-)
%dir %{_includedir}/kddockwidgets-qt6
%{_includedir}/kddockwidgets-qt6/kddockwidgets/*
%dir %{_libdir}/cmake/KDDockWidgets-qt6
%{_libdir}/cmake/KDDockWidgets-qt6/*
%{_libdir}/libkddockwidgets-qt6.so
#%{_prefix}/mkspecs/modules/* ECMGeneratePriFile isn't ported to Qt6 yet
%changelog
* Mon Nov 24 2021 Allen Winter <allen.winter@kdab.com> 1.5.0
1.5.0 final
* Fri Jul 16 2021 Allen Winter <allen.winter@kdab.com> 1.4.0
1.4.0 final
* Mon Jun 07 2021 Allen Winter <allen.winter@kdab.com> 1.3.1
1.3.1 final
* Mon Feb 08 2021 Allen Winter <allen.winter@kdab.com> 1.3.0
1.3.0 final
* Thu Dec 17 2020 Allen Winter <allen.winter@kdab.com> 1.2.0
1.2.0 final
* Fri Dec 11 2020 Allen Winter <allen.winter@kdab.com> 1.1.1
1.1.1 final
* Mon Oct 26 2020 Allen Winter <allen.winter@kdab.com> 1.1.0
1.1.0 final
* Wed Sep 02 2020 Allen Winter <allen.winter@kdab.com> 1.0.0
1.0.0 final
* Thu Aug 06 2020 Allen Winter <allen.winter@kdab.com> 0.99.9
1.0.0 release candidate

View File

@@ -9,17 +9,6 @@
# Contact KDAB at <info@kdab.com> for commercial licensing options. # Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
# qhelpgenerator
find_program(QHELPGEN_EXECUTABLE qhelpgenerator
HINTS ${QT_INSTALL_BINS}
)
if(QHELPGEN_EXECUTABLE)
set(HAVE_QHELPGEN "YES")
else()
set(HAVE_QHELPGEN "NO")
message(STATUS "Unable to generate the API documentation in qch format. To fix, install the qthelpgenerator program which comes with Qt5.")
endif()
# Doxygen # Doxygen
find_package(Doxygen) find_package(Doxygen)
set_package_properties(Doxygen PROPERTIES set_package_properties(Doxygen PROPERTIES
@@ -28,12 +17,6 @@ set_package_properties(Doxygen PROPERTIES
URL "https://www.doxygen.org" URL "https://www.doxygen.org"
PURPOSE "Needed to build the API documentation." PURPOSE "Needed to build the API documentation."
) )
if(DOXYGEN_DOT_EXECUTABLE)
set(HAVE_DOT "YES")
else()
set(HAVE_DOT "NO")
message(STATUS "Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org")
endif()
if(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
add_subdirectory(api) add_subdirectory(api)

Binary file not shown.

View File

@@ -9,10 +9,30 @@
# Contact KDAB at <info@kdab.com> for commercial licensing options. # Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
# dot should come with Doxygen find_package(Doxygen)
if(DOXYGEN_DOT_EXECUTABLE)
set(HAVE_DOT "YES")
else()
set(HAVE_DOT "NO")
message(STATUS "Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org")
endif()
# qhelpgenerator
find_program(QHELPGEN_EXECUTABLE qhelpgenerator
HINTS ${QT_INSTALL_BINS}
)
if(QHELPGEN_EXECUTABLE)
set(HAVE_QHELPGEN "YES")
else()
set(HAVE_QHELPGEN "NO")
message(STATUS "Unable to generate the API documentation in qch format. To fix, install the qthelpgenerator program which comes with Qt.")
endif()
find_file(QDOC_QTCORE_TAG qtcore.tags find_file(QDOC_QTCORE_TAG qtcore.tags
HINTS ${QT_INSTALL_DOCS}/qtcore HINTS ${QT_INSTALL_DOCS}/qtcore
HINTS ${QT_INSTALL_DATA}/doc/qtcore HINTS ${QT_INSTALL_DATA}/doc/qtcore
) )
set(QDOC_TAG_DIR "<QDOC_TAG_DIR_not_found>")
if(QDOC_QTCORE_TAG) if(QDOC_QTCORE_TAG)
get_filename_component(QDOC_TAG_DIR ${QDOC_QTCORE_TAG} DIRECTORY) get_filename_component(QDOC_TAG_DIR ${QDOC_QTCORE_TAG} DIRECTORY)
get_filename_component(QDOC_TAG_DIR ${QDOC_TAG_DIR} DIRECTORY) get_filename_component(QDOC_TAG_DIR ${QDOC_TAG_DIR} DIRECTORY)
@@ -32,9 +52,20 @@ add_custom_command(
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
#handle a bug in doxygen where image files referred to in markdown are not copied the output #handle a bug in doxygen where image files referred to in markdown are not copied the output
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../../screencap.gif ${DOXYGEN_OUTPUT_DIR}/html COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../../screencap.gif ${DOXYGEN_OUTPUT_DIR}/html
#copy some files by-hand that are referred to by the markdown README
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/README-bindings.md ${DOXYGEN_OUTPUT_DIR}/html
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOXYGEN_OUTPUT_DIR}/html/LICENSES
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/LICENSES/GPL-2.0-only.txt ${DOXYGEN_OUTPUT_DIR}/html/LICENSES
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/LICENSES/GPL-3.0-only.txt ${DOXYGEN_OUTPUT_DIR}/html/LICENSES
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOXYGEN_OUTPUT_DIR}/html/docs
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/docs/KDDockWidgets-CopyrightAssignmentForm.pdf ${DOXYGEN_OUTPUT_DIR}/html/docs
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/examples ${DOXYGEN_OUTPUT_DIR}/html/examples
DEPENDS ${_dox_deps} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile DEPENDS ${_dox_deps} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
) )
add_custom_target(kddockwidgets-api.qch ALL DEPENDS ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch) add_custom_target(kddockwidgets-api.qch ALL DEPENDS ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch)
add_custom_target(docs DEPENDS kddockwidgets-api.qch)
install(FILES ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch DESTINATION ${INSTALL_DOC_DIR}) set(QCH_INSTALL_DIR ${INSTALL_DOC_DIR} CACHE STRING "Install location of Qt Assistant help files.")
install(FILES ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch DESTINATION ${QCH_INSTALL_DIR})
install(FILES ${DOXYGEN_OUTPUT_DIR}/kddockwidgets.tags DESTINATION ${INSTALL_DOC_DIR})

View File

@@ -1,4 +1,4 @@
# Doxyfile 1.8.18 # Doxyfile 1.8.20
# This file describes the settings to be used by the documentation system # This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project. # doxygen (www.doxygen.org) for a project.
@@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places. # title of most generated pages and in a few other places.
# The default value is: My Project. # The default value is: My Project.
PROJECT_NAME = "KDDockWidgets API Documentation" PROJECT_NAME = "@PROJECT_NAME@ API Documentation"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This # The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # control system is used.
PROJECT_NUMBER = @KDDockWidgets_VERSION@ PROJECT_NUMBER = @KDDockWidgets_VERSION_MAJOR@.@KDDockWidgets_VERSION_MINOR@
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a
@@ -99,7 +99,7 @@ OUTPUT_LANGUAGE = English
# Possible values are: None, LTR, RTL and Context. # Possible values are: None, LTR, RTL and Context.
# The default value is: None. # The default value is: None.
#TOO NEW OUTPUT_TEXT_DIRECTION = None OUTPUT_TEXT_DIRECTION = None
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class # descriptions after the members that are listed in the file and class
@@ -205,7 +205,7 @@ JAVADOC_AUTOBRIEF = NO
# interpreted by doxygen. # interpreted by doxygen.
# The default value is: NO. # The default value is: NO.
#TOO NEW JAVADOC_BANNER = NO JAVADOC_BANNER = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If # line (until the first dot) of a Qt-style comment as the brief description. If
@@ -227,6 +227,14 @@ QT_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO MULTILINE_CPP_IS_BRIEF = NO
# By default Python docstrings are displayed as preformatted text and doxygen's
# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
# doxygen's special commands can be used and the contents of the docstring
# documentation blocks is shown as doxygen documentation.
# The default value is: YES.
PYTHON_DOCSTRING = YES
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements. # documentation from any documented member that it re-implements.
# The default value is: YES. # The default value is: YES.
@@ -261,7 +269,7 @@ TAB_SIZE = 8
# commands \{ and \} for these it is advised to use the version @{ and @} or use # commands \{ and \} for these it is advised to use the version @{ and @} or use
# a double escape (\\{ and \\}) # a double escape (\\{ and \\})
ALIASES = ALIASES = "reimp=Reimplemented for internal purposes.\n"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For # only. Doxygen will then generate output that is more tailored for C. For
@@ -297,7 +305,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
# separated into more groups, etc. # separated into more groups, etc.
# The default value is: NO. # The default value is: NO.
#TOO NEW: OPTIMIZE_OUTPUT_SLICE = NO OPTIMIZE_OUTPUT_SLICE = NO
# Doxygen selects the parser to use depending on the extension of the files it # Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given # parses. With this tag you can assign which parser to use for a given
@@ -336,7 +344,7 @@ MARKDOWN_SUPPORT = YES
# Minimum value: 0, maximum value: 99, default value: 5. # Minimum value: 0, maximum value: 99, default value: 5.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
#TOO NEW TOC_INCLUDE_HEADINGS = 5 TOC_INCLUDE_HEADINGS = 5
# When enabled doxygen tries to link words that correspond to documented # When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can # classes, or namespaces to their corresponding documentation. Such a link can
@@ -449,6 +457,19 @@ TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0 LOOKUP_CACHE_SIZE = 0
# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
# during processing. When set to 0 doxygen will based this on the number of
# cores available in the system. You can set it explicitly to a value larger
# than 0 to get more control over the balance between CPU load and processing
# speed. At this moment only the input processing can be done using multiple
# threads. Since this is still an experimental feature the default is set to 1,
# which efficively disables parallel processing. Please report any issues you
# encounter. Generating dot graphs in parallel is controlled by the
# DOT_NUM_THREADS setting.
# Minimum value: 0, maximum value: 32, default value: 1.
NUM_PROC_THREADS = 1
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Build related configuration options # Build related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -461,7 +482,7 @@ LOOKUP_CACHE_SIZE = 0
# normally produced when WARNINGS is set to YES. # normally produced when WARNINGS is set to YES.
# The default value is: NO. # The default value is: NO.
EXTRACT_ALL = NO EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation. # be included in the documentation.
@@ -473,7 +494,7 @@ EXTRACT_PRIVATE = NO
# methods of a class will be included in the documentation. # methods of a class will be included in the documentation.
# The default value is: NO. # The default value is: NO.
#TOO NEW EXTRACT_PRIV_VIRTUAL = NO EXTRACT_PRIV_VIRTUAL = NO
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation. # scope will be included in the documentation.
@@ -547,13 +568,13 @@ HIDE_IN_BODY_DOCS = YES
# will be excluded. Set it to YES to include the internal documentation. # will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO. # The default value is: NO.
INTERNAL_DOCS = YES INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES, upper-case letters are also # names in lower-case letters. If set to YES, upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ # allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows # in case and if your file system supports case sensitive file names. Windows
# (including Cygwin) ands Mac users are advised to set this option to NO. # (including Cygwin) and Mac users are advised to set this option to NO.
# The default value is: system dependent. # The default value is: system dependent.
CASE_SENSE_NAMES = YES CASE_SENSE_NAMES = YES
@@ -698,14 +719,14 @@ MAX_INITIALIZER_LINES = 30
# list will mention the files that were used to generate the documentation. # list will mention the files that were used to generate the documentation.
# The default value is: YES. # The default value is: YES.
SHOW_USED_FILES = NO SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View # will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified). # (if specified).
# The default value is: YES. # The default value is: YES.
SHOW_FILES = NO SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the # page. This will remove the Namespaces entry from the Quick Index and from the
@@ -823,7 +844,8 @@ WARN_LOGFILE = doxygen.log
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = @CMAKE_SOURCE_DIR@ INPUT = "@CMAKE_SOURCE_DIR@/README.md" \
"@CMAKE_SOURCE_DIR@/src"
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -851,12 +873,7 @@ INPUT_ENCODING = UTF-8
# *.vhdl, *.ucf, *.qsf and *.ice. # *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS = *.cpp \ FILE_PATTERNS = *.cpp \
*.cc \
*.cxx \
*.h \ *.h \
*.hh \
*.hxx \
*.hpp \
*.dox \ *.dox \
*.md \ *.md \
*.gif *.gif
@@ -874,8 +891,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is # Note that relative paths are relative to the directory from which doxygen is
# run. # run.
EXCLUDE = @CMAKE_SOURCE_DIR@/examples \ EXCLUDE =
@CMAKE_SOURCE_DIR@/src/private
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded # directories that are symbolic links (a Unix file system feature) are excluded
@@ -901,7 +917,9 @@ EXCLUDE_PATTERNS = */.svn/* \
*/test/* \ */test/* \
*/tests/* \ */tests/* \
*_p.cpp \ *_p.cpp \
*_export.h *_p.h \
*_export.h \
*/fwd_headers/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the # (namespaces, classes, functions, etc.) that should be excluded from the
@@ -925,7 +943,7 @@ EXAMPLE_PATH =
# *.h) to filter out the source-files in the directories. If left blank all # *.h) to filter out the source-files in the directories. If left blank all
# files are included. # files are included.
EXAMPLE_PATTERNS = * EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands # searched for input files to be used with the \include or \dontinclude commands
@@ -938,7 +956,8 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the # that contain images that are to be included in the documentation (see the
# \image command). # \image command).
IMAGE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@" \ IMAGE_PATH = "@CMAKE_SOURCE_DIR@/images" \
"@CMAKE_CURRENT_SOURCE_DIR@" \
"@CMAKE_SOURCE_DIR@/screencap.gif" "@CMAKE_SOURCE_DIR@/screencap.gif"
# The INPUT_FILTER tag can be used to specify a program that doxygen should # The INPUT_FILTER tag can be used to specify a program that doxygen should
@@ -1008,7 +1027,7 @@ USE_MDFILE_AS_MAINPAGE = "@CMAKE_SOURCE_DIR@/README.md"
# also VERBATIM_HEADERS is set to NO. # also VERBATIM_HEADERS is set to NO.
# The default value is: NO. # The default value is: NO.
SOURCE_BROWSER = NO SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body of functions, # Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation. # classes and enums directly into the documentation.
@@ -1027,13 +1046,13 @@ STRIP_CODE_COMMENTS = YES
# entity all documented functions referencing it will be listed. # entity all documented functions referencing it will be listed.
# The default value is: NO. # The default value is: NO.
REFERENCED_BY_RELATION = NO REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented function # If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed. # all documented entities called/used by that function will be listed.
# The default value is: NO. # The default value is: NO.
REFERENCES_RELATION = NO REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES then the hyperlinks from functions in REFERENCES_RELATION and # to YES then the hyperlinks from functions in REFERENCES_RELATION and
@@ -1081,7 +1100,39 @@ USE_HTAGS = NO
# See also: Section \class. # See also: Section \class.
# The default value is: YES. # The default value is: YES.
VERBATIM_HEADERS = NO VERBATIM_HEADERS = YES
# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
# cost of reduced performance. This can be particularly helpful with template
# rich C++ code for which doxygen's built-in parser lacks the necessary type
# information.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.
# The default value is: NO.
CLANG_ASSISTED_PARSING = NO
# If clang assisted parsing is enabled you can provide the compiler with command
# line options that you would normally use when invoking the compiler. Note that
# the include paths will already be set by doxygen for the files and directories
# specified with INPUT and INCLUDE_PATH.
# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
CLANG_OPTIONS =
# If clang assisted parsing is enabled you can provide the clang parser with the
# path to the directory containing a file called compile_commands.json. This
# file is the compilation database (see:
# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the
# options used when the source files were built. This is equivalent to
# specifying the "-p" option to a clang tool, such as clang-check. These options
# will then be passed to the parser. Any options specified with CLANG_OPTIONS
# will be added as well.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.
CLANG_DATABASE_PATH =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index # Configuration options related to the alphabetical class index
@@ -1099,7 +1150,7 @@ ALPHABETICAL_INDEX = YES
# Minimum value: 1, maximum value: 20, default value: 5. # Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 3 COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all classes will # In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
@@ -1247,7 +1298,7 @@ HTML_TIMESTAMP = YES
# The default value is: YES. # The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
#TOO NEW HTML_DYNAMIC_MENUS = YES HTML_DYNAMIC_MENUS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the # documentation will contain sections that can be hidden and shown after the
@@ -1348,7 +1399,7 @@ CHM_FILE =
HHC_LOCATION = HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated # The GENERATE_CHI flag controls if a separate .chi index file is generated
# (YES) or that it should be included in the master .chm file (NO). # (YES) or that it should be included in the main .chm file (NO).
# The default value is: NO. # The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES. # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
@@ -1389,7 +1440,7 @@ GENERATE_QHP = @HAVE_QHELPGEN@
# the HTML output folder. # the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES. # This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE = @DOXYGEN_OUTPUT_DIR@/qch/kddockwidgets-api.qch QCH_FILE = "@DOXYGEN_OUTPUT_DIR@/qch/kddockwidgets-api.qch"
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace # Project output. For more information please see Qt Help Project / Namespace
@@ -1397,7 +1448,7 @@ QCH_FILE = @DOXYGEN_OUTPUT_DIR@/qch/kddockwidgets-api.qch
# The default value is: org.doxygen.Project. # The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES. # This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = com.kdab.KDDockWidgets.api.@KDDockWidgets_VERSION@ QHP_NAMESPACE = com.kdab.@PROJECT_NAME@.api.@KDDockWidgets_VERSION@
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual # Help Project output. For more information please see Qt Help Project / Virtual
@@ -1406,7 +1457,7 @@ QHP_NAMESPACE = com.kdab.KDDockWidgets.api.@KDDockWidgets_VERSION@
# The default value is: doc. # The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES. # This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = KDDockWidgets-@KDDockWidgets_VERSION@ QHP_VIRTUAL_FOLDER = @PROJECT_NAME@-@KDDockWidgets_VERSION@
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom # filter to add. For more information please see Qt Help Project / Custom
@@ -1436,7 +1487,7 @@ QHP_SECT_FILTER_ATTRS =
# generated .qhp file. # generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES. # This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION = @QHELPGEN_EXECUTABLE@ QHG_LOCATION = "@QHELPGEN_EXECUTABLE@"
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To # generated, together with the HTML files, they form an Eclipse help plugin. To
@@ -1514,12 +1565,12 @@ EXT_LINKS_IN_WINDOW = NO
# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see # tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
# https://inkscape.org) to generate formulas as SVG images instead of PNGs for # https://inkscape.org) to generate formulas as SVG images instead of PNGs for
# the HTML output. These images will generally look nicer at scaled resolutions. # the HTML output. These images will generally look nicer at scaled resolutions.
# Possible values are: png The default and svg Looks nicer but requires the # Possible values are: png (the default) and svg (looks nicer but requires the
# pdf2svg tool. # pdf2svg or inkscape tool).
# The default value is: png. # The default value is: png.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
#TOO NEW HTML_FORMULA_FORMAT = png HTML_FORMULA_FORMAT = png
# Use this tag to change the font size of LaTeX formulas included as images in # Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful # the HTML documentation. When you change the font size after a successful
@@ -1545,7 +1596,7 @@ FORMULA_TRANSPARENT = YES
# to create new LaTeX commands to be used in formulas as building blocks. See # to create new LaTeX commands to be used in formulas as building blocks. See
# the section "Including formulas" for details. # the section "Including formulas" for details.
#TOO NEW FORMULA_MACROFILE = FORMULA_MACROFILE =
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# https://www.mathjax.org) which uses client side JavaScript for the rendering # https://www.mathjax.org) which uses client side JavaScript for the rendering
@@ -1709,7 +1760,7 @@ LATEX_OUTPUT = latex
# the output language. # the output language.
# This tag requires that the tag GENERATE_LATEX is set to YES. # This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX. # index for LaTeX.
@@ -1729,7 +1780,7 @@ MAKEINDEX_CMD_NAME = makeindex
# The default value is: makeindex. # The default value is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES. # This tag requires that the tag GENERATE_LATEX is set to YES.
#TOO NEW LATEX_MAKEINDEX_CMD = makeindex LATEX_MAKEINDEX_CMD = makeindex
# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some # documents. This may be useful for small projects and may help to save some
@@ -1815,13 +1866,15 @@ LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate # If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
# the PDF file directly from the LaTeX files. Set this option to YES, to get a # specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
# higher quality PDF documentation. # files. Set this option to YES, to get a higher quality PDF documentation.
#
# See also section LATEX_CMD_NAME for selecting the engine.
# The default value is: YES. # The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES. # This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running # command to the generated LaTeX files. This will instruct LaTeX to keep running
@@ -1871,7 +1924,7 @@ LATEX_TIMESTAMP = NO
# LATEX_OUTPUT directory will be used. # LATEX_OUTPUT directory will be used.
# This tag requires that the tag GENERATE_LATEX is set to YES. # This tag requires that the tag GENERATE_LATEX is set to YES.
#TOO NEW LATEX_EMOJI_DIRECTORY = LATEX_EMOJI_DIRECTORY =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the RTF output # Configuration options related to the RTF output
@@ -2015,7 +2068,7 @@ XML_PROGRAMLISTING = YES
# The default value is: NO. # The default value is: NO.
# This tag requires that the tag GENERATE_XML is set to YES. # This tag requires that the tag GENERATE_XML is set to YES.
#TOO NEW XML_NS_MEMB_FILE_SCOPE = NO XML_NS_MEMB_FILE_SCOPE = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output # Configuration options related to the DOCBOOK output
@@ -2111,7 +2164,7 @@ ENABLE_PREPROCESSING = YES
# The default value is: NO. # The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and # the macro expansion is limited to the macros specified with the PREDEFINED and
@@ -2177,7 +2230,7 @@ EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------O #---------------------------------------------------------------------------
# Configuration options related to external references # Configuration options related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -2194,15 +2247,17 @@ SKIP_FUNCTION_MACROS = YES
# the path). If a tag file is not located in the directory in which doxygen is # the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here. # run, you must also specify the path to the tagfile here.
TAGFILES = @QDOC_TAG_DIR@/qtcore/qtcore.tags=https://doc.qt.io/qt-5/ \ TAGFILES = "@QDOC_TAG_DIR@/qtcore/qtcore.tags=https://doc.qt.io/qt-5/" \
@QDOC_TAG_DIR@/qtgui/qtgui.tags=https://doc.qt.io/qt-5/ \ "@QDOC_TAG_DIR@/qtgui/qtgui.tags=https://doc.qt.io/qt-5/" \
@QDOC_TAG_DIR@/qtwidgets/qtwidgets.tags=https://doc.qt.io/qt-5/ "@QDOC_TAG_DIR@/qtwidgets/qtwidgets.tags=https://doc.qt.io/qt-5/" \
"@QDOC_TAG_DIR@/qtprintsupport/qtprintsupport.tags=https://doc.qt.io/qt-5/" \
"@QDOC_TAG_DIR@/qtxml/qtxml.tags=https://doc.qt.io/qt-5/"
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a # When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to # tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files. # external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE = kddockwidgets.tag GENERATE_TAGFILE = "@DOXYGEN_OUTPUT_DIR@/kddockwidgets.tags"
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in # If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be # the class index. If set to NO, only the inherited external classes will be
@@ -2403,7 +2458,7 @@ GRAPHICAL_HIERARCHY = YES
# The default value is: YES. # The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES. # This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = NO DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. For an explanation of the image formats see the section # generated by dot. For an explanation of the image formats see the section
@@ -2468,7 +2523,7 @@ PLANTUML_JAR_PATH =
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
# configuration file for plantuml. # configuration file for plantuml.
#TOO NEW PLANTUML_CFG_FILE = PLANTUML_CFG_FILE =
# When using plantuml, the specified paths are searched for files specified by # When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block. # the !include statement in a plantuml block.

View File

@@ -1,7 +1,7 @@
<hr> <hr>
<div style="float: left;"> <div style="float: left;">
<img src="kdab-logo-16x16.png"> <img src="kdab-logo-16x16.png">
<font style="font-weight: bold;">Klar&auml;lvdalens Datakonsult AB (KDAB)</font> <font style="font-weight: bold;">&copy; 2019-2021 Klar&auml;lvdalens Datakonsult AB (KDAB)</font>
<br> <br>
"The Qt, C++ and OpenGL Experts"<br> "The Qt, C++ and OpenGL Experts"<br>
<a href="https://www.kdab.com/">https://www.kdab.com/</a> <a href="https://www.kdab.com/">https://www.kdab.com/</a>
@@ -12,7 +12,8 @@
<font style="font-weight: bold;">KDDockWidgets</font> <font style="font-weight: bold;">KDDockWidgets</font>
<br> <br>
Advanced Dock Widget Framework for Qt<br> Advanced Dock Widget Framework for Qt<br>
<a href="https://www.kdab.com/development-resources/qt-tools/kddockwidgets/">https://www.kdab.com/development-resources/qt-tools/kddockwidgets/</a> <a href="https://www.kdab.com/development-resources/qt-tools/kddockwidgets/">https://www.kdab.com/development-resources/qt-tools/kddockwidgets/</a><br>
$generatedby doxygen $doxygenversion<br>
</div> </div>
</body> </body>

View File

@@ -10,8 +10,14 @@
*/ */
#include "MyFrameworkWidgetFactory.h" #include "MyFrameworkWidgetFactory.h"
#include "MyTitleBar_CSS.h"
#include <kddockwidgets/FrameworkWidgetFactory.h> #include <kddockwidgets/FrameworkWidgetFactory.h>
#include <kddockwidgets/private/TabWidget_p.h>
#include <kddockwidgets/private/widgets/FrameWidget_p.h>
#include <kddockwidgets/private/widgets/TabBarWidget_p.h>
#include <kddockwidgets/private/widgets/TabWidgetWidget_p.h>
#include <kddockwidgets/private/widgets/TitleBarWidget_p.h> #include <kddockwidgets/private/widgets/TitleBarWidget_p.h>
#include <kddockwidgets/private/multisplitter/Separator_qwidget.h> #include <kddockwidgets/private/multisplitter/Separator_qwidget.h>
@@ -84,11 +90,13 @@ MySeparator::~MySeparator() = default;
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const
{ {
// Feel free to return MyTitleBar_CSS here instead, but just for education purposes!
return new MyTitleBar(frame); return new MyTitleBar(frame);
} }
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::FloatingWindow *fw) const KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::FloatingWindow *fw) const
{ {
// Feel free to return MyTitleBar_CSS here instead, but just for education purposes!
return new MyTitleBar(fw); return new MyTitleBar(fw);
} }
@@ -96,4 +104,3 @@ Layouting::Separator * CustomWidgetFactory::createSeparator(Layouting::Widget *p
{ {
return new MySeparator(parent); return new MySeparator(parent);
} }

View File

@@ -12,6 +12,7 @@
#include "MyMainWindow.h" #include "MyMainWindow.h"
#include "MyWidget.h" #include "MyWidget.h"
#include <kddockwidgets/Config.h>
#include <kddockwidgets/LayoutSaver.h> #include <kddockwidgets/LayoutSaver.h>
#include <QMenu> #include <QMenu>
@@ -20,9 +21,7 @@
#include <QDebug> #include <QDebug>
#include <QString> #include <QString>
#include <QTextEdit> #include <QTextEdit>
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
#include <QRandomGenerator> #include <QRandomGenerator>
#endif
#include <QApplication> #include <QApplication>
@@ -33,12 +32,7 @@
static MyWidget *newMyWidget() static MyWidget *newMyWidget()
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
const int randomNumber = qrand() % 100 + 1;
#else
const int randomNumber = QRandomGenerator::global()->bounded(0, 100) + 1; const int randomNumber = QRandomGenerator::global()->bounded(0, 100) + 1;
#endif
if (randomNumber < 50) { if (randomNumber < 50) {
if (randomNumber < 33) { if (randomNumber < 33) {
return new MyWidget1(); return new MyWidget1();
@@ -52,24 +46,23 @@ static MyWidget *newMyWidget()
MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options, MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative, bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
bool maxSizeForDockWidget8, bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore,
const QString &affinityName, QWidget *parent) const QString &affinityName, QWidget *parent)
: MainWindow(uniqueName, options, parent) : MainWindow(uniqueName, options, parent)
, m_dockWidget0IsNonClosable(dockWidget0IsNonClosable) , m_dockWidget0IsNonClosable(dockWidget0IsNonClosable)
, m_dockWidget9IsNonDockable(nonDockableDockWidget9) , m_dockWidget9IsNonDockable(nonDockableDockWidget9)
, m_restoreIsRelative(restoreIsRelative) , m_restoreIsRelative(restoreIsRelative)
, m_maxSizeForDockWidget8(maxSizeForDockWidget8) , m_maxSizeForDockWidget8(maxSizeForDockWidget8)
, m_dockwidget5DoesntCloseBeforeRestore(dockwidget5DoesntCloseBeforeRestore)
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
qsrand(time(nullptr));
#endif
// qApp->installEventFilter(this);
auto menubar = menuBar(); auto menubar = menuBar();
auto fileMenu = new QMenu(QStringLiteral("File")); auto fileMenu = new QMenu(QStringLiteral("File"), this);
m_toggleMenu = new QMenu(QStringLiteral("Toggle")); m_toggleMenu = new QMenu(QStringLiteral("Toggle"), this);
auto miscMenu = new QMenu(QStringLiteral("Misc"), this);
menubar->addMenu(fileMenu); menubar->addMenu(fileMenu);
menubar->addMenu(m_toggleMenu); menubar->addMenu(m_toggleMenu);
menubar->addMenu(miscMenu);
QAction *newAction = fileMenu->addAction(QStringLiteral("New DockWidget")); QAction *newAction = fileMenu->addAction(QStringLiteral("New DockWidget"));
@@ -113,8 +106,19 @@ MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowO
auto quitAction = fileMenu->addAction(QStringLiteral("Quit")); auto quitAction = fileMenu->addAction(QStringLiteral("Quit"));
connect(quitAction, &QAction::triggered, qApp, &QApplication::quit); connect(quitAction, &QAction::triggered, qApp, &QApplication::quit);
QAction *toggleDropIndicatorSupport = miscMenu->addAction(QStringLiteral("Toggle Drop Indicator Support"));
toggleDropIndicatorSupport->setCheckable(true);
toggleDropIndicatorSupport->setChecked(true);
connect(toggleDropIndicatorSupport, &QAction::toggled, this, [](bool checked) {
KDDockWidgets::Config::self().setDropIndicatorsInhibited(!checked);
});
setAffinities({ affinityName }); setAffinities({ affinityName });
createDockWidgets(); createDockWidgets();
if (options & KDDockWidgets::MainWindowOption_HasCentralWidget) {
setPersistentCentralWidget(new MyWidget1());
}
} }
MyMainWindow::~MyMainWindow() MyMainWindow::~MyMainWindow()
@@ -133,7 +137,6 @@ void MyMainWindow::createDockWidgets()
for (int i = 0; i < numDockWidgets; i++) for (int i = 0; i < numDockWidgets; i++)
m_dockwidgets << newDockWidget(); m_dockwidgets << newDockWidget();
// MainWindow::addDockWidget() attaches a dock widget to the main window: // MainWindow::addDockWidget() attaches a dock widget to the main window:
addDockWidget(m_dockwidgets.at(0), KDDockWidgets::Location_OnTop); addDockWidget(m_dockwidgets.at(0), KDDockWidgets::Location_OnTop);
@@ -164,13 +167,18 @@ KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
// Passing options is optional, we just want to illustrate Option_NotClosable here // Passing options is optional, we just want to illustrate Option_NotClosable here
KDDockWidgets::DockWidget::Options options = KDDockWidgets::DockWidget::Option_None; KDDockWidgets::DockWidget::Options options = KDDockWidgets::DockWidget::Option_None;
KDDockWidgets::DockWidget::LayoutSaverOptions layoutSaverOptions = KDDockWidgets::DockWidget::LayoutSaverOption::None;
if (count == 0 && m_dockWidget0IsNonClosable) if (count == 0 && m_dockWidget0IsNonClosable)
options |= KDDockWidgets::DockWidget::Option_NotClosable; options |= KDDockWidgets::DockWidget::Option_NotClosable;
if (count == 9 && m_dockWidget9IsNonDockable) if (count == 9 && m_dockWidget9IsNonDockable)
options |= KDDockWidgets::DockWidget::Option_NotDockable; options |= KDDockWidgets::DockWidget::Option_NotDockable;
auto dock = new KDDockWidgets::DockWidget(QStringLiteral("DockWidget #%1").arg(count), options); if (count == 5 && m_dockwidget5DoesntCloseBeforeRestore)
layoutSaverOptions |= KDDockWidgets::DockWidget::LayoutSaverOption::Skip;
auto dock = new KDDockWidgets::DockWidget(QStringLiteral("DockWidget #%1").arg(count), options, layoutSaverOptions);
dock->setAffinities(affinities()); // optional, just to show the feature. Pass -mi to the example to see incompatible dock widgets dock->setAffinities(affinities()); // optional, just to show the feature. Pass -mi to the example to see incompatible dock widgets
if (count == 1) if (count == 1)
@@ -192,6 +200,7 @@ KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
dock->resize(600, 600); dock->resize(600, 600);
m_toggleMenu->addAction(dock->toggleAction()); m_toggleMenu->addAction(dock->toggleAction());
dock->toggleAction()->setShortcut(QStringLiteral("ctrl+%1").arg(count));
count++; count++;
return dock; return dock;

View File

@@ -20,7 +20,7 @@ class MyMainWindow : public KDDockWidgets::MainWindow
public: public:
explicit MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options, explicit MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative, bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
bool maxSizeForDockWidget8, bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore,
const QString &affinityName = {}, // Usually not needed. Just here to show the feature. const QString &affinityName = {}, // Usually not needed. Just here to show the feature.
QWidget *parent = nullptr); QWidget *parent = nullptr);
~MyMainWindow() override; ~MyMainWindow() override;
@@ -33,5 +33,6 @@ private:
const bool m_dockWidget9IsNonDockable; const bool m_dockWidget9IsNonDockable;
const bool m_restoreIsRelative; const bool m_restoreIsRelative;
const bool m_maxSizeForDockWidget8; const bool m_maxSizeForDockWidget8;
const bool m_dockwidget5DoesntCloseBeforeRestore;
KDDockWidgets::DockWidget::List m_dockwidgets; KDDockWidgets::DockWidget::List m_dockwidgets;
}; };

View File

@@ -0,0 +1,86 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#ifndef EXAMPLETITLEBAR_CSS_H
#define EXAMPLETITLEBAR_CSS_H
#pragma once
#include <kddockwidgets/private/widgets/TitleBarWidget_p.h>
/**
* @brief Shows how to implement a custom titlebar which uses "Qt StyleSheets".
*
* Derive from KDDockWidgets::DefaultWidgetFactory and override the two createTitleBar() methods.
*
* To try it out, modify examples/dockwidgets/MyFrameworkWidgetFactory.cpp to return a MyTitleBar_CSS instance.
* Run the example with: ./bin/kddockwidgets_example -p
*
* WARNINGS:
* - Qt StyleSheets are not recommended for new applications. Often you are able to style 90% of
* the application but then hit a road block. QStyle is much more powerful and flexible.
* - The Qt maintainers have manifested intention to deprecated stylesheets.
* - Stylesheets are supported for built-in QWidgets (QPushButton, QComboBox, etc.), any widget
* that's not in Qt needs to be crafted by the user, that includes, for example, having to paint
* your background manually. KDDockWidget::TitleBarWidget does this for your convenience though.
* - Qt stylesheets don't react to property changes (known old bug in Qt), for example:
* QLineEdit[readOnly="true"] { color: gray }
* this won't trigger when readOnly changes to false, you need to set/unset. This is QTBUG-51236
* - KDDockWidgets::TitleBarWidget::isFocused is a property, there for needs to workaround the
* above bug by unsetting the sheet and setting it again.
*/
class MyTitleBar_CSS : public KDDockWidgets::TitleBarWidget
{
public:
explicit MyTitleBar_CSS(KDDockWidgets::Frame *frame)
: KDDockWidgets::TitleBarWidget(frame)
{
init();
}
explicit MyTitleBar_CSS(KDDockWidgets::FloatingWindow *fw)
: KDDockWidgets::TitleBarWidget(fw)
{
init();
}
~MyTitleBar_CSS() override;
void initStyleSheet()
{
// Or use qApp->setStyleSheet(), as you prefer
setStyleSheet(QStringLiteral("KDDockWidgets--TitleBarWidget {"
"background: blue"
"}"
"KDDockWidgets--TitleBarWidget:hover {"
"background: red"
"}"
"KDDockWidgets--TitleBarWidget[isFocused=true] {"
"background: green"
"}"));
}
void init()
{
initStyleSheet();
connect(this, &KDDockWidgets::TitleBar::isFocusedChanged, this, [this] {
// Workaround QTBUG-51236, this makes the [isFocused=true] syntax useful
setStyleSheet(QString());
initStyleSheet();
});
}
};
MyTitleBar_CSS::~MyTitleBar_CSS()
{
}
#endif

View File

@@ -111,6 +111,26 @@ int main(int argc, char **argv)
QCommandLineOption autoHideSupport("w", QCoreApplication::translate("main", "Enables auto-hide/minimization to side-bar support")); QCommandLineOption autoHideSupport("w", QCoreApplication::translate("main", "Enables auto-hide/minimization to side-bar support"));
parser.addOption(autoHideSupport); parser.addOption(autoHideSupport);
QCommandLineOption closeOnlyCurrentTab("close-only-current-tab",
QCoreApplication::translate("main", "The title bar's close button will only close the current tab instead of all. Illustrates using Config::Flag_CloseOnlyCurrentTab"));
parser.addOption(closeOnlyCurrentTab);
QCommandLineOption dontCloseBeforeRestore("dont-close-widget-before-restore", //krazy:exclude=spelling
QCoreApplication::translate("main", "DockWidget #5 won't be closed before a restore. Illustrates LayoutSaverOption::DontCloseBeforeRestore"));
parser.addOption(dontCloseBeforeRestore);
QCommandLineOption showButtonsInTabBarIfTitleBarHidden("show-buttons-in-tabbar-if-titlebar-hidden",
QCoreApplication::translate("main", "If we're not using title bars we'll still show the close and float button in the tab bar"));
parser.addOption(showButtonsInTabBarIfTitleBarHidden);
QCommandLineOption centralWidget("central-widget",
QCoreApplication::translate("main", "The main window will have a non-detachable central widget"));
parser.addOption(centralWidget);
QCommandLineOption ctxtMenuOnTabs("allow-switch-tabs-via-menu",
QCoreApplication::translate("main", "Allow switching tabs via context menu in tabs area"));
parser.addOption(ctxtMenuOnTabs);
#if defined(DOCKS_DEVELOPER_MODE) #if defined(DOCKS_DEVELOPER_MODE)
parser.addOption(centralFrame); parser.addOption(centralFrame);
@@ -152,6 +172,9 @@ int main(int argc, char **argv)
options = parser.isSet(centralFrame) ? MainWindowOption_HasCentralFrame options = parser.isSet(centralFrame) ? MainWindowOption_HasCentralFrame
: MainWindowOption_None; : MainWindowOption_None;
if (parser.isSet(centralWidget))
options |= MainWindowOption_HasCentralWidget;
if (parser.isSet(noQtTool)) if (parser.isSet(noQtTool))
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows; internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows;
@@ -177,6 +200,12 @@ int main(int argc, char **argv)
if (parser.isSet(autoHideSupport)) if (parser.isSet(autoHideSupport))
flags |= Config::Flag_AutoHideSupport; flags |= Config::Flag_AutoHideSupport;
if (parser.isSet(closeOnlyCurrentTab))
flags |= Config::Flag_CloseOnlyCurrentTab;
if (parser.isSet(showButtonsInTabBarIfTitleBarHidden))
flags |= Config::Flag_ShowButtonsOnTabBarIfTitleBarHidden;
if (parser.isSet(noTitleBars)) if (parser.isSet(noTitleBars))
flags |= KDDockWidgets::Config::Flag_HideTitleBarWhenTabsVisible; flags |= KDDockWidgets::Config::Flag_HideTitleBarWhenTabsVisible;
@@ -212,6 +241,9 @@ int main(int argc, char **argv)
if (parser.isSet(tabsHaveCloseButton)) if (parser.isSet(tabsHaveCloseButton))
flags |= KDDockWidgets::Config::Flag_TabsHaveCloseButton; flags |= KDDockWidgets::Config::Flag_TabsHaveCloseButton;
if (parser.isSet(ctxtMenuOnTabs))
flags |= KDDockWidgets::Config::Flag_AllowSwitchingTabsViaMenu;
if (parser.isSet(doubleClickMaximize)) if (parser.isSet(doubleClickMaximize))
flags |= KDDockWidgets::Config::Flag_DoubleClickMaximizes; flags |= KDDockWidgets::Config::Flag_DoubleClickMaximizes;
@@ -227,6 +259,7 @@ int main(int argc, char **argv)
const bool restoreIsRelative = parser.isSet(relativeRestore); const bool restoreIsRelative = parser.isSet(relativeRestore);
const bool nonDockableDockWidget9 = parser.isSet(nonDockable); const bool nonDockableDockWidget9 = parser.isSet(nonDockable);
const bool maxSizeForDockWidget8 = parser.isSet(maxSizeOption); const bool maxSizeForDockWidget8 = parser.isSet(maxSizeOption);
const bool dontCloseDockWidget5BeforeRestore = parser.isSet(dontCloseBeforeRestore);
const bool usesMainWindowsWithAffinity = parser.isSet(multipleMainWindows); const bool usesMainWindowsWithAffinity = parser.isSet(multipleMainWindows);
#ifdef KDDOCKWIDGETS_SUPPORTS_NESTED_MAINWINDOWS #ifdef KDDOCKWIDGETS_SUPPORTS_NESTED_MAINWINDOWS
@@ -236,7 +269,8 @@ int main(int argc, char **argv)
#endif #endif
MyMainWindow mainWindow(QStringLiteral("MyMainWindow"), options, nonClosableDockWidget0, MyMainWindow mainWindow(QStringLiteral("MyMainWindow"), options, nonClosableDockWidget0,
nonDockableDockWidget9, restoreIsRelative, maxSizeForDockWidget8); nonDockableDockWidget9, restoreIsRelative, maxSizeForDockWidget8,
dontCloseDockWidget5BeforeRestore);
mainWindow.setWindowTitle("Main Window 1"); mainWindow.setWindowTitle("Main Window 1");
mainWindow.resize(1200, 1200); mainWindow.resize(1200, 1200);
mainWindow.show(); mainWindow.show();
@@ -254,7 +288,8 @@ int main(int argc, char **argv)
auto mainWindow2 = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options, auto mainWindow2 = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
nonClosableDockWidget0, nonDockableDockWidget9, nonClosableDockWidget0, nonDockableDockWidget9,
restoreIsRelative, maxSizeForDockWidget8, affinity); restoreIsRelative, maxSizeForDockWidget8,
dontCloseDockWidget5BeforeRestore, affinity);
if (affinity.isEmpty()) if (affinity.isEmpty())
mainWindow2->setWindowTitle("Main Window 2"); mainWindow2->setWindowTitle("Main Window 2");
else else
@@ -267,7 +302,8 @@ int main(int argc, char **argv)
const QString affinity = QStringLiteral("Inner-DockWidgets-2"); const QString affinity = QStringLiteral("Inner-DockWidgets-2");
auto dockableMainWindow = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options, auto dockableMainWindow = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
false, false, restoreIsRelative, false, affinity); false, false, restoreIsRelative, false,
false, affinity);
dockableMainWindow->setAffinities({ affinity }); dockableMainWindow->setAffinities({ affinity });

View File

@@ -0,0 +1,37 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
cmake_minimum_required(VERSION 3.7)
project(kddockwidgets_minimal_mdi_example)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIRS ON)
if(NOT TARGET kddockwidgets)
# This will look for Qt, do find_package yourself manually before
# if you want to look for a specific Qt version for instance.
find_package(KDDockWidgets REQUIRED)
endif()
set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/resources_example.qrc)
add_executable(kddockwidgets_minimal_mdi_example
main.cpp
../dockwidgets/MyWidget.cpp
${RESOURCES_EXAMPLE_SRC}
)
target_link_libraries(kddockwidgets_minimal_mdi_example
PRIVATE
KDAB::kddockwidgets
)

View File

@@ -0,0 +1,116 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyWidget.h"
#include <QPainter>
#include <QDebug>
#include <QFile>
#include <QLineEdit>
static QHash<QString, QImage> s_images; /// clazy:exclude=non-pod-global-static
MyWidget::MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent)
: QWidget(parent)
{
if (!backgroundFile.isEmpty()) {
auto it = s_images.find(backgroundFile);
if (it == s_images.end())
it = s_images.insert(backgroundFile, QImage(backgroundFile));
m_background = it.value();
}
if (!logoFile.isEmpty()) {
auto it = s_images.find(logoFile);
if (it == s_images.end())
it = s_images.insert(logoFile, QImage(logoFile));
m_logo = it.value();
}
setFocusPolicy(Qt::StrongFocus);
#if 0
// Uncomment to show focus propagation working
new QLineEdit(this);
auto l2 = new QLineEdit(this);
l2->move(0, 100);
setFocusProxy(l2);
#endif
}
MyWidget::~MyWidget()
{
}
void MyWidget::drawLogo(QPainter &p)
{
if (m_logo.isNull())
return;
const qreal ratio = m_logo.height() / (m_logo.width() * 1.0);
const int maxWidth = int(0.80 * size().width());
const int maxHeight = int(0.80 * size().height());
const int proposedHeight = int(maxWidth * ratio);
const int width = proposedHeight <= maxHeight ? maxWidth
: int(maxHeight / ratio);
const int height = int(width * ratio);
QRect targetLogoRect(0,0, width, height);
targetLogoRect.moveCenter(rect().center() + QPoint(0, -int(size().height() * 0.00)));
p.drawImage(targetLogoRect, m_logo, m_logo.rect());
}
MyWidget1::MyWidget1(MyWidget::QWidget *parent)
: MyWidget(QStringLiteral(":/assets/triangles.png"), QStringLiteral(":/assets/KDAB_bubble_white.png"), parent)
{
}
void MyWidget1::paintEvent(QPaintEvent *)
{
QPainter p(this);
p.fillRect(rect(), QColor(0xCC, 0xCC, 0xCC));
p.drawImage(m_background.rect(), m_background, m_background.rect());
drawLogo(p);
}
MyWidget2::MyWidget2(MyWidget::QWidget *parent)
: MyWidget(QString(), QStringLiteral(":/assets/KDAB_bubble_blue.png"), parent)
{
}
void MyWidget2::paintEvent(QPaintEvent *)
{
QPainter p(this);
p.fillRect(rect(), Qt::white);
drawLogo(p);
}
MyWidget3::MyWidget3(MyWidget::QWidget *parent)
: MyWidget(QStringLiteral(":/assets/base.png"), QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"), parent)
, m_triangle(QImage(QStringLiteral(":/assets/tri.png")))
{
}
void MyWidget3::paintEvent(QPaintEvent *)
{
QPainter p(this);
p.fillRect(rect(), QColor(0xD5, 0xD5, 0xD5));
p.drawImage(m_background.rect(), m_background, m_background.rect());
const QRect targetRect = QRect({ width() - m_triangle.width(), height() - m_triangle.height() }, m_triangle.size());
p.drawImage(targetRect, m_triangle, m_triangle.rect());
drawLogo(p);
}

View File

@@ -0,0 +1,65 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#ifndef EXAMPLEDOCKABLEWIDGET_H
#define EXAMPLEDOCKABLEWIDGET_H
#pragma once
#include <QWidget>
QT_BEGIN_NAMESPACE
class QPainter;
QT_END_NAMESPACE
class MyWidget : public QWidget
{
Q_OBJECT
public:
MyWidget() = default;
explicit MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent = nullptr);
~MyWidget();
protected:
void drawLogo(QPainter &);
QImage m_background;
QImage m_logo;
};
class MyWidget1 : public MyWidget
{
Q_OBJECT
public:
explicit MyWidget1(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent*) override;
};
class MyWidget2 : public MyWidget
{
Q_OBJECT
public:
explicit MyWidget2(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent*) override;
};
class MyWidget3 : public MyWidget
{
Q_OBJECT
public:
explicit MyWidget3(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent*) override;
QImage m_triangle;
};
#endif

View File

@@ -0,0 +1,62 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyWidget.h"
#include <kddockwidgets/DockWidget.h>
#include <kddockwidgets/MainWindowMDI.h>
#include <QStyleFactory>
#include <QApplication>
// clazy:excludeall=qstring-allocations
int main(int argc, char **argv)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication app(argc, argv);
app.setOrganizationName(QStringLiteral("KDAB"));
app.setApplicationName(QStringLiteral("Test app"));
// Fusion looks better in general, but feel free to change
qApp->setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
// # 1. Create our main window
KDDockWidgets::MainWindowMDI mainWindow(QStringLiteral("MyMainWindow"));
mainWindow.setWindowTitle("Main Window");
mainWindow.resize(1200, 1200);
mainWindow.show();
// # 2. Create a dock widget, it needs a unique name
auto dock1 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock1"));
auto widget1 = new MyWidget1();
dock1->setWidget(widget1);
auto dock2 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock2"));
auto widget2 = new MyWidget2();
dock2->setWidget(widget2);
auto dock3 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock3"));
auto widget3 = new MyWidget3();
dock3->setWidget(widget3);
// # 3. Dock them
mainWindow.addDockWidget(dock1, QPoint(10, 10));
mainWindow.addDockWidget(dock2, QPoint(50, 50));
mainWindow.addDockWidget(dock3, QPoint(90, 90));
return app.exec();
}

View File

@@ -10,6 +10,8 @@
add_subdirectory(customtitlebar) add_subdirectory(customtitlebar)
add_subdirectory(dockwidgets) add_subdirectory(dockwidgets)
add_subdirectory(mdi)
set_compiler_flags(kddockwidgets_example_quick) set_compiler_flags(kddockwidgets_example_quick)
set_compiler_flags(kddockwidgets_example_mdi_quick)
set_compiler_flags(kddockwidgets_customtitlebar_quick) set_compiler_flags(kddockwidgets_customtitlebar_quick)

View File

@@ -17,6 +17,7 @@
#include <QQuickView> #include <QQuickView>
#include <QGuiApplication> #include <QGuiApplication>
#include <QQmlApplicationEngine>
class CustomFrameworkWidgetFactory : public KDDockWidgets::DefaultWidgetFactory class CustomFrameworkWidgetFactory : public KDDockWidgets::DefaultWidgetFactory
{ {
@@ -45,15 +46,11 @@ int main(int argc, char *argv[])
config.setFlags(flags); config.setFlags(flags);
config.setFrameworkWidgetFactory(new CustomFrameworkWidgetFactory()); config.setFrameworkWidgetFactory(new CustomFrameworkWidgetFactory());
QQuickView view; QQmlApplicationEngine appEngine;
view.setObjectName("MainWindow QQuickView"); KDDockWidgets::Config::self().setQmlEngine(&appEngine);
KDDockWidgets::Config::self().setQmlEngine(view.engine()); appEngine.load((QUrl("qrc:/main.qml")));
view.resize(1000, 800);
view.show();
view.setResizeMode(QQuickView::SizeRootObjectToView);
auto dw1 = new KDDockWidgets::DockWidgetQuick("Dock #1"); auto dw1 = new KDDockWidgets::DockWidgetQuick("Dock #1");
view.setSource(QUrl("qrc:/main.qml"));
dw1->setWidget(QStringLiteral("qrc:/Guest1.qml")); dw1->setWidget(QStringLiteral("qrc:/Guest1.qml"));
dw1->resize(QSize(800, 800)); dw1->resize(QSize(800, 800));

View File

@@ -10,14 +10,18 @@
*/ */
import QtQuick 2.6 import QtQuick 2.6
import QtQuick.Controls 2.12
import com.kdab.dockwidgets 1.0 as KDDW import com.kdab.dockwidgets 1.0 as KDDW
KDDW.MainWindow { ApplicationWindow {
id: root visible: true
width: 1000
height: 800
KDDW.MainWindowLayout {
id: dockWidgetArea
anchors.fill: parent
Component.onCompleted: { uniqueName: "MyMainLayout"
root.init("MyWindowName-1");
} }
} }

View File

@@ -10,38 +10,10 @@
*/ */
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 2.12
import com.kdab.dockwidgets 1.0 as KDDW import com.kdab.dockwidgets 1.0 as KDDW
Guest { Guest {
anchors.fill: parent anchors.fill: parent
background: "qrc:/assets/triangles.png" background: "qrc:/assets/triangles.png"
logo: "qrc:/assets/KDAB_bubble_white.png" logo: "qrc:/assets/KDAB_bubble_white.png"
KDDW.DockWidget {
id: another
uniqueName: "another1"
source: ":/Another.qml"
}
Button {
text: "Toggle Another"
anchors {
bottom: parent.bottom
left: parent.left
margins: 5
}
onClicked: {
if (another.dockWidget.visible) {
another.dockWidget.close();
} else {
another.dockWidget.show();
}
}
}
} }

View File

@@ -15,7 +15,7 @@
#include <kddockwidgets/private/DockRegistry_p.h> #include <kddockwidgets/private/DockRegistry_p.h>
#include <kddockwidgets/FrameworkWidgetFactory.h> #include <kddockwidgets/FrameworkWidgetFactory.h>
#include <QQuickView> #include <QQmlApplicationEngine>
#include <QGuiApplication> #include <QGuiApplication>
#include <QCommandLineParser> #include <QCommandLineParser>
@@ -23,6 +23,10 @@ int main(int argc, char *argv[])
{ {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QGuiApplication::setAttribute(Qt::AA_UseOpenGLES); QGuiApplication::setAttribute(Qt::AA_UseOpenGLES);
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif #endif
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
QCommandLineParser parser; QCommandLineParser parser;
@@ -69,20 +73,22 @@ int main(int argc, char *argv[])
internalFlags |= KDDockWidgets::Config::InternalFlag_NoAeroSnap; internalFlags |= KDDockWidgets::Config::InternalFlag_NoAeroSnap;
# endif # endif
// These are debug-only/development flags, which you can ignore.
KDDockWidgets::Config::self().setInternalFlags(internalFlags); KDDockWidgets::Config::self().setInternalFlags(internalFlags);
#endif #endif
// Set any required flags. The defaults are usually fine.
KDDockWidgets::Config::self().setFlags(flags); KDDockWidgets::Config::self().setFlags(flags);
QQuickView view; // Create your engine which loads main.qml. A simple QQuickView would work too.
view.setObjectName("MainWindow QQuickView"); QQmlApplicationEngine appEngine;
KDDockWidgets::Config::self().setQmlEngine(view.engine()); KDDockWidgets::Config::self().setQmlEngine(&appEngine);
view.resize(1000, 800); appEngine.load((QUrl("qrc:/main.qml")));
view.show();
view.setResizeMode(QQuickView::SizeRootObjectToView); // Below we illustrate usage of our C++ API. Alternative you can use declarative API.
// See main.qml for examples of dockwidgets created directly in QML
auto dw1 = new KDDockWidgets::DockWidgetQuick("Dock #1"); auto dw1 = new KDDockWidgets::DockWidgetQuick("Dock #1");
view.setSource(QUrl("qrc:/main.qml"));
dw1->setWidget(QStringLiteral("qrc:/Guest1.qml")); dw1->setWidget(QStringLiteral("qrc:/Guest1.qml"));
dw1->resize(QSize(800, 800)); dw1->resize(QSize(800, 800));

View File

@@ -10,14 +10,130 @@
*/ */
import QtQuick 2.6 import QtQuick 2.6
import QtQuick.Controls 2.12
import com.kdab.dockwidgets 1.0 as KDDW import com.kdab.dockwidgets 1.0 as KDDW
KDDW.MainWindow { ApplicationWindow {
id: root visible: true
width: 1000
height: 800
menuBar: MenuBar {
Menu {
title: qsTr("&File")
Action {
text: qsTr("Save layout")
onTriggered: {
layoutSaver.saveToFile("mySavedLayout.json");
}
}
Action {
text: qsTr("Restore layout")
onTriggered: {
layoutSaver.restoreFromFile("mySavedLayout.json");
}
}
Action {
text: qsTr("Toggle widget #4")
onTriggered: {
toggleDockWidget(dock4);
}
}
Action {
text: qsTr("Toggle widget #5")
onTriggered: {
toggleDockWidget(dock5);
}
}
Action {
text: qsTr("Toggle widget #6")
onTriggered: {
toggleDockWidget(dock6);
}
}
Action {
text: qsTr("Close All")
onTriggered: {
_kddwDockRegistry.clear();
}
}
MenuSeparator { }
Action { text: qsTr("&Quit")
onTriggered: {
Qt.quit();
}
}
}
}
KDDW.MainWindowLayout {
anchors.fill: parent
// Each main layout needs a unique id
uniqueName: "MainLayout-1"
Repeater {
model: 3
KDDW.DockWidget {
uniqueName: "fromRepeater-" + index
source: ":/Another.qml"
}
}
KDDW.DockWidget {
id: dock4
uniqueName: "dock4" // Each dock widget needs a unique id
source: ":/Another.qml"
}
KDDW.DockWidget {
id: dock5
uniqueName: "dock5"
Rectangle {
id: guest
color: "pink"
}
}
KDDW.DockWidget {
id: dock6
uniqueName: "dock6"
Rectangle {
color: "black"
}
}
Component.onCompleted: { Component.onCompleted: {
root.init("MyWindowName-1"); // Add dock4 to the Bottom location
addDockWidget(dock4, KDDW.KDDockWidgets.Location_OnBottom);
// Add dock5 to the left of dock4
addDockWidget(dock5, KDDW.KDDockWidgets.Location_OnRight, dock4);
// Adds dock6 but specifies a preferred initial size and it starts hidden
// When toggled it will be shown on the desired dock location.
// See MainWindowInstantiator_p.h for the API
addDockWidget(dock6, KDDW.KDDockWidgets.Location_OnLeft, null,
Qt.size(500, 100), KDDW.KDDockWidgets.StartHidden);
} }
} }
KDDW.LayoutSaver {
id: layoutSaver
}
function toggleDockWidget(dw) {
if (dw.dockWidget.isOpen()) {
dw.dockWidget.close();
} else {
dw.dockWidget.show();
}
}
}

View File

@@ -0,0 +1,18 @@
/*
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.
*/
import QtQuick 2.9
Rectangle {
id: root
color: "green"
anchors.fill: parent
}

View File

@@ -0,0 +1,37 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
cmake_minimum_required(VERSION 3.7)
project(kddockwidgets_example_mdi_quick)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIRS ON)
if(NOT TARGET kddockwidgets)
# This will look for Qt, do find_package yourself manually before
# if you want to look for a specific Qt version for instance.
find_package(KDDockWidgets REQUIRED)
endif()
set(RESOURCES_EXAMPLE_SRC
${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_mdi_example.qrc
${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc)
add_executable(kddockwidgets_example_mdi_quick
main.cpp
${RESOURCES_EXAMPLE_SRC}
)
target_link_libraries(kddockwidgets_example_mdi_quick
PRIVATE
KDAB::kddockwidgets
)

View File

@@ -0,0 +1,37 @@
/*
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.
*/
import QtQuick 2.9
Rectangle {
color: "white"
anchors.fill: parent
property alias background: background.source
property alias logo: logo.source
Image {
id: background
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
Image {
id: logo
fillMode: Image.PreserveAspectFit
anchors {
fill: parent
margins: 50
}
}
}
}

View File

@@ -0,0 +1,44 @@
/*
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.
*/
import QtQuick 2.9
import QtQuick.Controls 2.12
import com.kdab.dockwidgets 1.0 as KDDW
Guest {
anchors.fill: parent
background: "qrc:/assets/triangles.png"
logo: "qrc:/assets/KDAB_bubble_white.png"
KDDW.DockWidget {
id: another
uniqueName: "another1"
source: ":/Another.qml"
}
Button {
text: "Toggle Another"
anchors {
bottom: parent.bottom
left: parent.left
margins: 5
}
onClicked: {
if (another.dockWidget.visible) {
another.dockWidget.close();
} else {
another.dockWidget.show();
}
}
}
}

View File

@@ -0,0 +1,17 @@
/*
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.
*/
import QtQuick 2.9
Guest {
anchors.fill: parent
logo: "qrc:/assets/KDAB_bubble_blue.png"
}

View File

@@ -0,0 +1,18 @@
/*
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.
*/
import QtQuick 2.9
Guest {
anchors.fill: parent
background: "qrc:/assets/base.png"
logo: "qrc:/assets/KDAB_bubble_fulcolor.png"
}

View File

@@ -0,0 +1,59 @@
/*
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 <kddockwidgets/Config.h>
#include <kddockwidgets/DockWidgetQuick.h>
#include <kddockwidgets/private/DockRegistry_p.h>
#include <kddockwidgets/FrameworkWidgetFactory.h>
#include <kddockwidgets/MainWindowMDI.h>
#include <QQmlApplicationEngine>
#include <QGuiApplication>
#include <QCommandLineParser>
// Foro my own debugging, until we have better API
#include "../../src/private/MDILayoutWidget_p.h"
int main(int argc, char *argv[])
{
#ifdef Q_OS_WIN
QGuiApplication::setAttribute(Qt::AA_UseOpenGLES);
#endif
QGuiApplication app(argc, argv);
QCommandLineParser parser;
parser.setApplicationDescription("KDDockWidgets example application");
parser.addHelpOption();
QQmlApplicationEngine appEngine;
KDDockWidgets::Config::self().setQmlEngine(&appEngine);
appEngine.load((QUrl("qrc:/main.qml")));
auto dw1 = new KDDockWidgets::DockWidgetQuick("Dock #1");
dw1->setWidget(QStringLiteral("qrc:/Guest1.qml"));
dw1->resize(QSize(400, 400));
auto dw2 = new KDDockWidgets::DockWidgetQuick("Dock #2");
dw2->setWidget(QStringLiteral("qrc:/Guest2.qml"));
dw2->resize(QSize(400, 400));
auto dw3 = new KDDockWidgets::DockWidgetQuick("Dock #3");
dw3->setWidget(QStringLiteral("qrc:/Guest3.qml"));
auto mainWindow = static_cast<KDDockWidgets::MainWindowMDI*>(KDDockWidgets::DockRegistry::self()->mainwindows().constFirst());
mainWindow->addDockWidget(dw1, QPoint(10, 10));
mainWindow->addDockWidget(dw2, QPoint(50, 50));
mainWindow->addDockWidget(dw3, QPoint(90, 90));
return app.exec();
}

View File

@@ -0,0 +1,26 @@
/*
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.
*/
import QtQuick 2.6
import QtQuick.Controls 2.12
import com.kdab.dockwidgets 1.0 as KDDW
ApplicationWindow {
visible: true
width: 1000
height: 1200
KDDW.MainWindowLayout {
anchors.fill: parent
uniqueName: "MyMainLayout"
options: KDDW.KDDockWidgets.MainWindowOption_MDI
}
}

View File

@@ -0,0 +1,10 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>Guest1.qml</file>
<file>Guest2.qml</file>
<file>Guest3.qml</file>
<file>Guest.qml</file>
<file>Another.qml</file>
</qresource>
</RCC>

View File

@@ -1,10 +0,0 @@
Format: 1.0
Source: kddockwidgets
Version: 1.2.0-1
Binary: kddockwidgets
Maintainer: Allen Winter <allen.winter@kdab.com>
Architecture: any
Build-Depends: debhelper (>=9), cdbs, cmake, qt5-default, qtbase5-dev, libqt5x11extras5-dev
Files:
00000000000000000000000000000000 00000 kddockwidgets-1.2.0.tar.gz

View File

@@ -8,20 +8,37 @@
# #
# Contact KDAB at <info@kdab.com> for commercial licensing options. # Contact KDAB at <info@kdab.com> for commercial licensing options.
# #
set(PYTHON_BINDING_NAMESPACE "PyKDDockWidgets")
set(PYTHON_VERSION "3.7" CACHE STRING "Use specific python version to build the project.") # Just to fix warnings with --warn-uninitialized
find_package(Python3 ${PYTHON_VERSION} REQUIRED COMPONENTS Interpreter Development) if(NOT DEFINED SHIBOKEN_CUSTOM_PREFIX) #look for shiboken in a custom location
set(SHIBOKEN_CUSTOM_PREFIX "")
if (${PROJECT_NAME}_QT6) endif()
find_package(Shiboken6 REQUIRED) if(NOT DEFINED PYSIDE_CUSTOM_PREFIX) #look for pyside in a custom location
find_package(PySide6 ${Qt5Widgets_VERSION} EXACT REQUIRED) set(PYSIDE_CUSTOM_PREFIX "")
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() endif()
if(${PROJECT_NAME}_QT6)
set(PYSIDE_MAJOR_VERSION "6")
set(PYTHON_BINDING_NAMESPACE "${PYTHON_BINDING_NAMESPACE}Qt${PYSIDE_MAJOR_VERSION}")
set(QtWidgets_VERSION ${Qt6Widgets_VERSION})
else()
set(PYSIDE_MAJOR_VERSION "2")
set(QtWidgets_VERSION ${Qt5Widgets_VERSION})
endif()
find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter Development)
find_package(Shiboken${PYSIDE_MAJOR_VERSION} REQUIRED)
find_package(PySide${PYSIDE_MAJOR_VERSION} ${QtWidgets_VERSION} EXACT REQUIRED)
if(NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX)
set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
endif()
set(BINDINGS_DIR "${INSTALL_LIBRARY_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/${PYTHON_BINDING_NAMESPACE}")
set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX "${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/${BINDINGS_DIR}")
include(PySide${PYSIDE_MAJOR_VERSION}ModuleBuild)
add_subdirectory(PyKDDockWidgets) add_subdirectory(PyKDDockWidgets)
if(${PROJECT_NAME}_TESTS)
add_subdirectory(tests)
endif()

View File

@@ -16,10 +16,14 @@ set(PyKDDockWidgets_SRC
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_dockwidgetbase_wrapper.h ${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_dockwidgetbase_wrapper.h
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_dockwidget_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_dockwidget_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_dockwidget_wrapper.h ${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_dockwidget_wrapper.h
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_initialoption_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_initialoption_wrapper.h
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindowbase_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindowbase_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindowbase_wrapper.h ${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.cpp
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindow_wrapper.h ${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_mainwindow_wrapper.h
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_layoutsaver_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_layoutsaver_wrapper.h
# global module wrapper # global module wrapper
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_module_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_module_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_python.h ${CMAKE_CURRENT_BINARY_DIR}/KDDockWidgets/kddockwidgets_python.h
@@ -44,9 +48,10 @@ set(PyKDDockWidgets_target_include_directories
# Libraries that will be necessary to link the target, this will used in the command 'target_link_libraries' # Libraries that will be necessary to link the target, this will used in the command 'target_link_libraries'
set(PyKDDockWidgets_target_link_libraries set(PyKDDockWidgets_target_link_libraries
KDAB::kddockwidgets KDAB::kddockwidgets
Qt${QT_MAJOR_VERSION}::Core Qt${Qt_VERSION_MAJOR}::Core
Qt${QT_MAJOR_VERSION}::Gui Qt${Qt_VERSION_MAJOR}::Gui
Qt${QT_MAJOR_VERSION}::Widgets Qt${Qt_VERSION_MAJOR}::Widgets
${Python3_LIBRARIES}
) )
# changes on these files should trigger a new generation # changes on these files should trigger a new generation
@@ -56,6 +61,7 @@ set(PyKDDockWidgets_DEPENDS
${CMAKE_SOURCE_DIR}/src/DockWidget.h ${CMAKE_SOURCE_DIR}/src/DockWidget.h
${CMAKE_SOURCE_DIR}/src/MainWindowBase.h ${CMAKE_SOURCE_DIR}/src/MainWindowBase.h
${CMAKE_SOURCE_DIR}/src/MainWindow.h ${CMAKE_SOURCE_DIR}/src/MainWindow.h
${CMAKE_SOURCE_DIR}/src/LayoutSaver.h
) )
create_python_bindings( create_python_bindings(
@@ -75,4 +81,19 @@ create_python_bindings(
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/__init__.py @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/__init__.py @ONLY)
# install # install
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/PyKDDockWidgets) install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/__init__.py
$<TARGET_FILE:KDAB::kddockwidgets>
DESTINATION
${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
)
if(NOT WIN32)
install(
FILES
$<TARGET_LINKER_FILE:KDAB::kddockwidgets>
$<TARGET_SONAME_FILE:KDAB::kddockwidgets>
DESTINATION
${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
)
endif()

View File

@@ -10,10 +10,32 @@
# #
import sys import sys
import os
__all__ = ['KDDockWidgets'] __all__ = ['KDDockWidgets']
# Preload PySide2 libraries to avoid missing libraries while loading KDDockWidgets def setupLibraryPath():
if sys.platform != 'win32':
return
if "@PYSIDE_MAJOR_VERSION@" == "6":
from shiboken@PYSIDE_MAJOR_VERSION@ import Shiboken
else:
from shiboken@PYSIDE_MAJOR_VERSION@ import shiboken@PYSIDE_MAJOR_VERSION@ as Shiboken
from PySide@PYSIDE_MAJOR_VERSION@ import QtCore
extra_dll_dirs = [ os.path.abspath(os.path.dirname(Shiboken.__file__)),
os.path.abspath(os.path.dirname(QtCore.__file__)),
os.path.abspath(os.path.dirname(__file__)) ]
if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
for dll_dir in extra_dll_dirs:
os.add_dll_directory(dll_dir)
for dll_dir in extra_dll_dirs:
os.environ['PATH'] = os.fspath(dll_dir) + os.pathsep + os.environ['PATH']
# Preload PySide libraries to avoid missing libraries while loading KDDockWidgets
try: try:
from PySide@PYSIDE_MAJOR_VERSION@ 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 # Create a alias for PySide module so we can use a single import in source files
@@ -22,3 +44,5 @@ try:
except Exception: except Exception:
print("Failed to load PySide") print("Failed to load PySide")
raise raise
setupLibraryPath()

View File

@@ -25,3 +25,4 @@
#include <kddockwidgets/MainWindow.h> #include <kddockwidgets/MainWindow.h>
#include <kddockwidgets/DockWidgetBase.h> #include <kddockwidgets/DockWidgetBase.h>
#include <kddockwidgets/DockWidget.h> #include <kddockwidgets/DockWidget.h>
#include <kddockwidgets/LayoutSaver.h>

View File

@@ -16,7 +16,6 @@
otherwise shiboken will ignore the function and will fail to create a wrapper --> otherwise shiboken will ignore the function and will fail to create a wrapper -->
<primitive-type name="DropAreaWithCentralFrame"/> <primitive-type name="DropAreaWithCentralFrame"/>
<primitive-type name="SideBar"/> <primitive-type name="SideBar"/>
<primitive-type name="InitialOption"/>
<!-- Some plublic enum and flags --> <!-- Some plublic enum and flags -->
<enum-type name="Location"/> <enum-type name="Location"/>
@@ -28,6 +27,9 @@
<enum-type name="DropIndicatorType"/> <enum-type name="DropIndicatorType"/>
<enum-type name="SideBarLocation"/> <enum-type name="SideBarLocation"/>
<enum-type name="TitleBarButtonType"/> <enum-type name="TitleBarButtonType"/>
<enum-type name="SuggestedGeometryHint" flags="SuggestedGeometryHints" />
<enum-type name="CursorPosition" flags="CursorPositions" />
<enum-type name="AddingOption" />
<!-- our classes <!-- our classes
For class we can use two types: For class we can use two types:
@@ -35,6 +37,7 @@
value-type: class that can be passed as value for functions value-type: class that can be passed as value for functions
Here we only use 'object-type' since all our classes are derived from QWidget Here we only use 'object-type' since all our classes are derived from QWidget
--> -->
<value-type name="InitialOption"/>
<object-type name="MainWindowBase" /> <object-type name="MainWindowBase" />
<object-type name="MainWindow" /> <object-type name="MainWindow" />
<object-type name="DockWidgetBase" > <object-type name="DockWidgetBase" >
@@ -42,8 +45,10 @@
inside of the object-type --> inside of the object-type -->
<enum-type name="Option" flags="Options" /> <enum-type name="Option" flags="Options" />
<enum-type name="IconPlace" flags="IconPlaces" /> <enum-type name="IconPlace" flags="IconPlaces" />
<enum-type name="LayoutSaverOption" flags="LayoutSaverOptions" />
</object-type> </object-type>
<object-type name="DockWidget" /> <object-type name="DockWidget" />
<object-type name="LayoutSaver" />
</namespace-type> </namespace-type>
</typesystem> </typesystem>

View File

@@ -0,0 +1,163 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
from PyKDDockWidgetsQt6 import KDDockWidgets
from PySide6 import QtCore, QtWidgets, QtGui
from MyWidget1 import MyWidget1
from MyWidget2 import MyWidget2
from MyWidget3 import MyWidget3
def newMyWidget(parent = None):
randomNumber = QtCore.QRandomGenerator.global_().bounded(0, 100) + 1
if (randomNumber < 50):
if (randomNumber < 33):
return MyWidget1(parent)
else:
return MyWidget3(parent)
else:
return MyWidget2(parent)
class MyMainWindow(KDDockWidgets.MainWindow):
s_count = 0
s_menuCount = 0
def __init__(self, uniqueName, options = KDDockWidgets.MainWindowOption_None, dockWidget0IsNonClosable = False, nonDockableDockWidget9 = False, restoreIsRelative = False, maxSizeForDockWidget8 = False, affinityName = "", parent = None):
super().__init__(uniqueName, options, parent)
self.m_dockWidget0IsNonClosable = dockWidget0IsNonClosable
self.m_dockWidget9IsNonDockable = nonDockableDockWidget9
self.m_restoreIsRelative = restoreIsRelative
self.m_maxSizeForDockWidget8 = maxSizeForDockWidget8
self.m_dockwidgets = []
menubar = self.menuBar()
fileMenu = QtWidgets.QMenu("File")
self.m_toggleMenu = QtWidgets.QMenu("Toggle")
menubar.addMenu(fileMenu)
menubar.addMenu(self.m_toggleMenu)
newAction = fileMenu.addAction("New DockWidget")
newAction.triggered.connect(self._newDockWidget)
saveLayoutAction = fileMenu.addAction("Save Layout")
saveLayoutAction.triggered.connect(self._saveLayout)
restoreLayoutAction = fileMenu.addAction("Restore Layout")
restoreLayoutAction.triggered.connect(self._restoreLayout)
closeAllAction = fileMenu.addAction("Close All")
closeAllAction.triggered.connect(self._closeAll)
layoutEqually = fileMenu.addAction("Layout Equally")
layoutEqually.triggered.connect(self.layoutEqually)
quitAction = fileMenu.addAction("Quit")
quitAction.triggered.connect(QtWidgets.QApplication.instance().quit)
self.setAffinities([ affinityName ])
self.createDockWidgets()
def _newDockWidget(self):
MyMainWindow.s_menuCount += 1
w = newMyWidget(self)
w.setGeometry(100, 100, 400, 400)
dock = KDDockWidgets.DockWidget("new dock %d"%(MyMainWindow.s_menuCount))
dock.setWidget(w)
dock.resize(600, 600)
dock.show()
self.m_dockwidgets.append(dock)
def _saveLayout(self):
#saver = KDDockWidgets.LayoutSaver()
#result = saver.saveToFile("mylayout.json")
#print("Saving layout to disk. Result=", result)
print("Not available")
def _restoreLayout(self):
#options = KDDockWidgets.RestoreOption_None
#if self.m_restoreIsRelative:
# options |= KDDockWidgets.RestoreOption_RelativeToMainWindow
#saver = KDDockWidgets.LayoutSaver(options)
#saver.restoreFromFile("mylayout.json")
print("Not available")
def _closeAll(self):
for dw in self.m_dockwidgets:
dw.close()
def createDockWidgets(self):
if self.m_dockWidget9IsNonDockable:
numDockWidgets = 10
else:
numDockWidgets = 9
# numDockWidgets = 2
# Create 9 KDDockWidget::DockWidget and the respective widgets they're hosting (MyWidget instances)
for i in range(numDockWidgets):
self.m_dockwidgets.append(self.newDockWidget())
# MainWindow::addDockWidget() attaches a dock widget to the main window:
initialOpts = KDDockWidgets.InitialOption(KDDockWidgets.InitialVisibilityOption.StartHidden, QtCore.QSize(500, 500))
self.addDockWidget(self.m_dockwidgets[0], KDDockWidgets.Location_OnBottom, None, initialOpts)
# Here, for finer granularity we specify right of dockwidgets[0]:
self.addDockWidget(self.m_dockwidgets[1], KDDockWidgets.Location_OnRight, self.m_dockwidgets[0])
self.addDockWidget(self.m_dockwidgets[2], KDDockWidgets.Location_OnLeft)
self.addDockWidget(self.m_dockwidgets[3], KDDockWidgets.Location_OnBottom)
self.addDockWidget(self.m_dockwidgets[4], KDDockWidgets.Location_OnBottom)
# Tab two dock widgets together
self.m_dockwidgets[3].addDockWidgetAsTab(self.m_dockwidgets[5])
# 6 is floating, as it wasn't added to the main window via MainWindow::addDockWidget().
# and we tab 7 with it.
self.m_dockwidgets[6].addDockWidgetAsTab(self.m_dockwidgets[7])
# Floating windows also support nesting, here we add 8 to the bottom of the group
self.m_dockwidgets[6].addDockWidgetToContainingWindow(self.m_dockwidgets[8], KDDockWidgets.Location_OnBottom)
floatingWindow = self.m_dockwidgets[6].window()
floatingWindow.move(100, 100)
def newDockWidget(self):
# Passing options is optional, we just want to illustrate Option_NotClosable here
options = KDDockWidgets.DockWidget.Option_None
if (MyMainWindow.s_count == 0) and self.m_dockWidget0IsNonClosable:
options |= KDDockWidgets.DockWidget.Option_NotClosable
if (MyMainWindow.s_count == 9) and self.m_dockWidget9IsNonDockable:
options |= KDDockWidgets.DockWidget.Option_NotDockable
dock = KDDockWidgets.DockWidget("DockWidget #%d"%(MyMainWindow.s_count), options)
dock.setAffinities(self.affinities()); # optional, just to show the feature. Pass -mi to the example to see incompatible dock widgets
if MyMainWindow.s_count == 1:
dock.setIcon(QtGui.QIcon.fromTheme("mail-message"))
myWidget = newMyWidget(self)
if (MyMainWindow.s_count == 8) and self.m_maxSizeForDockWidget8:
# Set a maximum size on dock #8
myWidget.setMaximumSize(200, 200)
dock.setWidget(myWidget)
if dock.options() & KDDockWidgets.DockWidget.Option_NotDockable:
dock.setTitle("DockWidget #%d (%s)" %(MyMainWindow.s_count, "non dockable"))
else:
dock.setTitle("DockWidget #%d"%(MyMainWindow.s_count))
dock.resize(600, 600)
self.m_toggleMenu.addAction(dock.toggleAction())
MyMainWindow.s_count += 1
return dock

View File

@@ -0,0 +1,51 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
import PyKDDockWidgetsQt6
from PySide6 import QtWidgets, QtGui, QtCore
class MyWidget(QtWidgets.QWidget):
s_images = {}
def __init__(self, backgroundFile, logoFile, parent = None):
super().__init__(parent)
self.m_background = self._lookupImage(backgroundFile)
self.m_logo = self._lookupImage(logoFile)
def _lookupImage(self, imageName):
if imageName == "":
return None
if imageName not in MyWidget.s_images:
MyWidget.s_images[imageName] = QtGui.QImage(imageName)
return MyWidget.s_images[imageName]
def drawLogo(self, p):
if not self.m_logo:
return
ratio = self.m_logo.height() / (self.m_logo.width() * 1.0)
maxWidth = int(0.80 * self.size().width())
maxHeight = int(0.80 * self.size().height())
proposedHeight = int(maxWidth * ratio)
if (proposedHeight <= maxHeight):
width = maxWidth
else:
width = int(maxHeight / ratio)
height = int(width * ratio)
targetLogoRect = QtCore.QRect(0,0, width, height)
targetLogoRect.moveCenter(self.rect().center() + QtCore.QPoint(0, -int(self.size().height() * 0.00)))
p.drawImage(targetLogoRect, self.m_logo, self.m_logo.rect());

View File

@@ -0,0 +1,29 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
import PyKDDockWidgetsQt6
from PySide6 import QtWidgets, QtGui
from MyWidget import MyWidget
class MyWidget1(MyWidget):
def __init__(self, parent = None):
super().__init__(":/assets/triangles.png", ":/assets/KDAB_bubble_white.png", parent)
def paintEvent(self, ev):
p = QtGui.QPainter(self)
p.fillRect(self.rect(), QtGui.QColor(0xCC, 0xCC, 0xCC))
p.drawImage(self.m_background.rect(), self.m_background, self.m_background.rect())
self.drawLogo(p)

View File

@@ -0,0 +1,27 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
import PyKDDockWidgetsQt6
from PySide6 import QtWidgets, QtGui, QtCore
from MyWidget import MyWidget
class MyWidget2(MyWidget):
def __init__(self, parent = None):
super().__init__("", ":/assets/KDAB_bubble_blue.png", parent)
def paintEvent(self, ev):
p = QtGui.QPainter(self)
p.fillRect(self.rect(), QtCore.Qt.white);
self.drawLogo(p)

View File

@@ -0,0 +1,32 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
import PyKDDockWidgetsQt6
from PySide6 import QtWidgets, QtGui, QtCore
from MyWidget import MyWidget
class MyWidget3(MyWidget):
def __init__(self, parent = None):
super().__init__(":/assets/base.png", ":/assets/KDAB_bubble_fulcolor.png", parent)
self.m_triangle = QtGui.QImage(":/assets/tri.png")
def paintEvent(self, ev):
p = QtGui.QPainter(self)
p.fillRect(self.rect(), QtGui.QColor(0xD5, 0xD5, 0xD5))
p.drawImage(self.m_background.rect(), self.m_background, self.m_background.rect())
targetRect = QtCore.QRect(QtCore.QPoint(self.width() - self.m_triangle.width(), self.height() - self.m_triangle.height()), self.m_triangle.size())
self.drawLogo(p)

View File

@@ -0,0 +1,8 @@
Running python example
======================
Generate resource file with:
~# rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc
Run the app:
~# python3 main.py

View File

@@ -0,0 +1,38 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
from PyKDDockWidgetsQt6 import KDDockWidgets
from MyMainWindow import MyMainWindow
from PySide6 import QtWidgets, QtCore
import sys
try:
import rc_assets
except:
exit("Oops.. rc_assets needs to be generated first.\nPlease run:\n rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc\n(Make sure to use the rcc from the Qt6 version used to generate the bindings!)")
if __name__ == "__main__":
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
app = QtWidgets.QApplication(sys.argv)
app.setOrganizationName("KDAB")
app.setApplicationName("Test app")
app.setStyle(QtWidgets.QStyleFactory.create("Fusion"))
mainWindow = MyMainWindow("MyMainWindow", )
mainWindow.setWindowTitle("Main Window 1")
mainWindow.resize(1200, 1200)
mainWindow.show()
app.exec_()

View File

@@ -11,7 +11,7 @@
from PyKDDockWidgets import KDDockWidgets from PyKDDockWidgets import KDDockWidgets
from PySide import QtCore, QtWidgets, QtGui from PySide2 import QtCore, QtWidgets, QtGui
from MyWidget1 import MyWidget1 from MyWidget1 import MyWidget1
from MyWidget2 import MyWidget2 from MyWidget2 import MyWidget2
@@ -106,7 +106,8 @@ class MyMainWindow(KDDockWidgets.MainWindow):
self.m_dockwidgets.append(self.newDockWidget()) self.m_dockwidgets.append(self.newDockWidget())
# MainWindow::addDockWidget() attaches a dock widget to the main window: # MainWindow::addDockWidget() attaches a dock widget to the main window:
self.addDockWidget(self.m_dockwidgets[0], KDDockWidgets.Location_OnTop) initialOpts = KDDockWidgets.InitialOption(KDDockWidgets.InitialVisibilityOption.StartHidden, QtCore.QSize(500, 500))
self.addDockWidget(self.m_dockwidgets[0], KDDockWidgets.Location_OnBottom, None, initialOpts)
# Here, for finer granularity we specify right of dockwidgets[0]: # Here, for finer granularity we specify right of dockwidgets[0]:
self.addDockWidget(self.m_dockwidgets[1], KDDockWidgets.Location_OnRight, self.m_dockwidgets[0]) self.addDockWidget(self.m_dockwidgets[1], KDDockWidgets.Location_OnRight, self.m_dockwidgets[0])

View File

@@ -11,7 +11,7 @@
import PyKDDockWidgets import PyKDDockWidgets
from PySide import QtWidgets, QtGui, QtCore from PySide2 import QtWidgets, QtGui, QtCore
class MyWidget(QtWidgets.QWidget): class MyWidget(QtWidgets.QWidget):
s_images = {} s_images = {}

View File

@@ -11,7 +11,7 @@
import PyKDDockWidgets import PyKDDockWidgets
from PySide import QtWidgets, QtGui from PySide2 import QtWidgets, QtGui
from MyWidget import MyWidget from MyWidget import MyWidget

View File

@@ -11,7 +11,7 @@
import PyKDDockWidgets import PyKDDockWidgets
from PySide import QtWidgets, QtGui, QtCore from PySide2 import QtWidgets, QtGui, QtCore
from MyWidget import MyWidget from MyWidget import MyWidget

View File

@@ -11,7 +11,7 @@
import PyKDDockWidgets import PyKDDockWidgets
from PySide import QtWidgets, QtGui, QtCore from PySide2 import QtWidgets, QtGui, QtCore
from MyWidget import MyWidget from MyWidget import MyWidget

Some files were not shown because too many files have changed in this diff Show More