Compare commits

...

2467 Commits

Author SHA1 Message Date
Allen Winter
598787868b appveyor.yml - use Qt6.2 on Mac as well
since 6.2 is the min supported Qt version
2022-09-14 17:50:42 -04:00
Allen Winter
48319a6309 distro/qt6-kddockwidgets.spec - fix found on OBS 2022-09-14 17:46:51 -04:00
Allen Winter
409ac51a3f distro - use today's date 2022-09-14 11:44:30 -04:00
Allen Winter
d9b2eab833 .krazy - skip some example files 2022-09-14 11:41:26 -04:00
Allen Winter
dc510c06eb prepare for 1.6.0 release
`
2022-09-14 10:25:34 -04:00
Allen Winter
285a51b940 buildsystem - follow DPySide[2,6]ModuleBuild.cmake renaming 2022-09-14 10:24:15 -04:00
Allen Winter
f02e3e27d6 cmake/KDAB/modules/KDInstallLocation.cmake - sync 2022-09-14 09:11:15 -04:00
Allen Winter
be42120e06 remove PySide[2,6]ModuleBuild.cmake
replaced with KDPySide[2,6]ModuleBuild.cmake
2022-09-14 09:10:27 -04:00
Allen Winter
c8e542cabf buildsystem required CMake v3.12.0 or higher 2022-09-14 09:09:21 -04:00
Sergio Martins
a267f6a0a7 Mention in ChangeLog that minimum is 6.2 2022-09-14 13:47:16 +01:00
Sergio Martins
3c2cb67bcd cmake: Allow to build with Qt 6.2, since it's the last LTS 2022-09-14 13:40:31 +01:00
Allen Winter
77127886da .pylintrc - ignore settings for older pylint versions 2022-09-13 12:14:34 -04:00
Allen Winter
70def3e14c misspellings found by codespell v2.2.1 2022-09-13 12:12:16 -04:00
Allen Winter
a91aa74d52 misc whitespace cleaning 2022-09-13 12:07:14 -04:00
Allen Winter
619119fc37 README.md - a bit of trivial whitespace cleaning 2022-09-13 12:06:37 -04:00
Sergio Martins
77c8cec2b8 cmake: Fix ci-dev-qtquick-qt6 not using QtQuick
It was building the QtWidgets frontend by mistake
2022-09-12 18:36:07 +01:00
Sergio Martins
71f5cccb61 tests: Fix tests not being run on macOS Qt6
Latest Qt5 and Qt6 are fine nowadays, so just remove the check.
There was an offscreen qpa bug in macOS which was fixed in 5.15.2.
2022-09-12 17:57:28 +01:00
Sergio Martins
f5eb97bd26 cmake: Remove unity builds from cmake presets
The speedup is small since KDDW is small as well.
The burden of maintaining it isn't worth the speedup.

Fixes static build preset failing.
2022-09-12 17:54:51 +01:00
Sergio Martins
fcedc65c41 README: Explain our versioning 2022-09-08 11:51:42 +01:00
Sergio Martins
236ed813f8 qtquick: Fix build, use WidgetType instead of QWidget 2022-09-07 17:46:46 +01:00
Sergio Martins
1c4a4fb8bc README: Discourage people from using 1.6 for QtQuick
It works but won't be receiving bug fixes.
2022-09-07 17:11:35 +01:00
Allen Winter
be7bbe00b1 appveyor.yml - don't build the master branch 2022-09-06 09:10:20 -04:00
Sergio Martins
f277d5efb7 Fix affinity of central frame
Fixes issue #245

(cherry-picked from commit f9e758d02f)
2022-09-05 22:57:02 +01:00
Sergio Martins
bde5be9d9c Release mouse if Qt doesn't receive mouse release
As explained in commit message for #166, there's a case where Qt
doesn't receive the mouse release from Windows. If that happens
then allow to drop if we're over a drop indicator.

Fixes issue #306
2022-08-16 14:28:49 -07:00
Sergio Martins
7e689f0b39 python: Improve Dockerfile
Added more instructions and missing runtime packages

So I can test issue #304
2022-08-16 20:47:21 +01:00
Sergio Martins
ef78d60751 Python: Add a Dockerfile for a python environment
So I can test issue #304
2022-08-16 00:52:34 +01:00
Sergio Martins
bdbab41674 cmake: Disable unity builds for python preset
It's not supported
2022-08-16 00:03:29 +01:00
Sergio Martins
f84006347b Add SegmentedIndicators::s_centralIndicatorMaxWidth/height
So the user can change the maximum size of the central indicator
2022-07-28 19:42:56 +01:00
Allen Winter
9ce7477cbb docs/api/Doxyfile.cmake - add .pngs 2022-07-22 16:00:08 -04:00
Allen Winter
913c570b2b .reuse/dep5 - minor cleaning 2022-07-19 12:48:22 -04:00
Shantanu Tushar
daebe9e680 Export SideBarButton
This allows code to link to subclasses of SideBarButton.
2022-07-19 11:39:32 +01:00
Shantanu Tushar
cf7f037af4 Allow custom sidebars to access its dock widgets
This is useful in cases where a custom sidebar wants behavior that
affects multiple dock widgets it "contains".
2022-07-19 11:39:32 +01:00
Sergio Martins
72ac856fa7 Allow to use TitleBar with non-KDDW widgets
For example, on EGLFS, the user might want some dialogs with similar
decorations. In the future we can make it draggable as well.
2022-07-16 23:51:39 +01:00
Allen Winter
579cd3a201 python/examples[-qt6] - minor pylint fixes 2022-07-14 15:29:51 -04:00
Allen Winter
3764feaf89 Minimum Qt6 supported version 6.3.0 2022-07-13 08:40:59 -04:00
Allen Winter
f1959e5e16 Revert "CMakeLists.txt - set QT_MAJOR_VERSION for ECM"
This reverts commit 084947612b.
2022-07-13 08:37:38 -04:00
Allen Winter
084947612b CMakeLists.txt - set QT_MAJOR_VERSION for ECM 2022-07-13 06:19:28 -04:00
Allen Winter
710f71e7f0 CMakeLists.txt - fix LIB_NAME for ECMGeneratePriFile for Qt6 2022-07-12 16:03:17 -04:00
Allen Winter
4e6b49f876 CMakeLists.txt - ECMGeneratePriFiles supports Qt6 now 2022-07-12 12:53:50 -04:00
Allen Winter
d28dc745bc buildsystem - InstallLocation.cmake -> KDInstallLocation.cmake 2022-07-12 12:09:55 -04:00
Allen Winter
ad8e14ceff .reuse/dep5 - full project reuse licensing 2022-07-12 12:09:39 -04:00
Allen Winter
f9debe5f09 .pre-commit-config.yaml - add reuse lint checking 2022-07-12 12:08:45 -04:00
Allen Winter
b52b1335a6 Markdownlint the project 2022-07-12 11:12:33 -04:00
Sergio Martins
fedce40883 Workaround for EGLFS not supporting per window mouse cursor shape
When hovering over the floating window edges our mouse cursor
changes to resize shape, but when leaving and entering the main window
the mouse cursor wasn't unset.

Workaround by using a global event filter and detecting the leave.

Not using QEvent::Leave as we still allow for some margin outside
the floating window to count as a resize cursor
2022-07-12 15:29:43 +01:00
Sergio Martins
5894fd54f5 WidgetResizeHandler: Remove no-op code
We already bail out if o != mTarget a few lines above
2022-07-12 14:09:16 +01:00
Sergio Martins
d788cde263 minor: Improve readability
Mouse cursor setting is directly related to it being global or local
event filter.
2022-07-12 12:50:31 +01:00
Sergio Martins
1051e859f4 minor: Separate "toplevelness" with filter being local/global
It's too separate concepts
2022-07-12 12:22:39 +01:00
Sergio Martins
2fa9c06f9a minor: Pass a dedicated enum instead of bool to WidgetResizeHandler ctor
bool is opaque and needs a comment, the enum is expressive just by itself.
2022-07-12 11:49:58 +01:00
Sergio Martins
4691f9bfa5 Ran clang-format over the codebase 2022-07-12 11:28:05 +01:00
Sergio Martins
c7dd7d954f pre-commit: Don't clang-format json files
Not until I find out how to make vscode use clang-format for
json. It seems to be using its own formatter.
2022-07-11 21:14:15 +01:00
Sergio Martins
0f66fe853d pre-commit: Allow for multi-document yaml files
Which is valid yaml.
In case we want to make settings for json formatting in .clang-format.
2022-07-11 19:23:58 +01:00
Allen Winter
025c49c583 buildsystem - sync with cmake ECM and KDAB upstream 2022-07-11 12:27:24 -04:00
Allen Winter
518724132b fix a few missed pylint issues 2022-07-11 08:36:12 -04:00
Sergio Martins
800d97c352 Fix 2 clazy warnings 2022-07-09 14:38:01 +01:00
Allen Winter
ba7afe20b0 fix misspelling 2022-07-09 09:16:59 -04:00
Allen Winter
0b5b06dc5a .gitignore - ignore python/examples-qt6/rc_assets.py 2022-07-09 09:12:17 -04:00
Allen Winter
460b898bea cmake-lint, cmake-format CMake files 2022-07-09 09:11:45 -04:00
Allen Winter
6e5cfd70d1 pylint and autopep8 all python files 2022-07-08 17:34:42 -04:00
Allen Winter
4afc6b62b2 .pre-commit-config.yaml - add pylint,autopep8,cmake-lint,cmake-format 2022-07-08 17:33:12 -04:00
Sergio Martins
0785408a5c Add fwd header for DropAreaWithCentralFrame_p.h 2022-07-08 14:09:57 +01:00
Sergio Martins
3364d8ba76 Add .pre-commit-config.yaml
This one is simpler than the one in 2.0 branch, does not include
cmake formatting.
2022-07-08 06:55:59 +01:00
Sergio Martins
b5d1b6d02f vscode: Copy the compile_commands.json from build to source dir
No longer needed to symlink it to make clangd work
2022-07-08 06:53:59 +01:00
Allen Winter
ddf6847d4e .krazy - fix comment 2022-07-06 09:10:04 -04:00
Sergio Martins
6f177bc2df Assert that dock widget passed to MainWindow::addDockWidget is valid 2022-07-05 13:48:47 +01:00
Sergio Martins
e9eee0e69e wayland: Fix StateDragging::handleMouseMove() being called
For wayland we override StateDragging and deal in QDrag instead
but some spurious mouse event got in and were handled in the base
class.

Fixes a crash when receiving mouse move during a drag
2022-06-21 11:17:31 +01:00
Sergio Martins
d2339d1b12 wayland: Fix QEvent::DragEnter being accepted by user code
Otherwise we stop receiving drag moves.
If we're dragging a window we're absolutely sure that user code
won't be interested.

As reproduced by using graphic views.
2022-06-21 11:10:11 +01:00
Sergio Martins
e980dc9bb1 Add some trace debugging to DragController 2022-06-20 14:27:28 +01:00
Allen Winter
a2f0e2e689 codespell fix 2022-06-19 16:02:29 -04:00
Allen Winter
1b1d963d3e .krazy - exclude spelling checking -- use codespell instead 2022-06-19 15:39:24 -04:00
Sergio Martins
2dff66fb97 README: Move the supported toolchain section into the build section
So it's easier for users to find that they need a C++17 compiler.
Won't add exact compiler versions as I have no idea which gcc and which
clang version introduced such support.

Fixes #296
2022-06-19 17:59:09 +01:00
Sergio Martins
a44886279b README: Move building section to before the example
Since you need to build kddw before building the examples.

As a drive-by, added a mention to X11Extras.
Won't mention any package names as that's distro dependent and the amount
of distros is open ended. Would rather remove our current mentions of package names
to make it consistent.

Fixes #297
2022-06-19 17:15:17 +01:00
Sergio Martins
cd1ce835d7 Add cmake presets for ci 2022-06-18 21:49:12 +01:00
Sergio Martins
74dcbd994a Added MainWindow::internalLayout()
Allows the application to add more widgets next to the drop area.
2022-06-08 16:31:35 +01:00
Sergio Martins
189fc7356a Don't install DropArea_p.h twice
Adding the fwd header is enough, so it builds with same include
name for both system and submodule install
2022-06-08 08:17:02 +01:00
Sergio Martins
2ef569c114 Add a fwd area for DropArea 2022-06-08 08:09:26 +01:00
Sergio Martins
d06c6e8f11 EGLFS: Don't raise the main window when docking
EGLFS doesn't honour that the floating windows should be
on top and will make the floating windows go behind.

It's also unneeded to raise it on eglfs, since it's fullscreen.
2022-06-03 14:42:08 +01:00
Sergio Martins
596c330a77 Make numSideBySide_recursive() ignore invisible items
This amends previous commit, which missed a code path
2022-06-02 16:49:12 +01:00
Sergio Martins
9f96eff663 Make numSideBySide_recursive() ignore invisible items
We have invisible items that just remember the position of
other items.
2022-06-02 16:30:02 +01:00
Sergio Martins
3260c65a6c Add DropLocation_Horizontal and DropLocation_Vertical
So we can quickly use a bitwise and to see if an arbitrary
drop location is vertical or horizontal.
2022-06-02 16:16:24 +01:00
Sergio Martins
2c8ceb67ef Allow segmented indicators to disable individual segments
The application developer might now want to show some segments.
Now he can use Config::setDropIndicatorAllowedFunc(), which previously
only worked for classic indicators
2022-06-02 16:02:00 +01:00
Sergio Martins
982904e2ba Pass the DropArea to setDropIndicatorAllowedFunc() too
So the lambda can have more advanced usage and inspect the
target layout before allowing or disallowing the drop.

For our use case, we want to limit max 3 dock widgets side by side,
for example.
2022-06-02 15:19:01 +01:00
Sergio Martins
b2b75cd5bb Fix typo in snippet 2022-06-02 14:44:14 +01:00
Sergio Martins
90ad1a7f23 Added MultiSplitter::numSideBySide_recursive()
Since ItemBoxContainer isn't exported.
2022-06-02 14:01:47 +01:00
Sergio Martins
f5622732ce Added ItemBoxContainer::tst_numSideBySide_recursive() 2022-06-02 13:59:20 +01:00
Sergio Martins
4727c9c7fc MainWindow: Allow to avoid the immediate QWidget::create()
In case you're going to put the main window into a layout you
don't want to have it create a QWindow.
2022-05-25 00:36:40 +01:00
Allen Winter
f8ca5ca1ef KDDockWidgetsConfig.cmake.in - make sure QuickControls2 is found
if building for QTQUICK we'll have dependencies
on the Qt libraries QtQuick and QuickControls2
2022-05-24 17:20:16 -04:00
Allen Winter
ea00ecf33d qt6-kddockwidgets.dsc - fix package list 2022-05-23 12:00:29 -04:00
Allen Winter
bf255c104f distro/ - update for ubuntu22.04 and fedora36 2022-05-22 10:04:17 -04:00
Albert Astals Cid
9b8759c472 Add the possibility of setting the margin used for overlay docks 2022-05-17 15:32:28 +01:00
Sergio Martins
58b8633e3d Added KDDockWidgets::InitialVisibilityOption::PreserveCurrentTab
So you can insert into a tab group without changing the current
tab, if you want.
2022-05-05 14:28:07 +01:00
Sergio Martins
a743eafca1 Added DockWidgetBase::currentTabIndex() 2022-05-05 10:45:55 +01:00
Albert Astals Cid
2446519024 SideBar_p.h: Fix includes to make it usable from external projects 2022-05-03 10:43:37 +01:00
Sergio Martins
6166e5805c Don't show middle dock indicator if frame isn't dockable
This was implemented but the logic was wrong.
Fixes central persistent showing the central indicator.
2022-04-19 15:53:42 +01:00
Allen Winter
b1379f0bef .pylintrc - initial pylint config file 2022-04-14 12:40:17 -04:00
Allen Winter
f3da0f0547 various - fix some misspellings 2022-04-14 12:27:29 -04:00
Allen Winter
b2fc0c3eb1 various - update copyright year 2022-04-14 12:01:05 -04:00
Sergio Martins
6e7268e42a Workaround QTBUG-102430, don't move still maximized window
When dragging a maximized window we show normal, but we can
only start moving it when the window managers acknowledges the new
state. The state in QWidget isn't reliable.
2022-04-12 16:37:14 +01:00
Sergio Martins
7e6c5b2d9f Save the last known window state from the window manager POV
Required for QTBUG-102430
2022-04-12 14:56:20 +01:00
Sergio Martins
9a9676cb7a Add a TODOv2 comment about writing the same fix for QtQuick 2022-04-11 22:33:45 +01:00
Sergio Martins
aff86c3e0f Add a comment regarding QTBUG-102430 2022-04-11 22:31:26 +01:00
Sergio Martins
d4fe17a0bf Workaround FloatingWindow::windowStateChanged regarding QTBUG-102430
QWidget::windowStateChanged isn't useful as it's emitted once sync
and another async, with the same value. Only the async one is useful
as it will represent the real window manager state. Then we can do
further moves.

The QWindow one happens to be good (async), so use that one instead.
2022-04-11 22:10:30 +01:00
Sergio Martins
ab2843f3ef Update ChangeLog 2022-04-08 14:12:35 +01:00
Sergio Martins
0e5247e039 Use FloatingWindow::isMaximizedOverride() instead of isMaximized()
This is for issue #286.
Allows users to workaround buggy window managers.
2022-04-08 14:12:35 +01:00
Sergio Martins
6413266df3 Linux: Fix dragging of maximized floating windows
They should restore their normal size when the drag starts

(cherry picked from commit 1305dee081)
2022-04-08 14:12:35 +01:00
Allen Winter
c6ce421432 CMakeLists.txt - Python bindings are not supported in Unity builds
fixes #284
2022-04-08 08:42:06 -04:00
Sergio Martins
1f638d2c7a tests|qtquick|Windows: Stabilize a test
The warning is benign and unrelated to anything kddw is doing
2022-04-05 17:26:38 +01:00
Albert Astals Cid
7b73393095 Fix position of right overlay dockwidgets when there's a toolbar on the left 2022-04-05 17:13:29 +01:00
Sergio Martins
1a85363faf Preserve order of tabs when re-docking a tabbed group
Since our workaround isn't an atomic operation, each dock widget
was saving its new tab index while we were in the middle of a restore.

So be sure we set their correct index and restore "current" at the end.

Fixes #279
2022-03-30 15:26:11 +01:00
Sergio Martins
7f021248bf vscode: Remove ms-vscode.cpptools based launchers from linux/macOS
Replaced them with CodeLLDB based launchers.
This allows to not depend on binary-blob from microsoft and reduces
having to have 2 configs, now macOS uses the same one as Linux.
2022-03-30 14:49:42 +01:00
Sergio Martins
bec69e17a2 Fix QtQuick build 2022-03-21 15:40:07 +00:00
Allen Winter
057b33179a Changelog - we didn't have a formal 1.5.1 release
move the 1.5.1 changes to 1.6.0 since we never had a 1.5.1
2022-03-15 08:08:14 -04:00
Allen Winter
4945e6318c CMakeLists.txt - set version to 1.5.99 (ie. Release Candidate) 2022-03-15 08:00:46 -04:00
Allen Winter
339edf1143 appveyor.yml - re-enable testing on Windows 2022-03-15 07:59:43 -04:00
Allen Winter
f98ce37c12 appveyor.yml - fix PATH on Windows
forgot the Qt "bin"
2022-03-15 07:58:39 -04:00
Sergio Martins
743dbc0718 Added dockWidgetInserted|Removed signals to TabBarWidget
Since QTabBar doesn't have them.
Useful for custom tab bars
2022-03-12 12:47:26 +00:00
Sergio Martins
fd4588de0f TitleBarWidget: Mark members as protected
So custom titlebars have more power
2022-03-12 12:31:53 +00:00
Sergio Martins
6ba10cfe12 Added TitleBar::tabBar()
Useful for people writing custom titlebar's with style that depends
on the current tab
2022-03-11 18:21:49 +00:00
Sergio Martins
096176dc72 Don't dereference potentially nullptr 2022-03-10 18:37:28 +00:00
Sergio Martins
25b04d7ed8 MDI: Fix another case of showing resize handles wrong
the logic for 'y' only makes sense if 'x' is bounded and vice-versa
2022-03-10 10:55:17 +00:00
Sergio Martins
e345e89c35 MDI: Fix case where resize cursor would be shown for frame bellow
Was already fixed a few days ago, but this is the case for nested
mdi.
2022-03-09 19:08:29 +00:00
Sergio Martins
a97663294c example: Allow to test propagation of close event in the mdi example 2022-03-09 17:18:11 +00:00
Sergio Martins
bb4cf802f5 examples: Remove more duplicate MyWidget.cpp/h files
share with main example instead
2022-03-09 16:42:15 +00:00
Sergio Martins
701069617c example: Allow to test propagation of close event in the mdi example 2022-03-09 16:30:26 +00:00
Sergio Martins
a8c50f1876 example: Remove duplicate minimal-mdi/MyWidget.cpp
It was using the cpp from the main example but the header from
minimal-mdi. Instead, share both the impl and the header
2022-03-09 16:27:25 +00:00
Sergio Martins
61cca1e5ec Forward QCloseEvent to the MDI widgets too
Fixes case where docked MDI widgets were not able to block a close
2022-03-09 16:11:55 +00:00
Sergio Martins
7db9938b85 Fix MainWindow not propagating close events to docked widgets
Nested FloatingWindows already supported it, so make it consistent.

Personal take: In a non-docking world, users can override their
main window close event and prevent a close, to save a document
or such. However, in a docking world, the main window developer
won't know which widgets are docked, so forwarding needs to happen,
as some might have documents to save.
2022-03-09 15:47:02 +00:00
Sergio Martins
01cc915734 Further move onCloseEvent to base class
So that it can be reused by MDI layouts too
2022-03-09 14:58:35 +00:00
Sergio Martins
3454b67a45 Refactor: Move close event logic from FloatingWindow to DropArea
So main window can use it too
2022-03-09 14:39:20 +00:00
Sergio Martins
21765efbac example: Added --blocks-close-event
Makes dock widget #0 reject the close event, meaning it won't close.
2022-03-09 12:46:20 +00:00
Allen Winter
60a1e46453 CMakeLists.txt - fix setting KDDockWidgets_DEPS
broken with last commit
2022-03-08 12:06:53 -05:00
Allen Winter
8b8ef7f2b0 CMakeLists.txt - find COMPONENTS to search for Qt modules 2022-03-08 12:01:13 -05:00
Sergio Martins
c0e8fe3869 Update ChangeLog regarding #44 and #96 being fixed 2022-03-07 16:38:40 +00:00
Sergio Martins
524dff9105 Don't try to restore to previous position if there isn't any 2022-03-07 16:36:38 +00:00
Sergio Martins
0099a19a82 Make redocking floating windows with tabs possible
TitleBar::isFloating() was returning false, while it should
have returned true.

Fixed by making isFloating() simpler and dumb. isFloating() should
only say if it belongs to a floating window or not. It shouldn't
contain any logic about whether button should be visible or not.

There's already logic elsewhere that will hide the float button
in case there's nesting.

Fixes issue #96 and #44
2022-03-07 15:56:15 +00:00
Sergio Martins
e6b8636e88 MDI: Fix resize cursor appearing for frames that had others on top 2022-03-04 11:34:35 +00:00
Sergio Martins
86419fd979 MDI: Fixed closing dock widget in MDI would close main window
We only close the window when the window is a FloatingWindow and
it's the last frame
2022-03-03 17:52:13 +00:00
Eism
220471f746 Corrected the updating of normal geometry for window 2022-02-14 15:34:01 +00:00
Sergio Martins
412860abac tests: Use QT_NO_KEYWORDS too 2022-02-12 14:43:37 +00:00
Sergio Martins
2eeb4aac27 Fix Item_p.h being exposed in public API
Forward declare Item instead
2022-02-12 14:37:19 +00:00
Sergio Martins
bfb2ec701e cmake: Add a dedicated ASAN preset
It's not doing well on Windows, so make the default be a non-asan
build
2022-02-11 22:55:54 +00:00
Sergio Martins
54bf24d5d4 Added Config::setDropIndicatorAllowedFunc() 2022-02-11 19:49:23 +00:00
Sergio Martins
76cbb760ed Minor refactoring before introducing DropIndicatorAllowedFunc
Deals with all the false case first
2022-02-11 19:07:28 +00:00
Sergio Martins
4824a398ab Move DropIndicatorOverlayInterface::DropLocation enum to namespace scope
It's public now
2022-02-11 18:14:26 +00:00
Sergio Martins
a502a8250b Fix possible nullptr dereference 2022-02-11 17:42:09 +00:00
Sergio Martins
85fb4ff671 indicators: Prepare the visibility to be more granular
Currently either all or none inner indicators can be hidden/shown,
and same of the outter.

We'll soon allow some of them to be hidden, selectively, by the
client app.
2022-02-11 17:37:26 +00:00
Sergio Martins
6db3ccc87f .gitignore: Add a few clangd files 2022-02-11 17:10:22 +00:00
Sergio Martins
5811cab164 segmented indicators: Fix potential bugs due to decoupled drop types
The returned QVector was indexed by the enum values, but the enum
is flag based now, no longer sequential. Instead of depending
on ordering of the enum, let's instead return a QHash where the
type is coupled with the corresponding QPolygon already
2022-02-11 17:08:30 +00:00
Sergio Martins
1387c2f573 segmented indicators: Use the base class logic
Instead of repeating it
2022-02-11 16:58:12 +00:00
Sergio Martins
79cc347cd8 Refactor: Move indicator visibility logic into base class 2022-02-11 16:42:07 +00:00
Sergio Martins
e62bde3152 Improve documentation for MainWindowOption_HasCentralWidget
Fixes issue #272
2022-02-11 14:36:19 +00:00
Sergio Martins
81abb3cea5 Fix build on OpenBSD
Fixes #265
2022-02-11 14:31:00 +00:00
Sergio Martins
ecd3c20adf Fix build with Qt5+C++20
Error was:
qvector.h:532:18: error: use of overloaded operator '!=' is ambiguous (with operand types 'int *' and 'QTypedArrayData<int>::iterator')
        while (i != d->begin())
2022-02-10 11:01:14 +00:00
Sergio Martins
755d53432b Fix "drag to detach" MDI windows when in nested MDI mode
We were deleting the draggable, causing the drag to stop
2022-02-04 17:54:43 +00:00
Sergio Martins
e00a552bf8 Add DragController::currentStateChanged() signal 2022-02-04 17:52:54 +00:00
Sergio Martins
faf93fe597 Add DragController::isIdle() 2022-02-04 17:48:42 +00:00
Sergio Martins
4f8aac7df3 Fix floating windows not restoring to previous position
The dock widget wrapper that we deleted had that info. We need
to preserve it.
2022-02-04 16:57:44 +00:00
Sergio Martins
719803ecfa Fix a test with offscreen QPA
We were pressing on pos 6,6 to start a drag but that triggered
a window resize instead.
2022-02-04 16:10:13 +00:00
Sergio Martins
f0ef24383b Debug++ 2022-02-04 16:10:13 +00:00
Sergio Martins
4f8b174a8d Fixed Frame::isFloating() for the nested MDI case 2022-02-04 15:17:11 +00:00
Sergio Martins
675b166956 Added the last crash fix to the ChangeLog 2022-02-04 15:11:17 +00:00
Sergio Martins
b13ba1e42e Fix crash due to use of native widgets on Windows
Qt has corner cases when all of its widgets are native widgets.
This particular crash was a loop between QWidget::create()
and QWidget::createWinId().
2022-02-02 13:21:14 +00:00
Sergio Martins
481dae64c3 nested_mdi: Fix floating windows not going back to their previous location
When floating a mdi window that was nested in a drop area, clicking the
float button should put it back to the MDI area.
2022-01-30 02:55:02 +00:00
Sergio Martins
6b04e20a7e Add some doxygen 2022-01-30 02:40:53 +00:00
Sergio Martins
8a3ee35993 Fix firstParentOfType() going through different windows 2022-01-30 02:15:58 +00:00
Sergio Martins
146c656e29 Minor: Use OOP, add ItemRef::isInMainWindow() 2022-01-29 21:43:41 +00:00
Sergio Martins
a190e2dfbf Fix -Wshadow warning 2022-01-29 20:57:19 +00:00
Sergio Martins
d0daff6771 vscode: Add an entry to run the mdi with dock widgets example 2022-01-29 20:15:29 +00:00
Sergio Martins
721795b113 Remove LastPosition struct, move its members to Position
It was an unneeded indirection that didn't provide added semantics
2022-01-29 19:29:03 +00:00
Sergio Martins
40231b7fae Minor coding style 2022-01-29 19:02:17 +00:00
Sergio Martins
1d0300ecc8 Fix another unused variable 2022-01-26 00:14:01 +00:00
Sergio Martins
ce20628555 Remove unused variable - fixes Werror build 2022-01-25 23:23:54 +00:00
Sergio Martins
d0dcac6b03 Make DockWidgetBase::setMDIPosition|setMDISize support nesting
They now honour Option_MDINestable.
Before they would bail out assuming they weren't in a MDI area.
Now they look further up the hierarchy to find our MDIArea, if any.
2022-01-25 20:14:04 +00:00
Sergio Martins
2b1aa44eff Fix crash when floating nested mdi 2022-01-24 19:18:55 +00:00
Sergio Martins
ae42dffcb1 Update Changelog regarding new nested MDI feature 2022-01-24 18:48:00 +00:00
Sergio Martins
21adfe06ad Add an example for nested docking within MDI 2022-01-24 18:31:10 +00:00
Sergio Martins
7de26139a2 Restore source-compat for TabWidgetWidget() 2022-01-24 15:47:06 +00:00
Sergio Martins
894ff9fea0 Minor: Fix overridden signature 2022-01-24 15:34:37 +00:00
Sergio Martins
942c462586 Fix release build 2022-01-24 15:27:24 +00:00
Sergio Martins
128645693c nested_mdi: Fix DnD over dock widgets docked in MDI
Dragging was always detecting the main window's drop indicator
overlay. Make it transparent for mouse events, so that
QWidget::childAt() doesn't pick it, and we can see the inner
drop areas.
2022-01-23 23:31:50 +00:00
Sergio Martins
86bceb4c48 nested mdi: Fix detaching inner dock widgets
Only the outter-most MDI frame is dragged in MDI mode. The inner ones
are dragged in normal docking mode, they become real floating windows.
2022-01-23 21:46:37 +00:00
Sergio Martins
ea64aae861 tests++ 2022-01-23 21:46:37 +00:00
Sergio Martins
d1645dff73 tests: Remove unneeded sleep 2022-01-23 21:46:37 +00:00
Sergio Martins
a72e018f3b nested mdi: Also test floating a nested MDI 2022-01-23 21:46:37 +00:00
Sergio Martins
66b0ba8902 Added MDIArea::frames() 2022-01-23 21:46:37 +00:00
Sergio Martins
18457d80aa nested mdi: Get rid of unneeded drop area mdi wrapper when floating
When floating, the FloatingWindow has its own DropArea for nesting.
We delete the redundant level of wrappers when floating.
2022-01-23 21:46:37 +00:00
Sergio Martins
95c12dbd4c nested mdi: Fix floating picking the wrong title bar
Use DockWidget::titleBar() which will always travel the hierarchy
and pick the first visible title bar. We have more nesting now.
2022-01-23 21:46:37 +00:00
Sergio Martins
c7682a3524 Use QScopedValueRollback, it's more expressive 2022-01-23 21:46:37 +00:00
Sergio Martins
4922363e71 Simplify expression 2022-01-23 21:46:37 +00:00
Sergio Martins
9f6ec0244f nested mdi: More tests for closing docks 2022-01-23 21:46:37 +00:00
Sergio Martins
747e987f28 test++ 2022-01-23 21:46:37 +00:00
Sergio Martins
68e01c70ee nested mdi: Delete wrappers once we close the last nested DW 2022-01-23 21:46:37 +00:00
Sergio Martins
296b2a3370 nested mdi: Fix MDI's frame title not being updated
Before we didn't need to update it because there was only 1
dock widget. But now, if there's more than one we need to set the
application's name instead of the dock widget's name as title.
2022-01-23 21:46:37 +00:00
Sergio Martins
074bc26be9 Added DropArea::mdiDockWidgetWrapper() 2022-01-23 21:46:37 +00:00
Sergio Martins
f8e6ecf821 Remove DropArea::setIsMDIWrapper(), use ctor instead
This propery is meant to be set only once, so enforce it via
compiler.
2022-01-23 21:46:37 +00:00
Sergio Martins
3e70a2cc71 nested mdi: Added DockWidgetBase::Private::isMDIWrapper 2022-01-23 21:46:37 +00:00
Sergio Martins
65ced9604f nested mdi: Fixed title bar visibility
When there's only one docked widget we only show 1 title bar.
Just like happens with a FloatingWindow
2022-01-23 21:46:37 +00:00
Sergio Martins
45b0536c6a Added DropArea::hasSingleFrame()
For readability
2022-01-23 21:46:37 +00:00
Sergio Martins
8c8f5a8fda Introduce Option_MDINestable
Should allow MDI dock widgets to also accept drops.
Befor, each MDI "window" only had 1 dock widget, but now each
MDI "window" a layout of dock widgets.

This is implemented by nesting the actual dock widget inside
a wrapper drop area. This drop area gives the drop support.

There's still bugs and more tests to fix before merging.
2022-01-23 21:46:37 +00:00
Sergio Martins
22a9ce2596 Merge branch '1.5' 2022-01-21 12:01:38 +00:00
Sergio Martins
93b664414b X11: Add support for robust z-order detection
Qt doesn't provide any way to know which window is directly
bellow the cursor. Generally this is fine since floating windows
are always on top of the main window. However, if Qt::Tool is removed,
then they can be behind, and KDDW can't know which window to overlay
the drop indicators onto.

This patch uses XLib's XQueryTree to solve this.
This is still experimental, hence disabled by default.

For now it's disabled by default, since it's experimental.
You can turn it on by passing -DKDDockWidgets_XLib=ON

Fixes bug #256

(cherry-picked from b20ce0895b as it's safe enough)
2022-01-21 11:56:48 +00:00
Sergio Martins
866788674f Minor: Added Utils::isXCB() 2022-01-21 11:56:48 +00:00
Mauro Persano
f13f0129d4 Add API to set center widget margins on MainWindow
We can't change the margins by subclassing MainWindow and overriding
centerWidgetMargins, since the margins are initialized in MainWindow's
constructor. This adds public API to MainWindow to allow us to change
the margins later on.
2022-01-20 22:37:36 +00:00
Sergio Martins
22ffc6c7ea Fix QtQuick build 2022-01-20 22:37:36 +00:00
Mauro Persano
d1767b5534 Don't render frame for central persistent widget
When the main window has a central persistent widget, make sure the
containing tab widget doesn't render a frame around it.
2022-01-20 22:08:17 +00:00
Allen Winter
2fbe4f872e Merge branch '1.5' 2022-01-20 08:15:23 -05:00
Allen Winter
93e60a743e update copyright year 2022-01-20 08:05:26 -05:00
Allen Winter
328a14b46a src/private/FloatingWindow.cpp - fix compile with mingw
NOMINMAX should only be defined with MSVC on Windows.
2022-01-20 07:50:24 -05:00
Allen Winter
9c17b44ad7 Merge branch '1.5' 2022-01-19 16:23:47 -05:00
Allen Winter
cf40cadce8 cmake/KDAB/modules/KDQtInstallPaths.cmake - sync to upstream 2022-01-19 16:23:28 -05:00
Sergio Martins
16c43b8c24 Make cmake config file honour KDDockWidgets_X11EXTRAS 2022-01-12 09:55:02 +00:00
Allen Winter
8391d85d48 appveyor.yml - add libxkbcommon on ubuntu for qt6 2022-01-09 10:17:39 -05:00
Allen Winter
e59e5d7a71 appveyor.yml - add builders for Qt6 2022-01-09 09:50:58 -05:00
Sergio Martins
aa3c3272ee Fix examples build on macOS and Windows
For some reason a X11 dependency was commited by mistake.
2022-01-08 18:39:16 +00:00
Sergio Martins
1d8fad245a Fix build with 5.12
This is a special request from a customer who can't upgrade right
now.

Min is still 5.15 in CMakeLists.
2022-01-07 17:55:53 +00:00
Sergio Martins
789c531f3d Fix parent of the MDIArea layout
Fixes tests on QtQuick. On QtWidgets it would get reparented
so tests already passed.
2022-01-07 17:45:37 +00:00
Sergio Martins
5b87fb4435 Add an examples/mdi_with_docking/ example 2022-01-07 17:31:20 +00:00
Sergio Martins
402f0b9d90 Add a fwd header for MDIArea.h 2022-01-07 17:27:45 +00:00
Sergio Martins
37567d3980 Introduce MDIArea, a widget that can host MDI dock widgets
This is a public wrapper to MDILayoutWidget. The latter is private
and has internals we don't want to expose. Instead create a public
class with a thin API.

You no longer need to create a MainWindowMDI to have MDI support.
You can now have a normal MainWindow (with normal docking) and
add some dock widget that as a MDIArea as widget.
2022-01-07 17:13:16 +00:00
Sergio Martins
6cef4cea2c Port frameParent() to firstParentOfType() 2022-01-07 14:59:33 +00:00
Sergio Martins
aea2bf971b Add TestDocks::tst_mdi_mixed_with_docking
Tests that we can dock a MDI Layout.
Meaning the main window would support both docking and MDI.
This basic test passes. But there's still a lot of bugs to fix
2022-01-07 12:50:25 +00:00
Sergio Martins
00a0e455e7 Make MDILayoutWidget::addDockWidget's initial opt param optional
It's seldom needed
2022-01-07 12:41:24 +00:00
Sergio Martins
d5c7fbfedd Install MDILayoutWidget_p.h too 2022-01-07 12:32:39 +00:00
Sergio Martins
bea6c09494 CMake: Add a clang -ftime-trace preset
Just for profiling build times.
2022-01-06 13:54:34 +00:00
Allen Winter
0adb130d4b src/private/FloatingWindow.cpp - on Windows, define NOMINMAX
else windows.h will define the max() macro which doesn't
play nice with the std::numeric_limits::max()

Issue #266
2021-12-27 08:09:09 -05:00
Allen Winter
92d0d74641 src/private/FloatingWindow.cpp - on Windows, define NOMINMAX
else windows.h will define the max() macro which doesn't
play nice with the std::numeric_limits::max()

Issue #266
2021-12-27 07:56:00 -05:00
Sergio Martins
4d4f2a0183 Merge branch '1.5' 2021-12-22 17:07:24 +00:00
Alistair Baxter
f1e19ec59c Ensure that floating windows are not positioned off-screen when they are shown
At points when a Rect is to be used to position a floating widget,
test to see if it overlaps any of the system's screens.

If it does not, adjust the Rect to within the closest screen edges.
2021-12-22 16:48:45 +00:00
Sergio Martins
64b5564f99 README: Clarify that for QtQuick we suggest Qt6 2021-12-22 16:08:55 +00:00
Sergio Martins
66cc9ddc03 Updated ChangeLog
Closes #259
2021-12-22 15:39:00 +00:00
Eism
336f1146d3 Fixed the restoration of geometry when user closed maximized window 2021-12-22 15:31:26 +00:00
Mauro Persano
29b1a434c4 Make lazy resize rubber bands optionally top-level
To workaround MFC bug
2021-12-14 11:32:45 +00:00
Allen Winter
c0c8399bd7 README.md - add a bit of info about Qt private packages on linux
related to issue#257
2021-11-26 09:04:30 -05:00
Sergio Martins
b20ce0895b X11: Add support for robust z-order detection
Qt doesn't provide any way to know which window is directly
bellow the cursor. Generally this is fine since floating windows
are always on top of the main window. However, if Qt::Tool is removed,
then they can be behind, and KDDW can't know which window to overlay
the drop indicators onto.

This patch uses XLib's XQueryTree to solve this.
This is still experimental, hence disabled by default.

For now it's disabled by default, since it's experimental.
You can turn it on by passing -DKDDockWidgets_XLib=ON

Fixes bug #256
2021-11-25 20:59:16 +00:00
Sergio Martins
e67f55af51 Minor: Added Utils::isXCB() 2021-11-25 17:22:58 +00:00
Allen Winter
f1410948f8 Merge branch '1.5' 2021-11-24 16:51:38 -05:00
Allen Winter
30185d5b2a This is would become version 1.5.1 2021-11-24 16:49:11 -05:00
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
d832750eb7 CMakeLists.txt - increase min Qt to version 5.15 2021-11-18 09:07:36 -05:00
Allen Winter
a82a283b4b CMakeLists.txt - increase min Qt to version 5.15 2021-11-18 09:06:50 -05:00
Sergio Martins
77392709e2 Merge branch '1.5' 2021-11-18 14:03:00 +00: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
6fd0b4ddee CMakeLists.txt, Changelog - this will be version 1.6 2021-11-15 09:55:47 -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
Renato Araujo Oliveira Filho
4e79c68a7d Added PySide6 support
Task-Id: KDDW-27
2021-01-11 16:31:49 -03:00
Sergio Martins
d80325ec8f Merge branch '1.2' into master 2021-01-10 23:11:17 +00:00
Sergio Martins
e9925785ab Cancel the drag if the draggable is destroyed
Can be destroyed for reasons we can't control or simply destroyed
because the draggable was docked/undocked

Fixes #120
2021-01-10 23:07:57 +00:00
Sergio Martins
81efda2d11 Add a QPointer guard for the draggable
So we can detect if it was deleted meanwhile
2021-01-10 23:00:19 +00:00
Sergio Martins
36eef80192 Also pass InitialOption to addDockWidgetToContainingWindow()
So you can control initial size and such
2021-01-09 13:58:56 +00:00
Sergio Martins
306bf26f66 Remove some qCDebug I never needed 2021-01-09 13:27:30 +00:00
Sergio Martins
e07fb7f121 DockWidget::addDockWidgetToContainingWindow() now accepts docking to main window
Was already stated in the docs that it would work with a main window but implementation
only allowed floating window.

Fixes #132
2021-01-09 13:24:06 +00:00
Sergio Martins
bc86cfcb1f Move Item::insertItem() to the derived class
Item itself doesn't know how to insert into the layout.
We'll soon have a new derived class which will do things differently
2021-01-09 00:11:59 +00:00
Sergio Martins
63bb7e31cd Remove unused method 2021-01-08 22:32:42 +00:00
Sergio Martins
1840d50fc0 Move LayoutBorderLocation out of Item
It only affect the box layout
2021-01-08 22:24:53 +00:00
Sergio Martins
c6fd4e4bc4 Remove duplicate Location enum
No longer needed
2021-01-08 22:11:03 +00:00
Sergio Martins
46210203f7 Rename ItemContainer to ItemBoxContainer 2021-01-08 22:02:02 +00:00
Sergio Martins
5a2d000ddd qtquick: Fix weak vtable 2021-01-08 18:25:14 +00:00
Sergio Martins
c73c26e5cb tests: Fix overloaded signal "parentChanged()" 2021-01-08 18:24:51 +00:00
Sérgio Martins
39c3e4fd13 Fix flags being compared against internal flag enum 2021-01-08 17:09:49 +00:00
Sergio Martins
011d83b7d9 tests: Also restore the internal flags 2021-01-08 09:03:24 -08:00
Sergio Martins
26f1b75976 tests: delete the dockwidgets when each test ends
Will save us from doing manual cleanup.
2021-01-08 08:45:28 -08:00
Sergio Martins
309a90d3a6 tests: Fix a test on windows 2021-01-08 08:28:41 -08:00
Sérgio Martins
946e1e977e tests: Make sure our own stuff is deleted
but don't care about other stuff.
Other QWindows might be deleted delayed. We care more about
DockWidget and MainWindow due to their unique names. They need to
be deleted before the next test starts.
2021-01-08 15:43:04 +00:00
Sergio Martins
7f1347f15d Overload DragRegistry::floatingWindows() to return windows being deleted too 2021-01-08 15:38:18 +00:00
Jacob Young
b81c32b1c9 Fix issues with pri file. 2021-01-07 20:43:47 -05:00
Sergio Martins
2e498f644b Remove unneeded multisplitter examples
We use the top-level examples instead
2021-01-07 16:45:29 +00:00
Sergio Martins
ee0272e036 Merge pull request #129 from mateoconlechuga/master
Add support for setting toggle action icon
2021-01-07 16:09:34 +00:00
Sergio Martins
4aa87c1758 Merge branch '1.2' 2021-01-07 11:15:29 +00:00
Sergio Martins
3b1158b82f Fix potential crash uncovered by UBSAN
m_inCtor might be read before being initialized since when
the earlier members are initialized they can call back into
Frame.
2021-01-07 11:13:56 +00:00
Sergio Martins
1aee98bebd README-WASM: Minor correction, library is static 2021-01-07 11:13:56 +00:00
Allen Winter
b5a6433950 Merge branch '1.2' 2021-01-06 10:55:54 -05:00
Allen Winter
077264fd54 CopyrightAssignmentForm.docx - update email address 2021-01-06 10:55:26 -05:00
Kevin Funk
bee653cf80 Streamline README.md a bit 2021-01-06 16:04:14 +01:00
Sergio Martins
e1363aadaa Remove inclusion of moc from .cpp file
doesn't play nice with cmake unity build on older cmake
2021-01-06 14:40:40 +00:00
Sergio Martins
43877ca712 README: Added url of our WASM demo 2021-01-06 14:35:46 +00:00
Sergio Martins
f7cc54ad38 Merge branch '1.2' 2021-01-06 12:00:13 +00:00
Sergio Martins
538f318fac README-WASM: Minor correction, library is static 2021-01-06 11:07:52 +00:00
Sergio Martins
f0376fa7a2 Disable unity build on the stable branch
Fixes a build failure on ubuntu.
Will probably only enabled for development.
2021-01-06 10:59:13 +00:00
Sergio Martins
0d2bccc15e Deprecate AddingOption
Will probably be removed in v1.5
2021-01-05 20:32:14 +00:00
Sergio Martins
842b89c36d Restore source-compat with 1.2
It's not very hard. Just added the old enum and an implicit ctor.
2021-01-05 19:09:11 +00:00
Sergio Martins
1d74c67bd4 Merge pull request #130 from dangelog/more-build-fixups
More build fixups
2021-01-04 15:23:55 +00:00
Sergio Martins
ea0dd04bd9 Fix build with installed KDDW 2021-01-04 14:48:26 +00:00
Giuseppe D'Angelo
a5dbab096b More build fixups 2021-01-04 15:17:47 +01:00
mateoconlechuga
f1f555d5ab Add support for setting toggle action icon
This adds support for a custom icon to be displayed in a QMenu.
2021-01-03 19:36:56 -07:00
Sergio Martins
5b60a929ab Merge branch '1.2' 2021-01-04 00:20:56 +00:00
Sergio Martins
f4404dcbe0 qt6: disable -Wconversion
the long long int to int conversions due to the Qt6 containers
are harmless
2021-01-04 00:12:55 +00:00
Sergio Martins
dd81e02d94 Fix Qt6 build 2021-01-03 22:17:25 +00:00
Sergio Martins
f4643aeefd Merge branch '1.2' 2021-01-03 22:15:33 +00:00
Sergio Martins
e563ffb673 Add presets for Qt6 dev build 2021-01-03 22:12:56 +00:00
Sergio Martins
4cceec82ac Remove unused variable
Should fix MingW build with -Werror
2021-01-03 21:24:21 +00:00
Sergio Martins
4b868e2078 README: Mention that Qt6 is supported and MSVC 2013 won't be 2021-01-03 21:22:41 +00:00
Allen Winter
875544a449 Merge branch '1.2' 2021-01-02 09:32:20 -05:00
Allen Winter
a2f4c972a6 update copyright year 2021-01-02 09:27:50 -05:00
Sergio Martins
2b0a6e5d06 README: Mention VS 2013 isn't supported anymore
We're getting an ICE
2020-12-28 22:42:24 +00:00
Sergio Martins
5f7e645ed6 Merge branch '1.2' 2020-12-28 22:28:15 +00:00
Sergio Martins
59c90c01f9 README: Mention that Qt6 is supported and MSVC 2013 won't be 2020-12-28 22:27:38 +00:00
Sergio Martins
92063ab61b Remove some duplicate code, Qt does the same already
Recently Qt implemented something similar. Since we only support
aero snap with Qt 5.15 we dont need KDDW's native win32 code anymore

cc issue #121
2020-12-28 13:06:37 -08:00
Sergio Martins
003ec5aa5b Probably fix namespaced build 2020-12-28 19:35:03 +00:00
Sergio Martins
02bf43b468 Add InternalFlag_DontShowWhenUnfloatingHiddenWindow
It's an internal knob you can turn so that setFloating(false)
doesn't show the dockwidget. Only adding this flag in case you need
to support both KDDW and QDW at the same time, or during porting/evaluation.

Fixes #125
2020-12-28 19:19:46 +00:00
Sergio Martins
50e1285839 Move more internal enumerators into the internal enum
the public enum is now clean
2020-12-28 14:36:42 +00:00
Sergio Martins
3fb6574322 Move Flag_internal_NoAeroSnap into its own enum
Enumerators not intended for the public shouldn't be in the
public enum. Move it to a private enum.
2020-12-28 14:01:16 +00:00
Sergio Martins
fa2501d5e4 Merge branch '1.2' 2020-12-28 12:35:04 +00:00
Jacob Young
0fe58fd160 Fix filename case so that it will build on a case-sensitive filesystem. 2020-12-28 12:34:03 +00:00
Sergio Martins
01f3042f48 Merge pull request #127 from CE-Programming/fix/case
Fix filename case so that it will build on a case-sensitive filesystem.
2020-12-28 12:24:23 +00:00
Sergio Martins
6719dd2b9e Allow to pass a preferred initial size to MainWindow::addDockWidget()
fixes #95
2020-12-28 11:59:09 +00:00
Sergio Martins
08c058b214 Remove unimplemented DefaultSizeMode::SizePolicy
It's public API so don't expose enumerators that don't work
2020-12-28 10:58:37 +00:00
Jacob Young
e4502d4f64 Fix filename case so that it will build on a case-sensitive filesystem. 2020-12-28 03:07:30 -05:00
Sergio Martins
db928a0fca refactor: Move the DefaultSizingMode enum into InitialSizingOption
It's another enum that affects the initial sizing.
No behaviour was change in this commit.

Needed for issue #95
2020-12-28 00:17:13 +00:00
Sergio Martins
5582f37a18 Introduce InitialOption struct
addDockWidget() received a AddingOption enumerator. But that
enum isn't enough, as we also want to be able to specify an initial
QSize.

So, instead of adding yet another parameter to addDockWidget(), we
create a struct to old those "initial settings".

Implies a minor source break, but trivial to fix in user code,
just rename the enumerator.

Honouring preferredSize will be a followup.

Needed for issue #95
2020-12-27 20:22:02 +00:00
Sergio Martins
a28e152a37 Remove duplicate DefaultSizeMode enum
It's already in Item_p.h
2020-12-27 13:56:58 +00:00
Sergio Martins
d6dea6f426 TabWidget: Remove paint event hack
Origin unknown, came from "initial commit".
Can't notice any difference without it. Users can do such hacks
by overriding it
2020-12-27 12:58:12 +00:00
Sergio Martins
d29f9fdd0d Fix install location of TabWidget_p.h
It moved location in the repo recently
2020-12-27 12:39:08 +00:00
Sergio Martins
a2a80df5df Add static function DockWidgetBase::byName()
So users don't have to use private API.

Fixes issue #126
2020-12-27 11:41:16 +00:00
Sergio Martins
48ce3a972f DockWidget: Move some clutter to the end of the file
So users not using doxygen can quickly see the API
2020-12-27 11:34:44 +00:00
Sergio Martins
9fae250897 DockWidget: Make the serialization methods private
They are not for the public
2020-12-27 11:32:38 +00:00
Sergio Martins
4dd703dcb2 Remove another unneeded qWait 2020-12-24 11:57:18 +00:00
Sergio Martins
e46b5b2edf tests: Remove a few unneeded qWaits regarding QStateMachine
We don't use QStateMachine anymore
2020-12-24 11:55:45 +00:00
Sergio Martins
7febcf2170 qtquick: Uncomment another TabBar that passes now 2020-12-24 11:53:13 +00:00
Sergio Martins
012ed4cf1d qtquick: Uncomment another test regarding tab widget 2020-12-24 11:43:13 +00:00
Sergio Martins
18283c4d1a qtquick: Enable another QTabBar test 2020-12-23 23:37:37 +00:00
Sergio Martins
2bb46b1cdf Uncomment another tab test 2020-12-23 23:11:09 +00:00
Sergio Martins
113263a4a1 qtquick: Enable one more QTabBar test 2020-12-23 22:47:36 +00:00
Sergio Martins
a6ca44cde6 qtquick: double-clicking a tab will detach it now 2020-12-23 20:37:59 +00:00
Sergio Martins
894be60a75 tests: Add pressOn/doubleClickOn that receives a QWindow
Easier as we don't need to know the actual QWidget/QQuickItem
receiver. The QWindow will deliver it.
2020-12-23 20:36:50 +00:00
Sergio Martins
244a1bec24 Merge branch '1.2' 2020-12-23 14:34:39 +00:00
Sergio Martins
51d78ba20b cmake: Allow to not build the fuzzer
Slight build improvement locally.
Still build by the CI anyway.

Did the same for the linter.
2020-12-23 13:36:43 +00:00
Sérgio Martins
8291025dfa tests: Make the tests run much faster
tst_docks is already run in parallel. Then it was running
again sequentially!
2020-12-23 13:32:15 +00:00
Sergio Martins
6ea1d4ca58 Minor coding style 2020-12-22 18:58:51 +00:00
Sergio Martins
771bf10951 Merge branch '1.2' 2020-12-22 18:48:22 +00:00
Sergio Martins
67a3270324 cmake: Add a setting to enable -Werror without developer build
Enabled for clazy, for example
2020-12-22 18:16:35 +00:00
Sergio Martins
cd859d6725 Fix a bunch of clazy warnings 2020-12-22 17:01:50 +00:00
Sergio Martins
092b4afe4a Add a clazy preset 2020-12-22 16:05:10 +00:00
Sergio Martins
f8d0ffe7ba Fix a few clazy warnings 2020-12-22 16:02:55 +00:00
Sergio Martins
10f47a701f Fix -Wclazy-copyable-polymorphic 2020-12-22 15:38:50 +00:00
Sergio Martins
d3224ed266 Fix -Wclazy-qstring-arg 2020-12-22 15:28:29 +00:00
Sergio Martins
2ccb5391bb Fix -Wclazy-detaching-temporary 2020-12-22 15:14:28 +00:00
Sergio Martins
5c0c9799a4 Fix build with clang -Wsigness 2020-12-22 15:14:13 +00:00
Sergio Martins
5ccbb5b056 build-all.dart: no need to pass the cmake variables
they are already in the preset
2020-12-22 12:28:32 +00:00
Sergio Martins
fc04455e93 build-all.dart: Update the usage comment 2020-12-22 12:15:15 +00:00
Sergio Martins
4ae8f461cb Merge branch '1.2' 2020-12-22 11:56:45 +00:00
Giuseppe D'Angelo
17539e5b88 Frame: stop using "virtual" signals
They don't work as expected across DLL boundaries on MSVC: connecting
to Frame::isFocusedChanged using the PMF syntax fails.

The reason has to do with how MSVC implements pointers to virtual
function members: they are "regular" function pointers to a DLL-local
stub that implements the virtual call. For that reason, a connect()
happening in client code would generate a pointer for the signal that
doesn't compare equal to the same pointer generated from inside KDDW;
and moc-generated code relies on this comparison to find the index of
the signal.

Just avoid the whole thing: rename the non-signal virtual call into a
"callback", and reimplement it in the first QObject subclass to turn it
into a proper signal.
2020-12-22 11:54:44 +00:00
Sergio Martins
e53b9c71da Update build-all.dart with the contents from master
Adding the --tests option should have been done in 1.2 branch
2020-12-21 20:19:59 +00:00
Sergio Martins
9275f852d6 CMakePresets: Enable sanitizers for our developer builds 2020-12-21 20:06:40 +00:00
Sergio Martins
dd8f46880f qtquick: Implement TabBarQuick::tabAt()
Also redirect the mouse press event to our C++ counterpart.
2020-12-21 17:09:55 +00:00
Sergio Martins
e9159a08bd Fix build when usign installed TabWidget_p.h 2020-12-21 13:31:10 +00:00
Sergio Martins
cf89891e4f Merge branch '1.2' 2020-12-21 12:43:31 +00:00
Sergio Martins
1cc8824f84 Workaround shiboken crash, found by Milian 2020-12-21 12:41:09 +00:00
Sergio Martins
b73c526c57 qtquick: Move the event redirector to the base class
Instead of having it in TitleBarQuick.
It will be needed by the TabWidget too
2020-12-20 17:12:44 +00:00
Sergio Martins
add577c46f qtquick: Fix title not changing when we changed current tab
added unit-test too
2020-12-20 16:30:25 +00:00
Sergio Martins
9ddd65ea71 qtquick: tidy some connects 2020-12-20 15:37:17 +00:00
Sergio Martins
b15afa9231 Move TabWidget instantiation to base class Frame
Instead of being instantiated by both FrameQuick and FrameWidget
2020-12-20 14:21:39 +00:00
Allen Winter
f8dfde2784 README.md - add a "Using" section 2020-12-20 08:27:00 -05:00
Sergio Martins
6e0898a31e Remove some methods from TabWidgetQuick
Reuse more from base class.
2020-12-20 13:19:07 +00:00
Sergio Martins
8b98dafba2 TabBar::numDockWidgets() doesn't need to be virtual 2020-12-20 12:32:50 +00:00
Sergio Martins
a123437d03 qtquick: Implement the TabWidget backend
Not yet connected to the GUI.
2020-12-20 12:06:29 +00:00
Sergio Martins
616c871da7 qtquick: initialize the tab widget via the factory 2020-12-20 11:25:50 +00:00
Sergio Martins
925c9725b3 qtquick: Build TabBarQuick too 2020-12-20 01:09:02 +00:00
Sergio Martins
1a173a7c72 Add a TabWidgetQuick.cpp
Doesn't do much yet
2020-12-20 01:02:55 +00:00
Sergio Martins
a959da46db qtquick: Build TabWidget.cpp too
Not being used yet though.
2020-12-20 01:01:20 +00:00
Sergio Martins
a9c70d086c qtquick: Move TabWidget_p.h out of widgets/
To be shared with qtquick
2020-12-20 00:07:07 +00:00
Sergio Martins
48bacb2811 build-all: Add option to run the tests 2020-12-19 23:30:09 +00:00
Sergio Martins
6b846fcdff qt6: Use more 'auto' to fix some Wconversion errors 2020-12-19 22:54:06 +00:00
Sergio Martins
fdc97fecaf build-all: Don't test the unity variations by default 2020-12-19 22:16:29 +00:00
Sergio Martins
86983d58f5 Merge branch '1.2' 2020-12-19 20:05:19 +00:00
Sergio Martins
58f7edb0bc build-all: Build with unity turned off too
As it often finds builds failures to do missing includes
2020-12-19 20:00:05 +00:00
Sergio Martins
302bbeceb0 Merge branch '1.2' 2020-12-19 19:02:46 +00:00
Sergio Martins
cd9e16398c qtquick: Fix the build for Qt6
And added cmake presets for Qt6
2020-12-19 18:59:33 +00:00
Sergio Martins
1e1ea8db34 qtquick: fix build 2020-12-19 18:04:54 +00:00
Sergio Martins
7ac3ea1fcf Merge branch '1.2' 2020-12-19 17:52:52 +00:00
Sergio Martins
3f661d0322 Add dev-scripts/build-all.dart
This script builds all our supported configurations.
Useful if you don't have access to KDAB CI, or if you don't want
to wait for the results.
2020-12-19 17:51:29 +00:00
Sergio Martins
8dad079df5 Add a CMakePresets.json
Contains the configrations we support:
    QtWidgets, QtQuick, static, Python and developer-build
2020-12-19 16:07:49 +00:00
Sergio Martins
1727e50489 Merge branch '1.2' 2020-12-19 15:44:59 +00:00
Sergio Martins
1ab9688f58 Fix Python build 2020-12-19 15:44:44 +00:00
Sergio Martins
613b1b8524 Allow the user to change the absolute min and max widget sizes.
It's not hardcoded anymore
2020-12-19 15:34:37 +00:00
Sergio Martins
ae5edc9ebf Added README-troubleshooting
Fixes issue #114
2020-12-19 14:59:40 +00:00
Sergio Martins
d0c15b5da2 Add missing include 2020-12-19 14:59:04 +00:00
Sergio Martins
ccbd15c922 Merge branch '1.2' 2020-12-19 14:12:10 +00:00
Sergio Martins
7b9673e4e2 Shrink the overlay popup when we shrink the main window
Should be enough for issue #118
2020-12-19 14:10:01 +00:00
Sergio Martins
7fbcbbacdf Preserve overlay size when resizing main window
For issue #118
2020-12-19 14:09:27 +00:00
Sergio Martins
d1f48b0685 Save the last overlayed size
We might want to restore it
2020-12-19 14:09:27 +00:00
Allen Winter
9ee6b91f61 Merge branch '1.2' 2020-12-18 13:04:02 -05:00
Allen Winter
e6c89c0564 setup for 1.2.1 2020-12-18 13:02:49 -05:00
Sergio Martins
8b97088c70 Fix QtQuick build 2020-12-18 17:39:24 +00:00
Sergio Martins
e5809c06c7 Enable resizing the overlayed dock widgets
Fixed WidgetResizeHandler to not allow it to resize the overlay
bigger than its parent

For issue #116

The size isn't remembered though. Next time you open the overlay
it will have the previous size.
2020-12-18 17:15:54 +00:00
Sergio Martins
23b69d4e9e Fix overlay disappearing when we were resizing
We allow the user to click 4px outside of the overlay for better
resizing. But we also had code that would hide the overlay if we
clicked elsewhere. So these two requirements were in conflict.

So, before hidding, check if the frame accepted the press.

Also for issue #118
2020-12-18 16:02:35 +00:00
Sergio Martins
0f468033fb Commit the code needed for resizing overlays/popups
Still not happy with it, so the actual part that enables it
is commented out

Also for issue #118
2020-12-18 15:35:43 +00:00
Sergio Martins
468074cda8 Fix min/max not being respected when resizing overlay popup
While the min size wasn't set the min size hint was.
Use our wrapper which honours the size hint.

Also for isssue #118
2020-12-18 15:32:43 +00:00
Sergio Martins
7acbe0c62e Make the WidgetResizeHandler margin public 2020-12-18 15:23:52 +00:00
Sergio Martins
2c1a70280a WidgetResizeHandler: Fix the geometry calculation for non-toplevels 2020-12-18 15:20:58 +00:00
Sergio Martins
d2fa5efafe Add Utils::globalGeometry() 2020-12-18 14:29:44 +00:00
Sergio Martins
a437bc5d07 Minor WidgetResizeHandler cleanups 2020-12-18 12:11:28 +00:00
Sergio Martins
2447bb12c8 WidgetResizeHandler: Dont' accept the release if we're not resizing 2020-12-18 11:58:08 +00:00
Sergio Martins
1082d5e8e1 Added WidgetResizeHandler::setAllowedResizeSides() 2020-12-18 10:43:36 +00:00
Sergio Martins
3b1ac9a2d0 Merge branch '1.2' 2020-12-17 20:38:49 +00:00
Sergio Martins
4635405fb5 Allow WidgetResizeHandler to act on global event filter
Needed for widgets which are not top-levels
2020-12-17 19:47:19 +00:00
Sergio Martins
c481875e55 Fix WidgetResizeHandler::cursorPosition() for negative positions
Usually we don't get negative relative positions, since we're
tracking top-level widgets which wouldn't receive exterior mouse
events to begin with.
But we want the WidgetResizeHandler to work for embedded widgets
too, for example for the sidebar overlays.
2020-12-17 19:47:19 +00:00
Sergio Martins
62f50f9458 Minor coding style 2020-12-17 19:47:19 +00:00
Sergio Martins
c86252665c Make WidgetResizeHandler::mouseMoveEvent() return bool
Returns true if it consumed the event
2020-12-17 19:47:19 +00:00
Sergio Martins
d141863ffb Make a method private 2020-12-17 19:47:19 +00:00
Sergio Martins
e99b9678e4 Add WidgetResizeHandler::restoreMouseCursor() 2020-12-17 19:47:19 +00:00
Sergio Martins
e0a034748d Factor out setting the mouse cursor
We'll soon also need to call qApp's set cursor
2020-12-17 19:47:19 +00:00
Sergio Martins
c3377431cc docs++ 2020-12-17 19:47:19 +00:00
Allen Winter
2fb70009cc OBS - updates 2020-12-17 14:40:16 -05:00
Allen Winter
289ddffbe2 prep for 1.2.0 release 2020-12-17 14:40:16 -05:00
Sergio Martins
54738bbea2 Simplify WidgetResizeHandler::cursorPosition() impl 2020-12-17 18:51:40 +00:00
Sergio Martins
5c6eb352d6 Use the CursorPosition enum as flags 2020-12-17 18:46:31 +00:00
Sergio Martins
f657399ef8 Make enum public so we can use Q_ENUM 2020-12-17 18:44:48 +00:00
Sergio Martins
be0f72ca25 Remove unneeded method 2020-12-17 17:05:55 +00:00
Sergio Martins
31598d8334 Make a variable private 2020-12-17 16:59:21 +00:00
Sergio Martins
5e64463a8c Remove some Item_p.h/multisplitter includes
that's private API for the layouts, don't want them exposed higher
in the stack
2020-12-17 13:48:50 +00:00
Sergio Martins
27ffb64eb4 Merge branch '1.2' 2020-12-17 12:45:33 +00:00
Sergio Martins
c4ffe10e12 Fix non unity build 2020-12-17 12:24:12 +00:00
Sergio Martins
efcad6d2be Update ChangeLog 2020-12-17 11:53:12 +00:00
Sergio Martins
c7dc7bdb3d Bump so version on master 2020-12-17 11:15:42 +00:00
Sergio Martins
b6925c928a Clear sidebars before restoring them
If restoring a state without a sidebar, the existing sidebars
should hide

Fixes issue #116
2020-12-17 10:51:16 +00:00
Sergio Martins
75368d334a Don't restore the popup/overlay state
popups are perishable
2020-12-17 10:15:39 +00:00
Allen Winter
d39ce8f66e tests/Testing.cpp - include <QTest>, not <QtTest> 2020-12-16 17:10:07 -05:00
Allen Winter
805ea41d8a Rubberband_quick.h, RubberBandQuick.h - adjust include guard 2020-12-16 17:04:06 -05:00
Allen Winter
d7ed2494be CMakeLists.txt - add documentation for the new options 2020-12-16 17:01:47 -05:00
Allen Winter
0990337cdc examples/qtquick/CMakeLists.txt - add license+copyright header 2020-12-16 16:51:03 -05:00
Allen Winter
e41cdb6f78 various - fix misspellings 2020-12-16 16:49:22 -05:00
Sergio Martins
666673a251 Added a comment 2020-12-16 18:46:56 +00:00
Sergio Martins
34cb2ae5f0 Restore the SideBars when restoring a layout
For issue #116
2020-12-16 18:27:29 +00:00
Sergio Martins
51d8c2ff3e tests: Group the "Save/restore" tests together 2020-12-16 18:15:06 +00:00
Sergio Martins
aa9f50d0f4 Serialize the SideBar to JSON too
Part 1 of 2 for issue #116
2020-12-16 17:58:05 +00:00
Sergio Martins
b7c36a2ec9 Stabilize a test with 5.9
Minor differences in the frame's min-sizes, no point in spending
more time on such old Qt version just so tests pass.
2020-12-16 17:24:33 +00:00
Sergio Martins
e18fb7ffd8 Remove unneeded private moc include
Doesn't play nice with unity builds
2020-12-16 15:48:32 +00:00
Sergio Martins
96439339c7 cmake: Add a missing QtQuick header to the source list 2020-12-16 15:46:31 +00:00
Sergio Martins
04d418b2e9 same for QtQuick 2020-12-16 15:42:48 +00:00
Sergio Martins
c04d856322 cmake: Add the header files to the source list too
So they are automoced with unity build
2020-12-16 15:40:25 +00:00
Sergio Martins
1c41c33f33 Merge the two qrc files that are only for QtQuick 2020-12-16 11:53:36 +00:00
Sergio Martins
1dae128511 Fix the static build
The other library qrc is only needed for QtQuick
2020-12-16 11:41:15 +00:00
Sergio Martins
eab80c0545 Fix a -Wmismatched-tag warning 2020-12-16 10:54:47 +00:00
Sergio Martins
288c3df30b Add missing include 2020-12-15 23:11:52 +00:00
Sergio Martins
e8728e8a35 qtquick: Fix the qrc not being included 2020-12-15 23:07:11 +00:00
Sergio Martins
94bfc4f2d1 qtquick: Fix build 2020-12-15 23:02:13 +00:00
Sergio Martins
d2da07508a Replaced an include with a fwd decl 2020-12-15 22:58:10 +00:00
Sergio Martins
7082e40cd5 Fix non-developer build
These exports are needed
2020-12-15 21:56:22 +00:00
Sergio Martins
2c8bbd10f7 Remove the export macros from the old library
We now use only 1 library, so use the same export macros
2020-12-15 21:41:10 +00:00
Sergio Martins
ed8a401fe8 Meld kddockwidgets__multisplitter into kddockwidgets lib
It's overkill to have it in a separate library.
Simplifies deployment.
Speeds up build, as it was breaking paralellism.
2020-12-15 21:00:41 +00:00
Sergio Martins
72428075f0 Fix -Wshadow warnings 2020-12-15 20:38:20 +00:00
Sergio Martins
562db7c812 qtquick: Fix build
Missing include guards
2020-12-15 13:38:35 +00:00
Sergio Martins
3ee15d1307 Give python a bit of help building KDDW 2020-12-15 12:15:23 +00:00
Sergio Martins
cf232dda34 Enable Unity Builds unconditionally
Projects using KDDW won't need to modify KDDW, so there's no impact
on incremental builds
2020-12-15 11:13:41 +00:00
Sergio Martins
bfeac02a45 cmake: Make KDDW build faster with a unity build 2020-12-12 15:18:39 +00:00
Sergio Martins
22f4c36eb0 cmake: remove duplicate set of qtquick/qtwidget cmake options
Let's simply things and only use one set. If the top-level requires
QtQuick then so will multisplitter. It's not mix-and-match.
2020-12-12 14:11:26 +00:00
Allen Winter
3dc56ea4ef Merge branch '1.1' 2020-12-12 08:20:10 -05:00
Allen Winter
cbedc06e97 various - prep for 1.1.1 release 2020-12-11 16:56:04 -05:00
Sergio Martins
8f85f28ed4 Merge branch '1.1' 2020-12-11 16:44:07 +00:00
Sergio Martins
b5c2757874 Updated Changelog with v1.1.1 2020-12-11 16:36:37 +00:00
Sergio Martins
46f57ffbbc Merge branch '1.1' 2020-12-10 21:39:54 +00:00
Sergio Martins
fb6e2afd7b Windows: Don't start a drag when it's a resize
There were a few pixels where you could click where, very near the
border where it would start a drag while it shouldn't.

The drag state machine then was in an invalid state which could lead to
a crash.

Fixes issue #110
2020-12-10 21:16:42 +00:00
Sergio Martins
f74eb73326 qt6: Use only one CMake option for Qt6
We still had OPTION_QT6 leftovers
2020-12-09 14:09:20 +00:00
Sergio Martins
ceb796d807 qt6: Don't set the HDPI attributes
They don't do anything on Qt6, but warn.
2020-12-09 12:23:17 +00:00
Sergio Martins
9a9488117c Add a State dtor, fixes a -Wweak-vtables warning 2020-12-09 11:13:55 +00:00
Sergio Martins
e55d75ba98 qt6: Fix build on Windows 2020-12-08 23:21:51 +00:00
Sergio Martins
742763e6e5 qt6: Remove unneeded Qt5Test find
It's already found in the root CMakeLists.txt
2020-12-08 22:56:59 +00:00
Sergio Martins
d7242f17b7 examples: Add AUTORCC
Fixes standalone examples not showing images
2020-12-08 22:36:23 +00:00
Sergio Martins
eba395dc4c Fix build 2020-12-08 22:31:21 +00:00
Sergio Martins
89635d8b98 qt6: build is fixed now 2020-12-08 21:47:35 +00:00
Sergio Martins
f475312f11 qt6: Port away from QStateMachine
QStateMachine was moved to qtsxml module, which is not ported to
Qt6 yet.

We use QStateMachine for the semantics it gives us, not because of
its implementation. The implementation is trivial, so do it outselves.
We used very little from QStateMachine.
2020-12-08 19:55:52 +00:00
Sergio Martins
9f604829dd qt6: Use AUTORCC instead of qt5_add_resources
As this works with both Qt5 and Qt6
2020-12-08 18:11:34 +00:00
Sergio Martins
85f829f97a qt6: Remove an hardcoded Qt5 lib 2020-12-08 16:38:08 +00:00
Sergio Martins
e3bb0b3d48 qt6: Link to StateMachine 2020-12-08 16:36:00 +00:00
Sergio Martins
22c0b6f9b6 qt6: Fix build of FloatingWindow.cpp
QWidget::nativeEvent() changed signature
2020-12-08 16:33:35 +00:00
Sergio Martins
200cb7aded qtquick: Fix build with gcc 2020-12-08 15:06:21 +00:00
Sergio Martins
4999fdd819 qtquick: Remove the native child widget case
This can only happen for QtWidgets. With QtQuick all items are
alien, never native
2020-12-06 15:48:31 +00:00
Sergio Martins
76aca4139a Minor cleanup 2020-12-05 23:37:56 +00:00
Sergio Martins
64276cb872 qtquick: Fix clicking on close button of floating window
Since we're using native events on windows we were using the whole
title bar for dragging, but obviously the buttons don't serve for
window dragging
2020-12-05 23:28:04 +00:00
Sergio Martins
aad63d117b qtquick: Enable aero-snap on Windows
The events simply need to be forward from QWindow to the FloatingWindow.
That happens automatically for QWindow/QWidget, but not with
QWindow/QQuickItem, so add this behaviour to QtQuick too, so it behaves
the same as QtWidgets and we have a single code path for aero snap
2020-12-05 15:20:26 +00:00
Sergio Martins
bd66af0a9f Remove unused logging categories 2020-12-05 14:29:13 +00:00
Sergio Martins
a21d80279e qtquick: Fix background of indicator being black on macOS 2020-12-03 19:15:34 +00:00
Sergio Martins
4347aefc8f Fix a -Wweak-vtable warning on macOS 2020-12-03 18:45:08 +00:00
Sergio Martins
b6341154fb qtquick: Fix a test
The tests are not prepared for the min-size of the floating window
to change (QLayout helped with that). We need to write some kind
of constraint propagation first, until then we use a static
size for the non-contents
2020-12-03 18:24:26 +00:00
Sergio Martins
16f6692b79 qtquick: Add an example of how to instantiate a dock widget from QML
Instead of using C++
2020-12-03 14:58:59 +00:00
Sergio Martins
6c1026956a qtquick: titlebar's height is reduced to 0 when invisible
otherwise we see an empty space when it's not visible
2020-12-02 23:33:04 +00:00
Sergio Martins
97679abb02 qtquick: silence warning
not worth it
2020-12-02 23:29:15 +00:00
Sergio Martins
e173a4cfff qtquick: Also allow for custom titlebar for the Frame 2020-12-02 23:24:28 +00:00
Sergio Martins
26971ef1e2 qtquick: Add an example of a custom title bar 2020-12-02 23:20:44 +00:00
Sergio Martins
d7bde47105 qtquick: Don't hardcode the title bar height in C++
It's now in QML and the user is allowed to change it
2020-12-02 22:58:11 +00:00
Sergio Martins
143c82291d qtquick: The user can now choose another titlebar file 2020-12-02 22:43:01 +00:00
Sergio Martins
979b2fdd40 qtquick: Set the frameworkwidget factory as a context prop 2020-12-02 22:38:17 +00:00
Sergio Martins
46337d900b qtquick: Load the titlebars with a loader
in followup commit the source will be user configurable
2020-12-02 21:43:57 +00:00
Sergio Martins
ec1f1bea9a qtquick: Move some style code to TitleBar.qml
Doesn't belong in the base component
2020-12-02 21:30:55 +00:00
Sergio Martins
d207028d60 qtquick: Document and add proper interface to TitleBarBase.qml 2020-12-02 16:17:46 +00:00
Sergio Martins
a237eae508 qtuick: Add a customtitlebar example stub
Not custom yet.
2020-12-02 15:48:51 +00:00
Sergio Martins
243396f22b qtquick: Move the example into a sub-directory
We'll have other qtquick examples
2020-12-02 14:52:10 +00:00
Sergio Martins
f240bf5d40 Disable Aero-snap for QtQuick, for now 2020-12-01 20:33:52 +00:00
Sergio Martins
785db1b50c qtquick: Fix detaching windows not working smoothly
Use the global event filter, as grabing isn't reliable in QtQuick.

Either not the same item is getting the mouse moves and release, or
it's because QtQuick internally is also setting/unsetting grabbers,
as seen in the source code
2020-12-01 20:14:46 +00:00
Sergio Martins
b6a7048a4f Fwd declare QWidget, no need to include in the header 2020-12-01 19:48:41 +00:00
Sergio Martins
52bff59024 Remove duplicated logic regarding mouse events 2020-11-30 23:14:00 +00:00
Sergio Martins
bba0195196 Move "mouseEvent()" function to Utils_p.h
So it can be reused
2020-11-30 23:00:30 +00:00
Sergio Martins
41fdb9c7df qtquick: Fix non-developer build 2020-11-30 18:37:39 +00:00
Sergio Martins
c1c1da25a8 Fix build with vs2013 2020-11-30 14:11:21 +00:00
Sergio Martins
b4e7b97646 examples: Fix non-developer build 2020-11-30 12:25:29 +00:00
Sergio Martins
2c687fe469 qtquick: Implement the rubber band
When hovering a drop indicator we now see the blue rubberband
2020-11-29 22:31:11 +00:00
Sergio Martins
10e0402afa Fix build 2020-11-29 19:51:37 +00:00
Sergio Martins
ebb1179167 fix namespace 2020-11-29 19:41:30 +00:00
Sergio Martins
15c196d865 qtquick: Move Rubberband to its own file 2020-11-29 19:23:10 +00:00
Sergio Martins
e897ce6e8e qtquick: Add a replacement for QAction
So we don't depend on QtWidgets lib
2020-11-29 18:44:00 +00:00
Sergio Martins
83d9db1b64 qtquick: multisplitter lib no longer depends on QtWidgets
Added a QSizePolicy replacement.
KDDW for QtQuick still needs to link to QtWidgets, but it's a
step forward
2020-11-29 18:08:49 +00:00
Sergio Martins
60331fc654 qtquick: Remove some unneeded QtWidget includes 2020-11-29 17:57:14 +00:00
Sergio Martins
e8f16dd172 qtquick: Don't build ObjectViewer 2020-11-29 17:50:51 +00:00
Sergio Martins
44bd451362 qtquick: stabilize tests with offscreen QPA 2020-11-29 15:17:29 +00:00
Sergio Martins
1d2a791dfc qtquick: Fix DND operation never ending
When double-clicking a title bar we're getting: Press, Release,
Press and never the Release. We get the MouseDblClickEvent instead,
so handle that
2020-11-29 14:40:03 +00:00
Sergio Martins
a4ba45b423 qtquick: Fix flickering the first time we drag over 2020-11-28 19:27:18 +00:00
Sergio Martins
12576970c6 qtquick: Fix dragged window being behind in Z order
For QtWidgets, when we raise something that's not a top-level
it won't raise. So do the same thing for QtQuick
2020-11-28 18:28:43 +00:00
Sergio Martins
e0ee7d14b0 qtquick: Remove warning about we not implementing keyboard ungrab
I don't see it in QQuickItem API, so we also don't grab it to
begin with
2020-11-28 17:53:39 +00:00
Sergio Martins
66f447ad3f qtquick: Fix crash when hovering over titlebar
It would think we were over a drag indicator, because during an instant
the overlay window has 0x0 size but the indicators are still visible.

Fix by only showing the overlay window (visible property) when it has
the correct size
2020-11-28 17:11:46 +00:00
Sergio Martins
75db599142 tests: Make DropArea::hover() return the chosen drop location
Just for tests.
2020-11-28 16:47:19 +00:00
Sergio Martins
a5c65ae039 Introduce NullIndicators and a Config option for it
Mostly for debugging purposes, but also useful if anyone doesn't
want to display indicators
2020-11-28 14:11:39 +00:00
Sergio Martins
5c055e0b8d examples: Add a flag to disable aero-snap
For development/debugging purposes only
2020-11-28 00:39:30 +00:00
Sergio Martins
090483f04e qtquick: Add some flags to the example
Mostly for debugging at this point
2020-11-28 00:18:41 +00:00
Sergio Martins
953219f6f3 qtquick: Minor refactoring
Removed some hardcoded QLineEdit casts, that code is now generic.
2020-11-27 18:47:03 +00:00
Sergio Martins
8356bb0c3c Introduce KDDockWidgets::widgetAt()
Only repro for QtWidgets for now, but already useful to remove some
QApplication includes
2020-11-27 18:29:46 +00:00
Sergio Martins
758548f7a2 qtquick: Only Windows needs Angle 2020-11-27 17:11:45 +00:00
Sergio Martins
2aa16eb6d9 examples: comment out the old multisplitter example
It's not for end users. Might even delete it
2020-11-27 17:07:44 +00:00
Sergio Martins
9d6cef24c1 qtquick: Use Angle on Windows
It's aero-snap friendly. Otherwise shows black artifacts.
We can however use normal GL and use FramelessWindowhint instead
2020-11-27 16:46:21 +00:00
Sergio Martins
52999d4cc9 qtquick: Don't process native events when being deleted 2020-11-27 15:03:55 +00:00
Sergio Martins
bc2fff2c04 qtquick: Window resizing works on Linux/mac now 2020-11-27 13:59:27 +00:00
Sergio Martins
40fa4e98f8 qtquick: Fix tests
Mouse tracking isn't implemented, so warns
2020-11-27 11:06:47 +00:00
Sergio Martins
a07f63a2c7 qtquick: Fix build on Windows 2020-11-26 23:30:55 +00:00
Sergio Martins
39c9a4da9b qtquick: Enable native event handling for the floating windows
Same as done with QtWidgets, now hopefully we have native window
resize
2020-11-26 23:26:15 +00:00
Sergio Martins
e0aa547393 qtquick: Start using the WidgetResizeHandler
It's no longer commented out in FloatingWindow.
Doesn't do much for QtQuick, but at least we don't have different
code paths

Making it work is next.
2020-11-26 23:13:46 +00:00
Sergio Martins
08eab8882f qtquick: Call FloatingWindow::setupWindow() at the correct time
We need a QWindow. While that's done very early, and automatically
for QtWidgets, for QtQuick it's done later, by us, manually
2020-11-26 22:52:23 +00:00
Sergio Martins
04723ac3a9 Minor refactoring, moved code into a function 2020-11-26 22:46:14 +00:00
Sergio Martins
c25043fa00 qtquick: Enable more QtWidget paths that compile fine
Just needed a dummy create() function
2020-11-26 22:28:57 +00:00
Sergio Martins
5372920cd0 qtquick: Port NCHITTESTEventFilter 2020-11-26 21:53:48 +00:00
Sergio Martins
28ae4c3b8c Add helper to get FloatingWindow by its WId 2020-11-26 21:42:45 +00:00
Sergio Martins
6158ebd520 qtquick: Fix our QtQuick QLineEdit clashing with the QWidgets one
Some indirect include is making it clash. Cleaner to use a different
name anyway
2020-11-26 21:28:01 +00:00
Sergio Martins
b77430e574 Remove two more unneeded QApplication includes 2020-11-26 19:35:46 +00:00
Sergio Martins
fad81d595a qtquick: Remove some dependencies to QApplication 2020-11-26 19:31:32 +00:00
Sergio Martins
0980a7f601 qtquick: Port qtTopLevelForHWND() to Windows
Deals in QWindow instead of QWidget
2020-11-26 18:54:58 +00:00
Sergio Martins
46830713e0 stabilize test on Windows 2020-11-26 18:27:17 +00:00
Sergio Martins
cd796db0ff Add helper topLevelForHandle() 2020-11-26 17:53:28 +00:00
Sergio Martins
29da5f4a8a qtquick: Fix another include
Fixes the multisplitter build on Windows, which has a more picky
linker
2020-11-26 17:18:55 +00:00
Sergio Martins
315bdc71e5 qtquick: Include the correct include
Not the widget one
2020-11-26 17:17:18 +00:00
Sergio Martins
a8965bea91 Fix a unit-test
Broke it by mistake
2020-11-26 17:00:10 +00:00
Sergio Martins
bf259c7ffc qtquick: Fix build on mac
Mostly due to -Werror and clang having more warnings
2020-11-26 16:45:12 +00:00
Sergio Martins
8a990451d7 Fix casting -1 to WId on mac 2020-11-26 15:59:32 +00:00
Sergio Martins
974bdbd637 Fix a -Wweak-vtable warning 2020-11-26 15:55:52 +00:00
Sergio Martins
cb9d77cd18 Fix more -Woverloaded-virtual 2020-11-26 15:17:33 +00:00
Sergio Martins
af10efa587 Fix more -Woverloaded-virtual 2020-11-26 15:15:37 +00:00
Sergio Martins
a0fb47af58 Fix -Woverloaded-virtual 2020-11-26 14:52:04 +00:00
Sergio Martins
598fbdc51b qtquick: Fix build on mac
RubberBand was being compiled twice. We shouldn't compile the
_widget* multisplitter files when using QtQuick.

Also implies tst_multisplitter shouldn't be run when compiling
for QtQuick.
2020-11-26 14:29:17 +00:00
Sergio Martins
81c3f3f0c6 Fix a -Wweak-vtables warning 2020-11-26 13:28:15 +00:00
Sergio Martins
b9962b3df0 qtquick: Make the QWinWidget case specific to QtWidgets
With QtQuick we don't have QWinWidget
2020-11-26 13:23:06 +00:00
Sergio Martins
a71386e62a Fix using qAbs(bool)
detected by msvc
2020-11-26 12:59:51 +00:00
Sergio Martins
812ce1c08b qtquick: Fix floating dock #3 in the example
It would go to its previous place (0,0), so don't show it at
start.

Added a unit-test as thought it was a bug, but code is correct.
2020-11-26 12:31:50 +00:00
Sergio Martins
189e82450b qtquick: Add 2px margin for the the tab widget
Mimics QtWidgets
2020-11-26 12:06:52 +00:00
Sergio Martins
a3dbc3739c qtquick: Make title bar look nicer 2020-11-26 12:02:58 +00:00
Sergio Martins
c8d34375af qtquick: Add margin to Frame 2020-11-26 11:43:30 +00:00
Sergio Martins
6c3775ea45 qtquick: floating window now has a border and 4px margin
Just like the QtWidget one
2020-11-26 11:36:36 +00:00
Sergio Martins
5a72e1adab qtquick: Fix some colors 2020-11-25 23:52:56 +00:00
Sergio Martins
0f7f310734 qtquick|example: Use the KDAB logs, as we have for QtWidgets 2020-11-25 23:09:53 +00:00
Sergio Martins
e8bf2a5222 qtquick: Remove dummy background color 2020-11-25 22:59:30 +00:00
Sergio Martins
468f545c9a qtquick: Enable more tests
these pass now, too
2020-11-25 22:15:52 +00:00
Sergio Martins
a59ff6dfee qtquick: Build tests with ctest too 2020-11-25 21:41:46 +00:00
Sergio Martins
4fa415ba05 qtquick: Comment out a few tests
We don't support max-size yet
2020-11-25 21:01:37 +00:00
Sergio Martins
d851c60b2f qtquick: Don't allow the initial window size to be smaller than its min
Fixes a test
2020-11-25 20:52:29 +00:00
Sergio Martins
bf097098e5 qtquick: Fix pointer comparison in test 2020-11-25 20:10:32 +00:00
Sergio Martins
8c93b85a24 qtquick: Remove unneeded code 2020-11-25 20:10:13 +00:00
Sergio Martins
f87d67dd59 qtquick: Remove unneeded code 2020-11-25 20:07:08 +00:00
Sergio Martins
bc3278b218 qtquick: tst_positionWhenShown 2020-11-25 17:01:37 +00:00
Sergio Martins
d2c55a67df qtquick: Fix more tests 2020-11-25 16:28:54 +00:00
Sergio Martins
a3414fd92b qtquick: Fix tst_addToSmallMainWindow1 2020-11-25 16:10:04 +00:00
Sergio Martins
12f3ba9074 qtquick: Fix some tests 2020-11-25 16:02:42 +00:00
Sergio Martins
034d2c8aee README: Mention Qt6 2020-11-25 12:31:29 +00:00
Sergio Martins
ad3f4141c8 qtquick|tests: Fix main window QWindow not being resized 2020-11-24 18:40:22 +00:00
Sergio Martins
cde2e4e571 qtquick: Fix tst_constraintsAfterPlaceholder
The resize happens sync for QtQuick, so that wait isn't needed
2020-11-24 13:36:10 +00:00
Sergio Martins
e0775467b2 qtquick|tests: Fix verifying frame min size 2020-11-24 13:12:53 +00:00
Sergio Martins
b20ffcde61 tst_negativeAnchorPosition: Fix typo
we need to subtract from height(), not width()
2020-11-24 12:44:00 +00:00
Sergio Martins
43bdb6a4c2 qtquick: Bunch of fixes for min-size support 2020-11-24 11:38:13 +00:00
Sergio Martins
929aabdc0d example: Add --native-title-bar
Behind developer mode for now
2020-11-23 21:37:59 +00:00
Sergio Martins
6a90a5125f TitleBar: these 4 getters are only for development mode 2020-11-23 20:22:45 +00:00
David Faure
77016a619f Fixes for being used as a subproject
* Don't use CMAKE_SOURCE_DIR, always use CMAKE_CURRENT_SOURCE_DIR
* -Werror=undef found that #if was used instead of #ifdef
2020-11-23 21:16:40 +01:00
Sergio Martins
dc328ff7c4 Fix developer mode build on Windows
developer mode will make some 'private' in headers be 'public', this
affects name mangling on MSVC.

kddockwidgets_linter didn't have the developer mode macro enabled,
so there was a mangling mismatch when linking
2020-11-23 17:40:06 +00:00
Sergio Martins
dc13665566 Fix forward declaration 2020-11-23 16:53:52 +00:00
Sergio Martins
d1279ab119 Merge branch '1.1' 2020-11-23 15:57:42 +00:00
Sergio Martins
80bf6032f3 Fix FloatingWindow's title when shown in the taskbar
The window title isn't only important when using native title bar,
it's also important for showing the correct title in the taskbar
or alt-tab.

For example, if using "minimize support", they'll show in the task bar

Fixes issue #101
2020-11-23 15:52:50 +00:00
Sergio Martins
22437e75c6 qtquick: Override min size for FrameQuick
Fixes constriants not propagating from dock widget to frame
2020-11-23 15:45:06 +00:00
Sergio Martins
801e49de9d Make DockWidgetQuick::minimumSize()/max virtual
While for QtWidgets we have layouts which propagate the constraints
up, for QtQuick we don't, so we need to override minimumSize instead
2020-11-23 15:45:06 +00:00
Sergio Martins
a847a574ed qtquick: Delete the frame visual item delayed
If we're in a QML event handler we can't delete the QML item,
it's a QML limitation. We still want to delete the dockwidgets now though
since all tests depend on that.
2020-11-23 15:45:06 +00:00
Sergio Martins
ef8807bc09 Minor style 2020-11-23 15:45:06 +00:00
Allen Winter
d441477fa9 Merge branch '1.1' 2020-11-22 12:25:28 -05:00
Allen Winter
ece7b22bec apidox - fix doc for enum KDDockWidgets::Config::Flag
doxygen likes "///<"  (not "///>")

Issue#106
2020-11-22 12:17:38 -05:00
Sergio Martins
97d8e4f18b qtquick|tests: Be able to deliver a double-click event to a titlebar
Needed for tests
2020-11-20 21:44:06 +00:00
Sergio Martins
9937f5d789 qtquick: Fix floating windows having a parentItem
they are top-level windows, so shouldn't have a parent item.
Only a QObject::parent()
2020-11-20 16:55:00 +00:00
Sergio Martins
675edfe6db qtquick: Move the floating button logic one level up, to the base class
So QtQuick can use the same logic.

Fixes tst_nonDockable too.
2020-11-20 15:35:46 +00:00
Sérgio Martins
c23d179385 Add support for Qt6
Adds the -DKDDockWidgets_QT6=ON option
Also you'll need to port any required Qt6 module first (For example QStateMachine).
2020-11-20 12:36:11 +00:00
Sergio Martins
36af020505 Fix two scoped value rollback being temporaries 2020-11-20 09:55:31 +00:00
Sergio Martins
7b2d195139 qtquick: Put the failing QtQuick tests at the end
So they don't corrupt the passing ones.
Approx 40 need to pass now.
2020-11-19 22:59:00 +00:00
Sergio Martins
984ab3bb13 qtquick: Add support for disabling close button
For when dockwidget isnt' closable.
Fixes tst_nonClosable() too
2020-11-19 22:12:49 +00:00
Sergio Martins
0331f90791 Move title bar logic regarding close button to base class
So QtQuick can use it too
2020-11-19 22:09:40 +00:00
Sergio Martins
b19c53d650 qtquick: Implement some title bar helpers for tests
Mostly getters that return the title button state
2020-11-19 21:45:29 +00:00
Sergio Martins
3670cf2377 qtquick: Comment the embedded main window test
We don't support that yet
2020-11-19 17:49:27 +00:00
Sergio Martins
864670b0a1 qtquick: Fix some cases where floating windows didn't have parent
Happened because floatingWindow->parentWidget() was null. On QtWidgets
this works because QWidget::parentWidget() will return the transient parent
without a problem.
2020-11-19 17:47:02 +00:00
Sergio Martins
0cf148b389 tests: Check for the existence of QWindow at exit, not QWidget
So we're clean for QtQuick too
2020-11-19 16:34:30 +00:00
Sergio Martins
921d0892a0 qtquick: Fix tst_setVisibleFalseWhenSideBySide
Was also broken (but passed) for QtWidgets.
We don't support hidding widgets with setVisible(false).
2020-11-19 11:59:09 +00:00
Sergio Martins
beb2d9e659 qtquick: Add support for non-closable windows
fixes tst_preventClose
2020-11-18 18:13:35 +00:00
Sergio Martins
59168da231 qtquick: Fix crash at exit
Don't delete our QWindow if the QWindow is currently deleting us
2020-11-18 18:10:32 +00:00
Sergio Martins
3dbf699c49 qtquick: Fix QtQuick parenting
Mimic QtWidgets so we have similar behaviour:

- When a MainWindow is deleted, its associated QWindow is deleted
too.
- When a MainWindow is deleted, it deletes any FloatingWindows
which have it as a transient parent
2020-11-18 16:18:42 +00:00
Sergio Martins
baa7561b13 qtquick: Fix tst_addAndReadd
Wasn't even correct for QtWidgets and just passing because the
widget wasn't getting dropped QtWidgets, since the indicator was hidden.

For QtQuick the indicator is also hidden but it's accepting it. To fix.
2020-11-18 14:42:34 +00:00
Sergio Martins
ac5f4b871c qtquick: Fix tst_honourGeometryOfHiddenWindow
We want the geometry of the QWindow
2020-11-18 14:30:08 +00:00
Sergio Martins
52bf449366 qtquick: Fixes for focusing
Fixes tst_focus too, and  maybe a few other tests
2020-11-18 14:01:55 +00:00
Sergio Martins
08a1c4e6df qtquick: Implement focus policy
fixes tst_dockWidgetGetsFocusWhenDocked
2020-11-18 12:35:46 +00:00
Sergio Martins
156dad6e03 qtquick: Fix IndicatorWindow::posForIndicator()
Wasn't even implemented. Should make some tests pass.
2020-11-18 12:06:20 +00:00
Sergio Martins
b642d2df2f qtquick: Fix dropped widget not being the current tab 2020-11-18 11:44:55 +00:00
Sergio Martins
5cedfab82c Make DropIndicatorOverlay::posForIndicator() pure virtual 2020-11-18 11:44:02 +00:00
Sergio Martins
af9d62a58c qtquick: Fix FloatingWindows not being destroyed when empty
Also fixes tst_createFloatingWindow
2020-11-17 23:15:33 +00:00
Sergio Martins
0758496b0d Fix QtQuick build without developer mode 2020-11-17 21:15:07 +00:00
Sergio Martins
a452723919 Fix tests running with a nullptr state machine 2020-11-17 21:08:05 +00:00
Sergio Martins
774e66ba6f Minor: add an assert
Provides a nicer backtrace when it happens.
Currently repro on QtQuick only
2020-11-17 21:04:32 +00:00
Sergio Martins
f13de89db5 tests. Fix utils.h draggableFor() for QtQuick 2020-11-17 20:44:04 +00:00
Sergio Martins
1393ae224f Fix DockWidget::windowActiveAboutToChange() being emitted too much
Was being emitted even when it didn't affect our window.
This caused an explosion of signals when we had many dock widgets.
2020-11-17 18:52:54 +00:00
Sergio Martins
d92d7c258c tests: Remove stray qDebug 2020-11-17 18:15:38 +00:00
Sergio Martins
619ca74051 Use QFAIL instead of qFatal
more elegant, and test can continue, so we see the whole result
2020-11-17 18:15:03 +00:00
Sergio Martins
aa39a71ae5 Rename tst_common to tst_docks
Now that tst_docks was all ported let's have the old name again.
Also cmake -jN now works, as tst_docks is called by the tests_launcher
while tst_common was not
2020-11-17 15:44:49 +00:00
Sergio Martins
f4e33c1409 tests: Port the remaining tests to QtQuick
Tests now build with QtQuick too.
2020-11-17 15:26:14 +00:00
Sergio Martins
ad96336a36 Also init resources if QT_STATIC is defined
Should help with WASM, so you don't need to manually call
Q_INIT_RESOURCE
2020-11-17 11:35:37 +00:00
Sergio Martins
50d1e75709 Fully scope the qrc resource files
So they don't clash when KDDW is a static library
2020-11-17 11:33:22 +00:00
Sergio Martins
793c4e509b Fix crash regarding edge case of dragging window to itself
If we're not showing a title bar, then the draggable is the tabbar,
not the floating window.
2020-11-16 22:55:45 +00:00
Sergio Martins
e4a33ad8b7 Added README for wasm
Fixes issue #100
2020-11-13 18:45:58 +00:00
Sergio Martins
52cf53ce5c example: init resources if static
Fixes title bar not having icons on WASM
For issue #100
2020-11-13 18:33:13 +00:00
Sergio Martins
8791870efb Blacklist classical indicators on WASM
Use segmented indicators.
Wasm doesn't support top-level windows with translucency, which
is required for the classical indicators

For issue #100
2020-11-13 18:18:25 +00:00
Sergio Martins
4f8c47bfa4 Don't require Qt5X11Extras for web assembly
For issue #100
2020-11-13 17:43:38 +00:00
Sergio Martins
ad141df6b1 Merge branch '1.1' 2020-11-13 16:00:49 +00:00
Sergio Martins
72605292b7 Don't show dock/undock icon when dockwidget is not dockable
Fixes issue #99
2020-11-13 15:51:26 +00:00
Sergio Martins
1443eff1d9 tests: Port some tests to QtQuick
15 to go
2020-11-10 18:00:19 +00:00
Sergio Martins
22d5db32ce FocusScope: Remove focus when nothing is focused 2020-11-09 15:25:32 +00:00
Sergio Martins
e9a321039f Renamed signal to windowActiveAboutToChange()
Added the 'aboutTo', as the event hasn't been caught by the top-level
window yet
2020-11-09 13:46:16 +00:00
Sergio Martins
b93f115b53 Added DockWidget::windowActiveChanged() signal
Tracking the top-level window's 'isActiveWindow' property is difficult
since the dock widget's top-level window is changing all the time
when docking and undocking. So added a convenience signal
2020-11-09 13:35:05 +00:00
Sergio Martins
7faaf2cc69 tests: Port more tests to QtQuick
18 to go before we start fixing them
2020-11-08 15:18:16 +00:00
Sergio Martins
978f9d3a5e tests: Port another test to QtQuick
29 to go
2020-11-06 23:52:48 +00:00
Sergio Martins
09793b3481 tests: Port more tests to QtQuick
31 to go
2020-11-06 23:33:02 +00:00
Sergio Martins
f4d9a96ddb Added Config::Flag_KeepAboveIfNotUtilityWindow
Which sets Qt::WindowStaysOnTopHint for floating windows.
Usually unneeded, as floating windows are Qt::Tool with a transient
parent, but in case you're using Flag_DontUseUtilityFloatingWindows
then you might want (or not) to keep them above.
2020-11-05 12:11:48 +00:00
Sergio Martins
4ac892038f Fix QtQuick build 2020-11-04 11:34:35 +00:00
Colin Ogilvie
387ba291be export FocusScope 2020-11-04 11:32:42 +00:00
Sergio Martins
5d3d189774 tests: Port 1 test to QtQuick 2020-11-03 17:22:50 +00:00
Sergio Martins
a6a1047f75 FocusScope: Also honour widgets embedded in the tab bar
A widget embedded in a tab bar (like a line edit) lives outside
the DockWidget but inside the Frame. It should still focus the
current dockwidget.
2020-11-03 17:12:21 +00:00
Sergio Martins
3e70b846e8 FocusScope: Modify the member variable before emitting signal 2020-11-03 16:19:47 +00:00
Sergio Martins
0a2aebd78d FocusScope: Also focus when the user clicks on tab widget background
Relevant when you don't have a title bar
2020-11-03 15:29:13 +00:00
Sergio Martins
ddad0feaf3 tests: Additional 5 tests build for QtQuick now
37 to go
2020-11-02 20:04:14 +00:00
Sergio Martins
aba1cce1f6 Merge branch '1.1' into master 2020-11-02 11:37:56 +00:00
Sergio Martins
7318675e84 Clarify comment about fractionaly scalling factors
The problem can happen on Windows too.

Fixes issue #94

Nothing more we can do here, it's fixed for Qt 5.15.2.
2020-11-02 11:36:24 +00:00
Sergio Martins
cf700f8eb6 tests: port more tests to QtQuick
43 to go
2020-10-30 18:29:59 +00:00
Sergio Martins
2c1d099c83 Fix include here too 2020-10-30 12:27:50 +00:00
Sergio Martins
91ff29ae64 Fix build when KDDW is embedded within a project 2020-10-30 12:21:25 +00:00
Renato Araujo Oliveira Filho
523dfb0d12 Fix python bindings build 2020-10-30 08:36:15 -03:00
Sergio Martins
b84e0f3605 tests: More tests are now building with QtQuick
56 to go
2020-10-29 18:11:24 +00:00
Sergio Martins
f72e8e6a1c tests: Port 5 more tests 2020-10-28 22:57:28 +00:00
Sergio Martins
c6c1fe79c3 Fix QtQuick build
src/ is no longer in the include path
2020-10-28 22:15:32 +00:00
Sergio Martins
ea382dcc17 cmake: Install DockRegistry_p.h
It's available as private API if anyone wants to use it
2020-10-28 21:55:02 +00:00
Sergio Martins
c142eb8ecd trying to fix the python build
after the include paths changes
2020-10-27 21:40:51 +00:00
Sergio Martins
46c039153e cmake: Don't export src/ to include path
Otherwise applications can't have files named MainWindow.h or
DockWidget.h.

Now all kddockwidgets includes need to be scoped, example:
2020-10-27 17:01:18 +00:00
Sergio Martins
473f03360c tests: Fix Wweak-vtables warnings 2020-10-26 18:59:21 +00:00
Sergio Martins
3fb3984a72 Merge branch '1.1' 2020-10-26 18:23:17 +00:00
Sergio Martins
9c5e3cf5af tests: Port another test to QtQuick 2020-10-26 18:22:01 +00:00
Sergio Martins
7419ca806d tests: Port 2 more tests to QtQuick 2020-10-26 17:32:13 +00:00
Allen Winter
8a51c31663 OBS - update for 1.1.0 release 2020-10-26 12:14:46 -04:00
Sergio Martins
a586a7894b cmake: Qt5::GuiPrivate is only needed on Windows 2020-10-26 16:14:07 +00:00
Sergio Martins
31fcbebaff ChangeLog: Add the date of 1.1 release 2020-10-26 15:29:47 +00:00
Sergio Martins
c4cc6b3e6e tests: Port more tests to QtQuick 2020-10-25 22:39:10 +00:00
Sergio Martins
420ac9044e Merge branch '1.1' into master 2020-10-23 17:11:45 +01:00
Sergio Martins
392dac5691 Use Qt::WA_PendingMoveEvent instead of Qt::WA_Moved
We check if the user provided position before putting a floating
window in a default position. Qt::WA_Moved however has the problem
that it's not cleared, so second time you show a window, it will
have it, even if user didn't set geometry.

Use Qt::WA_PendingMoveEvent instead, which was made for tracking
moves made before the first show.
2020-10-23 17:07:14 +01:00
Sergio Martins
29744c01c6 ChangeLog: Added Config::setTabbingAllowedFunc 2020-10-23 10:33:37 +01:00
Sergio Martins
a16adb9578 Merge branch '1.1' 2020-10-23 10:32:10 +01:00
Sergio Martins
49e488df24 remove roadmap from 1.1 ChangeLog
We only have it for master
2020-10-23 10:29:57 +01:00
Sergio Martins
1a3f00eac8 ChangeLog: Added HDPI improvements 2020-10-23 10:29:00 +01:00
Sérgio Martins
c6ea8d5525 ChangeLog: Remove mention to 1.0.1 release
We're releasing 1.1 asap
2020-10-23 10:23:52 +01:00
Sergio Martins
7738585d01 tests: Enabled another batch of tests for QtQuick
83 of 175 are now building with QtQuick
2020-10-22 20:54:39 +01:00
Sergio Martins
61bc24c6ea tests: A bunch of drag/mouse functions are not compatible with qtquick
In the sense that they build.
2020-10-21 22:43:08 +01:00
Sergio Martins
ae90001d7a tests: Remove some QWidget ifdefs
Works fine for QtQuick too
2020-10-21 21:08:03 +01:00
Sergio Martins
c0ea3a097c tests: Port a test to qtquick 2020-10-21 21:05:03 +01:00
Sergio Martins
abca57be11 qtquick: Fix tst_stealFrame
Now has the same behaviour as with QWidgets
2020-10-20 22:36:45 +01:00
Sergio Martins
645201480c qtquick: Port two tests 2020-10-20 22:05:29 +01:00
Sergio Martins
8cffba3e22 Merge branch '1.1' into master 2020-10-19 21:25:39 +01:00
Sergio Martins
8f62004f5b cmake: Remove QTQUICK option for 1.1
Leave it in master only.
2020-10-19 21:23:44 +01:00
Sergio Martins
4fff6edb7b qtquick: Port another test 2020-10-19 21:03:47 +01:00
Sergio Martins
64cff4ba49 qtquick|tests: use auto instead of QPointer<QWidget> 2020-10-19 21:00:18 +01:00
Sergio Martins
ce3c4d5661 qtquick|tests: pass parent to main window
Those tests pass now
2020-10-19 20:58:00 +01:00
Sergio Martins
5f333f0934 qtquick: port more tests 2020-10-19 20:53:40 +01:00
Sergio Martins
f70722934c qtquick: Port more tests 2020-10-19 20:47:09 +01:00
Sergio Martins
b9eb9f10d4 qtquick: Port more tests 2020-10-19 20:26:09 +01:00
Sergio Martins
6f89d94eef qtquick: Emit Frame::layoutInvalidated() when needed
When min/max size changes it needs to be emitted, so layout
notices
2020-10-19 20:06:29 +01:00
Sergio Martins
3a494d706a qtquick: Implement missing QWidgetAdapter::floatingWindow() 2020-10-19 19:05:10 +01:00
Sergio Martins
2ffbe07bcf Updated README-Wayland.md 2020-10-19 11:46:22 +01:00
Sergio Martins
371fd361a8 Detach when double-click on tab bar background, if no title bar
When a title bar isn't visible, we need a way to detach an entire
group of tabs by double clicking, required for wayland.

Implemented for all platforms, as it makes sense
2020-10-19 11:42:39 +01:00
Sergio Martins
97416607e5 qtquick: Allow to set min-sizes on items 2020-10-18 23:27:10 +01:00
Sergio Martins
51ccbe7c7c Move TabBar::detachTab() to Frame
As the code doesn't have anything specific to QTabBar.
Means QtQuick can reuse it without needing a TabBarQuick.

tst_crash now passes for QtQuick too
2020-10-18 23:07:13 +01:00
Sergio Martins
65599399c7 qtquick: port a bunch of tests 2020-10-18 22:23:51 +01:00
Sergio Martins
c0816d4924 qtquick: Fix tst_negativeAnchorPosition5
min sizes weren't bounded
2020-10-18 21:58:46 +01:00
Sergio Martins
2988e97e14 qtquick: Fix build 2020-10-18 20:29:44 +01:00
Sergio Martins
046ceae500 Remove unneeded null check from DropArea::drop() 2020-10-18 12:31:04 +01:00
Sergio Martins
33c0cda582 Minor readability, just call setWindowBeingDragged(true)
It's always true here.
2020-10-18 12:28:10 +01:00
Sergio Martins
df7acc1075 Added README-Wayland.md to explain some differences
Fixes issue #10
2020-10-17 12:30:57 +01:00
Sergio Martins
3859e4b277 Added Wayland to the README 2020-10-17 12:18:05 +01:00
Sergio Martins
26253b65c7 wayland: Silence warning about qpa not supporting activating
"qt.qpa.wayland: Wayland does not support QWindow::requestActivate()"
2020-10-17 12:13:58 +01:00
Sergio Martins
424453ab57 Double clicking on a tab will make it float
Also really required for Wayland, where we don't another way to
float a single tab, as the float button affects all of them.
2020-10-17 12:09:47 +01:00
Sergio Martins
d7de0ebd20 Updated ChangeLog
- Added wayland for 1.2, it's done. Might need more polishing.
- Removed 1.0.1, let's release 1.1 instead
- Moved QtQuick to 1.3. The december target is still there, but I want
to release 1.2 sooner, since the wayland support is done.
2020-10-17 11:44:45 +01:00
Sergio Martins
bf1c5140cd Wayland: Fix another missing mapToGlobal
Hovering indicators was fine, but dropping was off by a few pixels
vertically due to the menu bar
2020-10-17 11:41:19 +01:00
Sergio Martins
fb7a35db5b Wayland: Fix indicator hover being off
Drag events are in local coords, while DropArea wants it in
global
2020-10-17 11:05:56 +01:00
Sergio Martins
5872c2fbe3 Wayland: Support classical indicators too
The Indicator Window is top-level, but on Wayland that can't do,
as we have no way to position it. So parent it. The indicators
are now under the window being dragged, but that's no so bad, as it's
smi-transparent, so you still see the indicator.
2020-10-17 11:02:49 +01:00
Sergio Martins
ba04c70d5a Minor code re-ordering 2020-10-17 10:30:26 +01:00
Sergio Martins
de1e2d301f wayland: Support affinities too 2020-10-17 10:27:43 +01:00
Sergio Martins
b67bdf779e Don't dereference windowBeingDragged->floatingWindow()
Add a level of indirection instead, and support for the wayland case
2020-10-16 23:06:30 +01:00
Sergio Martins
78a3221395 Merge branch '1.1' into master 2020-10-16 22:05:14 +01:00
Sergio Martins
f698b56dad relax test
Seems to happen with 5.15 static. It's benign anyway
2020-10-16 22:02:45 +01:00
Sergio Martins
4ed18fdf1d Introduce Config::setTabbingAllowedFunc(<lambda>)
This gives a lot of power to the user to disallow tabbing two dock
widgets, while still allowing them to be docked side by side. As
this can't be achieved with affinities.

Instead of adding API which might not be enough soon, just allow
the user to pass a lambda and implement his very custom requirement.

Fixes #91
2020-10-16 21:56:33 +01:00
Sergio Martins
6e05f13c77 Added FloatingWindow::dockWidgets() 2020-10-16 21:48:47 +01:00
Sergio Martins
cb51d0af11 Merge branch '1.1' into master 2020-10-16 20:53:17 +01:00
Sergio Martins
a146cd81b2 Fix mac tests build 2020-10-16 20:52:22 +01:00
Sergio Martins
8dbd6df456 Merge branch '1.1' into master 2020-10-16 20:35:56 +01:00
Sergio Martins
ac6d845c8d Skip tests on macOS+offscreen if Qt <= 5.15.0
There's a bug in Qt qpa only fixed in 5.15.1
2020-10-16 20:35:04 +01:00
Sergio Martins
cfc9d1abcd cmake: Fix indentation 2020-10-16 19:43:50 +01:00
Sergio Martins
a66748f6ca relax test
Seems to happen with 5.15 static. It's benign anyway
2020-10-16 17:10:40 +01:00
Sergio Martins
e5f46ead3b qtquick: Fix build 2020-10-16 17:08:36 +01:00
Sergio Martins
171023558e Introduce WindowBeingDraggedWayland
This is just a cleanup. Instead of having WindowBeingDragged
having both code paths, let's keep the non-wayland platforms code
small and clean.
2020-10-16 17:08:36 +01:00
Allen Winter
059a424b88 Merge branch '1.1' 2020-10-16 08:39:26 -04:00
Sergio Martins
307b22deaf Wayland: Also allow to drag by tab widget
For when we don't have title bar
2020-10-16 13:30:20 +01:00
Sergio Martins
e405688f67 Fixing build with msvc 2013
error C2876: 'QMimeData' : not all overloads are accessible
2020-10-16 13:16:13 +01:00
Sergio Martins
68554119f4 Fix -Werror build on mac 2020-10-16 11:46:02 +01:00
Sergio Martins
86a4a740ef wayland: dropping a single tab or frame now works too 2020-10-16 11:33:09 +01:00
Sergio Martins
0a004b83ca Add WindowBeingDragged::draggable() getter 2020-10-16 11:16:49 +01:00
Sergio Martins
4fa47403c5 Make DragArea::drop() deal in WindowBeingDragged()
Preparing for wayland case.
2020-10-16 10:49:42 +01:00
Sergio Martins
9e418ced53 wayland: Finish WindowBeingDragged::maxSize() and minSize
Supports now single dock widgets or single frames
2020-10-16 10:40:34 +01:00
Sergio Martins
bc04863439 Wayland: Dragging a tab or a nested dock widget now shows pixmap
TODO: Supporting a drop for those two cases
2020-10-16 10:33:01 +01:00
Allen Winter
77f259a435 README.md - contact info 2020-10-15 16:06:26 -04:00
Sergio Martins
16bcace663 Add some transparency to the QDrag pixmap
Looks better
2020-10-15 19:15:40 +01:00
Sergio Martins
52fddaa1cd wayland: Set a pixmap while DND
Since our source window isn't moving, let's at least show a copy
of it on the pixmap

A bunch of tearing going on kwin_wayland/nvidia though.
Weston/nvidia is fine.
Haven't tried kwin_wayland/Intel yet
2020-10-15 19:11:12 +01:00
Sergio Martins
f3d7400c15 wayland: End the drag properly when user cancels the drag 2020-10-15 19:02:46 +01:00
Allen Winter
7ebc3f3533 src/DockWidgetBase.h - fix compile after merge from master 2020-10-15 12:43:29 -04:00
Renato Araujo Oliveira Filho
0ee94b425e Fixed python bindings generation 2020-10-15 12:38:32 -04:00
Sergio Martins
d44a173945 Wayland: Really end the drag after dropping
Fixes a crash on shutdown
2020-10-15 17:27:12 +01:00
Sergio Martins
ac001d6f32 wayland: Don't allow to drop onto itself
It was showing the drop indicators in the window being dragged
2020-10-15 16:50:46 +01:00
Sergio Martins
e3de2df69c wayland: Add initial drag and drop support
You can drag a floating window and drop it somewhere

- Only works with segmented indicator style. Classical indicators
require us being able to positioning an overlay, which wayland
doesn't allow us to.
- Detaching inner tabs and dock widgets not implemented yet.
- polishing needed
2020-10-15 16:50:46 +01:00
Sergio Martins
39d3c90b2f Minor variable rename for readability 2020-10-15 16:50:46 +01:00
Sergio Martins
bca21defa5 wayland: Don't grab mouse or set window opacity
Not supported by the QPA and not needed for wayland anyway
2020-10-15 16:50:46 +01:00
Sergio Martins
dd3116ae7f Minor: remove const, need to pass it somewhere else 2020-10-15 16:50:46 +01:00
Allen Winter
49b3765eae Merge branch '1.1' 2020-10-15 10:53:41 -04:00
Allen Winter
1f5dd35bec Merge pull request #93 from KDAB/fix-python-binding
Fixed python bindings generation
2020-10-15 10:52:44 -04:00
Renato Araujo Oliveira Filho
6fce8e6161 Fixed python bindings generation 2020-10-15 09:55:32 -03:00
Allen Winter
e57b46979d buildsystem - fix installation path for Python bindings 2020-10-14 16:27:18 -04:00
Allen Winter
683b67abb0 buildsystem - install libs with symlinks for the major vers 2020-10-14 15:59:53 -04:00
Sergio Martins
6479bcabfb Make DropArea::drop() receive WindowBeingDragged instead
In prep for wayland support
2020-10-14 20:42:51 +01:00
Sergio Martins
a8c9735652 wayland: Add needed API to WindowBeingDragged
So it can act as a substitute for FloatingWindow, which we don't
always have during a drag
2020-10-14 20:34:55 +01:00
Sergio Martins
93b25b6a31 Make MultiSplitter::rectForDrop() receive WindowBeingDragged
Instead of FloatingWindow, which won't exist on wayland while a
drag is in progress.
2020-10-14 20:25:09 +01:00
Sergio Martins
4eb5a0940e dont' cast pointer to bool 2020-10-14 19:44:27 +01:00
Sergio Martins
c2cc914b5c indicators: Depend less on FloatingWindow
Deal in terms of WindowBeingDragged instead, as wayland won't have
a floating window being dragged
2020-10-14 19:39:51 +01:00
Sergio Martins
1219ba90af Add WindowBeingDragged::affinities()
So we can deal in WindowBeingDragged instead of FloatingWindow.
For wayland we won't have floating window whilst dragging
2020-10-14 19:22:13 +01:00
Sergio Martins
beef3c7fb5 Specialize StateDragging for wayland
Introduces StateDraggingWayland. Wayland is the alien, so don't want
to introduce hacks in the existing clean code.

StateDraggingWayland will deal with the wayland workarounds.

Although the impl only has placeholders for now I'm committing it
because it's already an improvement: broken detachment is no longer
possible. Detached windows were going to a random place on screen.
2020-10-14 18:12:25 +01:00
Sergio Martins
52184ca72b Added StateBase::isActiveState() 2020-10-14 18:01:48 +01:00
Sergio Martins
78cd7c56f7 Minor: Switch order of ifdefs
Will want to add a case for wayland too.
2020-10-14 16:41:17 +01:00
Sergio Martins
7805a1dc25 wayland: Use both client and native titlebar
native will be used for moving while client for DND
2020-10-14 16:32:10 +01:00
Sergio Martins
92f426e4c0 wayland: Allow floating windows to properly move
They move now, but don't drag yet.
2020-10-14 16:25:05 +01:00
Sergio Martins
90f10042fd Merge branch '1.1' into master 2020-10-14 15:22:04 +01:00
Allen Winter
697c140883 set version to 1.1.0 2020-10-14 10:07:48 -04:00
Sergio Martins
3369816d31 Merge branch '1.1' into master 2020-10-14 14:59:44 +01:00
Sergio Martins
819725351a Fix -Wweak-vtables warnings 2020-10-14 14:55:28 +01:00
Allen Winter
860cbd29bc Merge branch '1.1' 2020-10-13 13:24:03 -04:00
Allen Winter
07db9f9a7a cmake/Python/FindShiboken2.cmake - clean 2020-10-13 13:23:39 -04:00
Allen Winter
2fd4f9ce97 Merge branch '1.1' 2020-10-13 12:51:38 -04:00
Allen Winter
77d7cd7d58 buildsystem - namespace CMake options
OPTION_DEVELOPER_MODE => KDDockWidgets_DEVELOPER_MODE
OPTION_BUILD_PYTHON_BINDINGS => KDDockWidgets_PYTHON_BINDINGS
PYTHON_BINDINGS_INSTALL_PREFIX =>
  KDDockWidgets_PYTHON_BINDINGS_INSTALL_PREFIX
OPTION_QTQUICK => KDDockWidgets_QTQUICK
2020-10-13 12:28:49 -04:00
Allen Winter
e5cb42c4fe CMakeLists.txt - improve installing to non-KDAB location 2020-10-13 11:32:12 -04:00
Allen Winter
1fe1d619a9 footer.html - update tag line 2020-10-13 11:30:14 -04:00
Sergio Martins
697cc34c23 Merge branch '1.1' into master 2020-10-12 18:10:53 +01:00
Sergio Martins
b00d1d80b0 Merge branch '1.0' into 1.1 2020-10-12 18:09:54 +01:00
Sergio Martins
67bb42c5b4 Fix infinite loop when updating title bar visibility
Not exactly infinite, just exponential growth or worse
Fixes #92
2020-10-12 18:09:32 +01:00
Sergio Martins
d50fcb80c5 qtquick: Fixed all the layouting spam/warnings
Don't layout a view with 0x0.
2020-10-12 17:07:30 +01:00
Sergio Martins
9571ffc30e Remove unneeded qDebug 2020-10-12 17:05:39 +01:00
Sergio Martins
f4a88276b8 qtquick|tests: ported two more tests 2020-10-11 13:05:51 +01:00
Sergio Martins
4ea254029a qtquick: Fix tst_negativeAnchorPosition3
MainWindow needed a parent.
Also normalized deletion of the floating window.
2020-10-11 13:00:09 +01:00
Sergio Martins
f5e85c2196 qtquick|tests: Add a few more tests 2020-10-11 12:55:25 +01:00
Sergio Martins
926103325c qtquick: Fix close events not being delivered
Also ported some tests from tst_docks to tst_common, which
were failing due to close events not working. Fixed now
2020-10-11 12:42:20 +01:00
Sergio Martins
20b2988165 Unfold an assert into a qWarning+assert
Just to print some debug data
2020-10-11 11:58:32 +01:00
Sergio Martins
39aefd312b qtquick|tests: Don't abort tests due to binding loop warnings
Don't want to care about it right now
2020-10-11 11:53:55 +01:00
Sergio Martins
b5478bcb0d tests: Enable a bunch of tests for QtQuick
only one is failing
2020-10-11 11:44:47 +01:00
Sergio Martins
d403557b9e tests: Abstract QPushButton somewhat
Anything refering QPushButton will simply compile with QtQuick.
2020-10-10 21:07:18 +01:00
Sergio Martins
db9884ea64 qtquick: Enable tst_setFloatingSimple and tst_restoreSimple 2020-10-10 20:53:27 +01:00
Sergio Martins
74148aabc3 tests: Don't complain there's a leak if the FloatingWindow is being deleted already 2020-10-10 20:52:56 +01:00
Sergio Martins
7bfac091ae Rename DockRegistry::nestedwindows() to DockRegistry::floatingWindow
which is the naming we use everywhere else
2020-10-10 20:41:42 +01:00
Sergio Martins
60a68817b6 qt_quick: Enable tst_restoreCentralFrame too
Removes a warning from FrameQuick. It's benign.
For QtWidgets we also set a -1 tab index to clear
2020-10-10 20:25:46 +01:00
Sergio Martins
a56e6d7fe8 qtquick: Enable tst_simple2 2020-10-10 20:10:43 +01:00
Sergio Martins
1f0b208922 qtquick: Enable tst_resizeWindow too 2020-10-10 12:15:18 +01:00
Sergio Martins
9da147f50e qtquick: Enable tst_floatingWindowTitleBug too 2020-10-10 11:52:38 +01:00
Sergio Martins
c175451284 qtquick: Fix user geometry not being honoured
QtQuick doesn't set Qt::WA_Moved, which we expect. Set this attribute
in the wrappers then.

Fixes the unit-test too.
2020-10-10 11:46:24 +01:00
Sergio Martins
9a88cf3a72 tests: Enable tst_honourUserGeometry for QtQuick
It's failing. Will fix.
2020-10-10 11:36:16 +01:00
Sergio Martins
d0255e5310 tests: Use DockWidgetType instead of DockWidget
Will be easier to enable QtQuick support
2020-10-10 11:24:32 +01:00
Sergio Martins
2a2fb0a4f2 tests: Enable tst_sizeAfterRedock for QtQuick too 2020-10-10 11:18:40 +01:00
Sergio Martins
b0ad939db8 tests: Enable tst_tabbingWithAffinities for QtQuick 2020-10-10 11:18:40 +01:00
Allen Winter
5abf118b8c Merge branch '1.1' 2020-10-10 05:30:38 -04:00
Allen Winter
f5099167b6 misspelling-- 2020-10-10 05:29:08 -04:00
Sergio Martins
30949bd4c3 quick: Fix test, don't leak window 2020-10-09 19:15:55 +01:00
Sergio Martins
63279c187e quick: Fix QtQuick not reacting to parent change events
- We were calling event() directly, which skiped event filters.
- The handler was calling parent(), but the setParent() call is done
later. So first call setParentItem()
2020-10-09 19:09:45 +01:00
Sergio Martins
fad03f8e0b Debug++ 2020-10-09 19:08:51 +01:00
Sergio Martins
6edfcc4f02 Install DragController_p.h
Still private. It's for advanced used only.
2020-10-09 17:26:00 +01:00
Sergio Martins
17df7b5b4e Install DragController_p.h
Still private. It's for advanced used only.
2020-10-09 16:56:43 +01:00
Sergio Martins
62cbd823c9 quick: Assert that we're not using this QtWidgets only function 2020-10-08 16:25:29 +01:00
Sergio Martins
bdcc211308 quick: Resize FloatingWindow and it's QWindow immediately
So it matches QtWidgets behaviour, otherwise tests will
break a lot if they have to wait for an event loop for FloatingWindow
to be resized
2020-10-08 16:20:12 +01:00
Sergio Martins
ddeb4611a1 quick: Fix an invalid cast to QWidget
We don't have QtWidgets in QtQuick.
Will try to fix it at a build-system level so we catch these
cases sooner.
2020-10-08 16:15:56 +01:00
Allen Winter
ad639c8001 CMakeLists.txt - increase version number for 1.2 2020-10-08 09:48:16 -04:00
Sergio Martins
15dc64d550 quick: Fix positioning windows when floating them
- Resizing the FloatingWindow wasn't resizing the QQuickView
- QQuickItems were being created as visible, while QWidgets are
created invisible. Fixed this difference in behaviour
2020-10-07 19:43:40 +01:00
Sergio Martins
03b575d16e quick: Fix MultiSplitter()::mainWindow()
Works now for QtQuick
2020-10-06 21:04:25 +01:00
Sergio Martins
4cacee45e8 Export MultiSplitter
Has powerful private api which could be useful
2020-10-06 11:03:52 +01:00
Sergio Martins
873b860203 ItemContainer: Make some getters public
They're decent private api for some very custom use cases
2020-10-06 10:53:15 +01:00
Sergio Martins
128ae2d889 Fix separators not being deleted
Bug found with QtQuick but also reproducible with QtWidgets.
Added unit-test for both stacks.
2020-10-05 18:25:33 +01:00
Sergio Martins
b0ec0e22e4 quick: Remove unused Separator.qml
We have one in multisplitter/ already
2020-10-05 17:34:27 +01:00
Sergio Martins
6aa4e979dc Added DockWidgetBase::hasPreviousDockedLocation() 2020-10-05 13:52:36 +01:00
Sergio Martins
36f225b859 Fix build with MinGW, no pragma link
Instead use cmake to link, which is cleaner anyway.

As a drive-by, remove the QtWidget check from the headers includes,
as QtQuick also needs Dwm lib
2020-10-05 03:15:36 -07:00
Sergio Martins
48a75b2450 Fix namespaced build 2020-10-05 10:21:20 +01:00
Sergio Martins
2af4f939dd tests|quick: Fix leak 2020-10-04 20:37:00 +01:00
Sergio Martins
b592d21064 quick: Also run tst_resizeWindow2 for QtQuick 2020-10-04 20:22:43 +01:00
Sergio Martins
3cdd5afe7a quick: Fix ownership of the floating view
Not nice to delete it in two places.
2020-10-04 20:16:30 +01:00
Sergio Martins
0ef56c1302 quick: Fix the overlay from minimizing windows being dragged 2020-10-04 19:41:26 +01:00
Sergio Martins
96f7f38a0e tests|quick: Set a source in the view, so we have a root item 2020-10-04 19:39:13 +01:00
Sergio Martins
689ba7da8f quick: Make dealing with window flags more stable
There's only one place where we need to set the flags, it's when
creating the FloatingWindowQuick. So no need to complex machinery
which is bug propne
2020-10-04 11:12:35 +01:00
Sergio Martins
951aeece6e quick: Make DockWidgetBase::setWidget() virtual
The QtQuick counter-part needs to do some specific things, like
settings anchors.parent: fill on it, and parenting it
2020-10-04 00:01:32 +01:00
Sergio Martins
2ea0d54e6c quick: Fix floating windows not having the correct window flags
Add a unit-test too.
2020-10-03 23:30:13 +01:00
Sergio Martins
1c98fe04ca Fix build 2020-10-03 23:11:40 +01:00
Sergio Martins
59a9ab6642 tests: Remove org.kde.desktop from warning blacklist
It's now solved by not using the kde QQC2 style. So no need to polute
the warning list
2020-10-03 23:07:49 +01:00
Sergio Martins
7ee5949ae2 tests|quick: Fix memory leaks 2020-10-03 23:07:04 +01:00
Sergio Martins
721f08e29b tests: Show the QQuickView and cleanit up
Also commit main.qml I forgot
2020-10-03 22:49:27 +01:00
Sergio Martins
df07133c9d tests: Silence some QML warnings from KDE theme plugin Kirigami
We don't want tests to abort because of that
2020-10-03 22:48:28 +01:00
Sergio Martins
b9e3024720 tst_common now passes for QtQuick
Needed a view
2020-10-03 22:10:38 +01:00
Sergio Martins
d848d3e39a MainWindow: Receive either QWidget or QQuickItem as parent
No need to receive the more complex adapters
2020-10-03 22:09:56 +01:00
Sergio Martins
3f26f4c8f2 Remove unused variable 2020-10-03 22:09:26 +01:00
Sergio Martins
dc9d709dd7 quick: Use proper icons for close and float
No more red rectangles
2020-10-03 18:55:33 +01:00
Sergio Martins
543f734650 Added DragController::enableFallbackMouseGrabber()
So it's easier to test the fallback mouse grabber
2020-10-03 18:37:26 +01:00
Sergio Martins
3fb723a82f quick: Fix QtQuick build 2020-10-03 18:27:22 +01:00
Sergio Martins
71c2f34ed4 quick: Add needed pure virtual FrameQuick::renameTab()
Not needed to have much of an impl, it's just to fix the build.
For QtQuick the tab's titles are updated via bindings
2020-10-03 18:15:56 +01:00
Sergio Martins
d4b3bf9de6 quick: Added support for showMinimized() 2020-10-03 18:11:33 +01:00
Sergio Martins
2b234f313c quick: Remove some QWidget specific code from MainWindowBase 2020-10-03 18:10:23 +01:00
Sergio Martins
d1b2d17f7d Allow the normal/restore icon to be different than float/dock
Allow we use the same icon, the user might now want to, so allow
them to use a different icon
2020-10-03 14:58:07 +01:00
Sergio Martins
f062ab7a64 TitleBar: Move button construction into the FrameWorkWidgetFactory
So it can be more easily overridden by the user.
A virtual in TitleBarWidget is not good enough as we can't call virtuals
when in the ctor
2020-10-03 14:52:44 +01:00
Sergio Martins
f009f57581 Move TitleBarButtonType next to all other enums 2020-10-03 14:29:36 +01:00
Sergio Martins
f86a818e69 TitleBar: Add an enum to describe each button type 2020-10-03 14:24:40 +01:00
Sergio Martins
bb80c2158d Fix outter_bottom_active.png
Was missing an outline for some reason
2020-10-03 13:57:32 +01:00
Sergio Martins
86fa6258f6 Comment++ 2020-10-03 13:56:51 +01:00
Sergio Martins
545536fab5 Support high-res icons when on 1.5x scaling and Qt >= 5.15.2
Icons look nice now on linux with 1.5x. Windows and macOS don't use
fractional scaling, so not affected

Fixes #11

Will open a separate bug report to get high-res docking indicators.
2020-10-03 13:21:06 +01:00
Sergio Martins
ef23553b66 Fix high-res unauto-hide icon
We had it but we were still using the old one in C++
2020-10-03 12:04:39 +01:00
Sergio Martins
fcf56664cc Add high-res icons for minimize and maximize 2020-10-03 11:50:33 +01:00
Sergio Martins
d932166bcd Add high-res icons for dock/float 2020-10-03 11:43:15 +01:00
Sergio Martins
0c5783774d Added high-res close icon 2020-10-03 11:38:26 +01:00
Sergio Martins
aa42ea15f7 Add high-res versions for auto-hide and unauto-hide png
1.5x is disabled for now, as Qt < 5.15.2 has a rounding bug
rendering them
2020-10-03 11:28:21 +01:00
Sergio Martins
9dd778d55d Pass the correct icon size when rendering a button
Needed when rendering with different scaling
2020-10-03 10:57:54 +01:00
Sergio Martins
ac35a919f4 Don't show center/tab docking indicator when there's no affinity
If the dock widget can't dock there as tabbed, don't show the
indicator
2020-10-02 17:35:15 +01:00
Sergio Martins
a32c5017e6 Minor: Remove unneeded variable 2020-10-02 17:24:50 +01:00
Sergio Martins
7995a6d13b Windows: Fix dragging sometimes not showing indicators
DragController thought there was a resize going on.
The hardcoded margins in FloatingWindow::isInDragArea() arent
needed anymore.

iPlease enter the commit message for your changes. Lines starting
2020-10-02 17:05:16 +01:00
Sergio Martins
d4ec2eec88 Windows: Added support for drop shadow for floating windows 2020-10-01 18:31:46 +01:00
Sergio Martins
12ad3b3484 Fix floating window's border, was appearing black
QPen was unused
2020-10-01 18:22:07 +01:00
Sergio Martins
9a53c36c14 Also honour affinities when dropping into a dock widget as tabbed
Fixes #89
2020-10-01 17:55:19 +01:00
Sergio Martins
8fb3802343 tests: Add an xfail for an affinities bug
This is for #89. They shouldn't be allowed to tab
together since they have different affinities

Minor refactoring in drop area so we can call DropArea::drop()
directly without having to move the mouse, as that's not relevant
for this test.
2020-10-01 17:45:53 +01:00
Sergio Martins
c035df7e85 Improve the heuristics for auto-hide prefered side bar
Now it counts the number of borders it's touching to decide.
Then checks aspect ratio too.

Can still be improved, but it's a start. Will gather feedback
before changing it further.
2020-10-01 17:16:41 +01:00
Sergio Martins
92f81e28ca Merge branch '1.0' into master 2020-10-01 11:08:39 +01:00
Sergio Martins
7a87db608b README: Updated build instructions
use cmake to call the generator, this way it's generic and
works with any generator
2020-10-01 11:07:11 +01:00
Sergio Martins
d42fb81790 Windows: Fix artifacts when dragging window to another screen
Qt does its best to honour our custom WM_NCCALCSIZE processing,
except when the window moves to another screen. So help Qt a bit
and trigger a WM_NCCALCSIZE message, which Qt intercepts and takes
notes of the custom margins.

Fixes #46
2020-09-30 22:12:40 +01:00
Sergio Martins
73934e2f90 Always call FloatingWindow::create() in the CTOR
0x051000 was a typo, as it's Qt 5.16, not 5.10.
Since it's been running fine for 5.15 for so long, let's remove
special cases and have the same path for all Qt versions.
2020-09-30 22:07:07 +01:00
Allen Winter
1c8642298b src/private/multisplitter/Item.cpp - fix compile with msvc2013
might be choking on the QStringLiteral being a lambda
used into a [] ??
2020-09-30 12:51:02 -04:00
Allen Winter
bfc45bb0e9 tst_multisplitter.cpp - add braces to make msvc2013 happy
Change-Id: I562a8b14c9c6713fc15116397b5c215138a0c9cb
2020-09-30 12:50:03 -04:00
Allen Winter
58af9e2516 tst_multisplitter.cpp - add braces to make msvc2013 happy
Change-Id: I562a8b14c9c6713fc15116397b5c215138a0c9cb
2020-09-30 09:25:01 -04:00
Sergio Martins
4228c044ea Fix false-positive caught by Coverity
It's benign
2020-09-30 10:58:36 +01:00
Sergio Martins
ccc0aec968 Remove some dead code which is no longer used 2020-09-30 10:39:04 +01:00
Sergio Martins
3718d3fe79 Silence false-positive pointed out by Coverity 2020-09-30 10:33:58 +01:00
Sergio Martins
26ed9b722b Don't allow to turn off native dragging on Windows
Native dragging is much better as Windows deals with crossing screen
boundaries, there's no reason not to want that.

Client-side moving is buggy within Qt, depending on the HDPI setting.

Fixes #86
Fixes #78
2020-09-30 09:01:09 +01:00
Sergio Martins
6751669249 Fix flaky test on 5.14, it's benign 2020-09-29 23:21:36 +01:00
Sergio Martins
c7955dce1e Update ChangeLog and README
1.1 is due out soon, won't have QtQuick yetx
2020-09-29 21:10:47 +01:00
Sergio Martins
2e432f402f Also update floating action when removing from a FloatingWindow
Fixes #79
2020-09-29 21:05:45 +01:00
Sergio Martins
07791cd901 Fix another case where floating actions weren't updated
Relates to issue #79
2020-09-29 20:50:02 +01:00
Sergio Martins
1458da92d9 minimal example: Use fusion too
Looks better in general
2020-09-29 18:10:12 +01:00
Sergio Martins
c56f998292 Use Qt::MitterJoin when drawing rectangle
As it's not the default. Otherwise there's artifacts with hdpi scaling
2020-09-29 13:38:44 +01:00
Sergio Martins
991075d69e Windows: Start a native drag as soon as possible
Native drag works much better with HDPI crossing screens.
Relates to issue #78
2020-09-29 12:39:10 +01:00
Sergio Martins
234ca75728 tests: minor: Use QCOMPARE instead of QVERIFY 2020-09-28 22:10:00 +01:00
Allen Winter
e34d62d3e5 src/private/multisplitter/Item.cpp - fix compile with msvc2013
might be choking on the QStringLiteral being a lambda
used into a [] ??
2020-09-28 16:49:59 -04:00
Allen Winter
423be28afd various - misspelling-- 2020-09-28 16:40:27 -04:00
Sergio Martins
eb7bed9601 Fix build with -Werror 2020-09-28 19:00:40 +01:00
Sergio Martins
fa09521012 Adjust unit-test, according to the latest change 2020-09-28 18:55:55 +01:00
Sergio Martins
bb30f322a3 Fix size when docking a floating window
The docked widget would have the size of the window's contents,
we should use the size of the floating window instead.

The difference is just the title bar. When docked, the title bar
belongs do Frame, while when Floating it belongs to FloatingWindow.
When doing the docking calculation the frame's title bar is still hidden

Fixes issue #84
2020-09-28 18:47:46 +01:00
Sergio Martins
0e35c93ae5 Update ChangeLog 2020-09-27 18:02:56 +01:00
Sergio Martins
603224e553 FrameWidget: Fix painting the border on HDPI
Work in floating point instead of int.
2020-09-27 18:00:15 +01:00
Sergio Martins
9b82063d52 Fix drawing the FloatingWindowWidget border on HDPI
left and top margins were smaller than bottom and right.
2020-09-27 17:49:29 +01:00
Sergio Martins
c210a523e3 Focus the newly dropped dock widget
When we drag a dock widget into a another widget, we should focus it

Fixes issue #77
2020-09-26 17:44:30 +01:00
Sergio Martins
e33151d482 Add a failing test for issue #77 2020-09-26 17:15:46 +01:00
Sergio Martins
835f67a106 Mark DropArea::drop() as private
It's an implementation detail
2020-09-26 17:08:23 +01:00
Sergio Martins
a50f6ec602 Added DockWidgetBase::isFocused Q_PROPERTY
For GammaRay convenience. For QML too.
The getter and signal already existed.

For issue #73
2020-09-25 19:35:28 +01:00
Sergio Martins
4a49dbc6b4 Add a DockWidget::isFloatingChanged() signal
For issue #73
2020-09-25 19:25:58 +01:00
Sergio Martins
05c843397b Add one more test
tabbed dock widget aren't floating either
2020-09-25 18:32:06 +01:00
Sergio Martins
e4871eb340 Fix floating action not being triggered in some cases
When docking a dock widget into a floating widget, then both
are not "floating" anymore, as there's two of them in the layout

Fixes #79
2020-09-25 18:28:32 +01:00
Sergio Martins
0e696ff2dd FloatingWindow: Also use margin when using aero-snap
It's always good to have contents margin. Initially the idea was
that we were adding margin just to make the client resize handler
work better. But no reason to have different visual aspect depending
on if you have aero-snap or not

Fixes applications needing to look the same on all platforms.
2020-09-25 11:23:03 +01:00
Sergio Martins
9f15773a9b Fix dragging by tabbar if there's a line edit in the tab bar
User was able to drag and line edit wouldn't get focus.
This is a hot fix, not the most elegant way to do it.
2020-09-25 11:02:35 +01:00
Sergio Martins
a00984f95a Fix potential crash at shutdown
QWidget DTOR can trigger a focus change, which triggers
DockRegistry::onFocusObjectChanged(), which would dereference the
dockwidget
2020-09-24 16:05:38 +01:00
Allen Winter
c7e9632f18 src/MainWindow.cpp - minor header order 2020-09-22 11:22:40 -04:00
Sergio Martins
7080712501 Rename the tab's title if its dock widget changes 2020-09-21 16:19:35 +01:00
Sergio Martins
03b574434c Fix non-developer build
Fixes #76
2020-09-21 10:07:04 +01:00
Sergio Martins
6a46744073 Make Flag_AutoHideSupport public
Ready to be tested by the public
2020-09-21 00:19:20 +01:00
Sergio Martins
7e52c510b3 Fix rendering vertical sidebars on scaled monitors 2020-09-21 00:14:09 +01:00
Sergio Martins
9bf060af9a SideBar: Support sending to West/East too
Algorithm can be made smarter, but this is good for now
2020-09-20 23:53:26 +01:00
Sergio Martins
b5973fcf8c Fix sidebar test
We're not hidding them, they just occupy 0 it seems
2020-09-20 23:50:46 +01:00
Sergio Martins
ac7d06d4fe When closing overlay, remove it from side bar too
Added test.
2020-09-20 23:46:37 +01:00
Sergio Martins
75e9137e3a Increase a bit the side of the overlays 2020-09-20 23:18:46 +01:00
Sergio Martins
5168940422 When enabling auto-hide, don't overlay it immediately
Instead, hide it. Will be overlayed when the user toggles it.
2020-09-20 23:16:40 +01:00
Sergio Martins
cfd2dafa53 Remove bogus debug 2020-09-20 23:15:01 +01:00
Sergio Martins
188b0a0edd Don't style side-bar buttons of overlayed widgets
As mouse-over is already using the same color. Would be nice
to have some different style for the currently overlayed window.
2020-09-20 23:09:33 +01:00
Sergio Martins
206c418ebc Make TitleBarWidget::buttonAreaWidth() generic
Nowadays we have much more buttons
2020-09-20 22:59:25 +01:00
Sergio Martins
b0acf8d1ae Disable floating button when using auto-hide
TitleBar is a bit crowded otherwise. User can still pass
& ~Flag_TitleBarNoFloatButton if he really wants both buttons.
2020-09-20 22:54:51 +01:00
Sergio Martins
f279ea41e6 Add tooltips to title bar buttons 2020-09-20 22:43:10 +01:00
Sergio Martins
d2a929f35d Minor whitespace fix 2020-09-20 22:26:51 +01:00
Sergio Martins
6f5258b5dd Add auto-hide iconsz 2020-09-20 22:25:56 +01:00
Sergio Martins
4f223a9439 Change color of active/hovered SideBarButton 2020-09-20 20:59:54 +01:00
Sergio Martins
ea98eb3d44 Restyle the StyleBarButtons a bit 2020-09-20 20:30:40 +01:00
Sergio Martins
cdb8f85620 Fix overlay positions when on left/right
Was off by a few pixels, looks good now
2020-09-20 19:37:53 +01:00
Sergio Martins
f459dcb8b3 length of overlayed dockwidgets now accounts for open sidebars
For example, if we're showing a bottom overlay, but the left
sidebar is visible, then the bottom overlay can't be so wide
2020-09-20 19:20:35 +01:00
Sergio Martins
967a539e71 Simplify SideBarButton::sizeHint() 2020-09-20 19:08:52 +01:00
Sergio Martins
db615da0ee Override from QToolButton to have our own SideBarButton
Has proper size when vertical.
Text isn't vertical yet though.
2020-09-20 19:06:47 +01:00
Sergio Martins
c4b420bd31 Add a fwd-header for SideBarWidget too 2020-09-20 18:09:54 +01:00
Sergio Martins
a6c4730c44 SideBar is now constructed by the framework widget factory
Means it can be overridden by the user
2020-09-20 18:08:23 +01:00
Sergio Martins
eb1f4c5a14 Auto-hide overlays when clicking elsewhere
That's what auto-hide is all about
2020-09-20 17:25:40 +01:00
Sergio Martins
b303af738c Improve position for north/south overlays 2020-09-20 16:56:57 +01:00
Sergio Martins
af5e11a265 Update the overlay's geometry when we resize the main window 2020-09-20 16:38:03 +01:00
Sergio Martins
8d7627069c Factor out some code into updateOverlayGeometry()
So it's reusable
2020-09-20 16:30:43 +01:00
Sergio Martins
9e94c0d67d The auto-hide button now works as expected
1st click it show the overlay and adds to sidebar
2nd click it hides the overlay, removes from sidebar and restores the dockwidget
2020-09-20 14:13:39 +01:00
Sergio Martins
55ddacf978 Partially revert previous commit
toggling overlay visibility won't remove it from the sidebar afterall.
User will need to explicitly press the auto-hide button
2020-09-20 13:56:52 +01:00
Sergio Martins
005e0552b6 Delete SideBarButton when dock widget is removed from sidebar 2020-09-20 13:53:49 +01:00
Sergio Martins
54b28c42e2 Added DockWidgetBase::isOverlayed() 2020-09-20 13:48:17 +01:00
Sergio Martins
2659ddb76b refactor: Decouple moveToSideBar from overlaying
overlaying just shows/hides the overlay, and not requires
the dock widget was added to the sidebar before
2020-09-20 13:44:04 +01:00
Sergio Martins
c85873c6ce Added MainWindowBase::sideBarForDockWidget(dw)
Just a getter.
2020-09-20 13:24:18 +01:00
Sergio Martins
6e32f3f915 Added SideBar::mainWindow()
It's just a getter.
2020-09-20 13:18:34 +01:00
Sergio Martins
b8891a5727 Start implementing overlaying on top of main window 2020-09-20 12:56:31 +01:00
Sergio Martins
fcb6f5a6af Use the top sidebar too 2020-09-19 12:16:51 +01:00
Sergio Martins
0365f3194d Added Item::adjacentLayoutBorders() 2020-09-19 11:50:00 +01:00
Sergio Martins
76e2ec6429 Add East, West and North sidebars too
Instead of just south.
Only south is used for now though.
2020-09-19 11:00:42 +01:00
Sergio Martins
a5d0a202a5 Add enum with sidebar location 2020-09-19 10:35:36 +01:00
Sergio Martins
def752632f tests: fix flaky test on macOS 2020-09-19 00:08:47 +01:00
Sergio Martins
f296048063 tests: Stabilize two tests on XCB
Spacings/margins are different. Anyway, that QVERIFY isn't
very important, mostly useless.
2020-09-18 23:44:34 +01:00
Sergio Martins
1c1b816292 Fix tst_maximumSizePolicy with qpa xcb 2020-09-18 23:28:14 +01:00
Sergio Martins
fbd463e18b tests: debug++ 2020-09-18 19:42:26 +01:00
Sergio Martins
9e01363648 tests: debug++ 2020-09-18 19:40:37 +01:00
Sergio Martins
67bf7e9775 tst_raise: raise the window before starting
needed on macOS
2020-09-18 19:34:09 +01:00
Sergio Martins
d8c2100b24 tests: Set object name for debugging 2020-09-18 19:30:28 +01:00
Sergio Martins
d1a3e39f17 tests: Improve debug message 2020-09-18 19:27:17 +01:00
Sergio Martins
3d5c081333 tests: Debugging a macOS failure 2020-09-18 19:24:49 +01:00
Sergio Martins
e1085fb770 Add experimental support for minimization to side-bar
Auto-hide not working yet. Just minimization.
Internal for now. Will be public once finished.
2020-09-18 18:35:41 +01:00
Sergio Martins
c294c19be7 Fix Frame having a null DropArea
Fixes inMainWindow() signal not being emitted sometimes
2020-09-18 18:34:49 +01:00
Sergio Martins
87726fb0a7 Minor style: Reduce nesting level in Frame::setDropArea() 2020-09-18 18:34:28 +01:00
Sergio Martins
d28e61f412 Minor tidying 2020-09-18 17:48:31 +01:00
Sergio Martins
890e750c23 Trying to fix Windows/MinGW build 2020-09-18 17:48:04 +01:00
Sergio Martins
1fe5cfd121 Added Frame::mainWindow() 2020-09-18 17:40:38 +01:00
Sergio Martins
c8eaf88cf1 Added DockWidgetBase::mainWindow() 2020-09-18 17:20:41 +01:00
Sergio Martins
f3f812205d Pass the new title to DockWidget::titleChanged() signal 2020-09-18 17:12:38 +01:00
Sergio Martins
7b2ec52831 Fix build on 5.9/mingw 2020-09-18 16:59:01 +01:00
Sergio Martins
72785cf869 Updated ChangeLog and README with new features and bugfixes 2020-09-17 21:54:36 +01:00
Sergio Martins
e92ef472b3 Floating windows now support a minimize button
Introduced Flag_TitleBarHasMinimizeButton for it.
It implies Flag_DontUseUtilityFloatingWindows too, since Qt::Tool
don't appear in the task bar.

example: kddockwidgets_example -k
2020-09-17 21:46:28 +01:00
Sergio Martins
deec6ffa31 Windows: Fix windows have 0 min-size
Also tested on HDPI configurations and added the device pixel ratio
into account, as Windows works in native pixels
2020-09-17 18:37:13 +01:00
Sergio Martins
47779c8d0a Fix non-native move screwing up the size when moving across screens
The drag to the 2nd monitor was native, as we detected HTCAPTION,
but the drag back to 1st monitor was non-native. Non native is not
recommended, not great with HDPI in Qt.

The bug we were mixing native pos from win32 with Qt's logical
positions.

Fixes #72
2020-09-17 09:43:38 +01:00
Allen Winter
3e9e802b6c buildsystem - do not build docs by default 2020-09-16 16:04:18 -04:00
Allen Winter
8bd429db4c buildsystem - do not build docs by default 2020-09-16 16:03:31 -04:00
Sergio Martins
d76b27863f Don't center floating window if user moved it
Fixes #75
2020-09-16 16:51:05 +01:00
Sergio Martins
576627eb17 Always outter indicators if the center is obscured with something else
If there's some other floating window over our drop zone, then it's
very difficult to drop if there's no outter indicators.

Now we'll show the outter indicators if we suspect there's some other
window obscuring
2020-09-16 12:54:09 +01:00
Sergio Martins
74adb5f021 Fix floating window's title bar not being correct
FloatingWindow::hasSingleFrame() was true, but FloatingWindow::frames()
returned 2 of them, since frames() is based on child count and it hadn't
been reparented yet

Not commiting to 1.0 since it touches the layouting engine.
All tests pass and testing showed no side effects though, so should be fine for
1.0 too

Fixes #74
2020-09-15 19:52:48 +01:00
Allen Winter
dcdcef1fb2 Merge branch '1.0' 2020-09-15 08:45:20 -04:00
Allen Winter
cf7311682e images - add svg version of logo. update other png's 2020-09-15 08:44:37 -04:00
Sergio Martins
beb2128804 example: Added --no-aero-snap for debugging purposes 2020-09-14 22:28:15 +01:00
Sergio Martins
85cb289bc4 Also focus when clicking on the current tab
Fixes issue #71
2020-09-14 21:08:48 +01:00
Sergio Martins
5293943a50 Add TabBar::frame()
Returns the Frame this TabBar is in.
2020-09-14 21:07:51 +01:00
Sergio Martins
ee4d720c51 Added test for issue #71 2020-09-14 20:54:35 +01:00
Allen Winter
f8b698e669 Merge branch '1.0' 2020-09-13 09:41:53 -04:00
Allen Winter
0e3fcc7749 update home page URL 2020-09-13 09:29:36 -04:00
Allen Winter
5755e5ff65 Doxygen - add product logo to page header and footer 2020-09-13 09:16:23 -04:00
Allen Winter
d9db3d0b29 images - add logo and banner images 2020-09-13 09:14:04 -04:00
Sergio Martins
87ba2e0ee7 example: Add option to test combinations of Qt::Tool and parent
for internal testing
2020-09-13 13:30:55 +01:00
Sergio Martins
eaeed567f3 Don't have a parent window when using Qt::Window
Otherwise Qt::Window behaves like Qt::Tool, on Windows
2020-09-13 13:22:48 +01:00
Sergio Martins
a2054359a2 Minor code move, so next diff is short 2020-09-13 12:48:25 +01:00
Sergio Martins
85b533d4c4 Minor code move 2020-09-13 12:47:04 +01:00
Sergio Martins
2d2c8524ee Introduce Config::Flag_DontUseUtilityWindowsForFloating
Controls whether windows get Qt::Tool or not
2020-09-13 12:24:26 +01:00
Sergio Martins
62271b11a7 Update .gitignore 2020-09-13 12:12:13 +01:00
Sergio Martins
869cacc568 Use mouse events for tst_titleBarFocusedWhenTabsChange
So we can test clicking on a current tab too.
Also since changing tabs programatically shouldn't change focus,
which I'll fix soon
2020-09-12 00:39:10 +01:00
Sergio Martins
0155790b02 tests: add Test::clickOn() 2020-09-12 00:33:34 +01:00
Sergio Martins
2cb25fefe4 Minor: Add the tab widget as a member 2020-09-11 23:40:41 +01:00
Sergio Martins
98225ac9a3 Fix DockWidget::isInMainWindow()
FloatingWindows are parented to the main window, so we need to stop
the loop once isWindow().

The tests didn't catch this because the floating window in the test
was created before the main window, so it truly didn't have a parent

Fixes #69
2020-09-11 22:33:25 +01:00
Sergio Martins
4bdfc35c8c Changing tabs should also activate our focus scope
Fixes #70
2020-09-09 21:03:00 +01:00
Sergio Martins
f090a51485 example: Make title bar focusable when debugging focus 2020-09-07 20:26:09 +01:00
Sergio Martins
b510c2fd5f Added DockWidget::isInMainWindow()
For task #69.
A signal would be nice too, though.
2020-09-07 15:27:54 +01:00
Sergio Martins
03e58c7443 update change log regarding issue #68 2020-09-04 17:17:23 +01:00
Sergio Martins
676086ba90 Update .gitignore 2020-09-04 17:17:23 +01:00
Sergio Martins
4f6b9e3dff update change log regarding issue #68 2020-09-04 17:16:00 +01:00
Allen Winter
c8a5bd3f15 .../quick/qml/ClassicIndicator.qml - license+copyright header 2020-09-04 12:15:31 -04:00
Sergio Martins
5e83ddf7bd Update .gitignore 2020-09-04 17:13:58 +01:00
Sergio Martins
6b28a804f8 example: Allow to demo the focus scope
set KDDW_DEBUG_FOCUS
2020-09-04 17:06:32 +01:00
Allen Winter
7c5e159677 Merge branch '1.0' 2020-09-03 18:55:08 -04:00
Allen Winter
63f8468f48 cmake/Python - don't require pkg-config, only use if available.
Issue#68
2020-09-03 18:14:14 -04:00
Allen Winter
933a535494 Merge branch '1.0' 2020-09-03 08:08:55 -04:00
Allen Winter
518a7cb398 Changelog - fix typo 2020-09-03 08:08:14 -04:00
Allen Winter
eac2cff09c Merge branch '1.0' 2020-09-03 08:07:47 -04:00
Allen Winter
9a601a5172 CMakeLists.txt, Changelog - bump to 1.0.1 2020-09-03 08:06:12 -04:00
Allen Winter
cf8f25988c Merge branch '1.0' 2020-09-03 07:58:52 -04:00
Allen Winter
a613e401e2 ready for 1.0.0 release 2020-09-02 12:29:58 -04:00
Sergio Martins
23e27ee953 Add 1.0 release date to the ChangeLog 2020-09-02 17:27:51 +01:00
Allen Winter
633dc06e6f Merge branch '1.0' 2020-09-02 11:54:06 -04:00
Allen Winter
5ddf0ada76 Changelog - reorder versions 2020-09-02 11:50:53 -04:00
Allen Winter
c8664c4d44 cmake/Python/* - sync with the KDAB toolbox 2020-09-02 11:11:29 -04:00
Allen Winter
d6d28b3f7b src/DockWidgetBase.h - minor spelling fixes 2020-09-02 11:11:06 -04:00
Allen Winter
eddcfef5d8 Merge branch '1.0' 2020-08-31 18:19:44 -04:00
Allen Winter
737d63eede CMakeLists.txt - document PYTHON_BINDINGS_INSTALL_PREFIX 2020-08-31 18:19:20 -04:00
Allen Winter
ba3890acfa Merge branch '1.0' 2020-08-31 13:22:24 -04:00
Allen Winter
9e8353f50f cmake/Python/PySide2ModuleBuild.cmake - another fix for Mac 2020-08-31 12:11:33 -04:00
Renato Araujo Oliveira Filho
2db4398637 Python/PySide2ModuleBuild.cmake - fix for Windows build 2020-08-31 11:19:04 -04:00
Allen Winter
1348434b50 docs/api/Doxyfile.cmake - remove CLANG options
to quiet the doxygen warnings:
"belongs to an option that was not enabled at compile time."
2020-08-31 11:15:47 -04:00
Renato Araujo Oliveira Filho
4ebf60a9c8 Python/PySide2ModuleBuild.cmake - fix for Mac frameworks 2020-08-31 10:53:03 -04:00
Sergio Martins
6cf527403e Merge branch '1.0' into master 2020-08-30 17:53:04 +01:00
Sergio Martins
d738f6f43f Fix Config::Flag enumerators with the same value 2020-08-30 17:52:01 +01:00
Sergio Martins
92843b4972 Merge branch '1.0' into master 2020-08-30 14:46:28 +01:00
Sergio Martins
ae000e75bc Allow DockWidget::setWidget() to be called multiple times
Fixes #66
2020-08-30 14:43:12 +01:00
Allen Winter
e017438605 FindShiboken2.cmake - fix finding the library on MacOS 2020-08-28 18:40:19 -04:00
Allen Winter
bcd29f1dcc README.md - improve python bindings instructions 2020-08-28 12:14:32 -04:00
Allen Winter
b2df16dcb0 Merge branch '1.0' 2020-08-27 12:23:38 -04:00
Allen Winter
9903780792 kddockwidgets.spec - improve description text 2020-08-27 12:17:15 -04:00
Sergio Martins
8bb15f5447 Updated ChangeLog 2020-08-27 15:30:17 +01:00
Sergio Martins
2977f0b8c6 Introduce Config::Flag_AlwaysTitleBarWhenFloating
Allows to improve on Flag_HideTitleBarWhenTabsVisible.

Flag_HideTitleBarWhenTabsVisible will hide title bar regardless
if the window is floating or docked. By enabling Flag_AlwaysTitleBarWhenFloating
the title bar will only be hidden if docked.

Demo: ./bin/kddockwidgets_example -qt

Fixes #64
2020-08-27 15:14:55 +01:00
Sergio Martins
251423116f Merge branch '1.0' into master 2020-08-27 14:54:18 +01:00
Sergio Martins
5a66d09266 example: Decouple Flag_HideTitleBarWhenTabsVisible from Flag_AlwaysShowTabs
New swtich -z will trigger Flag_AlwaysShowTabs.
use -zt for what was -t before.

This is more granular now, as they are mix and match
2020-08-27 14:52:48 +01:00
Sergio Martins
04e2a71b66 Merge branch '1.0' into master 2020-08-25 22:00:25 +01:00
Sergio Martins
e3f89b6c17 Remove unneeded include 2020-08-25 21:57:55 +01:00
Sergio Martins
9d8587aa40 Remove empty file 2020-08-25 21:56:23 +01:00
Sergio Martins
a06fec51c8 Merge branch '1.0' into master 2020-08-25 21:54:32 +01:00
Sergio Martins
4b4d839074 Expose more private API so users can use the full power
Installed more private headers.
TabWidget_p.h was moved into widgets/ as the QtQuick impl won't
use that abstraction. Could even be folded into TabWidgetWidget.

Fixes #65
2020-08-25 21:46:46 +01:00
Sergio Martins
83eda81263 Minor code simplification 2020-08-24 17:58:42 +01:00
Sergio Martins
1bb476ca95 Merge branch '1.0' into master 2020-08-24 14:38:06 +01:00
Sergio Martins
1c65b3e453 Remove examples/qtquick from the 1.0 branch
Should be in master only
2020-08-24 14:36:30 +01:00
Sergio Martins
70a4ca6533 Updated README with the new features 2020-08-24 14:35:07 +01:00
Sergio Martins
073647cf79 Add a minimal example
The other example is getting too big. Minimal is best to get
started
2020-08-24 13:49:56 +01:00
Sergio Martins
f0ac455ec1 Allow the window being dragged to be transparent 2020-08-23 17:44:57 +01:00
Sergio Martins
44b2fc6944 indicators: Improve style for segmented indicators 2020-08-23 17:23:37 +01:00
Sergio Martins
113e6453ea example: Show usage of segmented indicators 2020-08-23 16:57:48 +01:00
Sergio Martins
283d814dc6 indicators: Also install the headers
So that the example app can show how to switch style type
2020-08-23 16:43:54 +01:00
Sergio Martins
034dc25483 indicators: Remove type()
There's no point in using it
2020-08-23 16:22:21 +01:00
Sergio Martins
b1333b2c4c ChangeLog: Update the changelog for 1.1 2020-08-23 13:52:16 +01:00
Sergio Martins
ff58ff72f9 Merge branch '1.0' into master 2020-08-23 13:47:52 +01:00
Sergio Martins
90da74b211 ChangeLog: Fill in the changes for 1.0 2020-08-23 13:46:29 +01:00
Sergio Martins
fbe88f7b99 ChangeLog: Remove the mention to 1.1
Since we're on 1.0 branch
2020-08-23 13:34:29 +01:00
Sergio Martins
05276999ad ChangeLog: Fix dates and versions
1.0 wasn't released yet
2020-08-23 13:34:11 +01:00
Sergio Martins
00b4dbc821 Add a Segmented Indicator
Just a POC of a new indicator style
2020-08-23 13:24:27 +01:00
Sergio Martins
35076bbdb6 indicators: Update the indicator's visibility in the base class
So derived classes don't have to.
Doesn't affect ClassicIndicators, since it uses a separate
window for them. But useful for new indicator types.
2020-08-22 19:58:45 +01:00
Sergio Martins
2dc98804f4 qml|indicators: Use frame geometry instead of frame rect
The rect is always at 0,0, not very useful.
2020-08-22 19:53:20 +01:00
Sergio Martins
961600fe74 qtquick: fix build
MainWindow.h is specific to QtWidgets
2020-08-22 19:19:59 +01:00
Sergio Martins
7fdca76a4c indicators: Use enum class for the type 2020-08-22 19:16:24 +01:00
Sergio Martins
32592f6ad1 classic indicators: Remove unneeded hidding in ctor
Already done in base class
2020-08-22 19:13:26 +01:00
Sergio Martins
1545e98e6d Merge branch '1.0' into master 2020-08-22 18:58:42 +01:00
Sergio Martins
a1c473fb0e Override QMainWindow::setCentralWindow() to make it private
The central widget is used internally by KDDW to make all of this
possible. It shouldn't be used by users
2020-08-22 17:03:55 +01:00
Allen Winter
85b3feb10b Merge branch '1.0' 2020-08-15 10:15:26 -04:00
Allen Winter
721b4de55e .krazy - add checks 2020-08-15 10:14:53 -04:00
Sergio Martins
d9fdd20caa Add DockWidgetBase::isFocusedChanged
Fixes: #60
2020-08-15 00:46:41 +01:00
Sergio Martins
9e2d001ac5 Add DockWidget::isFocused() for issue #60
Needs a signal now
2020-08-14 23:51:35 +01:00
Sergio Martins
750f9b6142 tests: Add strong-focus to the widget 2020-08-14 23:00:14 +01:00
Sergio Martins
1c3cf8cf2d Merge branch '1.0' into master 2020-08-14 18:47:42 +01:00
Sergio Martins
f1b9ce714b Fix building user apps out of repo
Our example was being built as part of KDDW, so that worked fine.
Now it can also be built with an installed KDDW.

Problem was the folder hiearchy in the installed include dir
didn't match the folder hiearchy in the source repo

Fixes #62

Cherry-picked from master's 037fa76fff
1.0 makes more sense
2020-08-14 18:47:03 +01:00
Sergio Martins
db19cb40d7 Merge branch '1.0' into master 2020-08-14 18:30:00 +01:00
Sergio Martins
2b0a426135 Fix crash if a FloatingWindow gets a native event too late
If delete is already scheduled and the multisplitter is already gone
we shouldn't handle the native event anymore

Fixes #63
2020-08-14 18:29:38 +01:00
Sergio Martins
369a020d81 readability: Rename m_beingDeleted to m_deleteScheduled 2020-08-14 18:29:38 +01:00
Sergio Martins
037fa76fff Fix building user apps out of repo
Our example was being built as part of KDDW, so that worked fine.
Now it can also be built with an installed KDDW.

Problem was the folder hiearchy in the installed include dir
didn't match the folder hiearchy in the source repo

Fixes #62
2020-08-14 17:49:24 +01:00
Sergio Martins
caa2ece751 qml: Move the 1st test from tst_docks to tst_common 2020-08-13 00:46:55 +01:00
Sergio Martins
22f2975f3c tests: createMainWindow() works for qml now too 2020-08-13 00:46:55 +01:00
Sergio Martins
d3323d824a tests: Make createMainWindow return MainWindowBase
Instead of QMainWindow, so it works with qml too
2020-08-13 00:46:55 +01:00
Allen Winter
41d1ea8f61 various fixes for the OBS config 2020-08-12 18:07:40 -04:00
Allen Winter
b1b5cd169a various fixes for the OBS config 2020-08-12 18:06:07 -04:00
Sergio Martins
1e85b1e7fb tests: Share EnsureTopLevelsDeleted with qml too
So we can start to copy tests to tst_common without hacking them
2020-08-12 22:45:59 +01:00
Sergio Martins
75464708af Remove unneeded debug 2020-08-12 22:00:23 +01:00
Sergio Martins
f007451442 Fix case where floatAction() wouldn't trigger
Fixes #58
2020-08-12 21:21:04 +01:00
Allen Winter
f591270d46 CMakeLists.txt - increase numbers. this will be v1.1 some day 2020-08-12 13:00:35 -04:00
Allen Winter
390423d0c1 Merge branch '1.0' 2020-08-12 12:59:09 -04:00
Allen Winter
5061620f46 kddockwidgets.spec - build requires qt5-qtx11extras-devel 2020-08-12 12:55:22 -04:00
Allen Winter
23ee5d538c buildsystem - install versioned .so libraries (non-Windows) 2020-08-12 12:49:42 -04:00
Sergio Martins
1aed8c7429 Merge branch '1.0' into master 2020-08-12 11:09:06 +01:00
Sergio Martins
fa0576362d Don't install the BSD license
The ECM modules aren't installed nor redistributed with the binaries,
they're just used while developing. Also don't want to create licensing
confusion
2020-08-12 11:07:32 +01:00
Sergio Martins
0aee56114b qml: Dropping a dragged window now works 2020-08-11 23:40:07 +01:00
Sergio Martins
b3ec7423e8 qml: The inner indicators are now centered 2020-08-11 22:19:51 +01:00
Sergio Martins
179cd4cf45 qml: Add properties for outter/inner indicators visibility 2020-08-11 22:19:51 +01:00
Sergio Martins
75d26c3cce qml: Draw the inner indicators too 2020-08-11 22:19:51 +01:00
Allen Winter
40d868581b .krazy - add another checker 2020-08-11 12:10:34 -04:00
Allen Winter
9071664ef2 .../ClassicIndicatorsOverlay.qml - copyright+license header 2020-08-11 08:14:00 -04:00
Sergio Martins
1980f9c42c qml: Fix namespaced build 2020-08-11 09:59:25 +01:00
Sergio Martins
2c917dcd7c qml: Show 4 proper indicators when dragging in a floating window
They don't do much yet, but at least appear.
2020-08-11 01:35:28 +01:00
Allen Winter
5ccf15b9ed Merge branch '1.0' 2020-08-10 17:07:05 -04:00
Allen Winter
f8a6bd7ad4 cmake/QtInstallPaths.cmake - update SPDX info in header 2020-08-10 17:00:30 -04:00
Allen Winter
635a63deba add license+copyright header to some CMake files. 2020-08-10 16:54:04 -04:00
Allen Winter
8731450cda fwd_headers - add copyright+license header
makes reuse happy
2020-08-10 16:38:29 -04:00
Allen Winter
1eb5392aef cmake/.../ECMEnableSanitizers.cmake - update from upstream 2020-08-10 16:27:55 -04:00
Allen Winter
f58a76426a examples/qtquick/main.cpp - add copyright+license header 2020-08-10 16:27:37 -04:00
Allen Winter
2e6623c9e7 LICENSES/BSD-3-Clause.txt - add for the cmake ECM files 2020-08-10 16:21:27 -04:00
Sergio Martins
7eaac87640 qml: Add a ClassicIndicatorsOverlay.qml file
Doesn't do much yet
2020-08-10 19:05:59 +01:00
Sergio Martins
5b9f08c754 Remove mapTo/From global from Layouting::Widget
Use the ones from QWidgetAdapter instead
2020-08-10 19:05:02 +01:00
Sergio Martins
02c165163a DragController: Use the geometry of the QWindow
While this works fine for QtWidgets, where the geometry of the
top-level QWidget is the same as the QWindow, it doesn't work
for QtQuick, where the geometry of the root item starts at 0,0
2020-08-10 19:03:15 +01:00
Sergio Martins
4bbc0f1d4f qml: Create drop indicator overlay too
The actual impl isn't done yet though
2020-08-09 22:45:15 +01:00
Sergio Martins
cf692797b6 qml: ClassicIndicators are now abstracted and built
The QtQuick counterpart just needs to be implemented
2020-08-09 20:27:05 +01:00
Sergio Martins
0e4ec055b2 Remove unused function 2020-08-09 20:05:38 +01:00
Sergio Martins
cf7c25cd88 Remove old cruft "rubberBandIsTopLevel" which we don't use 2020-08-09 19:23:52 +01:00
Sergio Martins
60b5eb00a3 Move IndicatorWindow to its own file
As it's the part that will be different with QtQuick.
ClassicIndicators can be shared.
2020-08-09 19:19:31 +01:00
Sergio Martins
0705b4da72 qml: Make Indicator class a implementation detail of QtWidgets
No longer accessed by ClassicIndicators
2020-08-09 18:57:23 +01:00
Sergio Martins
09b3e685a9 IndicatorWindow: Make some members private 2020-08-09 18:53:30 +01:00
Sergio Martins
64791eec82 qml: decouple ClassicIndicator from QRubberBand
the rubber band is now returned from the factory, meaning it can
be a QQuickItem when QtQuick is being used

Still need to remove the QtWidget'isms from IndicatorWindow
though
2020-08-09 18:39:56 +01:00
Sergio Martins
dc3aa354ec Minor code styling: Remove unneeded indentation 2020-08-09 18:13:23 +01:00
Sergio Martins
890784ba5a Finish FocusScope support
When clicking on a TitleBar the focus will be redirected to either:
- Last widget that had focus inside the scope
- To the DockWidget. Implies the user setting a guest widget that
accepts focus

Fixes: #56
2020-08-08 17:34:06 +01:00
Sergio Martins
c9468bef8a example: Add some helper code to debug focus 2020-08-08 17:34:06 +01:00
Sergio Martins
0b4c017f22 qml: Add subs regarding focus 2020-08-08 17:34:06 +01:00
Sergio Martins
6de558773f Merge branch '1.0' into master 2020-08-08 17:33:53 +01:00
Sergio Martins
2fdb85f3fb Fix build with 5.9 2020-08-08 17:32:26 +01:00
Sergio Martins
94258abf43 Decouple title bar icon from tab bar icon
You can now use different icons, or even just set an icon for the
title bar but not tab bar

Fixes #57
2020-08-08 14:05:42 +01:00
Sergio Martins
10026ba191 Add FocusScope behaviour to TitleBar
Github issue #56 is not a KDDW bug, it's how Qt works. QtWidgets don't
have focus scope. But let's workaround and handroll our own FocusScope.

Now the title bar can be colored differently if the dock widget it controls
contains any focused children.

This just implements half of the story. You have to focus a child
for the title bar to change color. Clicking the title bar directly
isn't done yet. Needs to be figured out. What do we focus when clicking it?
TitleBars usually don't care about keyboard focus. Probably we
just use the user's widget as a focus proxy.
2020-08-08 12:33:23 +01:00
Sergio Martins
0a6f760100 Fix a couple of clazy warnings 2020-08-07 22:23:08 +01:00
Sergio Martins
8db40d368c pass QStringList by const-ref 2020-08-07 22:00:44 +01:00
Sergio Martins
96a3eea108 Silence some clazy warnings which are benign in this context 2020-08-07 21:56:17 +01:00
Sergio Martins
47b20f03f9 Fix -Wclazy-copyable-polymorphic 2020-08-07 21:52:20 +01:00
Sergio Martins
bdcd8c1e20 Fix -Wclazy-range-loop 2020-08-07 21:50:46 +01:00
Sergio Martins
eaff83251c Fix -Wclazy-fully-qualified-moc-types 2020-08-07 21:47:46 +01:00
Sergio Martins
1cdd1a1b74 Fix static build on Windows
The STATICBUILD macros should:
- Be PUBLIC, so anyone linking against kddw gets them
- Not needed to be included in all targets, just link other targets and
they'll inherit

fixes linker errors
2020-08-07 21:24:43 +01:00
Sergio Martins
21938e4b3f Fix Windows build
The "BUILDING_*" macros are only to be defined on the dll that's
being build, so that the export macros expand to QT_EXPORT

The kddockwidgets target had the BUILDING_MULTISPLITTER macro, so
it included multisplitter.dll's symbols with QT_EXPORT, instead of
import, so couldn't work, resulting in linker errors
2020-08-07 21:12:52 +01:00
Allen Winter
95710d9e5e README.md - add more info links 2020-08-07 12:41:03 -04:00
Allen Winter
8a3252473f buildsystem - support static library build 2020-08-07 12:26:27 -04:00
Allen Winter
c52c8922dc add OBS files 2020-08-07 12:19:27 -04:00
Sergio Martins
80dcd57d91 qml: warn instead of crashing 2020-08-06 23:39:50 +01:00
Sergio Martins
37590b44d7 qml: DragController now compiles with the QtQuick frontend 2020-08-06 23:31:44 +01:00
Sergio Martins
051f8ab3a6 qml: Implement widgetForWindow 2020-08-06 23:17:28 +01:00
Sergio Martins
78dcb0f7f3 qml: Abstract some methods that QQuickItem doesn't have
geometry(), isMinimized(), etc.
2020-08-06 23:10:08 +01:00
Sergio Martins
6bb0d7ab08 Silence debug noise 2020-08-06 18:34:50 +01:00
Sergio Martins
c7afbf0803 qml: make qtTopLevelUnderCursor_impl() receive QWindow
QWindow works for both QtWidgets and QtQuick
2020-08-06 18:30:53 +01:00
Sergio Martins
bbea17b81b Make DockRegistry use QWindow to represent top-levels
Not QWidget/QQuickItem, since QtQuick uses QWindow (QQuickWindow),
not QQuickItem. Unlike QtWidgets, where QWidget can be used for both
purposes.
2020-08-06 18:03:25 +01:00
Sergio Martins
769d34d746 qml: implement childAt
Added a namespace-level parentWidget() helper, so it works for
both widgets and quick
2020-08-06 17:51:49 +01:00
Sergio Martins
64020568d6 Remove unused topLevel() method 2020-08-06 17:51:49 +01:00
Allen Winter
b7df2fb5f5 examples/qtquick - add license+copyright header 2020-08-05 17:52:49 -04:00
Allen Winter
ddc6da5894 add conanfile 2020-08-05 17:34:20 -04:00
Sergio Martins
6502ee5071 DragControl: Remove some dead code paths
Neither DockWidget nor DropArea are ever a top-level
2020-08-04 18:23:55 +01:00
Sergio Martins
22a13c7c9c Fix widgets example
Committed some things I shouldn't have during the qml port
2020-08-04 18:23:22 +01:00
Sergio Martins
a29f80f90b qml: set a transient parent to the floating QQuickWindow
so when it's frameless it get shown when we show the main window
(depending on the window manager)
2020-08-04 16:44:44 +01:00
Sergio Martins
0ccd4b8afa qml: Fix warnings and crash when closing windows 2020-08-04 14:56:12 +01:00
Sergio Martins
48433a05fb qml: Fix stray windows not being deleted 2020-08-04 14:13:42 +01:00
Sergio Martins
c6a455a059 qml: Fix anchoring
There's situations where neither title bar or tab bar are visible
2020-08-04 13:54:45 +01:00
Sergio Martins
3e3df799e6 qml: Deliver the close event 2020-08-04 13:53:31 +01:00
Sergio Martins
912f2de1ee qml: Fix close 2020-08-04 13:16:49 +01:00
Sergio Martins
1ad8a67caf qml: Fix Frame's title bar not being visible
It was being covered by the stack layout
2020-08-04 12:17:26 +01:00
Sergio Martins
a0588cd312 qml: Make floating window follow its QWindow
Means if you resize the window then FloatingWindow resizes too
2020-08-03 20:43:21 +01:00
Sergio Martins
40f0c0f322 qml: Fix guest not filling its DockWidget 2020-08-03 20:31:49 +01:00
Sergio Martins
52626b1874 qml: Add support for the MainWindow
Not really a MainWindow in the sense of toolbars and all.
For qml it's just the drop area, acepting drops
2020-08-03 20:05:36 +01:00
Sergio Martins
1cfceb4d07 MainWindow: Move the drop area to the base class
QtQuick impl will also use it
2020-08-03 19:39:01 +01:00
Sergio Martins
fd56ab7932 qml: Introduce tst_common
Will be moving tests that are common to both QtWidgets and QtQuick
2020-08-02 22:16:03 +01:00
Sergio Martins
4fd28f9577 qml: Implement more QtQuick API 2020-08-02 22:10:54 +01:00
Sergio Martins
fd6d9654bc qml: Start running some tests for the QtQuick version too
tst_multisplitter for now.
tst_docks will have to be split into common and widgets
2020-08-02 20:16:07 +01:00
Sergio Martins
31f391294c qml: Implement a few "Implement me"s in the QtQuick glue 2020-08-02 20:05:02 +01:00
Sergio Martins
9dd4e733eb qml: Empty FloatingWindows no longer stay around 2020-08-02 17:47:40 +01:00
Sergio Martins
e4f6893324 qml: Fix warnings about dereferencing null types 2020-08-02 17:43:44 +01:00
Sergio Martins
3c841aa2a9 qml: Make FrameQuick have a model for the dock widgets
More versatil for QML
2020-08-02 17:05:57 +01:00
Sergio Martins
85b4fc3751 qml: Hide TabBar if only 1 tab exists 2020-08-02 12:28:00 +01:00
Sergio Martins
197a0abb7e qml: Wire up some events for DockWidget
Some events like QEvent::Show, Hide and Close are for QWidget only,
so we have to synthetize them, as KDDW expects them
2020-08-02 12:15:26 +01:00
Sergio Martins
1df0e6d6dd qml: Add Guest #3 2020-08-01 18:09:49 +01:00
Sergio Martins
36407d2abe qml: Separators now work 2020-08-01 17:44:07 +01:00
Sergio Martins
2ffdfcad24 qml: Calling DockWidget::setWidget(filename) now loads a QML 2020-07-31 21:23:35 +01:00
Sergio Martins
0e1dc4bd45 qml: Remove some QWidget'isms 2020-07-31 21:06:11 +01:00
Sergio Martins
2853f54ac7 qml: Add a visual item for DockWidget
DockWidget.qml, in case the user wants to make style changes
2020-07-31 21:00:29 +01:00
Sergio Martins
76efd45e2d qml: Fix parenting dock widgets to the stack layout 2020-07-31 20:48:37 +01:00
Sergio Martins
7c5e0826c6 qml: Add a tabbar from QQC2 to Frame.qml 2020-07-31 20:37:56 +01:00
Sergio Martins
7c77c9597e qml: less debug noise 2020-07-31 20:37:28 +01:00
Sergio Martins
312d95a376 qml: link to QQC2 too, needed for TabBar 2020-07-31 18:51:39 +01:00
Sergio Martins
dc1b4f79e4 qml: Parent dock widget to Frame 2020-07-30 23:10:42 +01:00
Sergio Martins
44da2dca65 qml: Implement dragging via title bar
needs to redirect the events from the mouse area to the
C++ draggable
2020-07-30 22:34:36 +01:00
Sergio Martins
9657bc50a3 qml: Remove QtWidget'ism from DragController 2020-07-30 22:18:05 +01:00
Sergio Martins
affd7dfb87 qml: Fix two title bars being shown 2020-07-30 17:56:56 +01:00
Sergio Martins
dc59ecb4eb qml: Fix title bars not showing their title 2020-07-30 17:28:27 +01:00
Allen Winter
f95e3d10e7 Doxyfile.cmake - comment another setting too new for our CI 2020-07-30 11:53:18 -04:00
Allen Winter
a664a05201 docs/api/CMakeLists.txt - copy screencap.gif by-hand 2020-07-30 11:45:51 -04:00
Allen Winter
7b3e858aa3 docs/api/CMakeLists.txt - fix qch file name 2020-07-30 11:18:36 -04:00
Sergio Martins
1d032abb72 Fix some doxygen bugs 2020-07-30 16:15:25 +01:00
Allen Winter
61a5fec3cb Doxyfile.cmake - comment settings that are too new for our CI 2020-07-30 10:52:42 -04:00
Allen Winter
4e6022e529 README.md - possible fix for screen capture link in doxygen 2020-07-30 10:14:28 -04:00
Allen Winter
9216964b02 Doxyfile.cmake - improvements 2020-07-30 10:14:28 -04:00
Allen Winter
a87a694e3c docs/api/Doxyfile.cmake.bak - remove. added by mistake 2020-07-30 10:14:28 -04:00
Sergio Martins
8736d2cdb6 qml: Implement QWidgetAdapter::close() and window()
Clicking the title bar's close button now works
2020-07-29 23:58:46 +01:00
Allen Winter
fc633f2547 various minor documentation fixes for doxygen 2020-07-29 18:58:17 -04:00
Allen Winter
82abc90133 Build API documentation with doxygen 2020-07-29 18:44:42 -04:00
Sergio Martins
f8f596ad30 qml: Layout the drop area and title bar inside the FloatingWindow
We could just control geometry of the c++ title bar and geometry,
but then the user wouldn't be able to style it, and users rather
style things in QML than subclassing FloatingWindow and writing C++.

So instance some .qml files to represent the drop area and floating
window, so user can muck with.

Hierarchy looks like this now:

-QQuickWindow
--FloatingWindowQuick (C++ QQuickItem)
---FloatingWindow.qml
----TitleBar.qml (reads state from TitleBar c++)
----DropArea.qml
-----DropArea (C++ QQuickItem)
------Frame
      etc
2020-07-29 23:28:05 +01:00
Sergio Martins
c13f9c00aa minor coding style 2020-07-29 22:07:51 +01:00
Sergio Martins
0ff9b95577 Move some typedefs into KDDockWidget namespace
So they don't conflict with user code
2020-07-29 10:30:21 +01:00
Sergio Martins
ab28c63273 Fix possible crash when deserializing 2020-07-29 09:31:46 +01:00
Sergio Martins
cbe6e47233 qml: Make the windows bigger for now 2020-07-28 22:27:15 +01:00
Sergio Martins
dc3a598594 qml: Fix no QEvent::ParentChange being sent
QWidget::setParent() does this but QQuickWidget doesn't, so do
it manually.
2020-07-28 22:25:43 +01:00
Sergio Martins
6738bb0ae1 qml: Implement QWidgetAdapter::parentWidget()
Frame gets access to its DropArea now
2020-07-28 22:25:09 +01:00
Sergio Martins
1286fc28ca qml: Wire up TitleBar buttons 2020-07-28 21:41:41 +01:00
Sergio Martins
6104fdf2e0 qml: Implemented QWidgetAdapter::setFlag
FloatingWindow is frameless now.
2020-07-28 21:28:15 +01:00
Sergio Martins
f42f3804a1 qml: Add a default size for items
Otherwise it's 0x0
2020-07-28 21:17:28 +01:00
Sergio Martins
10226fc61a qml: FloatingWindow now creates a real top level QWindow 2020-07-28 21:17:01 +01:00
Sergio Martins
ba2ce8b8db qml: Implement QWidgetAdapter::isWindow and initialize min/max 2020-07-28 20:41:26 +01:00
Sergio Martins
dccdeda18a qml: debug++ 2020-07-28 20:41:12 +01:00
Sergio Martins
a23c76f6fb qml: create a dock widget in the example
So we can debug why it's not creating a floating window
2020-07-28 20:40:39 +01:00
Sergio Martins
0245b6e81b qml: Fix path for Frame.qml 2020-07-28 19:25:10 +01:00
Allen Winter
35728f54cd src/CMakeLists.txt - ${PROJECT_NAME}_VERSION for PACKAGE_VERSION
we haven't set a PACKAGE_VERSION needed by
write_basic_package_version_file() but we don't need one
since we can simply use ${PROJECT_NAME}_VERSION
2020-07-27 17:49:59 -04:00
Allen Winter
fc7af85c83 CMakeLists.txt - must set *_VERSION_* after project() call
project() sets ${PROJECT_NAME}
then we can use ${PROJECT_NAME} to set VERSION variables
2020-07-27 17:48:07 -04:00
Sergio Martins
c87f5ba6eb Move utility function into tests
used by the tests only
2020-07-27 21:32:58 +01:00
Sergio Martins
a574364100 vscode: Add settings for QtQuick too 2020-07-27 21:32:31 +01:00
Sergio Martins
88e10ffb31 qml: Add the skeleton for the example
Doesn't do much yet, but has background.
2020-07-27 18:00:06 +01:00
Sergio Martins
2895de3ef5 qml: Add missing export macro 2020-07-27 10:52:34 +01:00
Sergio Martins
5346f808f9 qml: Don't include the widgets MainWindow in LayoutSaver 2020-07-27 10:51:03 +01:00
Sergio Martins
36e6613f6a Fix build 2020-07-27 10:46:59 +01:00
Sergio Martins
0090799f7f qml: Add missing API in QWidgetAdapter_quick_p.h 2020-07-27 10:44:02 +01:00
Sergio Martins
c64b938e40 qml: Fix FloatingWindow.cpp building on Windows 2020-07-27 10:32:33 +01:00
Sergio Martins
08721ea458 qml: Fix linking
Abstractions are all in place now.
Let the port start!
2020-07-26 21:57:19 +01:00
Sergio Martins
fa7e8af014 qml: Remove QWidget'isms from MultiSplitter 2020-07-26 21:53:05 +01:00
Sergio Martins
7d01b7649a qml: Move MultiSplitter out of widgets/
Will make it shared to both stacks
2020-07-26 21:46:09 +01:00
Sergio Martins
9275432aea Remove a couple of unneeded includes 2020-07-26 21:42:29 +01:00
Sergio Martins
df5738dd34 qml: Don't build layoutlinter yet
needs some work and not a priority at this point
2020-07-26 21:37:54 +01:00
Sergio Martins
119cadae30 build the layouting engine with quick support if kddw is too
it's required
2020-07-26 21:33:20 +01:00
Sergio Martins
f6837ee4e5 qml: Fix compile for layoutlinter
Doesn't link yet though
2020-07-26 21:33:10 +01:00
Sergio Martins
ed752d953a Fix include 2020-07-26 21:01:22 +01:00
Sergio Martins
34ea666007 qml: Remove LayoutSaverQuick
LayoutSaver is generic enough and works with both stacks
2020-07-26 21:00:51 +01:00
Sergio Martins
0659f1e52b qml: Add missing API to the QtQuick wrapper
related to size hints and such
2020-07-26 21:00:22 +01:00
Sergio Martins
1f09bfa9d5 qml: Don't build the QWidgets example 2020-07-26 21:00:00 +01:00
Sergio Martins
ebda537a11 qml: Make DockWidgetBase inherit from QWidgetAdapter
So we get access to maximumSize, sizePolicy and such API
for QQuickItems too
2020-07-26 20:37:49 +01:00
Sergio Martins
ac115bc078 Fix typo 2020-07-26 20:37:49 +01:00
Sergio Martins
a84fea36fe qml: Move widgetMaxSize to the base class
The logic is not specific to QWidget. It will be reused for QtQuick
2020-07-26 20:24:24 +01:00
Sergio Martins
e4c87f60e9 qml: Fix Layout's saver API 2020-07-26 20:12:55 +01:00
Sergio Martins
a21abef6bd Make MultiSplitter::rectForDrop() take a FloatingWindow directly
Which is the only use case. Also since FloatingWindow inherits
from Layouting::Widget that will be nice to make this code work
with QtQuick version too. Otherwise it's complicated as QQuickItem
doesn't have min/max/sizePolicy
2020-07-26 20:05:41 +01:00
Sergio Martins
6fe8d7aea0 qml: MultiSplitter also inherits from LayoutGuestWidget now 2020-07-26 19:55:31 +01:00
Sergio Martins
2a34ecd563 qml: Frame inherits from Widget_quick when built with QtQuick support 2020-07-26 18:56:24 +01:00
Sergio Martins
2e2288cc0f Update .gitignore 2020-07-26 17:59:37 +01:00
Sergio Martins
1a44d36838 qml: Make ClassicIndicator widgets only 2020-07-26 17:51:13 +01:00
Sergio Martins
c53d71e2de qml: Remove more QWidget'isms, make code generic 2020-07-26 16:49:01 +01:00
Sergio Martins
e2674d2a68 qml: Port screenSizeForWidget() 2020-07-26 16:16:06 +01:00
Sergio Martins
e66cbae09f qml: Remove QWidget'isms from TitleBar and from the overlay interface 2020-07-26 16:16:06 +01:00
Sergio Martins
08dc55ea06 qml: Adjust API of the quick specialization of the factory 2020-07-26 16:16:06 +01:00
Sergio Martins
5c0c204859 qml: Remove QWidget'isms from DockRegistry
The DebugWindow is QWidgets only too.
2020-07-26 16:16:06 +01:00
Sergio Martins
85c32abdf0 minor: Silence warning about unused variable 2020-07-26 16:16:06 +01:00
Sergio Martins
b7353d2bba qml: Fix signatures for Frame and FloatingWindow quick specializations 2020-07-26 16:16:06 +01:00
Sergio Martins
e9131897e4 qml: Remove QWidget'isms from DockWidgetBase 2020-07-26 16:16:06 +01:00
Sergio Martins
fab0c5f8f8 qml: Remove QWidget'isms from DropArea
It's generic now
2020-07-26 16:04:17 +01:00
Sergio Martins
77307a1664 qml: Add more API to match the QWidget counter part
Namely isMaximized, showNormal and showMaximized
2020-07-26 16:01:13 +01:00
Sergio Martins
40e944ee9d qml|cmake: Move some widget only .cpp files into the widgets-only section
These won't be used by the QtQuick impl
2020-07-26 16:00:10 +01:00
Sergio Martins
a9402d1073 qml: fix the qml paths in the qrc file 2020-07-26 15:59:36 +01:00
Sergio Martins
9a15ac4bfa Fix running cmake with OPTION_QUICK 2020-07-26 14:47:09 +01:00
Sergio Martins
6a13085e77 qml: Fix another import 2020-07-25 21:04:39 +01:00
Sergio Martins
14e862f1fb qml: Add import statements which were removed when adding copyright headers 2020-07-25 21:01:15 +01:00
Allen Winter
b4f49895c2 clarify: licensing is GPL2 or GPL3 or commercial licensed
follow the REUSE specs
2020-07-24 18:16:13 -04:00
Allen Winter
2d0dcb9dbe multisplitter qml examples - add license+copyright header 2020-07-24 17:24:40 -04:00
Allen Winter
9b2b8bbc02 src/Qt5Qt6Compat_p.h - minor tweak for the include guard 2020-07-24 17:23:37 -04:00
Sergio Martins
1ae66eb8c2 minor cleanup 2020-07-22 17:01:45 +01:00
Sergio Martins
478c6e3bbc Fix crash when loading a bogus layout 2020-07-21 17:36:45 +01:00
Allen Winter
41b48bd41c private/multisplitter/Item.cpp - minor comments readability 2020-07-19 10:57:02 -04:00
Sergio Martins
709728e456 Revert "Add support for Qt6"
This reverts commit e1bf1cd786.

This breaks the build with older CMake (3.9 for example), which
doesn't support alias to imported targets.
2020-07-19 15:42:59 +01:00
Sergio Martins
e1bf1cd786 Add support for Qt6
Build with -DOPTION_QT6=ON
2020-07-18 21:56:18 +01:00
Sérgio Martins
8474f246ae Fix Qt6 build
Didn't include the cmake changes, as those are hacks for now.
Only included fixes to cpp code.
2020-07-18 18:51:47 +01:00
Sergio Martins
beaa45d16d Use QStyleOption::initFrom() instead of QStyleOption::init()
The later is deprecated and removed in Qt6
2020-07-18 18:08:26 +01:00
Sergio Martins
ffe13f4bea Fix macOS build due to -Werror extra-semi 2020-07-07 17:33:11 +01:00
Sergio Martins
2559b29b30 Fix separators not moving in some situations
We were mixing heights with widths... root->length() can be a width()
(if vertical), while we're calculating available width to grow
on a nested horizontal container
2020-07-06 23:54:42 +01:00
Sergio Martins
7dfcdd1981 Merge pull request #54 from KDAB/mac-testing
CMakeLists.txt - disable test_launcher tests on Mac && Qt<5.15.1
2020-07-06 23:21:30 +01:00
Allen Winter
341f682274 CMakeLists.txt - disable test_launcher tests on Mac && Qt<5.15.1 2020-07-06 17:58:17 -04:00
Sergio Martins
5349ff3832 Fix potential crash 2020-07-06 22:40:13 +01:00
Sergio Martins
259a78ebaf Also simplify layouts that only have 1 child
Those have any orientation, so can be simplified, as its "orientation"
matches its parent one
2020-07-06 21:15:23 +01:00
Sergio Martins
090392a02e tests++ 2020-07-06 20:27:45 +01:00
Sergio Martins
563d569ec4 tests: When removing a dock widget, check if max-size is honoured 2020-07-06 19:20:08 +01:00
Sergio Martins
0899a4e0c8 Simplify layouts after adding items
A vertical layout inside another vertical layout is redundant (same for horizontal),
so grab the contents of the sub-layout and delete it
2020-07-06 19:19:01 +01:00
Sergio Martins
29e625b85f Fix Item::requestEqualSize() when items have max-size
It already honoured max-size, but was bailing out early if
both items had the same size. Which is fine, unless one of them
has max-size, where we want to honour it
2020-07-06 12:31:47 +01:00
Sergio Martins
380c3eee81 Fix separators not being movable in some cases
The 'minPos' isn't a special case, should follow the same logic as 'maxPos'.
Confused separator min pos with dock widget's min-size,
which is a special case for dock widgets.
2020-07-06 12:18:39 +01:00
Sergio Martins
21ef8017e8 Honour max-size when dropping a widget that can grow
We already honoured max-size in the case of dropping a widget with
some max-size. Now we also honour it when an existing docked widget
has max-size and we're dropping a widget that can grow. Now the
dropped widget will occupy more space in this case
2020-07-06 11:01:29 +01:00
Sergio Martins
eee8cb8341 Minor, remove unneeded check 2020-07-06 11:00:57 +01:00
Allen Winter
9630f0f48a tst_docks.cpp - fix link. remove unneeded method declaration
tst_maxSizeHonouredWhenAnotherDropped didn't have an
implementation so I removed its declaration.
2020-07-04 12:10:36 -04:00
Sergio Martins
0f71b30096 Allow to drag separators when they are past their max-pos
As long they are moving in Side1 direction. i.e: left/up, i.e:
reducing their distance to the max-pos.
2020-07-04 13:02:46 +01:00
Sergio Martins
2ec226c432 Dragging separators now honours max-size recursively too
Previously only min-size propagated.
Now, when dragging a separator, let's say to the right, and the left
widget can't grow more, we start to move the previous separator to
the right
2020-07-04 12:32:10 +01:00
Sergio Martins
fa2cd1bc74 Also honour max-size when resizing nested container via separator 2020-07-04 11:38:33 +01:00
Sergio Martins
730af05aa1 Add a failing unit-test 2020-07-04 00:39:55 +01:00
Sergio Martins
4788f41593 tests: don't fail when window is out of bounds on mac
Should be benign. My screen it too small.
2020-07-03 19:36:39 +01:00
Sergio Martins
84b0b8f6ad Fix serializing floating window affinity 2020-07-02 17:44:16 +01:00
Allen Winter
cf1514f8a4 src/private/DebugWindow.cpp - removed unused assignment
compile warnings are errors with MinGW

Change-Id: I03ed6d6fbfbdb07d85582d50a302f09d87d0b32d
2020-07-01 18:36:11 -04:00
Allen Winter
47f0dfd3ae fix MinGW build. the pragmas are for MSVC
Change-Id: I8ec58f136ad02449fdbf5aedca7a1b88583a561f
2020-07-01 18:34:03 -04:00
Allen Winter
183c48696e private/multisplitter/CMakeLists.txt - obey KDDockWidgets_TESTS 2020-06-29 17:51:41 -04:00
Allen Winter
2462f991be buildsystem - consistent formatting 2020-06-25 13:32:59 -04:00
Sergio Martins
d373585e0c get rid of some unneeded qobject_cast<FloatingWindow*> casts 2020-06-25 17:56:21 +01:00
Sergio Martins
7f324dda91 Mention KDDockWidgets instead of KDChart in the readme
was a copy-paste typo
2020-06-25 17:29:00 +01:00
Allen Winter
c5739e8626 examples/dockwidgets/CMakeLists.txt - increase cmake min vers
to make consistent with the top-level project
2020-06-25 10:42:57 -04:00
Allen Winter
5362200d21 CMakeLists.txt - use KDAB installation directory 2020-06-25 10:35:47 -04:00
Sergio Martins
d7f9bf7adc Remove two unneeded connects
Also since DockWidgetBase won't be a QObject soon
2020-06-24 22:33:11 +01:00
Sergio Martins
52c37f28d0 Remove pure-virtual which isn't pure 2020-06-24 16:37:37 +01:00
Sergio Martins
bcfb57f89d Fix aerosnap|alwaysTabs|noTitleBar
DragController would ignore the non-client mouse press
2020-06-24 16:18:58 +01:00
Sergio Martins
16fac61a9d Fix build 2020-06-24 16:10:20 +01:00
Sergio Martins
5203718f93 When not using a title-bar, don't say a tab is HTCAPTION
Otherwise tabs are not clickable
2020-06-24 16:06:35 +01:00
Sergio Martins
d3aee0dabb Add a unit-test 2020-06-24 16:06:35 +01:00
Allen Winter
b6e8703038 CMakeLists.txt - Always build the tests in developer-mode 2020-06-24 10:48:39 -04:00
Allen Winter
153aa65b40 CMakeLists.txt - fail if building bindings in non-release mode 2020-06-24 10:48:39 -04:00
Allen Winter
0701e8aa97 buildsystem - improve how Windows libraries are versioned
Change-Id: Ie6873c1ec8fc53a005d12ef6a0573f61b41fba39
2020-06-24 09:57:28 -04:00
Allen Winter
baed168458 CMakeLists.txt - require Qt5.9 or higher 2020-06-24 09:46:12 -04:00
Allen Winter
6b45f97215 Merge branch 'master' of github.com:KDAB/KDDockWidgets 2020-06-23 18:58:16 -04:00
Allen Winter
1fc1e3abb2 CMakeLists.txt - add option to disable building examples 2020-06-23 18:56:51 -04:00
Allen Winter
b825e0b9ea CMakeLists.txt - add option to disable building tests 2020-06-23 18:52:05 -04:00
Allen Winter
7aa45ebed9 CMakeLists.txt - add option to disable building examples 2020-06-23 18:45:03 -04:00
Allen Winter
c50fe5fa88 CMakeLists.txt - improvements
* add some doc at the top
 * set VERSION strings
 * disable Python bindings in debug build
 * consistent coding style
2020-06-23 18:17:46 -04:00
Sergio Martins
ba2fdfc46c Fix tests with 5.9
There was just 1 failing, which needed higher margins
2020-06-23 22:11:50 +01:00
Sergio Martins
815b496599 Mention in the README that min Qt is 5.12 if Python bindings are enabled 2020-06-23 21:59:18 +01:00
Allen Winter
b2e79d4285 .krazy - skip a file in cmake 2020-06-23 15:41:59 -04:00
Sergio Martins
4c630f6c6a Fix build of python bindings 2020-06-23 20:24:19 +01:00
Allen Winter
bf4ef05d00 CMakeLists.txt - install doc files (LICENSE, README, etc) 2020-06-23 15:14:53 -04:00
Allen Winter
e35fcb02df src/CMakeLists.txt - fix cmake file install destination 2020-06-23 15:09:20 -04:00
Sergio Martins
4fa2be3263 On Windows it's fine to use the FloatingWindow as the draggable
As it supports native dragging
2020-06-23 19:33:33 +01:00
Sergio Martins
7c04cd96c6 Fix dragging on Linux 2020-06-23 19:28:14 +01:00
Sergio Martins
a8bd46155c Fix typo in test 2020-06-23 19:24:00 +01:00
Sergio Martins
5f4d8b515f Fix detaching now allowing to continue a drag
Seen sometimes on Windows.
Also, since aero-snap works fine now, we can re-enable the mouse grab
2020-06-23 19:19:59 +01:00
Sergio Martins
da4b90e373 tests: Use different json filenames
So tests can run in parallel
2020-06-23 19:01:13 +01:00
Allen Winter
7ec2f31a46 buildsystem - generate PRI file for qmake users 2020-06-23 12:55:26 -04:00
Sergio Martins
3217c61713 Help clang-tidy knowing that frame can't be null here 2020-06-23 17:48:40 +01:00
Sergio Martins
2a33599bde Fix range-loop detachements 2020-06-23 17:48:40 +01:00
Sergio Martins
2994046c7b Fix -Wclazy-rule-of-three 2020-06-23 17:48:40 +01:00
Allen Winter
842e72c4c3 Windows: version libs, install pdb files for MSVC builds
Change-Id: I2964e809de20a9cb94d3039c95a1a623fdfd4d40
2020-06-23 12:38:51 -04:00
Sergio Martins
3b5ca4dafb Silence -Wclazy-non-pod-global-static for the example
we don't care about non-lib example code regarding this
2020-06-23 17:12:21 +01:00
Sergio Martins
b76ec9e611 Remove unused trivial variable from linux build 2020-06-23 17:10:06 +01:00
Allen Winter
7a1a2f2c43 python/ - copyright and license headers 2020-06-23 11:50:33 -04:00
Allen Winter
4ffe5e72d8 FindShiboken2.cmake, FindPySide2.cmake - use https 2020-06-23 11:44:51 -04:00
Allen Winter
0275fe441e .vscode/launch.json - add trailing newline 2020-06-23 11:43:21 -04:00
Allen Winter
44bf882a2a various - include own header first 2020-06-23 11:38:41 -04:00
Allen Winter
f9196203e7 .krazy - skip files in fwd_headers 2020-06-23 11:32:35 -04:00
Allen Winter
275e334120 Item_p.h, MultiSplitter.cpp - remove duplicate includes 2020-06-23 11:27:18 -04:00
Allen Winter
f97f920ffb private/multisplitter/Separator_qwidget.h - fix include guard 2020-06-23 11:26:54 -04:00
Allen Winter
7773c3fe27 minor spelling fixes 2020-06-23 11:10:56 -04:00
Sergio Martins
19d5467f4d fuzzer: Also generate max-size constraints 2020-06-21 23:28:35 +01:00
Sergio Martins
4c0e418bc1 Add DropArea::frames()
instead of the FloatingWindow using findChildren on another object's
internals
2020-06-21 22:07:12 +01:00
Sergio Martins
fab4d39f92 Use a dedicated id() property instead of casting pointers to int
Which would be flaky once we have multi-inheritance
2020-06-21 21:17:04 +01:00
Sergio Martins
91b291a1a9 tests: Tests now run 10x faster, with ctest -j10 or so
Introduced an indirection, tests_launcher, which can run a subset
of the 140 tests, this way it's paralelizable by ctest
2020-06-20 15:27:58 +01:00
Sergio Martins
be4a71685a Fix a fuzzer test
When restoring a layout it can happen that the widget has
different size constraints when being restored, so this warning
was benign. There's a chekcSanity() later, so that's what's matters
2020-06-20 14:00:33 +01:00
Sergio Martins
8b862b7843 Honour max-size constraints when moving a separator
The separator will still move, but won't make the item grow
past its max-size, instead, it will grow the item's neighbours
2020-06-20 13:17:26 +01:00
Sergio Martins
b0503cfeb4 checkSanity: Don't honour max-size when checking the constraints
It's not always possible to honour max-size, when there's conflicting
items in the layout with min-sizes which wouldn't allow use to satisfy
max-size constraints. max-size is more of an hint
2020-06-20 13:16:14 +01:00
Sergio Martins
ecb01ff9c3 wip 2020-06-19 19:31:04 +01:00
Sergio Martins
40c816e0c5 Improve README regarding running the python bindings 2020-06-17 22:29:53 +01:00
Sergio Martins
6bbba2bff7 python: install to CMAKE_INSTALL_PREFIX by default
Set PYTHON_BINDINGS_INSTALL_PREFIX to put them in another place
2020-06-17 22:15:27 +01:00
Sergio Martins
36fba5db3d After growing neighbours, also honour the max size
So items with max-size don't grow past their max-size
2020-06-17 19:33:30 +01:00
Sergio Martins
744f351c4e Fix highlight when widget has QSizePolicy::Maximum
Multisplitter::rectForDrop() was only using QWidget::maximumSize(),
which doesn't need to be set. Also fix the case where the dropped widget
be a complete multisplitter
2020-06-17 18:04:59 +01:00
Sergio Martins
b8664c44c7 example: show the use of max-sizes without developer-build
the feature is stable to show
2020-06-17 16:29:45 +01:00
Sergio Martins
e3276411f9 Propagate developer built into the example too 2020-06-17 16:20:21 +01:00
Sergio Martins
84989745b4 Use target_compile_options instead of the hammer
Doing per target ensures that the python stuff won't get -Werror.
We can now build the python bindings and still use the developer build
2020-06-17 14:37:42 +01:00
Sergio Martins
3121b4cf28 Add *pyc to .gitignore 2020-06-17 14:29:52 +01:00
Sergio Martins
da6df47706 Merge pull request #50 from KDAB/python
Python
2020-06-17 11:12:27 +01:00
Sergio Martins
e5c0316ebb Fix the highlight/rubber-band size not matching the size the item gets
Not all code-paths were using FairButFloor. Dropping a single item
used FairButFloor, but not when dropping another multi-splitter (
Layout with nested items)
2020-06-16 22:34:18 +01:00
Renato Araujo Oliveira Filho
c0d8f22049 Use PySide from the system when possible 2020-06-16 17:57:56 -03:00
Renato Araujo Oliveira Filho
c2d8991283 Allow to install python bindings in a custom dir
Added cmake var PYTHON_BINDINGS_INSTALL_PREFIX
2020-06-16 17:57:46 -03:00
Renato Araujo Oliveira Filho
a599736c1b Create Python bidings
Added Cmake files
Ported examples
2020-06-16 15:12:41 -03:00
Sergio Martins
5526022a57 Add another fwd header 2020-06-13 19:09:44 +01:00
Sergio Martins
25dd149475 Add Widget::mapToGlobal() 2020-06-13 19:09:44 +01:00
Sergio Martins
e6b67101fa Make the example customize TitleBarWidget instead of TitleBar
TitleBar will cease to depend on QWidget
2020-06-11 21:26:33 +01:00
Sergio Martins
16c32cea4b Added Widget::update() and mapFromGlobal 2020-06-11 19:33:20 +01:00
Sergio Martins
9f44eb3154 Add Widget::topLevel()
Equivalent to QWidget::window()
2020-06-11 18:18:11 +01:00
Sergio Martins
c7b6a1a654 wip 2020-06-11 18:10:01 +01:00
Sergio Martins
6bbcb8f8f2 Rename LayoutSaver::MultiSplitterLayout to LayoutSaver::MultiSplitter 2020-06-11 17:00:54 +01:00
Sergio Martins
163b194398 Fix clang build, mostly shadowing warnings 2020-06-11 17:00:54 +01:00
Sergio Martins
86e58dd8a7 Merge MultiSplitterLayout into MultiSplitter
No need to have two. It's a leftover from the old layouting engine
2020-06-11 16:34:28 +01:00
Sergio Martins
e54ef787ed Some include cleanup 2020-06-11 11:03:12 +01:00
Sergio Martins
d5957a0dc5 Double-clicking on separator now respects max-size 2020-06-10 23:32:04 +01:00
Sergio Martins
bb79bd12a7 Fix bug in availableToGrowOnSide() and add unit-test 2020-06-10 20:31:03 +01:00
Sergio Martins
47795d0751 min/max pos for separator can honour max-size now 2020-06-10 19:52:20 +01:00
Sergio Martins
e234ad65ab Add ItemContainer::availableToGrowOnSide_recursive() 2020-06-10 19:24:34 +01:00
Sergio Martins
1c3dd93ee3 More renaming, as we add more functions that honour max-size 2020-06-10 19:02:07 +01:00
Sergio Martins
ccf161e139 Add ItemContainer::availableToGrowOnSide() 2020-06-10 18:58:38 +01:00
Sergio Martins
9636054ccc Rename Item::availableOnSide() to availableToSqueezeOnSide() 2020-06-10 18:55:54 +01:00
Sergio Martins
6e77dce573 Add Item::neighboursMaxLengthFor() 2020-06-10 18:54:34 +01:00
Renato Araujo Oliveira Filho
e6a335a3f7 Use enum explicitly constructor as default values
This will avoid problems generating python bindings, shiboken does not
handle well '{}' initialization.
2020-06-10 12:37:46 -03:00
Sergio Martins
a442419db2 Honour max-size constraints when resizing the window
items won't resize past their max-size when resizing the window now
2020-06-10 14:10:41 +01:00
Sergio Martins
479e1acece tests: guest widget can get a max-size now too 2020-06-10 11:42:50 +01:00
Sergio Martins
a7878122ac Only use QT_DISABLE_DEPRECATED_BEFORE in developer-mode
Many projects just add kddw as a sub-folder and might have
QT_DISABLE_DEPRECATED_BEFORE with a different value, then you get
lots of warnings
2020-06-09 12:40:37 +01:00
Sergio Martins
fa32054085 Merge pull request #48 from KDAB/fix-warning
Fix -Wextra-semi
2020-06-08 21:20:26 +01:00
Colin Ogilvie
f3de1ad63d Fix -Wextra-semi 2020-06-08 19:36:18 +01:00
Sergio Martins
8baac15d24 Fix floating window position when dragging with constraints
When the detach starts we might make the window smaller so it
respects the max-size constraint. The quirk was that in that
case the window was no longer under the mouse cursor, so looked
weird while dragging, although it worked
2020-06-08 18:19:46 +01:00
Sergio Martins
4cf1159019 Two more places that should use setSuggestedGeometry()
Now dragging by the tab bar also respects the max-size
2020-06-08 17:40:17 +01:00
Sergio Martins
ee065795b9 Fix Frame max size accounting for the waste twice
Frame::biggestDockWidgetMaxSize() should return only the max size
of the dock widget, and not mix with sizes of the container frame
2020-06-07 23:12:47 +01:00
Sergio Martins
7f9d160658 Also honour QSizePolicy::Maximum
It's yet another way to say you want a max size
2020-06-07 20:14:50 +01:00
Sergio Martins
daa220d513 tests: let the widget receive a size hint 2020-06-07 20:01:37 +01:00
Sergio Martins
d5797a3aea Honour QSizePolicy::Fixed too
Some widgets, for example QPushButton, instead of having an explicit max size,
they communicate the need for a max size through their size policy
2020-06-07 19:53:06 +01:00
Sergio Martins
ab8545e2c2 Bound the item max size just in case 2020-06-06 20:27:36 +01:00
Sergio Martins
5fc16954f5 Fix max-size only working in one orientation
ItemContainer::maxSizeHint() algo was wrong.
Add unit-test too.
2020-06-06 20:11:09 +01:00
Sergio Martins
6610e48cb3 Fix qDebug for child items going out of scope before the parents
Made the child debug lines appear before
2020-06-06 18:12:44 +01:00
Sergio Martins
dabfeeaf3b Honour max-size when floating a window 2020-06-05 15:35:55 +01:00
Sergio Martins
9601f57050 example: Don't show the dock widgets immediately
It's not needed, as they are going to be added to the layout.
Saves us from flicker and also the temporary floating position
being saved
2020-06-05 13:43:35 +01:00
Sergio Martins
7c442dce85 Fix another place that should use setSuggestedGeometry 2020-06-04 21:47:47 +01:00
Sergio Martins
07ea3ff1a6 cleanup: Replace some qobject_casts with a function 2020-06-04 21:37:01 +01:00
Sergio Martins
874fd7d69f Don't set the FloatingWindow geometry directly
Let's have an indirection, so FloatingWindow can do some adjustments
and use a smaller rect incase of max-size.

Since we don't want to enforce max-size, just when showing the window.
2020-06-04 21:21:11 +01:00
Sergio Martins
69a737e286 FloatingWindow: Remove cruft 2020-06-04 21:16:22 +01:00
Sergio Martins
ddc49c9358 Don't warn when restoring and there's no last pos info
We now restore floating windows to their previous position too
when toggling float. If there's no last info it's fine
2020-06-04 18:21:52 +01:00
Sergio Martins
2b3c3b75bf Fix build with older cmake
Error was:
"install TARGETS given target "kddockwidgets_multisplitter" which does not
exist in this directory."

Fixes: #47
2020-06-04 15:29:34 +01:00
Sergio Martins
296889cace Move TabWidget usage to FrameWidget
Frame is abstract and doesn't care about such implementation details.
QQuick will role out their own QTabWidget equivalent. No need to
abstract tab widget too, it's overkill.
2020-06-04 09:57:59 +01:00
Sergio Martins
4ebe8ed631 harden Frame's pure virtuals
Too many paths to control, so protect against calling the pure
virtuals in ctor/dtor
2020-06-03 22:31:03 +01:00
Sergio Martins
ecfa43f801 Decouple TabWidget from Frame
TabWidget is now an implementation detail of FrameWidget.
QQuick will roll their own stuff with similar api, but no need to
abstract QTabWidget and QTabBar
2020-06-03 22:18:44 +01:00
Sergio Martins
f5f39a37a1 Decouple DockWidget from TabWidget
TabWidget will be an implementation detail of FrameWidget, and not
shared by QtQuick
2020-06-03 21:38:47 +01:00
Sergio Martins
0a75d89848 Add Frame::detachTab()
The tab widget will be an implementation detail of FrameWidget and
not accessed by anyone
2020-06-03 21:18:38 +01:00
Sergio Martins
e418725c13 Don't create Frame directly, but FrameWidget, depending on the factory 2020-06-03 21:18:13 +01:00
Sergio Martins
180fb96ecc quick: Implement separator support
you can now drag separators in the QML example
2020-06-01 22:22:33 +01:00
Sergio Martins
83af55a592 quick: Refactor QQuickItem creation
So it can be reused
2020-06-01 20:58:02 +01:00
Sergio Martins
fe6d80ae89 vscode: Add Qt source mapping 2020-06-01 18:13:54 +01:00
Sergio Martins
103a0e514a quick: Use the original kddw indicators instead of yellow rectangles
looks nicer
2020-06-01 15:25:34 +01:00
Sergio Martins
7cc302c977 Rename Config.h to MultiSplitterConfig.h
So it doesn't clash with KDDW's Config.h
2020-06-01 15:14:34 +01:00
Sergio Martins
c2d51bddc8 quick: Some style improvements to the example 2020-06-01 14:53:18 +01:00
Sergio Martins
443f80cdab qtquick: Improve the multisplitter example
you can now drop relative to
2020-06-01 13:42:47 +01:00
Sergio Martins
9af3740d86 fix memory leak 2020-06-01 12:28:35 +01:00
Sergio Martins
567b61c9ec Allow separator to have pos=0
Can happen if widget has min-size 0
2020-06-01 12:16:35 +01:00
Sergio Martins
df8511b3dc Add an example of how to use the multisplitter with QtQuick 2020-06-01 12:16:00 +01:00
Sergio Martins
1dad16bb63 vscode: Build kddockwidgets in developer mode 2020-05-31 23:01:33 +01:00
Sergio Martins
4e88b3742d Honour max-size when docking
Layout will choose a suitable size for the dock widget when
addDockWidget() is called
2020-05-29 09:53:51 +01:00
Sergio Martins
a086713bb6 Implement FrameWidget::maxSizeHint() 2020-05-29 08:11:42 +01:00
Sergio Martins
0c0a232e07 Add vscode launch file for the example 2020-05-28 23:47:48 +01:00
Sergio Martins
a66e750f7d Add Frame::biggestDockWidgetMaxSize() 2020-05-28 23:47:03 +01:00
Sergio Martins
3697814141 Add Frame::dockWidgetsMinSize()
Like Frame::minSize() but smaller due to the tab widget overhead
2020-05-28 20:51:06 +01:00
Sergio Martins
d8af06a7ee Rename Item::maxSize to Item::maxSizeHint
It will more of an hint than really enforced in all cases
2020-05-28 20:20:24 +01:00
Sergio Martins
6797d291b6 Propagate max-size from the guest widget to DockWidget
Next step is propagating from DockWidget->Frame
2020-05-28 18:40:55 +01:00
Sergio Martins
798c808790 example: Set the max-size on the guest widget not on the dock
the size constraint will propagate up
2020-05-28 17:48:10 +01:00
Sergio Martins
4e3197388e Add a failing TestDocks::tst_maxSizePropagates 2020-05-28 17:47:57 +01:00
Sergio Martins
6cd5254779 Add a .vscode directory
Has some presets for debugging launching and configuring intellisense
via cmake
2020-05-26 22:07:22 +01:00
Sergio Martins
f770e768b8 example: Add option to load a layout from file 2020-05-26 21:53:58 +01:00
Sergio Martins
d07f715ed7 updateTitleBarVisibility after deserializing
Fixes floating window having two title bars
2020-05-26 21:53:51 +01:00
Sergio Martins
87c7a8ad65 Add unit-test for the previous commit 2020-05-26 20:17:37 +01:00
Sergio Martins
05f93a98f0 LayoutSaver: Only close dock widgets that would be restored
It can happen that the JSON layout knew about less dock widgets
than there are, as there can be new ones now
2020-05-26 19:49:02 +01:00
Sergio Martins
bab10c8d65 Add overloads to DockRegistry::clear()
So we can specify what to close
2020-05-26 19:13:34 +01:00
Sergio Martins
5e3a305a7c Add some useful DockRegistry overloads 2020-05-26 18:58:04 +01:00
Sergio Martins
c9fa637ae7 Add some helper methods to LayoutSaver::Layout
To retrieve the list of main windows and dock widgets present
in the loaded layout
2020-05-26 18:29:30 +01:00
Sergio Martins
79064b539a Another amalgamation fix 2020-05-26 16:16:31 +01:00
Sergio Martins
aa7107bde2 Silence some warnings on Windows 2020-05-26 16:13:56 +01:00
Sergio Martins
704e6d0182 Fix the amalgamation build a bit
As Config is already in another namespace
2020-05-26 16:12:25 +01:00
Sergio Martins
7634438f6c Add unit-test to previous commit 2020-05-25 23:30:31 +01:00
Sergio Martins
314cd6649d Item: also emit numVisibleItemsChanged when inserting a container
Since it can have items inside too
2020-05-25 23:27:13 +01:00
Sergio Martins
e08a7a6725 Fix tst_lastFloatingPositionIsRestored when there's a frame
Otherwise only passes on offscreen qpa which has no frame
2020-05-25 22:19:05 +01:00
Sergio Martins
45d5d7b519 update .gitignore 2020-05-25 21:47:03 +01:00
Sergio Martins
63c90875aa example: Add example of docking main window into main window 2020-05-25 21:45:21 +01:00
Sergio Martins
ee4ad02722 Fix FloatingWindow::hasSingleFrame()
Use m_dropArea->numFrames() which happens first, otherwise there
can be a moment where the frames() aren't updated yet
2020-05-25 21:43:01 +01:00
Sergio Martins
cd1f52a4bb When looking for drop target honour affinity 2020-05-25 21:29:29 +01:00
Sergio Martins
66a0959ac0 Honour main windows being nested in Frame::floatingWindow()
In such case the Frame is inside the nested main window, not floating.
2020-05-25 20:52:15 +01:00
Sergio Martins
39d70c8186 Fix crash due to recurency in DragController
A drop could cause the events to be processed and trigger
another mouse move

Fixes: #19
2020-05-25 20:48:18 +01:00
Sergio Martins
d541a41536 Minor refactoring, factor some code into a function 2020-05-25 20:40:02 +01:00
Sergio Martins
9761759fee Fix Floating window returning frames from nested main windows
Which we want to support now too
2020-05-25 20:27:08 +01:00
Sergio Martins
d4d83111ff Added DockWidgetBase::isMainWindow() 2020-05-25 20:25:33 +01:00
Sergio Martins
de09d5532f Fix DropArea::numFrames()
Was counting with placeholder items too. This should fix title bars
being wrong in some cases.
2020-05-25 20:12:29 +01:00
Sergio Martins
944138273f Tests: stabilize tst_embeddedMainWindow
Going 50px into the window was too short and didn't reach the embedded
window to show the indicators.

Also, it's the inner indicator we want, the other isn't visible as the
window is single frame
2020-05-25 20:11:01 +01:00
Sergio Martins
d2ca14bf99 DebugWindow: Also print affinities 2020-05-25 14:39:19 +01:00
Sergio Martins
84391c693c DebugWindow: Remove duplicate dump debug button
And the second one was incomplete as it didn't dump for the
floating windows
2020-05-25 14:31:21 +01:00
Sergio Martins
d94263fce5 Allow each dock widget and main window to support multiple affinities 2020-05-25 14:14:17 +01:00
Sergio Martins
2fd9d45525 Link multisplitter as a PUBLIC dependency if kddockwidgets
This way user doesn't need to explicitly link against it
2020-05-25 06:52:25 +01:00
Sergio Martins
8461f1f79e kddockwidgets_multisplitter is now a library of its own 2020-05-25 06:45:13 +01:00
Sergio Martins
d9badf3ffd Fix build 2020-05-25 06:10:18 +01:00
Sergio Martins
1ece0f0fef Add a fwd header for Separator_qwidget.h
Makes QtC happy with editing the example
2020-05-24 20:54:25 +01:00
Sergio Martins
4af582a21f Update .gitignore 2020-05-24 20:53:52 +01:00
Sergio Martins
ab90da3b19 Readability: Rename Item::guest() and Item::widget()
Their name wasn't matching their return value
2020-05-24 20:52:23 +01:00
Sergio Martins
45f4d9f6a8 Item no longer depends on QWidget 2020-05-24 20:47:58 +01:00
Sergio Martins
ba49e1cbe2 Separator no longer inherits from QWidget
Only SeparatorWidget does
2020-05-24 20:29:49 +01:00
Sergio Martins
c67f1c28f6 Fix build 2020-05-24 20:23:07 +01:00
Sergio Martins
de0bcf9ce3 readability: Rename asWidget() to asQWidget() 2020-05-24 20:03:02 +01:00
Sergio Martins
3bbc33d8c4 example: Revive the custom separator example
Pass -p to see a custom painted separator
2020-05-24 19:31:15 +01:00
Sergio Martins
e8abc23f59 Use a dedicated export macro file for multisplitter/
As it's independent from KDDW
2020-05-24 19:24:16 +01:00
Sergio Martins
c63c713bea Move SeparatorWidget into multisplitter/
multisplitter/ is to be a reusable component without needing KDDW
2020-05-24 19:13:39 +01:00
Sergio Martins
c33c7ab450 Don't leak Layouting::Widget
Don't create it directly, instead of multi-inheritance
2020-05-24 18:45:44 +01:00
Sergio Martins
c31edd0cd8 Remove a stray qDebug 2020-05-24 18:30:56 +01:00
Sergio Martins
b395b96234 Fix tst_multisplitter leaks
The Widget wrapper was leaking
2020-05-24 18:30:07 +01:00
Sergio Martins
16aac70510 Make MultiSplitter inherit from Layouting::Widget too
Since it's the host widget.
Fixes the Widget wrapper leaking. And no need for so much boiler-plate
2020-05-24 18:25:19 +01:00
Sergio Martins
7c9ee4f497 Move the mouse handling from Separator to SeparatorWidget
As it's QWidget specific
2020-05-24 17:58:04 +01:00
Sergio Martins
7f49f6e6a4 Move the separator's rubber band into SeparatorWidget
as it's specific to QWidget
2020-05-24 17:49:14 +01:00
Sergio Martins
c477fce1d9 Add Widget::show(), hide() and setGeometry() 2020-05-24 17:43:54 +01:00
Sergio Martins
e28f82dcad Make Item::hostWidget be a Layouting::Widget instead of QWidget
Just an abstraction preparing for QQuickItem support
2020-05-24 17:31:37 +01:00
Sergio Martins
7016656264 Rename GuestInterface to Widget
So we can use it to abstract the host too, not just the guest.
2020-05-24 15:23:10 +01:00
Sergio Martins
7f981a1d1d Item cleanup, moved LengthOnSide to impl 2020-05-24 14:05:04 +01:00
Sergio Martins
94b4051e31 Fix namespace build 2020-05-24 13:57:17 +01:00
Sergio Martins
86a2b14921 Move more code to GuestWidget 2020-05-23 21:14:11 +01:00
Sergio Martins
4fab2cf360 Move more code into GuestWidget 2020-05-23 20:11:27 +01:00
Sergio Martins
0a2fb6ed73 Add GuestWidget.h
The QtWidgets counter-part for GuestInterface.

Removing QWidget from Item
2020-05-23 19:22:01 +01:00
Sergio Martins
3d95263b40 Fix examples build with installed kddw 2020-05-23 19:00:12 +01:00
Sergio Martins
e75b47737c Move GuestInterface into its own file 2020-05-23 18:59:58 +01:00
Sergio Martins
9ad6eefa7a Add Layouting::Config
To host many of the scatered static member variables which
held some settings that rarely change
2020-05-23 18:40:20 +01:00
Sergio Martins
2527b39368 Moved the multisplitter wrapper outside of multisplitter/
As it depends on kddw framework, while multisplitter/ is the
agnostic layouting engine
2020-05-23 17:01:20 +01:00
Sergio Martins
71c7a7c9a9 Move more ItemContainer members to private 2020-05-23 16:46:43 +01:00
Sergio Martins
72c2586e20 Item: move a bunch of members to the private impl 2020-05-22 21:30:24 +01:00
Sergio Martins
7c5ed8bf84 Merge pull request #45 from OlivierJG/master
Fix include path so private header can be used
2020-05-22 20:30:51 +01:00
Olivier JG
70f0c49709 Fix include path so private header can be used 2020-05-22 14:17:02 -05:00
Sergio Martins
986a25971e Also print the widget geometry if it's different from the item 2020-05-22 15:56:02 +01:00
Sergio Martins
0c776b6595 Fix non-developer build 2020-05-22 12:26:21 +01:00
Sergio Martins
7a852f700f Save floating geometry right before starting a drag
so if you drop, then set floating again it goes to the original
floating position
2020-05-22 12:15:24 +01:00
Sergio Martins
bd848d8040 Add Draggable::singleDockWidget()
If the draggable only has a single dock widget, returns it.
Otherwise nullptr.
2020-05-22 12:14:12 +01:00
Sergio Martins
a7013b4cf7 Make DockWidget::setFloating(false) save the last docking position
so we can restore to it when floating again
2020-05-22 11:42:00 +01:00
Sergio Martins
8e39ce2dea When floating via titlebar, restore to correct floating position
If the title bar has a single dock widget and you press the float
button, then use the DockWidget's "last floating position" to
position the new floating window
2020-05-22 11:37:52 +01:00
Sergio Martins
4917da9e7c Minor: factorout some code into DockWidget::saveLastFloatingGeometry() 2020-05-22 11:37:25 +01:00
Sergio Martins
6d44362991 DockWidget::setFloating(true): restore to previous floating position
When floating a dock widget we restore it to the last known floating
position now
2020-05-22 11:12:12 +01:00
Sergio Martins
b3b25ba047 Save the last floating geometry right before docking
Previously it was only saved on close(), which isn't enough
2020-05-22 11:01:31 +01:00
Sergio Martins
76ba261f62 Return LastPositions by reference
Otherwise we're calling setters on a temporary
2020-05-22 10:53:37 +01:00
Sergio Martins
d9184e2396 debug++ 2020-05-21 20:07:09 +01:00
Sergio Martins
ce7c913f8c Move the last floating geometry 1 level up
So it's not overwritten.
Added a unit-test for testing that floating geometry doesn't break
2020-05-21 19:32:18 +01:00
Sergio Martins
b4526b007c Make LastPositions::lastPosition private
Need to control how the setters are messing with it, to add more
of them
2020-05-21 18:56:44 +01:00
Sergio Martins
618ec9fd41 Minor, use the members directly 2020-05-21 18:15:06 +01:00
Sergio Martins
e1c18de48e Remove unused Frame::dumpDebug()
Should be operator<<(QDebug) anyway if we need it
2020-05-21 18:05:24 +01:00
Sergio Martins
9779b8edc3 Deal in terms of LastPositions instead of the individual position
Just a refactoring to add more encapsulation
2020-05-21 17:43:51 +01:00
Sergio Martins
50934ae56d Use a shared_ptr for Position, so we can pass LastPositions by value 2020-05-21 17:19:54 +01:00
Sergio Martins
2da37180b9 Start supporting multiple last positions
Pushing some boilerplate first, so the functional diff is smaller.
Wraps the old position class with one that will have many.
2020-05-21 16:52:03 +01:00
Sergio Martins
7ab1500651 Add a QDebug operator for Position 2020-05-21 15:28:24 +01:00
Sergio Martins
f260a76f8b Rename LastPosition to Position
so we can have a list of them, the dock widget might have been
in several main windows
2020-05-21 14:49:49 +01:00
Sergio Martins
ba740a4934 Do a complete relayout if the loaded json layout isn't valid
The layout can be valid on disk might it might happen that
the guest QWidgets have different min-sizes now (in a different
run of our app), so we need to relayout
2020-05-20 21:30:55 +01:00
Sergio Martins
e0f16ae57e Add a kddockwidgets_linter executable
For linking layout json files. Returns non 0 if invalid, and
probably some warnings too.
2020-05-20 19:19:07 +01:00
Sergio Martins
8a3e784ae2 Make layout saver create the main window if it's missing
and we have a factory. The same way it happens for dock widgets.
2020-05-20 19:19:07 +01:00
Sergio Martins
01112779b0 Add a Config::mainWindowFactoryFunc
Analog to the dock widget factory func.
To be used by the linter.
2020-05-20 19:06:54 +01:00
Sergio Martins
6de5860e9a Don't allow to drop to itself when having mainwindow inside dock widget 2020-05-20 16:33:48 +01:00
Sergio Martins
1061edb3b0 Remove asserts that are already guarded by a warning
that's enough for the tests to fail
2020-05-20 15:30:57 +01:00
Sergio Martins
88b830d297 set the max size on the item too when setting the guest widget
Not honoured yet
2020-05-20 14:33:27 +01:00
Sergio Martins
283d2a80c7 Add Item::maxSizeChanged signal and improve setter 2020-05-20 14:25:42 +01:00
Sergio Martins
215e8cfd24 example: Cleanup some options a bit 2020-05-20 14:25:23 +01:00
Sergio Martins
235018bfae example: Set the max-size before docking 2020-05-20 10:05:11 +01:00
Sergio Martins
dc87c05f04 example: Add an option to text max-sizes
Support not done yet, but useful for testing
2020-05-19 23:22:39 +01:00
Sergio Martins
4a17b04310 Item::dumpDebug: Also print the max-size, if any 2020-05-19 22:48:14 +01:00
Sergio Martins
6001e655fd Fix crash when moving separator
We weren't recurring up the tree to find the next separator
2020-05-19 14:46:30 +01:00
Sergio Martins
af22e3e12d Fix tst_raise on XCB 2020-05-19 13:44:01 +01:00
Sergio Martins
0d3ae48fed Refuse to save invalid layouts
Now layout saver won't save if the root ItemContainer::checkSanity()
is false
2020-05-19 13:15:31 +01:00
Sergio Martins
9e198917f0 Try to recover from loading an invalid layout 2020-05-19 12:35:33 +01:00
Laurent Montel
d2531d48d3 Make it compile against qt < 5.10 QRandomGenerator was created in qt5.10 2020-05-19 11:20:28 +02:00
Sergio Martins
dc0dab6a83 DebugWindow: Add button to show all dock widgets 2020-05-19 10:05:41 +01:00
Laurent Montel
8b81cd12f8 Compile without deprecated method (qrand is deprecated. Replaced by QRandomGenerator) 2020-05-19 11:03:38 +02:00
Sergio Martins
044c590b92 Fix ambiguous enum on Windows
Can happen when using an amalgamation, due to the "using namespace"
clauses
2020-05-18 22:00:52 +01:00
Sergio Martins
6c2a29968a Fix include 2020-05-18 21:51:26 +01:00
Sergio Martins
90fe9be6f6 DebugViewer: Fix crash at shutdown 2020-05-18 18:54:13 +01:00
Sergio Martins
2350f847d7 Item: Dump screen information too 2020-05-18 13:46:06 +01:00
Sergio Martins
8f7df69fa1 Add unit-test for previous commit 2020-05-18 11:48:18 +01:00
Sergio Martins
b687224801 Fix separators not moving when having invisible items
typo...
2020-05-18 11:40:33 +01:00
Sergio Martins
209005478e only build multisplitter test if in developer mode 2020-05-18 09:28:15 +01:00
Sergio Martins
af25af1259 Add MainWindow::layoutEqually()
Distributes the space equally between all dock widgets
2020-05-18 00:05:50 +01:00
Sergio Martins
8b0be3b2ba Add ItemContainer::layoutEqually()
Distributes all the space equally through the container.
Still respects min/max
2020-05-17 23:44:45 +01:00
Sergio Martins
43fafa1f33 Fix -Wextra-semi 2020-05-17 22:32:08 +01:00
Sergio Martins
ea56d20959 Fix clazy warnings about unused trivial variables 2020-05-17 19:15:59 +01:00
Sergio Martins
8477fdc7e1 Fix detachments 2020-05-17 19:14:50 +01:00
Sergio Martins
d613d25ef5 Add missing emit keyword 2020-05-17 19:12:09 +01:00
Sergio Martins
c5d9b38fc2 Disable copy of polymorphic types 2020-05-17 19:11:45 +01:00
Sergio Martins
36061fc6dc Fix detach of temporary 2020-05-17 19:08:07 +01:00
Sergio Martins
2b6b6e2ba5 Disable copy for LayoutSaver, it has a dtor, but no copy-ctor 2020-05-17 19:07:26 +01:00
Sergio Martins
adedcfd6db Use fully qualified types in signals 2020-05-17 19:06:24 +01:00
Sergio Martins
a9e02ccd41 example: Don't leak the dock widgets on shutdown 2020-05-17 18:02:03 +01:00
Sergio Martins
4647814aae Fix tests with Qt 5.9
QTabWidget is a bit flaky and changes min width at unexpected times.
Which is fine but we can't compare against the expected min size
since it changes. So just check sanity of the restored layout
2020-05-17 17:12:31 +01:00
Sergio Martins
5b1b029b80 Fix Item::calculateSqueezes() squeezing too much
Fixes tst_28NestedWidgets:28 with Qt 5.9
2020-05-17 16:28:36 +01:00
Sergio Martins
6fe998d9df Add build* to .gitignore 2020-05-17 15:04:53 +01:00
Sergio Martins
131b43a833 Item: Ignore item changing min size when it's not visible
Fixes tst_crash2 with Qt 5.9. Added a proper test too.
2020-05-17 15:03:54 +01:00
Sergio Martins
a87ab40aad Implement support for double-clicking a separator
Will resize the left and right widget, so they have the same size
2020-05-16 20:18:32 +01:00
Sergio Martins
2fb66c681b Item: Register the location enum for pretty debugging 2020-05-16 19:45:08 +01:00
Sergio Martins
0bd2f8f23a tests: Add sanity checks for the tested rects
Catches the situtions fixed in the two previous commits.
2020-05-16 19:44:35 +01:00
Sergio Martins
0f796da901 Fix suggestedDropRect() not returning in global coords 2020-05-16 19:44:06 +01:00
Sergio Martins
cc5578f8f4 Fix inserting items in the list when there's hidden items 2020-05-16 19:43:18 +01:00
Sergio Martins
f89aa59371 Implement an exact Item::suggestedDropRect()
It will create a temporary, invisible layout, insert a copy of the item,
and see where it landed.
2020-05-16 18:20:48 +01:00
Sergio Martins
3f242a8b59 tests: Test Item::suggestedDropRect() more 2020-05-16 12:37:23 +01:00
Sergio Martins
c4b94f0f21 tests: pain a background in the host and guest widgets
For easier visual debugging
2020-05-16 12:36:44 +01:00
Sergio Martins
582ce6ef31 Item: Add pathFromRoot() and itemFromPath()
An easy way to identify an item within a layout.
2020-05-16 12:35:39 +01:00
Sergio Martins
10b47a8f9c Item: Allow to have items that don't have an host QWidget
So we can create dummy ones, for usage in suggestDropRect()
2020-05-16 12:34:31 +01:00
Sergio Martins
d2716cf1c5 Item: Improve assert, don't dereference nullptr 2020-05-16 12:33:09 +01:00
Sergio Martins
2984b62ca0 Item: Fix warning about setSize() having an empty size
When doing setLength() make sure that the other dimension isn't 0,
as the item the user is trying to insert could have had an empty
size to begin with
2020-05-16 12:32:00 +01:00
Sergio Martins
1f6c49d5ba Fix 5.15 build 2020-05-14 22:39:17 +01:00
Sergio Martins
d0b36cf932 add ctest to tst_multisplitter too
moved up otherwise the multisplitter one was being generated in
a different folder
2020-05-14 22:29:19 +01:00
Sergio Martins
d1d1c983f1 Remove "using namespace Layouting" out of the layouting lib
Fixes windows build due to ambiguous symbols
2020-05-14 22:02:27 +01:00
Sergio Martins
c5d880c124 Fix build on Windows
Location being ambiguous
2020-05-14 21:21:55 +01:00
Sergio Martins
d44a6f78b8 Fix build with older Qt 2020-05-14 21:10:46 +01:00
Sergio Martins
0abb6292c1 Remove a sanity check, it's called from unit tests already 2020-05-14 20:53:54 +01:00
Sergio Martins
2bf977ede7 Fix build on older compilers 2020-05-14 20:42:57 +01:00
Sergio Martins
5bad616c5a Fix some memory leaks 2020-05-14 20:34:54 +01:00
Sergio Martins
e0cd9d95b5 Pass an entire item to Item::suggestedDropRect()
So we can do more powerful calculations in the future
2020-05-13 22:35:02 +01:00
Sergio Martins
b743565ea3 Fix Item::suggestedRect() when the parentContainer() wasn't root 2020-05-13 22:35:02 +01:00
Sergio Martins
be1a2a3878 Fix build on Windows 2020-05-13 20:04:48 +01:00
Sergio Martins
b7cb6afa49 Item: Also position the opposite position, not just the length
Fixes fuzzer test 20.json
2020-05-13 19:39:30 +01:00
Sergio Martins
0db40953ac fuzzer: don't dump invalid operations to the JSON 2020-05-13 19:37:47 +01:00
Sergio Martins
137cf017c4 fuzzer: add a nice place to set a breakpoint 2020-05-13 19:37:47 +01:00
Sergio Martins
68acdaeb9a Fix Items not being connected to their parent after a restore
Missing connectToParent() calls.
2020-05-13 12:24:46 +01:00
Sergio Martins
4dea453e7c fuzzer: Trim failling test 2020-05-11 00:25:09 +01:00
Sergio Martins
ca52d6f760 fuzzer: Add a failing test 2020-05-11 00:05:00 +01:00
Sergio Martins
5eff4f8df8 fuzzer: fix dumping to JSON skipping some operations
Operations that don't have any parameters werent being saved
2020-05-11 00:04:26 +01:00
Sergio Martins
cc2aa13eb7 fuzzer: Fix dockByName() returning nullptr
dockStr() is just for printing purposes
2020-05-10 23:44:48 +01:00
Sergio Martins
c4241b92f1 Item: When restoring, only shrink the immediate neighbours
So it matches the behaviour of closing an item, where only immediate
neighbours grow.

Now, pressing the float button multiple times will always put the
item on the same place, and not disturb non-immediate neighbours
2020-05-10 23:24:18 +01:00
Sergio Martins
1a0299d758 Simplify the NeighbourSqueezeStrategy enum
And make it agnostic to how separators work, so it can shrinkNeighbours()
can be reused in other contexts.
2020-05-10 22:44:53 +01:00
Sergio Martins
550d84ab11 Rename for readability 2020-05-10 22:26:40 +01:00
Sergio Martins
2450f9b39f Minor rename for readability 2020-05-10 22:23:36 +01:00
Sergio Martins
f6f70f26e4 Item: Also pass the neighbour shrink strategy all along
So we can choose another one when restoring a child
2020-05-10 22:17:59 +01:00
Sergio Martins
c4df3600af tst_docks|fuzzer: Use offscreen QPA by default too 2020-05-10 21:26:52 +01:00
Sergio Martins
0f0209ddf3 tst_multisplitter: Use offscreen QPA by default
It's less anoying as it doesn't show a window
2020-05-10 21:21:20 +01:00
Sergio Martins
0dac5eed68 Item: Add DefaultSizeMode enum
To control how we calculate the item's initial size when
we add it
2020-05-10 21:20:31 +01:00
Sergio Martins
11576c5455 ECM: Only set the sanitizers for DEBUG config
ECMEnableSanitizers isn't being friendly of multi generators, like
-G "Ninja Multi-Config" and is messing with global flags which is a no-no.
Instead it should be using a dedicated custom config IMHO.

With this change only debug will get the sanitizers, so you can for instance
build with -DCMAKE_CONFIGURATION_TYPES=Debug;RelWithDebInfo and have Debug
hardeneded with the sanitizers while the RelWithDebInfo without sanitizers,
ideal for profiling.
2020-05-10 17:49:20 +01:00
Sergio Martins
93c471623b Silence -Wmaybe-uninitialized false-positive 2020-05-10 15:20:59 +01:00
Sergio Martins
925df72c0f Fix propagation of resize when dragging a separator
It was ok but was resizing children via the "percentage method",
and we only want to resize the children next to the separator.
2020-05-10 15:07:42 +01:00
Sergio Martins
babed642eb Fix warning saying item size being too small
If the widget's size is smaller than hardcodedMinimumSize then
it would be violating the min-size constraint
2020-05-10 12:45:58 +01:00
Sergio Martins
fd9bcdeabe Fix crash if root() is nullptr when printing a warning 2020-05-09 18:37:35 +01:00
Sergio Martins
2fe1e22076 Remove OPTION_SANITIZER_SUPPORT
We have ECM inside the repo now, so no point in guarding the include
2020-05-09 17:55:22 +01:00
Sergio Martins
a9d0ec3fdd Use a better strategy for size propagation when resizing via separator
Behaves like old kddockwidgets now.
When dragging a separator, only the immediate neighbours are resized.
Only when min-sizes are violated that it propagates.
2020-05-09 17:42:55 +01:00
Sergio Martins
ed6d5134b0 Implement Side1 and Side2 resizing strategies
to be used when dragging separators when mouse, as we don't want
a recursive resize dealing with percentages, as it doesn't need to be fair.
Items near the mouse/separator will suffer/benetif more from there resize.
Resize only propagates further when size-constraints come into action
2020-05-09 13:28:59 +01:00
Sergio Martins
1f2bdaf188 Factor out children resize logic into Item::resizeChildren()
as we'll have other stragies for resizing children
2020-05-09 12:49:03 +01:00
Sergio Martins
a9be454604 Item: Rename resize to setSize_recursive() 2020-05-09 12:14:08 +01:00
Sergio Martins
7c85c1eb0f Resize the layout after restoring
After restoring, we need to put the layout at the same size
as its widget. Most of the times this happens since we also restore
the widget's geometry. But really make sure, as something might happen
to the window geometry, like for example using RestoreOption_RelativeToMainWindow
which doesn't restore the main window geometries
2020-05-09 00:46:30 +01:00
Sergio Martins
addf436fd0 LayoutSaver: Don't load old serialization versions 2020-05-08 19:30:41 +01:00
Sergio Martins
ff6260a4dc tests: Add a failling test tst_invalidLayoutAfterRestore
And a JSON file that makes it fail
2020-05-08 18:40:23 +01:00
Sergio Martins
48f872f696 Remove extra semi 2020-05-08 18:01:28 +01:00
Sergio Martins
e3e31ca5ca Ensure kddockwidgets_layouting is STATIC
Otherwise we get errors as only kddockwidgets is exported. It's
not public API for now
2020-05-08 18:00:42 +01:00
Sergio Martins
4b05d4ddd7 Remove unused Item_p.h include 2020-05-08 17:02:58 +01:00
Sergio Martins
e6e63806f8 MultiSplitterLayout_p.h: Forward declare Frame and Item 2020-05-08 17:01:07 +01:00
Sergio Martins
d267b0e0dd LastPosition: Forward declare Layouting::Item 2020-05-08 16:46:42 +01:00
Sergio Martins
96ee076e9a Add pimpl to Separator 2020-05-08 16:43:03 +01:00
Sergio Martins
7e86a32a23 Readability++
let the reader know position isn't imported at this stage
2020-05-07 23:34:57 +01:00
Sergio Martins
09026fd312 Uncomment assert 2020-05-07 23:05:59 +01:00
Sergio Martins
d2dca56ce6 Implement lazy resize in the new engine
We're almost feature complete
2020-05-07 19:35:05 +01:00
Sergio Martins
3742e5ef9a example: No persistent central frame by default
This is old style, which we don't use anymore by default
2020-05-07 19:32:32 +01:00
Sergio Martins
7ed54631ac Item: unit-tests++ 2020-05-07 18:49:18 +01:00
Sergio Martins
3c1ab0126d Item: Clear and honour a bunch of TODOs 2020-05-07 18:49:00 +01:00
Sergio Martins
0df9943aa5 Fix fuzzer test 11.json and other tests that worked by luck
mapFrom/toRoot were wrong
2020-05-07 16:30:45 +01:00
Sergio Martins
d4cc9e85eb Add more sanity checks to Item
Checks that the parentContainer and hostWidget are correct
for each separator
2020-05-07 12:35:58 +01:00
Sergio Martins
5f7899f265 Item: Remove unused methods 2020-05-07 00:08:04 +01:00
Sergio Martins
61bedce278 Separators now are able to be moved by the user with mouse 2020-05-06 22:52:36 +01:00
Sergio Martins
cd053d0cc4 Unit-tests++ 2020-05-06 00:01:46 +01:00
Sergio Martins
06a7346281 Introduce ItemContainer::availableOnSide_recursive()
and use it for calculating the min/max position of a separator

The min/max position of a separator isn't local to its container,
but is recursive upwards until root
2020-05-05 23:16:57 +01:00
Sergio Martins
535a0c943c Remove some cruft, bunch of unused methods from old layouting engine 2020-05-04 23:37:04 +01:00
Sergio Martins
e298667351 Remove dead code about static separators
Before we had separators on the left,top,bottom,right margins
with 0 width. Now we don't have this concept anymore
2020-05-04 14:28:59 +01:00
Sergio Martins
0595448bba Replace Anchor with Separator
We don't have the concept of Anchors anymore. Code is now simpler
2020-05-04 13:10:38 +01:00
Sergio Martins
97c1ca30fd Layouting engine rewrite
The layouting was becoming too complex to maintain and to introduce
new features. Was even buggy, the fuzzer was constantly finding
bugs, which took hours to workaround.

Problem with the old layout engine is that there was a catch 22, between
Items driving the separators, and separators driving the anchors.

The new layout is much simpler, both in implementation and conceptually.
There's simply a recursive hierarchy of Item elements. An Item can either
have a QWidget to show, or be a ItemContainer, which contains Item children,
and so forth. Each ItemContainer is either vertical or horizontal. That's enough
to represent the "nested multi-splitter" concept which KDDW uses.

After each item insertion/deletion/resize, the separators are regenerated. They
are essentially dumb now.

TODO:
- Separators are drawn, but are not interactive yet
- There's 5 tests failing
- LayoutSaver scalling functionality
2020-05-04 00:02:03 +01:00
424 changed files with 54651 additions and 19259 deletions

72
.clang-format Normal file
View File

@@ -0,0 +1,72 @@
---
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
...

2
.clazy
View File

@@ -1 +1 @@
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
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-qobject-macro

240
.cmake-format.py Normal file
View File

@@ -0,0 +1,240 @@
# ----------------------------------
# Options affecting listfile parsing
# ----------------------------------
with section("parse"):
# Specify structure for custom cmake functions
additional_commands = {'foo': {'flags': ['BAR', 'BAZ'],
'kwargs': {'DEPENDS': '*', 'HEADERS': '*', 'SOURCES': '*'}}}
# Override configurations per-command where available
override_spec = {}
# Specify variable tags.
vartags = []
# Specify property tags.
proptags = []
# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):
# Disable formatting entirely, making cmake-format a no-op
disable = False
# How wide to allow formatted cmake files
line_width = 120
# How many spaces to tab for indent
tab_size = 4
# If true, lines are indented using tab characters (utf-8 0x09) instead of
# <tab_size> space characters (utf-8 0x20). In cases where the layout would
# require a fractional tab character, the behavior of the fractional
# indentation is governed by <fractional_tab_policy>
use_tabchars = False
# If <use_tabchars> is True, then the value of this variable indicates how
# fractional indentions are handled during whitespace replacement. If set to
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
# to `round-up` fractional indentation is replaced with a single tab character
# (utf-8 0x09) effectively shifting the column to the next tabstop
fractional_tab_policy = 'use-space'
# If an argument group contains more than this many sub-groups (parg or kwarg
# groups) then force it to a vertical layout.
max_subgroups_hwrap = 2
# If a positional argument group contains more than this many arguments, then
# force it to a vertical layout.
max_pargs_hwrap = 6
# If a cmdline positional group consumes more than this many lines without
# nesting, then invalidate the layout (and nest)
max_rows_cmdline = 2
# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False
# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False
# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on its own line.
dangle_parens = True
# If the trailing parenthesis must be 'dangled' on its on line, then align it
# to this reference: `prefix`: the start of the statement, `prefix-indent`:
# the start of the statement, plus one indentation level, `child`: align to
# the column of the arguments
dangle_align = 'prefix'
# If the statement spelling length (including space and parenthesis) is
# smaller than this amount, then force reject nested layouts.
min_prefix_chars = 4
# If the statement spelling length (including space and parenthesis) is larger
# than the tab width by more than this amount, then force reject un-nested
# layouts.
max_prefix_chars = 10
# If a candidate layout is wrapped horizontally but it exceeds this many
# lines, then reject the layout.
max_lines_hwrap = 2
# What style line endings to use in the output.
line_ending = 'unix'
# Format command names consistently as 'lower' or 'upper' case
command_case = 'lower'
# Format keywords consistently as 'lower' or 'upper' case
keyword_case = 'upper'
# A list of command names which should always be wrapped
always_wrap = []
# If true, the argument lists which are known to be sortable will be sorted
# lexicographicall
enable_sort = True
# If true, the parsers may infer whether or not an argument list is sortable
# (without annotation).
autosort = False
# By default, if cmake-format cannot successfully fit everything into the
# desired linewidth it will apply the last, most agressive attempt that it
# made. If this flag is True, however, cmake-format will print error, exit
# with non-zero status code, and write-out nothing
require_valid_layout = False
# A dictionary mapping layout nodes to a list of wrap decisions. See the
# documentation for more information.
layout_passes = {}
# ------------------------------------------------
# Options affecting comment reflow and formatting.
# ------------------------------------------------
with section("markup"):
# What character to use for bulleted lists
bullet_char = '*'
# What character to use as punctuation after numerals in an enumerated list
enum_char = '.'
# If comment markup is enabled, don't reflow the first comment block in each
# listfile. Use this to preserve formatting of your copyright/license
# statements.
first_comment_is_literal = False
# If comment markup is enabled, don't reflow any comment block which matches
# this (regex) pattern. Default is `None` (disabled).
literal_comment_pattern = None
# Regular expression to match preformat fences in comments default=
# ``r'^\s*([`~]{3}[`~]*)(.*)$'``
fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$'
# Regular expression to match rulers in comments default=
# ``r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'``
ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$'
# If a comment line matches starts with this pattern then it is explicitly a
# trailing comment for the preceeding argument. Default is '#<'
explicit_trailing_pattern = '#<'
# If a comment line starts with at least this many consecutive hash
# characters, then don't lstrip() them off. This allows for lazy hash rulers
# where the first hash char is not separated by space
hashruler_min_length = 10
# If true, then insert a space between the first hash char and remaining hash
# chars in a hash ruler, and normalize its length to fill the column
canonicalize_hashrulers = True
# enable comment markup parsing and reflow
enable_markup = False
# ----------------------------
# Options affecting the linter
# ----------------------------
with section("lint"):
# a list of lint codes to disable
disabled_codes = []
# regular expression pattern describing valid function names
function_pattern = '[0-9a-z_]+'
# regular expression pattern describing valid macro names
macro_pattern = '[0-9a-z_]+'
# regular expression pattern describing valid names for variables with global
# (cache) scope
global_var_pattern = '[A-Z][0-9A-Z_]+'
# regular expression pattern describing valid names for variables with global
# scope (but internal semantic)
internal_var_pattern = '[A-Z][0-9A-Z_]+'
# regular expression pattern describing valid names for variables with local
# scope
local_var_pattern = '[_A-Za-z][A-Za-z0-9_]+'
# regular expression pattern describing valid names for privatedirectory
# variables
private_var_pattern = '[0-9a-z_]+'
# regular expression pattern describing valid names for public directory
# variables
public_var_pattern = '.*'
# regular expression pattern describing valid names for function/macro
# arguments and loop variables.
argument_var_pattern = '[a-z_][a-z0-9_]+'
# regular expression pattern describing valid names for keywords used in
# functions or macros
keyword_pattern = '[A-Z][0-9A-Z_]+'
# In the heuristic for C0201, how many conditionals to match within a loop in
# before considering the loop a parser.
max_conditionals_custom_parser = 2
# Require at least this many newlines between statements
min_statement_spacing = 1
# Require no more than this many newlines between statements
max_statement_spacing = 2
max_returns = 6
max_branches = 15
max_arguments = 10
max_localvars = 15
max_statements = 50
# -------------------------------
# Options affecting file encoding
# -------------------------------
with section("encode"):
# If true, emit the unicode byte-order mark (BOM) at the start of the file
emit_byteorder_mark = False
# Specify the encoding of the input file. Defaults to utf-8
input_encoding = 'utf-8'
# Specify the encoding of the output file. Defaults to utf-8. Note that cmake
# only claims to support utf-8 so be careful when using anything else
output_encoding = 'utf-8'
# -------------------------------------
# Miscellaneous configurations options.
# -------------------------------------
with section("misc"):
# A dictionary containing any per-command configuration overrides. Currently
# only `command_case` is supported.
per_command = {}

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

29
.gitignore vendored
View File

@@ -6,10 +6,10 @@ Makefile
CMakeFiles
CMakeCache.txt
/examples/example
libdocks.so
tst_docks
CMakeLists.txt.user*
/build
/examples/dockwidgets/build/
moc_*
*.moc
*automoc.cpp
@@ -33,12 +33,37 @@ cmake_install.cmake
latex
html
custom_titlebar
libkddockwidgets.so
libkddockwidgets.so*
*.depends
kddockwidgets_basic_quick
/src/KDDockWidgetsConfig.cmake
/src/KDDockWidgetsConfigVersion.cmake
build-*
/build*
/examples/dockwidgets/kddockwidgets_example
.cmake
CTestTestfile.cmake
mylayout.json
*.cbp
*.pyc
/python/examples/rc_assets.py
/python/examples-qt6/rc_assets.py
*.pri
/docks-w
kddockwidgets_minimal_example
/docs/api/Doxyfile
/docs/api/qch/kddockwidgets-api.qch
/doxygen.log
/kddockwidgets.tag
/CMakeDoxyfile.in
/CMakeDoxygenDefaults.cmake
/Testing
/layout_tst*
/x64
/src/kddockwidgets_version.h
*.vcxproj*
*.sln
*.dir
.vscode
/.cache
/compile_commands.json

18
.krazy
View File

@@ -1,18 +1,28 @@
CHECKSETS qt5,c++
#KDAB-specific checks
EXTRA kdabcopyright
EXTRA kdabcopyright-reuse,kdabcontactus,fosslicense-reuse
#additional checks
#EXTRA defines,null
#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 spelling as codespell is much, much better tool
EXCLUDE spelling
#exclude more checks
EXCLUDE style
SKIP /fwd_headers/
SKIP Doxyfile.cmake
#skip some example files
SKIP /examples/qtquick/CMakeFiles/
#skip CMake files
SKIP /KDDockWidgetsConfig.cmake.in
#skip more files
SKIP CMakePresets.json
SKIP \.cmake-format\.py
#skip the borrowed code in the cmake subdir
SKIP /cmake/Qt5Portability.cmake|/cmake/ECM/
SKIP /cmake/ECM/|/cmake/KDAB/

1
.mdlrc Normal file
View File

@@ -0,0 +1 @@
style ".mdlrc.rb"

4
.mdlrc.rb Normal file
View File

@@ -0,0 +1,4 @@
all
rule 'MD013', :line_length => 100, :tables => false
rule 'MD029', :style => :ordered
exclude_rule 'MD033'

2
.pep8 Normal file
View File

@@ -0,0 +1,2 @@
[pycodestyle]
max_line_length = 120

51
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,51 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^(cmake/ECM|cmake/KDAB/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-json
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.0
hooks:
- id: clang-format
exclude: (.json)
- repo: https://github.com/PyCQA/pylint
rev: v2.12.2
hooks:
- id: pylint
exclude: ^(.cmake-format.py|conan/conanfile.py)
additional_dependencies: ["PySide2", "PySide6"]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
hooks:
- id: autopep8
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-lint
exclude: (.py.cmake|Doxyfile.cmake)
- id: cmake-format
exclude: (.py.cmake|Doxyfile.cmake)
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
entry: mdl
language: ruby
files: \.(md|mdown|markdown)$
- repo: https://github.com/fsfe/reuse-tool
rev: v1.0.0
hooks:
- id: reuse

597
.pylintrc Normal file
View File

@@ -0,0 +1,597 @@
[MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=
# Specify a score threshold to be exceeded before program exits with error.
fail-under=10.0
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=rc_assets.py
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use.
jobs=1
# Control the amount of potential inferred values when inferring a single
# object. This can help the performance when dealing with large functions or
# complex, nested conditions.
limit-inference-results=100
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=
# Pickle collected data for later comparisons.
persistent=yes
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
confidence=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
consider-using-f-string,
useless-option-value,
unknown-option-value,
R0801,I1101,E0401
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=c-extension-no-member=
[REPORTS]
# Python expression which should return a score less than or equal to 10. You
# have access to the variables 'error', 'warning', 'refactor', and 'convention'
# which contain the number of messages in each category, as well as 'statement'
# which is the total number of statements analyzed. This score is used by the
# global evaluation report (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details.
#msg-template=
# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
output-format=text
# Tells whether to display a full report or only the messages.
reports=no
# Activate the evaluation score.
score=yes
[REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=6
# Complete name of functions that never returns. When checking for
# inconsistent-return-statements if a never returning function is called then
# it will be considered as an explicit return statement and no message will be
# printed.
never-returning-functions=sys.exit
[BASIC]
# Naming style matching correct argument names.
argument-naming-style=camelCase
# Regular expression matching correct argument names. Overrides argument-
# naming-style.
#argument-rgx=
# Naming style matching correct attribute names.
attr-naming-style=camelCase
# Regular expression matching correct attribute names. Overrides attr-naming-
# style.
#attr-rgx=
# Bad variable names which should always be refused, separated by a comma.
bad-names=foo,
bar,
baz,
toto,
tutu,
tata
# Bad variable names regexes, separated by a comma. If names match any regex,
# they will always be refused
bad-names-rgxs=
# Naming style matching correct class attribute names.
class-attribute-naming-style=any
# Regular expression matching correct class attribute names. Overrides class-
# attribute-naming-style.
#class-attribute-rgx=
# Naming style matching correct class names.
class-naming-style=PascalCase
# Regular expression matching correct class names. Overrides class-naming-
# style.
#class-rgx=
# Naming style matching correct constant names.
const-naming-style=camelCase
# Regular expression matching correct constant names. Overrides const-naming-
# style.
#const-rgx=
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
# Naming style matching correct function names.
function-naming-style=camelCase
# Regular expression matching correct function names. Overrides function-
# naming-style.
#function-rgx=
# Good variable names which should always be accepted, separated by a comma.
good-names=i,
j,
k,
ex,
Run,
_
# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs=^[a-z]?$
# Include a hint for the correct naming format with invalid-name.
include-naming-hint=no
# Naming style matching correct inline iteration names.
inlinevar-naming-style=any
# Regular expression matching correct inline iteration names. Overrides
# inlinevar-naming-style.
#inlinevar-rgx=
# Naming style matching correct method names.
method-naming-style=any
# Regular expression matching correct method names. Overrides method-naming-
# style.
#method-rgx=
# Naming style matching correct module names.
module-naming-style=any
# Regular expression matching correct module names. Overrides module-naming-
# style.
#module-rgx=
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
# These decorators are taken in consideration only for invalid-name.
property-classes=abc.abstractproperty
# Naming style matching correct variable names.
variable-naming-style=camelCase
# Regular expression matching correct variable names. Overrides variable-
# naming-style.
#variable-rgx="[a-z0-9_]{1,30}$"
[FORMAT]
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Maximum number of characters on a single line.
max-line-length=120
# Maximum number of lines in a module.
max-module-lines=1000
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
[LOGGING]
# The type of string formatting that logging methods do. `old` means using %
# formatting, `new` is for `{}` formatting.
logging-format-style=old
# Logging modules to check that the string format arguments are in logging
# function parameter format.
logging-modules=logging
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,
XXX,
TODO
# Regular expression of note tags to take in consideration.
#notes-rgx=
[SIMILARITIES]
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=yes
# Minimum lines number of a similarity.
min-similarity-lines=4
[SPELLING]
# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=4
# Spelling dictionary name. Available dictionaries: en_AG (hunspell), en_AU
# (hunspell), en_BS (hunspell), en_BW (hunspell), en_BZ (hunspell), en_CA
# (hunspell), en_DK (hunspell), en_GB (hunspell), en_GH (hunspell), en_HK
# (hunspell), en_IE (hunspell), en_IN (hunspell), en_JM (hunspell), en_MW
# (hunspell), en_NA (hunspell), en_NG (hunspell), en_NZ (hunspell), en_PH
# (hunspell), en_SG (hunspell), en_TT (hunspell), en_US (hunspell), en_ZA
# (hunspell), en_ZM (hunspell), en_ZW (hunspell).
spelling-dict=
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains the private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to the private dictionary (see the
# --spelling-private-dict-file option) instead of raising a message.
spelling-store-unknown-words=no
[STRING]
# This flag controls whether inconsistent-quotes generates a warning when the
# character used as a quote delimiter is used inconsistently within a module.
check-quote-consistency=no
# This flag controls whether the implicit-str-concat should generate a warning
# on implicit string concatenation in sequences defined over several lines.
check-str-concat-over-line-jumps=no
[TYPECHECK]
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# Tells whether to warn about missing members when the owner of the attribute
# is inferred to be None.
ignore-none=yes
# This flag controls whether pylint should warn about no-member and similar
# checks whenever an opaque object is returned when inferring. The inference
# can return multiple potential results while evaluating a Python object, but
# some branches might not be evaluated, which results in partial inference. In
# that case, it might be useful to still emit no-member and other checks for
# the rest of the inferred objects.
ignore-on-opaque-inference=yes
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis). It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=
# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
missing-member-hint=yes
# The minimum edit distance a name should have in order to be considered a
# similar match for a missing member name.
missing-member-hint-distance=1
# The total number of similar names that should be taken in consideration when
# showing a hint for a missing member.
missing-member-max-choices=1
# List of decorators that change the signature of a decorated function.
signature-mutators=
[VARIABLES]
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid defining new builtins when possible.
additional-builtins=
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables=yes
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,
_cb
# A regular expression matching the name of dummy variables (i.e. expected to
# not be used).
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
# Argument names that match this expression will be ignored. Default to name
# with leading underscore.
ignored-argument-names=_.*|^ignored_|^unused_
# Tells whether we should check for unused import in __init__ files.
init-import=no
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
[CLASSES]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,
__new__,
setUp,
__post_init__
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,
_fields,
_replace,
_source,
_make
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=cls
[DESIGN]
# Maximum number of arguments for function / method.
max-args=10
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=6
# Maximum number of branch for function / method body.
max-branches=15
# Maximum number of locals for function / method body.
max-locals=20
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of return / yield for function / method body.
max-returns=6
# Maximum number of statements in function / method body.
max-statements=50
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
[IMPORTS]
# List of modules that can be imported at any level, not just the top level
# one.
allow-any-import-level=
# Allow wildcard imports from modules that define __all__.
allow-wildcard-with-all=no
# Analyse import fallback blocks. This can be used to support both Python 2 and
# 3 compatible code, which means that the block might have code that exists
# only in one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks=no
# Deprecated modules which should not be used, separated by a comma.
deprecated-modules=optparse,tkinter.tix
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled).
ext-import-graph=
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled).
import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled).
int-import-graph=
# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=
# Force import order to recognize a module as part of a third party library.
known-third-party=enchant
# Couples of modules and preferred modules, separated by a comma.
preferred-modules=
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception

29
.reuse/dep5 Normal file
View File

@@ -0,0 +1,29 @@
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
#misc source code
Files: *.qrc *.json *.xml src/fwd_headers/*
Copyright: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
License: GPL-2.0-only OR GPL-3.0-only
#misc documentation
Files: CONTRIBUTORS.txt Changelog README.md README-QtQuick.md README-WASM.md README-Wayland.md README-bindings.md README-troubleshooting conan/README.txt python/examples/README.txt python/examples-qt6/README.txt docs/KDDockWidgets-CopyrightAssignmentForm.pdf *.html
Copyright: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
License: GPL-2.0-only OR GPL-3.0-only
#misc config files
Files: .pre-commit-config.yaml .codespellrc .krazy .cmake-format .clang-format .clazy .gitignore .mdlrc .mdlrc.rb .pep8 .pylintrc appveyor.yml code.dev-*.code-workspace docs/api/Doxyfile.cmake distro/*
Copyright: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
License: BSD-3-Clause
#artwork
Files: screencap.gif images/* src/img/* docs/api/*.png examples/dockwidgets/assets/*.png src/img/classic_indicators/*.png
Copyright: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
License: GPL-2.0-only OR GPL-3.0-only
#3rdparty
Files: cmake/ECM/modules/*
Copyright: The KDE Project
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

View File

@@ -1,59 +1,390 @@
cmake_minimum_required(VERSION 3.7)
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
project(KDDockWidgets VERSION 0.1 LANGUAGES CXX)
else()
project(KDDockWidgets
VERSION 0.1
DESCRIPTION "An advanced docking system for Qt"
HOMEPAGE_URL "https://github.com/KDAB/KDDockWidgets"
LANGUAGES CXX)
endif()
# Pass the following variables to cmake to control the build:
#
# -DKDDockWidgets_QT6=[true|false]
# Build against Qt6 rather than Qt5
# Default=false (Qt5 will be used even if Qt6 is available)
#
# -DKDDockWidgets_STATIC=[true|false]
# Build static versions of the libraries
# Default=false
#
# -DKDDockWidgets_TESTS=[true|false]
# Build the test harness.
# Currently ignored (except for Python bindings) unless KDDockWidgets_DEVELOPER_MODE=True.
# Default=false
#
# -DKDDockWidgets_EXAMPLES=[true|false]
# Build the examples.
# Default=true
#
# -DKDDockWidgets_DOCS=[true|false]
# Build the API documentation. Enables the 'docs' build target.
# 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]
# Configure the build for a developer setup.
# Enables some features that are not geared towards end-users.
# Forces the test harness to be built.
# Default=false
#
# -DKDDockWidgets_WERROR=[true|false]
# Compile with the -Werror gcc/clang option (always true for developer-mode)
# Default=false
#
# -DKDDockWidgets_LINTER=[true|false]
# Build the layout linter.
# Ignored unless KDDockWidgets_DEVELOPER_MODE=True
# Default=true
#
# -DKDDockWidgets_FUZZER=[true|false]
# Build the fuzzer.
# Ignored unless KDDockWidgets_DEVELOPER_MODE=True
# Default=true
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0042 NEW)
cmake_minimum_required(VERSION 3.12)
option(OPTION_DEVELOPER_MODE "Developer Mode" OFF)
option(OPTION_SANITIZER_SUPPORT "Activate support for using sanitizers" OFF)
# option(OPTION_QTQUICK "Build for QtQuick instead of QtWidgets" OFF)
find_package(Qt5Widgets)
set(CMAKE_AUTOMOC ON)
set(ECM_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/ECM/modules/")
set(CMAKE_MODULE_PATH ${ECM_MODULE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (OPTION_SANITIZER_SUPPORT)
include(ECMEnableSanitizers)
endif()
if (OPTION_DEVELOPER_MODE)
add_definitions(-DDOCKS_DEVELOPER_MODE -DQT_FORCE_ASSERTS)
if (NOT MSVC)
add_compile_options(-Wall -Wextra -Werror)
# Allow using a non-KDAB install location.
set(KDAB_INSTALL
True
CACHE INTERNAL "Install to default KDAB Location"
)
if(DEFINED CMAKE_INSTALL_PREFIX)
if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "")
set(KDAB_INSTALL
False
CACHE INTERNAL "Install to non-KDAB Location"
)
endif()
endif()
if (OPTION_QTQUICK)
find_package(Qt5Quick)
project(
KDDockWidgets
DESCRIPTION "An advanced docking system for Qt"
HOMEPAGE_URL "https://github.com/KDAB/KDDockWidgets"
LANGUAGES CXX
)
set(${PROJECT_NAME}_VERSION_MAJOR 1)
set(${PROJECT_NAME}_VERSION_MINOR 6)
set(${PROJECT_NAME}_VERSION_PATCH 0)
set(${PROJECT_NAME}_VERSION
${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}
)
set(PROJECT_VERSION ${${PROJECT_NAME}_VERSION}) #PROJECT_VERSION is needed by some ECM modules
set(${PROJECT_NAME}_SOVERSION "1.6")
include(FeatureSummary)
option(${PROJECT_NAME}_QT6 "Build against Qt 6" OFF)
option(${PROJECT_NAME}_DEVELOPER_MODE "Developer Mode" OFF)
option(${PROJECT_NAME}_PYTHON_BINDINGS "Build python bindings" OFF)
option(${PROJECT_NAME}_QTQUICK "Build for QtQuick instead of QtWidgets" OFF)
option(${PROJECT_NAME}_STATIC "Build statically" OFF)
option(${PROJECT_NAME}_TESTS "Build the tests" OFF)
option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON)
option(${PROJECT_NAME}_DOCS "Build the API documentation" OFF)
option(${PROJECT_NAME}_WERROR "Use -Werror (will be true for developer-mode unconditionally)" OFF)
option(${PROJECT_NAME}_X11EXTRAS
"Link with QtX11Extras to detect if the compositor supports transparency. Not applicable to non-Linux or Qt6."
ON
)
option(${PROJECT_NAME}_XLib "On Linux, link against XLib, for a more robust window z-order detection." OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/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}_XLib)
add_definitions(-DKDDockWidgets_XLIB)
endif()
if(${PROJECT_NAME}_QT6)
set(Qt_VERSION_MAJOR 6)
set(QT_MIN_VERSION "6.2.0")
set(${PROJECT_NAME}_LIBRARY_QTID "-qt6")
else()
set(Qt_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15")
set(${PROJECT_NAME}_LIBRARY_QTID "")
endif()
find_package(Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS Widgets Test)
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
set(${PROJECT_NAME}_DEPS "widgets")
if(${PROJECT_NAME}_QTQUICK)
find_package(Qt${Qt_VERSION_MAJOR} NO_MODULE REQUIRED COMPONENTS Quick QuickControls2)
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
set(${PROJECT_NAME}_DEPS "${${PROJECT_NAME}_DEPS} quick quickcontrols2")
else()
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS)
endif()
add_subdirectory(src)
add_subdirectory(examples/dockwidgets)
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()
if (OPTION_DEVELOPER_MODE)
if (NOT OPTION_QTQUICK)
enable_testing()
add_subdirectory(tests)
#Always build the test harness in developer-mode
if(${PROJECT_NAME}_DEVELOPER_MODE)
set(${PROJECT_NAME}_TESTS ON)
set(${PROJECT_NAME}_WERROR ON)
include(ECMEnableSanitizers)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(IS_CLANG_BUILD TRUE)
else()
set(IS_CLANG_BUILD FALSE)
endif()
if(${PROJECT_NAME}_QTQUICK)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Default to hidden visibility for symbols
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
# Sets compiler flags for the specified target, taking platform into consideration.
macro(set_compiler_flags targetName)
if(${PROJECT_NAME}_DEVELOPER_MODE)
target_compile_definitions(
${targetName}
PUBLIC DOCKS_DEVELOPER_MODE
PRIVATE QT_FORCE_ASSERTS
)
if(NOT MSVC)
target_compile_options(${targetName} PRIVATE -Wall -Wextra)
endif()
if(APPLE)
target_compile_options(${targetName} PRIVATE -Wweak-vtables)
endif()
endif()
# examples use <kddockwidget/ qualified includes so need to be installed first
# add_subdirectory(examples)
# Enable -Werror
if(${PROJECT_NAME}_WERROR AND (NOT MSVC OR IS_CLANG_BUILD)) # clang-cl accepts these too
target_compile_options(${targetName} PRIVATE -Werror -Wundef -Wno-error=deprecated-declarations)
endif()
endmacro()
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE)
OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE)
OR (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)
)
# Linker warnings should be treated as errors
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_MODULE_LINKER_FLAGS}")
string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" compileflags)
if("${CMAKE_CXX_FLAGS} ${${compileflags}}" MATCHES "-fsanitize")
set(sanitizers_enabled TRUE)
else()
set(sanitizers_enabled FALSE)
endif()
if(APPLE OR LINUX)
# 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)
set(${PROJECT_NAME}_LIBRARY_MODE "STATIC")
else()
set(${PROJECT_NAME}_LIBRARY_MODE "SHARED")
endif()
if(KDAB_INSTALL)
if(UNIX)
set(CMAKE_INSTALL_PREFIX
"/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}"
CACHE INTERNAL "Install to default KDAB Location"
)
elseif(WIN32)
set(CMAKE_INSTALL_PREFIX
"C:\\KDAB\\${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}"
CACHE INTERNAL "Install to default KDAB Location"
)
endif()
endif()
# setup default install locations
include(KDInstallLocation)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(${PROJECT_NAME}_IS_ROOT_PROJECT TRUE)
message(STATUS "Building ${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} in ${CMAKE_BUILD_TYPE} mode. "
"Installing to ${CMAKE_INSTALL_PREFIX}"
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
install(FILES LICENSE.txt README.md DESTINATION ${INSTALL_DOC_DIR})
install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR})
# Generate .pri file for qmake users (except when using the VS generator)
if(NOT CMAKE_CONFIGURATION_TYPES)
if(Qt_VERSION_MAJOR EQUAL 5 OR (Qt_VERSION_MAJOR EQUAL 6 AND Qt6Core_VERSION VERSION_GREATER "6.2"))
include(ECMGeneratePriFile)
set(PROJECT_VERSION_STRING ${${PROJECT_NAME}_VERSION})
ecm_generate_pri_file(
BASE_NAME
KDDockWidgets
LIB_NAME
kddockwidgets${${PROJECT_NAME}_LIBRARY_QTID}
DEPS
${${PROJECT_NAME}_DEPS}
FILENAME_VAR
pri_filename
INCLUDE_INSTALL_DIR
${CMAKE_INSTALL_INCLUDEDIR}
)
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
endif()
endif()
else()
#Always disable tests, examples, docs when used as a submodule
set(${PROJECT_NAME}_IS_ROOT_PROJECT FALSE)
set(${PROJECT_NAME}_TESTS FALSE)
set(${PROJECT_NAME}_EXAMPLES FALSE)
set(${PROJECT_NAME}_DOCS FALSE)
endif()
if(${PROJECT_NAME}_TESTS)
enable_testing()
endif()
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()
if(CMAKE_UNITY_BUILD)
message(FATAL_ERROR "** Python Bindings are disabled in Unity builds. " "Try again with CMAKE_UNITY_BUILD=OFF")
endif()
endif()
if(${PROJECT_NAME}_PYTHON_BINDINGS)
add_subdirectory(python)
endif()
if(${PROJECT_NAME}_EXAMPLES)
if(${PROJECT_NAME}_QTQUICK)
add_subdirectory(examples/qtquick)
else()
add_subdirectory(examples/dockwidgets)
add_subdirectory(examples/minimal)
add_subdirectory(examples/minimal-mdi)
add_subdirectory(examples/mdi_with_docking)
set_compiler_flags(kddockwidgets_example)
set_compiler_flags(kddockwidgets_minimal_example)
set_compiler_flags(kddockwidgets_mdi_with_docking_example)
endif()
endif()
if(${PROJECT_NAME}_TESTS)
if(${PROJECT_NAME}_DEVELOPER_MODE)
add_subdirectory(tests)
# tst_docks.exe is pretty big (160 tests), so split it in more runs so we can use threads.
add_test(NAME tst_docks0 COMMAND tests_launcher 0 5)
add_test(NAME tst_docks1 COMMAND tests_launcher 1 5)
add_test(NAME tst_docks2 COMMAND tests_launcher 2 5)
add_test(NAME tst_docks3 COMMAND tests_launcher 3 5)
add_test(NAME tst_docks4 COMMAND tests_launcher 4 5)
add_test(NAME tst_docks5 COMMAND tests_launcher 5 5)
add_test(NAME tst_docks6 COMMAND tests_launcher 6 5)
add_test(NAME tst_docks7 COMMAND tests_launcher 7 5)
add_test(NAME tst_docks8 COMMAND tests_launcher 8 5)
add_test(NAME tst_docks9 COMMAND tests_launcher 9 5)
add_test(NAME tst_docks10 COMMAND tests_launcher 10 5)
add_test(NAME tst_docks11 COMMAND tests_launcher 10 5)
add_test(NAME tst_docks12 COMMAND tests_launcher 11 5)
add_test(NAME tst_docks13 COMMAND tests_launcher 12 5)
add_test(NAME tst_docks14 COMMAND tests_launcher 13 5)
add_test(NAME tst_docks15 COMMAND tests_launcher 14 5)
add_test(NAME tst_docks16 COMMAND tests_launcher 15 5)
add_test(NAME tst_docks17 COMMAND tests_launcher 16 5)
add_test(NAME tst_docks18 COMMAND tests_launcher 17 5)
add_test(NAME tst_docks19 COMMAND tests_launcher 18 5)
add_test(NAME tst_docks20 COMMAND tests_launcher 19 5)
add_test(NAME tst_docks21 COMMAND tests_launcher 20 5) # one more for rounding leftovers
if(NOT ${PROJECT_NAME}_QTQUICK)
# tst_multisplitter depends on QWidget
add_test(NAME tst_multisplitter COMMAND tst_multisplitter)
endif()
endif()
endif()
if(${PROJECT_NAME}_DOCS)
add_subdirectory(docs) # needs to go last, in case there are build source files
endif()
if(${PROJECT_NAME}_IS_ROOT_PROJECT)
# Add uninstall target (not for submodules since parent projects typically have uninstall too)
include(ECMUninstallTarget)
endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

483
CMakePresets.json Normal file
View File

@@ -0,0 +1,483 @@
{
"version": 2,
"configurePresets": [
{
"name": "dev",
"displayName": "dev",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF"
},
"warnings" : {
"uninitialized" : true
}
},
{
"name": "dev-asan",
"displayName": "dev-asan",
"description": "An ASAN/UBSAN build",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-asan",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'"
},
"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": {
"CXX": "clazy",
"CCACHE_DISABLE" : "ON"
}
},
{
"name": "clazy-qtquick",
"displayName": "clazy-qtquick",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-clazy-qtquick",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_EXAMPLES" : "OFF",
"KDDockWidgets_WERROR": "ON",
"KDDockWidgets_QTQUICK": "ON"
},
"environment": {
"CXX": "clazy",
"CCACHE_DISABLE" : "ON"
}
},
{
"name": "release",
"displayName": "release",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "release-no-x11extras",
"displayName": "release-no-x11extras",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release-no-x11extras",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_X11EXTRAS" : "OFF"
}
},
{
"name": "release-qtquick",
"displayName": "release-qtquick",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release-qtquick",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QTQUICK": "ON"
}
},
{
"name": "dev-qtquick",
"displayName": "dev-qtquick",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-qtquick",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QTQUICK": "ON",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF"
}
},
{
"name": "python",
"displayName": "python",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-python",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_PYTHON_BINDINGS": "ON"
}
},
{
"name": "static",
"displayName": "static",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-static",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_STATIC": "ON"
}
},
{
"name": "static-qtquick",
"displayName": "static-qtquick",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-static-qtquick",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_STATIC": "ON",
"KDDockWidgets_QTQUICK": "ON"
}
},
{
"name": "release6",
"displayName": "release6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QT6": "ON",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
},
"environment": {
"PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
}
},
{
"name": "dev6",
"displayName": "dev6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QT6": "ON",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
},
"environment": {
"PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
}
},
{
"name": "dev-asan6",
"displayName": "dev-asan6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-asan6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QT6": "ON",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"KDDockWidgets_FUZZER" : "OFF",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
},
"environment": {
"PATH": "$env{QT6_DIR}/bin:$penv{PATH}"
}
},
{
"name": "release-qtquick6",
"displayName": "release-qtquick6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release-qtquick6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QTQUICK": "ON",
"KDDockWidgets_QT6": "ON",
"CMAKE_PREFIX_PATH" : "$env{QT6_DIR}"
},
"environment": {
"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"
}
},
{
"name": "dev-time-trace",
"displayName": "dev-time-trace",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-time-trace",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF",
"CMAKE_C_FLAGS_INIT" : "-ftime-trace",
"CMAKE_CXX_FLAGS_INIT": "-ftime-trace"
},
"warnings" : {
"uninitialized" : true
},
"environment": {
"CC": "clang",
"CXX": "clang++",
"CCACHE_DISABLE" : "ON"
}
},
{
"name": "dev6-time-trace",
"displayName": "dev6-time-trace",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev6-time-trace",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON",
"KDDockWidgets_FUZZER" : "OFF",
"KDDockWidgets_QT6" : "ON",
"CMAKE_C_FLAGS_INIT" : "-ftime-trace",
"CMAKE_CXX_FLAGS_INIT": "-ftime-trace"
},
"warnings" : {
"uninitialized" : true
},
"environment": {
"CC": "clang",
"CXX": "clang++",
"CCACHE_DISABLE" : "ON"
}
},
{
"name": "ci-dev-qtwidgets-qt5",
"displayName": "ci-dev-qtwidgets-qt5",
"description": "Qt5 QtWidgets dev-mode build",
"binaryDir": "${sourceDir}/build-ci-dev-qtwidgets-qt5",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "ci-dev-qtquick-qt5",
"displayName": "ci-dev-qtquick-qt5",
"description": "Qt5 QtQuick dev-mode build",
"binaryDir": "${sourceDir}/build-ci-dev-qtquick-qt5",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QTQUICK": "ON"
}
},
{
"name": "ci-qtwidgets-qt5",
"displayName": "ci-qtwidgets-qt5",
"description": "Qt5 QtWidgets release build",
"binaryDir": "${sourceDir}/build-ci-qtwidgets-qt5",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "OFF",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "ci-qtquick-qt5",
"displayName": "ci-qtquick-qt5",
"description": "Qt5 QtQuick release build",
"binaryDir": "${sourceDir}/build-ci-qtquick-qt5",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QTQUICK": "ON"
}
},
{
"name": "ci-dev-qtwidgets-qt6",
"displayName": "ci-dev-qtwidgets-qt6",
"description": "Qt6 dev-mode",
"binaryDir": "${sourceDir}/build-ci-dev-qtwidgets-qt6",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QT6": "ON"
}
},
{
"name": "ci-dev-qtquick-qt6",
"displayName": "ci-dev-qtquick-qt6",
"description": "Qt6 dev-mode",
"binaryDir": "${sourceDir}/build-ci-dev-qtquick-qt6",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "ON",
"CMAKE_BUILD_TYPE": "Debug",
"KDDockWidgets_QT6": "ON",
"KDDockWidgets_QTQUICK": "ON"
}
},
{
"name": "ci-qtwidgets-qt6",
"description": "Qt6 QtWidgets release build",
"displayName": "ci-qtwidgets-qt6",
"binaryDir": "${sourceDir}/build-ci-qtwidgets-qt6",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QT6": "ON"
}
},
{
"name": "ci-qtquick-qt6",
"description": "Qt6 QtQuick release build",
"displayName": "ci-qtquick-qt6",
"binaryDir": "${sourceDir}/build-ci-qtquick-qt6",
"generator": "Ninja",
"cacheVariables": {
"KDDockWidgets_DEVELOPER_MODE": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"KDDockWidgets_QT6": "ON",
"KDDockWidgets_QTQUICK": "ON"
}
},
{
"name": "ci-static",
"inherits":["static"],
"binaryDir": "${sourceDir}/build-ci-static"
},
{
"name": "ci-static-qtquick",
"inherits":["static-qtquick"],
"binaryDir": "${sourceDir}/build-ci-static-qtquick"
},
{
"name": "ci-python",
"inherits":["python"],
"binaryDir": "${sourceDir}/build-python"
}
],
"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>

163
Changelog
View File

@@ -1,10 +1,155 @@
* v1.0 (November 4th, 2019)
- Initial Release
* v1.6.0 (14 September 2022)
- Minimum Qt6 version is now 6.2.0
- Minimum CMake version is now 3.12.0
- Fixed restoring of normal geometry when closing a maximized window (#259)
- Experimental support for docking into dock widgets which are in a MDI area.
- Fixed potential crash involving infinite loop between QWidget::create() and QWidget::createWinId()
- Moved DropIndicatorOverlayInterface::DropLocation enum to KDDockWidgets namespace scope
- Added Config::setDropIndicatorAllowedFunc() and corresponding example
(kddockwidgets_example --hide-certain-docking-indicators)
- Fixed case where unfloating wouldn't restore to the main window (#44 and #96)
- Fixed MainWindow not propagating close events to docked widgets
- X11: Improved detecting which window is under the cursor, by using native X11 API
- X11: Fixed dragging a maximized floating window. Its size is now restored to normal size when the drag starts.
- Added DockWidgetBase::currentTabIndex()
- Added InitialVisibilityOption::PreserveCurrentTab
- Added MainWindow::internalLayout() for advanced customization
* v1.1 (, 2020)
Features:
- Allow tab re-ordering with mouse, via KDDockWidgets::Config::Flag_AllowReorderTabs.
- Allow tabs to have a close button, via KDDockWidgets::Config::Flag_TabsHaveCloseButton.
- Add support for lazy resize, via KDDockWidgets::Config::Flag_LazyResize. Resize is only done when mouse is released.
Fixes:
- Fix dock widgets not filling their complete available space
* v1.5.0 (24 November 2021)
- Install the Python bindings to "site-packages"
- The Python bindings for Qt6 use the "PyKDDockWidgetsQt6" namespace
- Co-installable with Qt6
- Adds support for non-detachable central widget, MainWindowOption_HasCentralWidget. (#225)
- Fix corrupt layout when restoring old JSON
- Fix "Unpin" button not showing up in overlayed widgets
- Minimum Qt version is now 5.15
* v1.4.0 (16 July 2021)
- No longer supports Qt versions less than 5.12
- 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)
- The enum KDDockWidgets::AddingOption has been deprecated, use
KDDockWidgets::InitialVisibilityOption instead
- 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 (6 February 2021)
- 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)
- Wayland support
- Added Flag_KeepAboveIfNotUtilityWindow, so you can have keep above even if
floating window is shown in the task-bar.
- Added DockWidget::windowActiveAboutToChange() signal
- Added support for Qt6 (PySide6 support is lacking)
- Added WASM support
* v1.1.1 (11 December 2020)
- Windows: Fixed a crash when clicking on the close button for floating windows in some situations (#110)
- Don't show dock/undock icon when dockwidget is not dockable (#99)
* v1.1.0 (26 October 2020)
- New drop indicator style type: Segmented Indicators
- Windows: Drop Shadow for floating windows
- Added AutoHide / SideBar support
- Added FocusScope support
- Added DockWidget::isFocused() and DockWidgetBase::isFocusedChanged()
- Added Config::Flag_AlwaysTitleBarWhenFloating, which complements Flag_HideTitleBarWhenTabsVisible
- Added Config::Flag_DontUseUtilityWindowsForFloating
- Added Config::Flag_TitleBarHasMinimizeButton
- Added Config::Flag_TitleBarNoFloatButton
- Added Config::Flag_AutoHideSupport
- Added Config::setTabbingAllowedFunc(TabbingAllowedFunc func)
- HDPI improvements, new high-res icons
- Bugfixes:
- Windows: Fixed windows not having proper minimum size.
- Windows: Fixed moving windows across screens with different DPI (#72)
- Don't center floating windows if the user set a custom position (#75)
- Fixed floating window's title not being correct (#74)
- Fixed focus scope not reacting when clicking on current tab (#71)
- Fixed floating window borders not being rendered correctly on HDPI due to rounding errors.
- cmake/Python - don't require pkg-config, only use if available (#68)
* v1.0.0 (2 September 2020)
- PySide2 bindings
- Rewrote the layouting engine, resulting in a huge stability gain and makes it easy to add new features
- Honour min/max sizes and some QSizePolicy heuristics
- Lazy resize (resize only when dropping the separator)
- Native Windows dragging (supporting Aero-snap)
- Allow to hide TitleBar and just show tabs. Allow dragging via the tab bar.
- Reordering tabs with mouse
- Partial layout save/restore (affecting only a subset)
- Double-click on title bar to maximize
- Maximize button on the title bar
- HDPI: Relative layouting restore
- Allow to make a dock widget non-closable and non-dockable
- Show close button on tabs
- Multiple Main Window support
- Allowing to dock on different parents
- Support for affinities, making some dock widgets only dockable on certain main windows
- 200 unit-tests
- Fuzzer which found plenty of crashes in the old layouting engine
- ASAN fixes
- Double click on separator to distribute equally
- Hovering over an indicator returns the true size that the dropped widget will get
- Static build support
- Namespaced Qt support
- Dozens of crash fixes, bugs and much more...
* v0.1 (4 November 2019)
- Initial Release and blog

View File

@@ -1,4 +1,4 @@
The KDDockWidgets software is Copyright (C) 2018-2020 Klaralvdalens Datakonsult AB.
The KDDockWidgets software is Copyright (C) 2018-2022 Klaralvdalens Datakonsult AB.
You may use, distribute and copy the KDDockWidgets software under the terms of
the GNU General Public License version 2 or under the terms of GNU General

7
LICENSE.txt Normal file
View File

@@ -0,0 +1,7 @@
KDDockWidgets is (C) 2018-2022, Klarälvdalens Datakonsult AB, and is licensed
according to the terms of the:
GNU General Public License version 2.0 (see LICENSES/GPL-2.0-only.txt)
or the
GNU General Public License version 3.0 (see LICENSES/GPL-3.0-only.txt).
Contact KDAB at <info@kdab.com> to inquire about commercial licensing.

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.

319
LICENSES/GPL-2.0-only.txt Normal file
View File

@@ -0,0 +1,319 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to
most of the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software
is covered by the GNU Lesser General Public License instead.) You can apply
it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You
must make sure that they, too, receive or can get the source code. And you
must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its recipients
to know that what they have is not the original, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms
of this General Public License. The "Program", below, refers to any such program
or work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or translated
into another language. (Hereinafter, translation is included without limitation
in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running the Program
is not restricted, and the output from the Program is covered only if its
contents constitute a work based on the Program (independent of having been
made by running the Program). Whether that is true depends on what the Program
does.
1. You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty;
keep intact all the notices that refer to this License and to the absence
of any warranty; and give any other recipients of the Program a copy of this
License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) You must cause the modified files to carry prominent notices stating that
you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or
in part contains or is derived from the Program or any part thereof, to be
licensed as a whole at no charge to all third parties under the terms of this
License.
c) If the modified program normally reads commands interactively when run,
you must cause it, when started running for such interactive use in the most
ordinary way, to print or display an announcement including an appropriate
copyright notice and a notice that there is no warranty (or else, saying that
you provide a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this License.
(Exception: if the Program itself is interactive but does not normally print
such an announcement, your work based on the Program is not required to print
an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Program, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Program.
In addition, mere aggregation of another work not based on the Program with
the Program (or with a work based on the Program) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may copy and distribute the Program (or a work based on it, under Section
2) in object code or executable form under the terms of Sections 1 and 2 above
provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code,
which must be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give
any third party, for a charge no more than your cost of physically performing
source distribution, a complete machine-readable copy of the corresponding
source code, to be distributed under the terms of Sections 1 and 2 above on
a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or executable
form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all
the source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation
of the executable. However, as a special exception, the source code distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the
source code from the same place counts as distribution of the source code,
even though third parties are not compelled to copy the source along with
the object code.
4. You may not copy, modify, sublicense, or distribute the Program except
as expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses terminated
so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Program
(or any work based on the Program), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program),
the recipient automatically receives a license from the original licensor
to copy, distribute or modify the Program subject to these terms and conditions.
You may not impose any further restrictions on the recipients' exercise of
the rights granted herein. You are not responsible for enforcing compliance
by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Program at all. For example, if a
patent license would not permit royalty-free redistribution of the Program
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and
the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system, which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose
any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing and reuse
of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively convey the exclusion
of warranty; and each file should have at least the "copyright" line and a
pointer to where the full notice is found.
<one line to give the program's name and an idea of what it does.>
Copyright (C)< yyyy> <name of author>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when
it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software,
and you are welcome to redistribute it under certain conditions; type `show
c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may be
called something other than `show w' and `show c'; they could even be mouse-clicks
or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision'
(which makes passes at compilers) written by James Hacker.
<signature of Ty Coon >, 1 April 1989 Ty Coon, President of Vice This General
Public License does not permit incorporating your program into proprietary
programs. If your program is a subroutine library, you may consider it more
useful to permit linking proprietary applications with the library. If this
is what you want to do, use the GNU Lesser General Public License instead
of this License.

625
LICENSES/GPL-3.0-only.txt Normal file
View File

@@ -0,0 +1,625 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and
other kinds of works.
The licenses for most software and other practical works are designed to take
away your freedom to share and change the works. By contrast, the GNU General
Public License is intended to guarantee your freedom to share and change all
versions of a program--to make sure it remains free software for all its users.
We, the Free Software Foundation, use the GNU General Public License for most
of our software; it applies also to any other work released this way by its
authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for them if you wish), that
you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs, and that you know you
can do these things.
To protect your rights, we need to prevent others from denying you these rights
or asking you to surrender the rights. Therefore, you have certain responsibilities
if you distribute copies of the software, or if you modify it: responsibilities
to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must pass on to the recipients the same freedoms that you received.
You must make sure that they, too, receive or can get the source code. And
you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert
copyright on the software, and (2) offer you this License giving you legal
permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that
there is no warranty for this free software. For both users' and authors'
sake, the GPL requires that modified versions be marked as changed, so that
their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified
versions of the software inside them, although the manufacturer can do so.
This is fundamentally incompatible with the aim of protecting users' freedom
to change the software. The systematic pattern of such abuse occurs in the
area of products for individuals to use, which is precisely where it is most
unacceptable. Therefore, we have designed this version of the GPL to prohibit
the practice for those products. If such problems arise substantially in other
domains, we stand ready to extend this provision to those domains in future
versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States
should not allow patents to restrict development and use of software on general-purpose
computers, but in those that do, we wish to avoid the special danger that
patents applied to a free program could make it effectively proprietary. To
prevent this, the GPL assures that patents cannot be used to render the program
non-free.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works,
such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License.
Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals
or organizations.
To "modify" a work means to copy from or adapt all or part of the work in
a fashion requiring copyright permission, other than the making of an exact
copy. The resulting work is called a "modified version" of the earlier work
or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the
Program.
To "propagate" a work means to do anything with it that, without permission,
would make you directly or secondarily liable for infringement under applicable
copyright law, except executing it on a computer or modifying a private copy.
Propagation includes copying, distribution (with or without modification),
making available to the public, and in some countries other activities as
well.
To "convey" a work means any kind of propagation that enables other parties
to make or receive copies. Mere interaction with a user through a computer
network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the
extent that it includes a convenient and prominently visible feature that
(1) displays an appropriate copyright notice, and (2) tells the user that
there is no warranty for the work (except to the extent that warranties are
provided), that licensees may convey the work under this License, and how
to view a copy of this License. If the interface presents a list of user commands
or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making
modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard
defined by a recognized standards body, or, in the case of interfaces specified
for a particular programming language, one that is widely used among developers
working in that language.
The "System Libraries" of an executable work include anything, other than
the work as a whole, that (a) is included in the normal form of packaging
a Major Component, but which is not part of that Major Component, and (b)
serves only to enable use of the work with that Major Component, or to implement
a Standard Interface for which an implementation is available to the public
in source code form. A "Major Component", in this context, means a major essential
component (kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to produce
the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source
code needed to generate, install, and (for an executable work) run the object
code and to modify the work, including scripts to control those activities.
However, it does not include the work's System Libraries, or general-purpose
tools or generally available free programs which are used unmodified in performing
those activities but which are not part of the work. For example, Corresponding
Source includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically linked
subprograms that the work is specifically designed to require, such as by
intimate data communication or control flow between those subprograms and
other parts of the work.
The Corresponding Source need not include anything that users can regenerate
automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright
on the Program, and are irrevocable provided the stated conditions are met.
This License explicitly affirms your unlimited permission to run the unmodified
Program. The output from running a covered work is covered by this License
only if the output, given its content, constitutes a covered work. This License
acknowledges your rights of fair use or other equivalent, as provided by copyright
law.
You may make, run and propagate covered works that you do not convey, without
conditions so long as your license otherwise remains in force. You may convey
covered works to others for the sole purpose of having them make modifications
exclusively for you, or provide you with facilities for running those works,
provided that you comply with the terms of this License in conveying all material
for which you do not control copyright. Those thus making or running the covered
works for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of your copyrighted
material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions
stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure
under any applicable law fulfilling obligations under article 11 of the WIPO
copyright treaty adopted on 20 December 1996, or similar laws prohibiting
or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention
of technological measures to the extent such circumvention is effected by
exercising rights under this License with respect to the covered work, and
you disclaim any intention to limit operation or modification of the work
as a means of enforcing, against the work's users, your or third parties'
legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive
it, in any medium, provided that you conspicuously and appropriately publish
on each copy an appropriate copyright notice; keep intact all notices stating
that this License and any non-permissive terms added in accord with section
7 apply to the code; keep intact all notices of the absence of any warranty;
and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you
may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce
it from the Program, in the form of source code under the terms of section
4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and
giving a relevant date.
b) The work must carry prominent notices stating that it is released under
this License and any conditions added under section 7. This requirement modifies
the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone
who comes into possession of a copy. This License will therefore apply, along
with any applicable section 7 additional terms, to the whole of the work,
and all its parts, regardless of how they are packaged. This License gives
no permission to license the work in any other way, but it does not invalidate
such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate
Legal Notices; however, if the Program has interactive interfaces that do
not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works,
which are not by their nature extensions of the covered work, and which are
not combined with it such as to form a larger program, in or on a volume of
a storage or distribution medium, is called an "aggregate" if the compilation
and its resulting copyright are not used to limit the access or legal rights
of the compilation's users beyond what the individual works permit. Inclusion
of a covered work in an aggregate does not cause this License to apply to
the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections
4 and 5, provided that you also convey the machine-readable Corresponding
Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including
a physical distribution medium), accompanied by the Corresponding Source fixed
on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including
a physical distribution medium), accompanied by a written offer, valid for
at least three years and valid for as long as you offer spare parts or customer
support for that product model, to give anyone who possesses the object code
either (1) a copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical medium customarily
used for software interchange, for a price no more than your reasonable cost
of physically performing this conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written
offer to provide the Corresponding Source. This alternative is allowed only
occasionally and noncommercially, and only if you received the object code
with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis
or for a charge), and offer equivalent access to the Corresponding Source
in the same way through the same place at no further charge. You need not
require recipients to copy the Corresponding Source along with the object
code. If the place to copy the object code is a network server, the Corresponding
Source may be on a different server (operated by you or a third party) that
supports equivalent copying facilities, provided you maintain clear directions
next to the object code saying where to find the Corresponding Source. Regardless
of what server hosts the Corresponding Source, you remain obligated to ensure
that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform
other peers where the object code and Corresponding Source of the work are
being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from
the Corresponding Source as a System Library, need not be included in conveying
the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible
personal property which is normally used for personal, family, or household
purposes, or (2) anything designed or sold for incorporation into a dwelling.
In determining whether a product is a consumer product, doubtful cases shall
be resolved in favor of coverage. For a particular product received by a particular
user, "normally used" refers to a typical or common use of that class of product,
regardless of the status of the particular user or of the way in which the
particular user actually uses, or expects or is expected to use, the product.
A product is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent the
only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures,
authorization keys, or other information required to install and execute modified
versions of a covered work in that User Product from a modified version of
its Corresponding Source. The information must suffice to ensure that the
continued functioning of the modified object code is in no case prevented
or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically
for use in, a User Product, and the conveying occurs as part of a transaction
in which the right of possession and use of the User Product is transferred
to the recipient in perpetuity or for a fixed term (regardless of how the
transaction is characterized), the Corresponding Source conveyed under this
section must be accompanied by the Installation Information. But this requirement
does not apply if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has been installed
in ROM).
The requirement to provide Installation Information does not include a requirement
to continue to provide support service, warranty, or updates for a work that
has been modified or installed by the recipient, or for the User Product in
which it has been modified or installed. Access to a network may be denied
when the modification itself materially and adversely affects the operation
of the network or violates the rules and protocols for communication across
the network.
Corresponding Source conveyed, and Installation Information provided, in accord
with this section must be in a format that is publicly documented (and with
an implementation available to the public in source code form), and must require
no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License
by making exceptions from one or more of its conditions. Additional permissions
that are applicable to the entire Program shall be treated as though they
were included in this License, to the extent that they are valid under applicable
law. If additional permissions apply only to part of the Program, that part
may be used separately under those permissions, but the entire Program remains
governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any
additional permissions from that copy, or from any part of it. (Additional
permissions may be written to require their own removal in certain cases when
you modify the work.) You may place additional permissions on material, added
by you to a covered work, for which you have or can give appropriate copyright
permission.
Notwithstanding any other provision of this License, for material you add
to a covered work, you may (if authorized by the copyright holders of that
material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of
sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author
attributions in that material or in the Appropriate Legal Notices displayed
by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring
that modified versions of such material be marked in reasonable ways as different
from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors
of the material; or
e) Declining to grant rights under trademark law for use of some trade names,
trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by
anyone who conveys the material (or modified versions of it) with contractual
assumptions of liability to the recipient, for any liability that these contractual
assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions"
within the meaning of section 10. If the Program as you received it, or any
part of it, contains a notice stating that it is governed by this License
along with a term that is a further restriction, you may remove that term.
If a license document contains a further restriction but permits relicensing
or conveying under this License, you may add to a covered work material governed
by the terms of that license document, provided that the further restriction
does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place,
in the relevant source files, a statement of the additional terms that apply
to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form
of a separately written license, or stated as exceptions; the above requirements
apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided
under this License. Any attempt otherwise to propagate or modify it is void,
and will automatically terminate your rights under this License (including
any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from
a particular copyright holder is reinstated (a) provisionally, unless and
until the copyright holder explicitly and finally terminates your license,
and (b) permanently, if the copyright holder fails to notify you of the violation
by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently
if the copyright holder notifies you of the violation by some reasonable means,
this is the first time you have received notice of violation of this License
(for any work) from that copyright holder, and you cure the violation prior
to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses
of parties who have received copies or rights from you under this License.
If your rights have been terminated and not permanently reinstated, you do
not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy
of the Program. Ancillary propagation of a covered work occurring solely as
a consequence of using peer-to-peer transmission to receive a copy likewise
does not require acceptance. However, nothing other than this License grants
you permission to propagate or modify any covered work. These actions infringe
copyright if you do not accept this License. Therefore, by modifying or propagating
a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives
a license from the original licensors, to run, modify and propagate that work,
subject to this License. You are not responsible for enforcing compliance
by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization,
or substantially all assets of one, or subdividing an organization, or merging
organizations. If propagation of a covered work results from an entity transaction,
each party to that transaction who receives a copy of the work also receives
whatever licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the Corresponding
Source of the work from the predecessor in interest, if the predecessor has
it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights
granted or affirmed under this License. For example, you may not impose a
license fee, royalty, or other charge for exercise of rights granted under
this License, and you may not initiate litigation (including a cross-claim
or counterclaim in a lawsuit) alleging that any patent claim is infringed
by making, using, selling, offering for sale, or importing the Program or
any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License
of the Program or a work on which the Program is based. The work thus licensed
is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled
by the contributor, whether already acquired or hereafter acquired, that would
be infringed by some manner, permitted by this License, of making, using,
or selling its contributor version, but do not include claims that would be
infringed only as a consequence of further modification of the contributor
version. For purposes of this definition, "control" includes the right to
grant patent sublicenses in a manner consistent with the requirements of this
License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent
license under the contributor's essential patent claims, to make, use, sell,
offer for sale, import and otherwise run, modify and propagate the contents
of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement
or commitment, however denominated, not to enforce a patent (such as an express
permission to practice a patent or covenant not to sue for patent infringement).
To "grant" such a patent license to a party means to make such an agreement
or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the
Corresponding Source of the work is not available for anyone to copy, free
of charge and under the terms of this License, through a publicly available
network server or other readily accessible means, then you must either (1)
cause the Corresponding Source to be so available, or (2) arrange to deprive
yourself of the benefit of the patent license for this particular work, or
(3) arrange, in a manner consistent with the requirements of this License,
to extend the patent license to downstream recipients. "Knowingly relying"
means you have actual knowledge that, but for the patent license, your conveying
the covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that country
that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement,
you convey, or propagate by procuring conveyance of, a covered work, and grant
a patent license to some of the parties receiving the covered work authorizing
them to use, propagate, modify or convey a specific copy of the covered work,
then the patent license you grant is automatically extended to all recipients
of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope
of its coverage, prohibits the exercise of, or is conditioned on the non-exercise
of one or more of the rights that are specifically granted under this License.
You may not convey a covered work if you are a party to an arrangement with
a third party that is in the business of distributing software, under which
you make payment to the third party based on the extent of your activity of
conveying the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by you
(or copies made from those copies), or (b) primarily for and in connection
with specific products or compilations that contain the covered work, unless
you entered into that arrangement, or that patent license was granted, prior
to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied
license or other defenses to infringement that may otherwise be available
to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise)
that contradict the conditions of this License, they do not excuse you from
the conditions of this License. If you cannot convey a covered work so as
to satisfy simultaneously your obligations under this License and any other
pertinent obligations, then as a consequence you may not convey it at all.
For example, if you agree to terms that obligate you to collect a royalty
for further conveying from those to whom you convey the Program, the only
way you could satisfy both those terms and this License would be to refrain
entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to
link or combine any covered work with a work licensed under version 3 of the
GNU Affero General Public License into a single combined work, and to convey
the resulting work. The terms of this License will continue to apply to the
part which is the covered work, but the special requirements of the GNU Affero
General Public License, section 13, concerning interaction through a network
will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the
GNU General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
that a certain numbered version of the GNU General Public License "or any
later version" applies to it, you have the option of following the terms and
conditions either of that numbered version or of any later version published
by the Free Software Foundation. If the Program does not specify a version
number of the GNU General Public License, you may choose any version ever
published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of
the GNU General Public License can be used, that proxy's public statement
of acceptance of a version permanently authorizes you to choose that version
for the Program.
Later license versions may give you additional or different permissions. However,
no additional obligations are imposed on any author or copyright holder as
a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM
PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM
AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO
USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot
be given local legal effect according to their terms, reviewing courts shall
apply local law that most closely approximates an absolute waiver of all civil
liability in connection with the Program, unless a warranty or assumption
of liability accompanies a copy of the Program in return for a fee. END OF
TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively state the exclusion
of warranty; and each file should have at least the "copyright" line and a
pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like
this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain
conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands might
be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. For
more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General Public
License instead of this License. But first, please read <https://www.gnu.org/
licenses /why-not-lgpl.html>.

View File

@@ -1,2 +0,0 @@
This software is provided as GPLv2 (read LICENSE.GPL.txt), or, alternatively,
contact KDAB at <info@kdab.com> if you need different licensing.

19
README-QtQuick.md Normal file
View File

@@ -0,0 +1,19 @@
# KDDockWidgets and QtQuick
## Supported Qt versions and toolchains
KDDockWidgets for QtQuick requires a C++17 capable compiler and Qt >= 6.2.1.
Qt 5.15.2 will probably also work, but it's not built and tested by KDAB CI, we
advise users to move to Qt6 as soon as possible.
## Troubleshooting
- 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.

40
README-WASM.md Normal file
View File

@@ -0,0 +1,40 @@
# KDDockWidgets with WebAssembly
KDDockWidgets works with WebAssembly with the following known limitations:
- Classic drop indicators are not supported, only the segmented ones. This is because
WASM doesn't support windows with translucency.
- Might be slow on Linux, depending on your browser, while dragging or resizing windows.
Please file a bug with Qt, as it's out of scope for KDDW to fix.
## Demo
A demo is available at <https://demos.kdab.com/wasm/kddockwidgets/dockwidgets.html>.
## Build tips for KDDW
- Visit <https://doc.qt.io/qt-5/wasm.html> if you haven't yet
- Open a terminal suitable for WASM development (with the correct Qt and toolchain in PATH, etc)
- KDDockWidgets can be built with:
```bash
cmake \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/emsdk-1.39.8/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
-DCMAKE_FIND_ROOT_PATH=~/Qt/5.15.1/wasm_32/ -DKDDockWidgets_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release`
(Adapt the paths to your own situation)
```
## Builds tips for your own app ==
- Link to KDDW (libkddockwidgets.a, or similar)
- As the build is static, don't forget to initialize KDDW's resources:
```cpp
#ifdef QT_STATIC
Q_INIT_RESOURCE(kddockwidgets_resources);
#endif
```

32
README-Wayland.md Normal file
View File

@@ -0,0 +1,32 @@
# KDDockWidgets and Wayland
Wayland support is done and has been tested on KDE (Kwin) and weston.
## Limitations
Wayland works very differently than traditional desktops and imposes us some,
limitations. Here's a list of different behaviours which KDDockWidgets will have
when running on Wayland:
- A title bar can either be used for drag&dock or for moving the window around.
- For this reason, floating windows now have two title bars.
The native one, drawn by the server and the client one, drawn by KDDockWidgets.
The native one allows you to drag the window around but not drop/dock.
The client title bar allows you to perform a drag and drop/dock but not move the window around.
- You can detach a window by:
- Clicking the title-bar's float button
- Double-clicking the title bar of a docked widget
- Double-clicking a tab
- If no title bar is shown, double-clicking the empty space of the tab bar will detach
the entire group of tabbed dock widgets
- Layout save/restore won't restore the position of floating windows, as wayland
doesn't allow us to set geometry.
- Kwin specific:
- The pixmap that's shown during a drag can't be bigger than 250x250. Might be a bug.
All in all it's pretty decent and usable. Any further improvements should be done at the server or
protocol level now.

77
README-bindings.md Normal file
View File

@@ -0,0 +1,77 @@
# KDDockWidgets and Python bindings
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:
```bash
% 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
```bash
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 mROUBLESHOOTINGake 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:
```bash
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:
```bash
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:
```bash
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)
```

3
README-troubleshooting Normal file
View File

@@ -0,0 +1,3 @@
# PySide: `ImportError: DLL load failed while importing KDDockWidgets`
If you're getting this error with Python see issue #114 and the proposed solution there.

226
README.md
View File

@@ -1,6 +1,18 @@
KDDockWidgets
==============
`KDDockWidgets` is a KDAB effort to provide an advanced docking system for Qt.
# KDDockWidgets
[![Build Status](https://travis-ci.com/KDAB/KDDockWidgets.svg?branch=master)](https://travis-ci.com/KDAB/KDDockWidgets)
> ⚠️⚠️: If you're using QtQuick/QML it's recommended to use 2.0 branch. 1.x will continue
> to receive bug fixes for a long time but only for QtWidgets frontend.
`KDDockWidgets` is a Qt dock widget library written by KDAB, suitable for replacing
`QDockWidget` and implementing advanced functionalities missing in Qt.
Although `KDDockWidgets` is ready to be used out of the box, it can also be seen
as a framework to allow building very tailored custom docking systems. It tries
to expose every internal widget and every knob for the app developer to tune.
## Motivation
Throughout the years KDAB contributed and funded bug fixes and features to `QDockWidget`.
Sadly, this was very painful. Each bug fix or feature took many days of implementation,
@@ -10,81 +22,195 @@ and an equal number of days just to fix dozens of regressions.
to move forward with new features. Furthermore, our customers were getting more
creative with their requests, so it was clear we needed a better docking framework.
You will find more information in these places:
Features
========
- Provide advanced docking that QDockWidgets doesn't support
- [our official home page](https://www.kdab.com/development-resources/qt-tools/kddockwidgets)
- [online detailed browsable API reference](https://docs.kdab.com/kddockwidgets)
- [our example programs](examples/)
We also have an [in browser demo](https://demos.kdab.com/wasm/kddockwidgets/dockwidgets.html). Note
however that this demo isn't fully featured, as it's running on Qt for WebAssembly.
## Features
- Provide advanced docking that QDockWidget doesn't support
- Native window resize on Windows (allowing for Aero-snap even with custom title bar decorations)
- Arrow drop indicators for great drop precision
- Allow for totally different, user provided, drop indicator types
- 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
- Supporting more than 1 main window
- Support for affinities, making some dock widgets only dockable on certain main windows
- Allow to hide TitleBar and just show tabs. Allows dragging via the tab bar.
- 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
- Cross-platform (macOS, Linux, Windows, WebAssembly, Wayland, X11/XCB, EGLFS are working)
See README-Wayland.md and README-WASM.md for platform specific information.
- Layouting engine honouring min/max size constraints and some size policies
- PySide2 bindings
- Clean codebase
- Not mixing GUI with state with logic with animations
- Unit-test everything, even the GUI and DnD operations (140 tests currently)
- Fuzzer for doing random testing
- Great test coverage, even the GUI and DnD operations are tested. 200 tests currently.
- Fuzzer for doing random testing and finding bugs
- Lazy separator resize
- Reordering tabs with mouse
- Partial layout save/restore, affecting only a chosen sub-set
- Double click on title bar to maximize
- Double click on separator to distribute equally
- Show close button on tabs
- Allow to make a dock widget non-closable and/or non-dockable
- Optional minimize and maximize button on the title bar
- FloatingWindows can be utility windows or full native
![Screen capture](/screencap.gif?raw=true "The docking system in action")
## Screen capture
Roadmap
========
- Different forms of docking indicators (through plugins)
- QtQuick support
![Screen capture](./screencap.gif?raw=true "The docking system in action")
## Building and requirements
Trying out the demo
====================
To build KDDockWidgets you'll need:
Open a terminal capable of building Qt5 applications (Should have cmake, ninja, compiler, Qt, etc in PATH).
- CMake
- Qt 5.15.x or Qt6 >= 6.2
- Ninja (Other generators might work but are untested)
- C++17 capable compiler
- Qt Widgets module
- Qt X11Extras module if on Linux/X11
- Qt Quick and QuickControls2 modules if using the QtQuick support
- Qt private development headers, for instance, for Qt5:
- SUSE: libqt5-qtbase-private-headers-devel
- Ubuntu, debian-based: qtbase5-private-dev
- Fedora, redhat-based: qt5-qtbase-private-devel
- others: consult your distro
Feel free to adapt the instructions to suit your cmake generator and operating system.
Build and install the KDDockWidgets framework:
Open a terminal capable of building Qt applications.
Make sure you have cmake, ninja, compiler, Qt, etc in PATH.
```
$ cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/path/where/to/install ../path/to/kddockwidgets
$ make
$ make install
Adapt the instructions to suit your cmake generator and operating system.
```bash
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/path/where/to/install ../path/to/kddockwidgets
cmake --build .
cmake --build . --target install
```
Now build and run the example:
```
$ cd path/to/kddockwidgets/examples/dockwidgets/
$ cmake -DCMAKE_PREFIX_PATH=/path/where/to/install
$ make
$ ./kddockwidgets_example
The installation directory defaults to `c:\KDAB\KDDockWidgets-<version>` on Windows
and `/usr/local/KDAB/KDDockWidgets-<version>` on non-Windows.
Change the installation location by passing the option `-DCMAKE_INSTALL_PREFIX=/install/path` to CMake.
## Trying out the examples
A full demo that showcases most of the features lives in [examples/dockwidgets](examples/dockwidgets).
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.
To build and run the example:
```bash
cd path/to/kddockwidgets/examples/dockwidgets/
cmake -G Ninja -DCMAKE_PREFIX_PATH=/path/where/kddw/is/installed
cmake --build .
./kddockwidgets_example
```
Supported Qt versions
======================
KDDockWidgets requires Qt >= 5.9
## Using
From your CMake Qt5 project, add
Licensing
=========
KDDockWidgets is (C) 2018-2020, Klarälvdalens Datakonsult AB, and is available
under the terms of the GPLv2 (see LICENSE.GPL.txt).
```cmake
find_package(KDDockWidgets CONFIG)
```
Contact KDAB at <info@kdab.com> if you need different licensing options.
or for Qt6
Get Involved
============
KDAB will happily accept external contributions; however, **all**
contributions will require a signed Contributor License Agreement
(see docs/KDDockWidgets-CopyrightAssignmentForm.docx).
```cmake
find_package(KDDockWidgets-qt6 CONFIG)
```
and link to the imported target `KDAB::kddockwidgets`.
That's all you need to do (the imported target also brings in the include directories)
You may also need to modify the `CMAKE_PREFIX_PATH` environment variable depending
on where you installed KDDockWidgets.
## Python Bindings
Please refer to [README-bindings.md](README-bindings.md).
## Versioning
There's currently two lines of development: `v1` which is very mature and stable and `v2` which is an
ongoing effort to make KDDW support multiple "frontends" (QtWidgets, QtQuick and even non-Qt technologies,
like flutter).
1.x will be supported for many years to come, at least for bug fixes and small features.
Use `v1.5.0` tag for the latest stable. `v1.6.0` will be released soon, so branch `1.6` is also safe.
Use `2.0` if you need non-QtWidgets support, for example `QtQuick/QML`. While `1.6` has support for `QtQuick/QML`
it won't be receiving bug fixes. `2.0` is under active development, you might encounter minor source/ABI
incompatibilities. Despite that, it is pretty stable, and all 200 unit-tests pass.
We'll try to remain source-compatible across versions (except for the v1 -> v2 jump).
API will get a deprecation notice before being removed in the next version. Note that this
compatibility effort is only for the public API. Private API (headers ending
in _p.h) might change so you shouldn't depend on them. Private API is only
exposed so more advanced users can override, for example `paintEvent()`, and
not so they can change internal business logic.
We don't promise or test binary compatibility. It's advised that you recompile
your application whenever updating KDDW.
## Styling
Almost all private widgets used by KDDW can be derived by the user to give them
a custom look. That's done by providing your own FrameworkWidgetFactory. Run
"kddockwidgets_example -p" to see that in action.
Qt StyleSheets are not, and will not, be supported. See the comments in
`examples/dockwidgets/MyTitleBar_CSS.h` for why. You can however use some minimal
CSS, as shown in that example, just don't report bugs about it.
Warning: When using private headers, be sure to rebuild your application whenever you
update to a new KDDW version. Binary compatibility is only kept when using public
headers.
## Licensing
KDDockWidgets is (C) 2019-2022, Klarälvdalens Datakonsult AB, and is licensed according to
the terms of the [GPL 2.0](LICENSES/GPL-2.0-only.txt) or [GPL 3.0](LICENSES/GPL-3.0-only.txt).
Contact KDAB at <info@kdab.com> to inquire about commercial licensing.
## 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
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.
Please submit your contributions or issue reports from our GitHub space at
https://github.com/KDAB/KDDockWidgets
Thanks to our [contributors](CONTRIBUTORS.txt).
## About KDAB
About KDAB
==========
KDDockWidgets is supported and maintained by Klarälvdalens Datakonsult AB (KDAB).
The KDAB Group is the global No.1 software consultancy for Qt, C++ and
@@ -96,4 +222,10 @@ We continue to help develop parts of Qt and are one of the major contributors
to the Qt Project. We can give advanced or standard trainings anywhere
around the globe on Qt as well as C++, OpenGL, 3D and more.
Please visit https://www.kdab.com to meet the people who write code like this.
Please visit <https://www.kdab.com> to meet the people who write code like this.
Stay up-to-date with KDAB product announcements:
- [KDAB Newsletter](https://news.kdab.com)
- [KDAB Blogs](https://www.kdab.com/category/blogs)
- [KDAB on Twitter](https://twitter.com/KDABQt)

96
appveyor.yml Normal file
View File

@@ -0,0 +1,96 @@
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: 1.0.{build}-{branch}
# branches to build
branches:
except:
- gh-pages
- wip/v2
- master
# Do not build on tags (GitHub and BitBucket)
skip_tags: false
#---------------------------------#
# environment configuration #
#---------------------------------#
# Build worker image
image:
- Ubuntu2004
- 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
environment:
matrix:
- useqt6: False
- useqt6: True
install:
- sh: if [ "`uname -s`" = "Darwin" ]; then brew install ninja; else sudo apt-get -y update; sudo apt-get -y install mesa-common-dev libglu1-mesa-dev libxkbcommon-dev libxkbcommon-x11-dev; fi
before_build:
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
- cmd: set PATH=C:\Qt\6.2\msvc2019_64\bin;C:\Qt\5.15\msvc2019_64\bin;%PATH%
- sh: if [ "`uname -s`" = "Darwin" ]; then export PATH=$HOME/Qt/6.2/macos/bin:$HOME/Qt/5.15/clang_64/bin:$PATH; else export PATH=$HOME/Qt/6.2/gcc_64/bin:$HOME/Qt/5.15/gcc_64/bin:$PATH; fi
build_script:
- mkdir build
- cd build
- cmd: cmake -G Ninja -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DKDDockWidgets_QT6=%useqt6% -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
- sh: cmake -G Ninja -DCMAKE_BUILD_TYPE=$CONFIGURATION -DKDDockWidgets_QT6=$useqt6 -DKDDockWidgets_TESTS=True -DKDDockWidgets_EXAMPLES=True -DKDDockWidgets_DEVELOPER_MODE=True ..
- cmake --build .
- cmd: cmake --build . --target install
- sh: sudo cmake --build . --target install
- cmd: set PATH=.\bin;%PATH%
- 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

@@ -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.

View File

@@ -40,6 +40,8 @@
# - thread
# - leak
# - undefined
# - fuzzer-no-link
# - fuzzer
#
# The sanitizers "address", "memory" and "thread" are mutually exclusive. You
# cannot enable two of them in the same build.
@@ -69,30 +71,9 @@
# Since 1.3.0.
#=============================================================================
# Copyright 2014 Mathieu Tarral <mathieu.tarral@gmail.com>
# SPDX-FileCopyrightText: 2014 Mathieu Tarral <mathieu.tarral@gmail.com>
#
# 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.
# SPDX-License-Identifier: BSD-3-Clause
# MACRO check_compiler_version
#-----------------------------
@@ -122,27 +103,47 @@ endmacro ()
# MACRO check_compiler_support
#------------------------------
macro (enable_sanitizer_flags sanitize_option)
if (${sanitize_option} MATCHES "address")
check_compiler_version("4.8" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
set(XSAN_LINKER_FLAGS "asan")
elseif (${sanitize_option} MATCHES "thread")
check_compiler_version("4.8" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=thread")
set(XSAN_LINKER_FLAGS "tsan")
elseif (${sanitize_option} MATCHES "memory")
check_compiler_version("99.99" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=memory")
elseif (${sanitize_option} MATCHES "leak")
check_compiler_version("4.9" "3.4")
set(XSAN_COMPILE_FLAGS "-fsanitize=leak")
set(XSAN_LINKER_FLAGS "lsan")
elseif (${sanitize_option} MATCHES "undefined")
check_compiler_version("4.9" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls")
else ()
message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.")
endif ()
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")
check_compiler_version("4.8" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
set(XSAN_LINKER_FLAGS "asan")
elseif (${sanitize_option} MATCHES "thread")
check_compiler_version("4.8" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=thread")
set(XSAN_LINKER_FLAGS "tsan")
elseif (${sanitize_option} MATCHES "memory")
check_compiler_version("99.99" "3.1")
set(XSAN_COMPILE_FLAGS "-fsanitize=memory")
elseif (${sanitize_option} MATCHES "leak")
check_compiler_version("4.9" "3.4")
set(XSAN_COMPILE_FLAGS "-fsanitize=leak")
set(XSAN_LINKER_FLAGS "lsan")
elseif (${sanitize_option} MATCHES "undefined")
check_compiler_version("4.9" "3.1")
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")
check_compiler_version("99.99" "6.0")
set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer")
else ()
message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.")
endif ()
endif()
endmacro ()
if (ECM_ENABLE_SANITIZERS)
@@ -161,11 +162,16 @@ if (ECM_ENABLE_SANITIZERS)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
link_libraries(${XSAN_LINKER_FLAGS})
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
endif ()
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()
message(STATUS "Tried to enable sanitizers (-DECM_ENABLE_SANITIZERS=${ECM_ENABLE_SANITIZERS}), \
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

@@ -0,0 +1,256 @@
# SPDX-FileCopyrightText: 2014 David Faure <faure@kde.org>
#
# 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_DIRS <dir> [<dir> [...]]] # since 5.92
[INCLUDE_INSTALL_DIR <dir>] # deprecated since 5.92
[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_DIRS`` are the paths (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.
``INCLUDE_INSTALL_DIR`` is the old variant of ``INCLUDE_INSTALL_DIRS``, taking only one
directory.
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
# Ask qmake if we're using the same prefix as Qt
set(_should_query_qt OFF)
if(NOT DEFINED KDE_INSTALL_USE_QT_SYS_PATHS)
include(ECMQueryQt)
ecm_query_qt(qt_install_prefix_dir QT_INSTALL_PREFIX TRY)
if(qt_install_prefix_dir STREQUAL "${CMAKE_INSTALL_PREFIX}")
set(_should_query_qt ON)
endif()
endif()
if(KDE_INSTALL_USE_QT_SYS_PATHS OR _should_query_qt)
include(ECMQueryQt)
ecm_query_qt(qt_install_prefix_dir QT_INSTALL_PREFIX)
ecm_query_qt(qt_host_data_dir QT_HOST_DATA)
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()
set(ECM_MKSPECS_INSTALL_DIR mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.")
endif()
function(ECM_GENERATE_PRI_FILE)
set(options )
set(oneValueArgs BASE_NAME LIB_NAME DEPS FILENAME_VAR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR VERSION)
set(multiValueArgs INCLUDE_INSTALL_DIRS)
cmake_parse_arguments(EGPF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(EGPF_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ECM_GENERATE_PRI_FILE(): \"${EGPF_UNPARSED_ARGUMENTS}\"")
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)
message(FATAL_ERROR "Required argument BASE_NAME missing in ECM_GENERATE_PRI_FILE() call")
endif()
if(NOT EGPF_LIB_NAME)
message(FATAL_ERROR "Required argument LIB_NAME missing in ECM_GENERATE_PRI_FILE() call")
endif()
if(NOT EGPF_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()
if(EGPF_INCLUDE_INSTALL_DIR)
if(EGPF_INCLUDE_INSTALL_DIRS)
message(FATAL_ERROR "Only one argument of INCLUDE_INSTALL_DIR & INCLUDE_INSTALL_DIRS can be used in ECM_GENERATE_PRI_FILE() call")
endif()
set(EGPF_INCLUDE_INSTALL_DIRS ${EGPF_INCLUDE_INSTALL_DIR})
endif()
if(NOT EGPF_INCLUDE_INSTALL_DIRS)
if(INCLUDE_INSTALL_DIR)
set(EGPF_INCLUDE_INSTALL_DIRS "${INCLUDE_INSTALL_DIR}/${EGPF_BASE_NAME}")
elseif(CMAKE_INSTALL_INCLUDEDIR)
set(EGPF_INCLUDE_INSTALL_DIRS "${CMAKE_INSTALL_INCLUDEDIR}/${EGPF_BASE_NAME}")
else()
set(EGPF_INCLUDE_INSTALL_DIRS "include/${EGPF_BASE_NAME}")
endif()
endif()
if(NOT EGPF_LIB_INSTALL_DIR)
if(LIB_INSTALL_DIR)
set(EGPF_LIB_INSTALL_DIR "${LIB_INSTALL_DIR}")
elseif(CMAKE_INSTALL_LIBDIR)
set(EGPF_LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
else()
set(EGPF_LIB_INSTALL_DIR "lib")
endif()
endif()
if(EGPF_VERSION)
set(PRI_VERSION "${EGPF_VERSION}")
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
# This allows to make the generated pri files relocatable (no absolute paths)
if (IS_ABSOLUTE ${ECM_MKSPECS_INSTALL_DIR})
set(BASEPATH ${CMAKE_INSTALL_PREFIX})
else()
string(REGEX REPLACE "[^/]+" ".." PRI_ROOT_RELATIVE_TO_MKSPECS ${ECM_MKSPECS_INSTALL_DIR})
set(BASEPATH "$$PWD/${PRI_ROOT_RELATIVE_TO_MKSPECS}")
endif()
set(PRI_TARGET_BASENAME ${EGPF_BASE_NAME})
set(PRI_TARGET_LIBNAME ${EGPF_LIB_NAME})
set(PRI_TARGET_QTDEPS ${EGPF_DEPS})
set(PRI_TARGET_INCLUDES)
foreach(_dir ${EGPF_INCLUDE_INSTALL_DIRS})
# separate list entries with space
if(IS_ABSOLUTE "${_dir}")
string(APPEND PRI_TARGET_INCLUDES " ${_dir}")
else()
string(APPEND PRI_TARGET_INCLUDES " ${BASEPATH}/${_dir}")
endif()
endforeach()
if(IS_ABSOLUTE "${EGPF_LIB_INSTALL_DIR}")
set(PRI_TARGET_LIBS "${EGPF_LIB_INSTALL_DIR}")
else()
set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}")
endif()
set(PRI_TARGET_DEFINES "")
set(PRI_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/qt_${PRI_TARGET_BASENAME}.pri)
if (EGPF_FILENAME_VAR)
set(${EGPF_FILENAME_VAR} ${PRI_FILENAME} PARENT_SCOPE)
endif()
set(PRI_TARGET_MODULE_CONFIG "")
# backward compat: it was not obvious LIB_NAME needs to be a target name,
# and some projects where the target name was not the actual library output name
# passed the output name for LIB_NAME, so .name & .module prperties are correctly set.
# TODO: improve API dox, allow control over module name if target name != output name
if(TARGET ${EGPF_LIB_NAME})
get_target_property(target_type ${EGPF_LIB_NAME} TYPE)
if (target_type STREQUAL "STATIC_LIBRARY")
set(PRI_TARGET_MODULE_CONFIG "staticlib")
endif()
endif()
file(GENERATE
OUTPUT ${PRI_FILENAME}
CONTENT
"QT.${PRI_TARGET_BASENAME}.VERSION = ${PRI_VERSION}
QT.${PRI_TARGET_BASENAME}.MAJOR_VERSION = ${PRI_VERSION_MAJOR}
QT.${PRI_TARGET_BASENAME}.MINOR_VERSION = ${PRI_VERSION_MINOR}
QT.${PRI_TARGET_BASENAME}.PATCH_VERSION = ${PRI_VERSION_PATCH}
QT.${PRI_TARGET_BASENAME}.name = ${PRI_TARGET_LIBNAME}
QT.${PRI_TARGET_BASENAME}.module = ${PRI_TARGET_LIBNAME}
QT.${PRI_TARGET_BASENAME}.defines = ${PRI_TARGET_DEFINES}
QT.${PRI_TARGET_BASENAME}.includes = ${PRI_TARGET_INCLUDES}
QT.${PRI_TARGET_BASENAME}.private_includes =
QT.${PRI_TARGET_BASENAME}.libs = ${PRI_TARGET_LIBS}
QT.${PRI_TARGET_BASENAME}.depends = ${PRI_TARGET_QTDEPS}
QT.${PRI_TARGET_BASENAME}.module_config = ${PRI_TARGET_MODULE_CONFIG}
"
)
endfunction()

View File

@@ -0,0 +1,100 @@
# SPDX-FileCopyrightText: 2014 Rohan Garg <rohan16garg@gmail.com>
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2014-2016 Aleix Pol <aleixpol@kde.org>
# SPDX-FileCopyrightText: 2017 Friedrich W. H. Kossebau <kossebau@kde.org>
# SPDX-FileCopyrightText: 2022 Ahmad Samir <a.samir78@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
ECMQueryQt
---------------
This module can be used to query the installation paths used by Qt.
For Qt5 this uses ``qmake``, and for Qt6 this used ``qtpaths`` (the latter has built-in
support to query the paths of a target platform when cross-compiling).
This module defines the following function:
::
ecm_query_qt(<result_variable> <qt_variable> [TRY])
Passing ``TRY`` will result in the method not making the build fail if the executable
used for querying has not been found, but instead simply print a warning message and
return an empty string.
Example usage:
.. code-block:: cmake
include(ECMQueryQt)
ecm_query_qt(bin_dir QT_INSTALL_BINS)
If the call succeeds ``${bin_dir}`` will be set to ``<prefix>/path/to/bin/dir`` (e.g.
``/usr/lib64/qt/bin/``).
Since: 5.93
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake)
include(CheckLanguage)
check_language(CXX)
if (CMAKE_CXX_COMPILER)
# Enable the CXX language to let CMake look for config files in library dirs.
# See: https://gitlab.kitware.com/cmake/cmake/-/issues/23266
enable_language(CXX)
endif()
if (QT_MAJOR_VERSION STREQUAL "5")
# QUIET to accommodate the TRY option
find_package(Qt${QT_MAJOR_VERSION}Core QUIET)
if(TARGET Qt5::qmake)
get_target_property(_qmake_executable_default Qt5::qmake LOCATION)
set(QUERY_EXECUTABLE ${_qmake_executable_default}
CACHE FILEPATH "Location of the Qt5 qmake executable")
set(_exec_name_text "Qt5 qmake")
set(_cli_option "-query")
endif()
elseif(QT_MAJOR_VERSION STREQUAL "6")
# QUIET to accommodate the TRY option
find_package(Qt6 COMPONENTS CoreTools QUIET CONFIG)
if (TARGET Qt6::qtpaths)
get_target_property(_qtpaths_executable Qt6::qtpaths LOCATION)
set(QUERY_EXECUTABLE ${_qtpaths_executable}
CACHE FILEPATH "Location of the Qt6 qtpaths executable")
set(_exec_name_text "Qt6 qtpaths")
set(_cli_option "--query")
endif()
endif()
function(ecm_query_qt result_variable qt_variable)
set(options TRY)
set(oneValueArgs)
set(multiValueArgs)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT QUERY_EXECUTABLE)
if(ARGS_TRY)
set(${result_variable} "" PARENT_SCOPE)
message(STATUS "No ${_exec_name_text} executable found. Can't check ${qt_variable}")
return()
else()
message(FATAL_ERROR "No ${_exec_name_text} executable found. Can't check ${qt_variable} as required")
endif()
endif()
execute_process(
COMMAND ${QUERY_EXECUTABLE} ${_cli_option} "${qt_variable}"
RESULT_VARIABLE return_code
OUTPUT_VARIABLE output
)
if(return_code EQUAL 0)
string(STRIP "${output}" output)
file(TO_CMAKE_PATH "${output}" output_path)
set(${result_variable} "${output_path}" PARENT_SCOPE)
else()
message(WARNING "Failed call: ${_command} \"${qt_variable}\"")
message(FATAL_ERROR "${_exec_name_text} call failed: ${return_code}")
endif()
endfunction()

View File

@@ -0,0 +1,213 @@
# 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}")
# drop leading 0 from values to avoid bogus octal values in c/C++ e.g. with 08 or 09
string(REGEX REPLACE "0*([0-9]+)" "\\1" _major "${PROJECT_VERSION_MAJOR}")
string(REGEX REPLACE "0*([0-9]+)" "\\1" _minor "${PROJECT_VERSION_MINOR}")
string(REGEX REPLACE "0*([0-9]+)" "\\1" _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,36 @@
# SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
QtVersionOption
---------------
Adds a build option to select the major Qt version if necessary,
that is, if the major Qt version has not yet been determined otherwise
(e.g. by a corresponding ``find_package()`` call).
This module is typically included by other modules requiring knowledge
about the major Qt version.
``QT_MAJOR_VERSION`` is defined to either be "5" or "6".
Since 5.82.0.
#]=======================================================================]
if (DEFINED QT_MAJOR_VERSION)
return()
endif()
if (TARGET Qt5::Core)
set(QT_MAJOR_VERSION 5)
elseif (TARGET Qt6::Core)
set(QT_MAJOR_VERSION 6)
else()
option(BUILD_WITH_QT6 "Build against Qt 6" OFF)
if (BUILD_WITH_QT6)
set(QT_MAJOR_VERSION 6)
else()
set(QT_MAJOR_VERSION 5)
endif()
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

@@ -0,0 +1,158 @@
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# 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

@@ -0,0 +1,136 @@
#
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# PYSIDE_BASEDIR - Top of the PySide6 installation
# PYSIDE_INCLUDE_DIR - Directories to include to use PySide6
# PYSIDE_LIBRARY - Files to link against to use PySide6
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide6
#
# You can install PySide6 from Qt repository with
# pip3 install --index-url=https://download.qt.io/official_releases/QtForPython --trusted-host download.qt.io pyside6
set(PYSIDE6_FOUND FALSE)
# extract python library basename
list(GET Python3_LIBRARIES 0 PYTHON_LIBRARY_FILENAME)
get_filename_component(PYTHON_LIBRARY_FILENAME ${PYTHON_LIBRARY_FILENAME} NAME)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os, sys
try:
import PySide6.QtCore as QtCore
print(os.path.dirname(QtCore.__file__))
except Exception as error:
print(error, file=sys.stderr)
exit()
"
OUTPUT_VARIABLE PYSIDE6_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(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)
set(PYSIDE_BASEDIR ${PYSIDE6_BASEDIR} CACHE PATH "Top level install of PySide6" FORCE)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import PySide6.QtCore as QtCore
print(os.path.basename(QtCore.__file__).split('.', 1)[1])
"
OUTPUT_VARIABLE PYSIDE6_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import PySide6.QtCore as QtCore
print(';'.join(map(str, QtCore.__version_info__)))
"
OUTPUT_VARIABLE PYSIDE6_SO_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(GET PYSIDE6_SO_VERSION 0 PYSIDE6_SO_MACRO_VERSION)
list(GET PYSIDE6_SO_VERSION 1 PYSIDE6_SO_MICRO_VERSION)
list(GET PYSIDE6_SO_VERSION 2 PYSIDE6_SO_MINOR_VERSION)
string(REPLACE ";" "." PYSIDE6_SO_VERSION "${PYSIDE6_SO_VERSION}")
if(NOT APPLE)
set(PYSIDE6_SUFFIX "${PYSIDE6_SUFFIX}.${PYSIDE6_SO_MACRO_VERSION}.${PYSIDE6_SO_MICRO_VERSION}")
else()
string(REPLACE ".so" "" PYSIDE6_SUFFIX ${PYSIDE6_SUFFIX})
set(PYSIDE6_SUFFIX "${PYSIDE6_SUFFIX}.${PYSIDE6_SO_MACRO_VERSION}.${PYSIDE6_SO_MICRO_VERSION}.dylib")
endif()
set(PYSIDE6_FOUND TRUE)
message(STATUS "PySide6 base dir: ${PYSIDE6_BASEDIR}")
message(STATUS "PySide6 suffix: ${PYSIDE6_SUFFIX}")
endif()
if(PYSIDE6_FOUND)
#PySide
#===============================================================================
find_path(PYSIDE_INCLUDE_DIR
pyside.h
PATHS ${PYSIDE6_BASEDIR}/include ${PYSIDE_CUSTOM_PREFIX}/include/PySide6
NO_DEFAULT_PATH)
# Platform specific library names
if(MSVC)
set(PYSIDE_LIBRARY_BASENAMES "pyside6.abi3.lib")
elseif(CYGWIN)
set(PYSIDE_LIBRARY_BASENAMES "")
elseif(WIN32)
set(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}")
else()
set(PYSIDE_LIBRARY_BASENAMES "libpyside6.${PYSIDE6_SUFFIX}")
endif()
find_file(PYSIDE_LIBRARY
${PYSIDE_LIBRARY_BASENAMES}
PATHS ${PYSIDE6_BASEDIR} ${PYSIDE_CUSTOM_PREFIX}/lib
NO_DEFAULT_PATH)
find_path(PYSIDE_TYPESYSTEMS
typesystem_core.xml
PATHS ${PYSIDE6_BASEDIR}/typesystems ${PYSIDE_CUSTOM_PREFIX}/share/PySide6/typesystems
NO_DEFAULT_PATH)
endif()
if(PYSIDE6_FOUND)
message(STATUS "PySide include dir: ${PYSIDE_INCLUDE_DIR}")
message(STATUS "PySide library: ${PYSIDE_LIBRARY}")
message(STATUS "PySide typesystems: ${PYSIDE_TYPESYSTEMS}")
message(STATUS "PySide6 version: ${PYSIDE6_SO_VERSION}")
# Create PySide6 target
add_library(PySide6::pyside6 SHARED IMPORTED GLOBAL)
if(MSVC)
set_property(TARGET PySide6::pyside6 PROPERTY IMPORTED_IMPLIB ${PYSIDE_LIBRARY})
endif()
set_property(TARGET PySide6::pyside6 PROPERTY IMPORTED_LOCATION ${PYSIDE_LIBRARY})
set_property(TARGET PySide6::pyside6 APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES
${PYSIDE_INCLUDE_DIR}
${PYSIDE_INCLUDE_DIR}/QtCore/
${PYSIDE_INCLUDE_DIR}/QtGui/
${PYSIDE_INCLUDE_DIR}/QtWidgets/
${Python3_INCLUDE_DIRS}
)
endif()
find_package_handle_standard_args(PySide6
REQUIRED_VARS PYSIDE6_BASEDIR PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_TYPESYSTEMS
VERSION_VAR PYSIDE6_SO_VERSION
)

View File

@@ -0,0 +1,200 @@
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
# SHIBOKEN_LIBRARY - Files to link against to use SHIBOKEN
# SHIBOKEN_BINARY - Executable name
# SHIBOKEN_BUILD_TYPE - Tells if Shiboken was compiled in Release or Debug mode.
# You can install Shiboken from Qt repository with
# pip3 install --index-url=https://download.qt.io/official_releases/QtForPython \
# --trusted-host download.qt.io shiboken2-generator
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(SHIBOKEN2_PRIV QUIET shiboken2)
endif()
set(SHIBOKEN_FOUND FALSE)
if(SHIBOKEN2_PRIV_FOUND)
set(SHIBOKEN_FOUND TRUE)
message(STATUS "Using shiboken found in the system!")
pkg_get_variable(SHIBOKEN_BINARY
shiboken2
generator_location
)
pkg_get_variable(SHIBOKEN_BASEDIR
shiboken2
libdir
)
pkg_get_variable(SHIBOKEN_INCLUDE_DIR
shiboken2
includedir
)
set(SHIBOKEN_VERSION ${SHIBOKEN2_PRIV_VERSION})
set(SHIBOKEN_LIBRARY ${SHIBOKEN2_PRIV_LINK_LIBRARIES})
else()
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
try:
import shiboken2_generator
print(shiboken2_generator.__path__[0])
except:
exit()
"
OUTPUT_VARIABLE SHIBOKEN_GENERATOR_BASEDIR
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(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
try:
import shiboken2
print(shiboken2.__path__[0])
except:
exit()
"
OUTPUT_VARIABLE SHIBOKEN_BASEDIR
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(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import shiboken2
print(';'.join(filter(None, map(str, shiboken2.__version_info__))))
"
OUTPUT_VARIABLE SHIBOKEN_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(GET SHIBOKEN_VERSION 0 SHIBOKEN_MACRO_VERSION)
list(GET SHIBOKEN_VERSION 1 SHIBOKEN_MICRO_VERSION)
list(GET SHIBOKEN_VERSION 2 SHIBOKEN_MINOR_VERSION)
string(REPLACE ";" "." SHIBOKEN_VERSION "${SHIBOKEN_VERSION}")
message(STATUS "ShibokenGenerator base dir: ${SHIBOKEN_GENERATOR_BASEDIR}")
message(STATUS "Shiboken base dir: ${SHIBOKEN_BASEDIR}")
message(STATUS "Shiboken custom path: ${SHIBOKEN_CUSTOM_PREFIX}")
if(SHIBOKEN_BASEDIR)
find_path(SHIBOKEN_INCLUDE_DIR
shiboken.h
PATHS ${SHIBOKEN_CUSTOM_PREFIX} ${SHIBOKEN_GENERATOR_BASEDIR}/include
NO_DEFAULT_PATH
)
if(MSVC)
set(SHIBOKEN_LIBRARY_BASENAMES "shiboken2.abi3.lib")
elseif(CYGWIN)
set(SHIBOKEN_LIBRARY_BASENAMES "")
elseif(WIN32)
set(SHIBOKEN_LIBRARY_BASENAMES "libshiboken2.${PYSIDE2_SUFFIX}")
elseif(APPLE)
set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken2.abi3.dylib
libshiboken2.abi3.${SHIBOKEN_MACRO_VERSION}.dylib
libshiboken2.abi3.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}.dylib
libshiboken2.abi3.${SHIBOKEN_VERSION}.dylib
)
else()
set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken2.abi3.so
libshiboken2.abi3.so.${SHIBOKEN_MACRO_VERSION}
libshiboken2.abi3.so.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}
libshiboken2.abi3.so.${SHIBOKEN_VERSION}
)
endif()
if(NOT SHIBOKEN_INCLUDE_DIR)
return()
endif()
set(SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_CUSTOM_PREFIX})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_BASEDIR})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_GENERATOR_BASEDIR})
find_file(SHIBOKEN_LIBRARY
${SHIBOKEN_LIBRARY_BASENAMES}
PATHS ${SHIBOKEN_SEARCH_PATHS}
NO_DEFAULT_PATH)
find_program(SHIBOKEN_BINARY
shiboken2
PATHS ${SHIBOKEN_SEARCH_PATHS}
NO_DEFAULT_PATH
)
endif()
if(SHIBOKEN_INCLUDE_DIR AND SHIBOKEN_LIBRARY AND SHIBOKEN_BINARY)
set(SHIBOKEN_FOUND TRUE)
endif()
if(SHIBOKEN_FOUND)
endif()
if(MSVC)
# On Windows we must link to python3.dll that is a small library that links against python3x.dll
# that allow us to choose any python3x.dll at runtime
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
for lib in '${Python3_LIBRARIES}'.split(';'):
if '/' in lib:
prefix, py = lib.rsplit('/', 1)
if py.startswith('python3'):
print(prefix + '/python3.lib')
break
"
OUTPUT_VARIABLE PYTHON_LIMITED_LIBRARIES
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
# On Linux and MacOs our modules should not link with any python library
# that must be handled by the main process
set(PYTHON_LIMITED_LIBRARIES "")
endif()
endif()
if(SHIBOKEN_FOUND)
message(STATUS "Shiboken include dir: ${SHIBOKEN_INCLUDE_DIR}")
message(STATUS "Shiboken library: ${SHIBOKEN_LIBRARY}")
message(STATUS "Shiboken binary: ${SHIBOKEN_BINARY}")
message(STATUS "Shiboken version: ${SHIBOKEN_VERSION}")
# Create shiboke2 target
add_library(Shiboken2::libshiboken SHARED IMPORTED GLOBAL)
if(MSVC)
set_property(TARGET Shiboken2::libshiboken PROPERTY
IMPORTED_IMPLIB ${SHIBOKEN_LIBRARY})
endif()
set_property(TARGET Shiboken2::libshiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_LIBRARY})
set_property(TARGET Shiboken2::libshiboken APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SHIBOKEN_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}
)
set_property(TARGET Shiboken2::libshiboken APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${PYTHON_LIMITED_LIBRARIES}
)
# Generator target
add_executable(Shiboken2::shiboken IMPORTED GLOBAL)
set_property(TARGET Shiboken2::shiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_BINARY})
endif()
find_package_handle_standard_args(Shiboken2
REQUIRED_VARS SHIBOKEN_BASEDIR SHIBOKEN_INCLUDE_DIR SHIBOKEN_LIBRARY SHIBOKEN_BINARY
VERSION_VAR SHIBOKEN_VERSION
)

View File

@@ -0,0 +1,178 @@
#
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
# SHIBOKEN_LIBRARY - Files to link against to use SHIBOKEN
# SHIBOKEN_BINARY - Executable name
# SHIBOKEN_BUILD_TYPE - Tells if Shiboken was compiled in Release or Debug mode.
# You can install Shiboken from Qt repository with
# pip3 install --index-url=https://download.qt.io/official_releases/QtForPython \
# --trusted-host download.qt.io shiboken6-generator
set(SHIBOKEN_FOUND FALSE)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
try:
import shiboken6_generator
print(shiboken6_generator.__path__[0])
except:
exit()
"
OUTPUT_VARIABLE SHIBOKEN_GENERATOR_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
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(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
try:
import shiboken6
print(shiboken6.__path__[0])
except:
exit()
"
OUTPUT_VARIABLE SHIBOKEN_BASEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
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(
COMMAND ${Python3_EXECUTABLE} -c "if True:
import os
import shiboken6
print(';'.join(filter(None, map(str, shiboken6.__version_info__))))
"
OUTPUT_VARIABLE SHIBOKEN_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(GET SHIBOKEN_VERSION 0 SHIBOKEN_MACRO_VERSION)
list(GET SHIBOKEN_VERSION 1 SHIBOKEN_MICRO_VERSION)
list(GET SHIBOKEN_VERSION 2 SHIBOKEN_MINOR_VERSION)
string(REPLACE ";" "." SHIBOKEN_VERSION "${SHIBOKEN_VERSION}")
message(STATUS "ShibokenGenerator base dir: ${SHIBOKEN_GENERATOR_BASEDIR}")
message(STATUS "Shiboken base dir: ${SHIBOKEN_BASEDIR}")
message(STATUS "Shiboken custom path: ${SHIBOKEN_CUSTOM_PREFIX}")
if(SHIBOKEN_BASEDIR)
find_path(SHIBOKEN_INCLUDE_DIR
shiboken.h
PATHS ${SHIBOKEN_CUSTOM_PREFIX} ${SHIBOKEN_GENERATOR_BASEDIR}/include
NO_DEFAULT_PATH
)
if(MSVC)
set(SHIBOKEN_LIBRARY_BASENAMES "shiboken6.abi3.lib")
elseif(CYGWIN)
set(SHIBOKEN_LIBRARY_BASENAMES "")
elseif(WIN32)
set(SHIBOKEN_LIBRARY_BASENAMES "libshiboken6.${PYSIDE2_SUFFIX}")
elseif(APPLE)
set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken6.abi3.dylib
libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.dylib
libshiboken6.abi3.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}.dylib
libshiboken6.abi3.${SHIBOKEN_VERSION}.dylib
)
else()
set(SHIBOKEN_LIBRARY_BASENAMES
libshiboken6.abi3.so
libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION}
libshiboken6.abi3.so.${SHIBOKEN_MACRO_VERSION}.${SHIBOKEN_MICRO_VERSION}
libshiboken6.abi3.so.${SHIBOKEN_VERSION}
)
endif()
if(NOT SHIBOKEN_INCLUDE_DIR)
return()
endif()
set(SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_CUSTOM_PREFIX})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_BASEDIR})
list(APPEND SHIBOKEN_SEARCH_PATHS ${SHIBOKEN_GENERATOR_BASEDIR})
find_file(SHIBOKEN_LIBRARY
${SHIBOKEN_LIBRARY_BASENAMES}
PATHS ${SHIBOKEN_SEARCH_PATHS}
NO_DEFAULT_PATH)
find_program(SHIBOKEN_BINARY
shiboken6
PATHS ${SHIBOKEN_SEARCH_PATHS}
NO_DEFAULT_PATH
)
endif()
if(SHIBOKEN_INCLUDE_DIR AND SHIBOKEN_LIBRARY AND SHIBOKEN_BINARY)
set(SHIBOKEN_FOUND TRUE)
endif()
if(SHIBOKEN_FOUND)
endif()
if(MSVC)
# On Windows we must link to python3.dll that is a small library that links against python3x.dll
# that allow us to choose any python3x.dll at runtime
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "if True:
for lib in '${Python3_LIBRARIES}'.split(';'):
if '/' in lib:
prefix, py = lib.rsplit('/', 1)
if py.startswith('python3'):
print(prefix + '/python3.lib')
break
"
OUTPUT_VARIABLE PYTHON_LIMITED_LIBRARIES
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
# On Linux and MacOs our modules should not link with any python library
# that must be handled by the main process
set(PYTHON_LIMITED_LIBRARIES "")
endif()
if(SHIBOKEN_FOUND)
message(STATUS "Shiboken include dir: ${SHIBOKEN_INCLUDE_DIR}")
message(STATUS "Shiboken library: ${SHIBOKEN_LIBRARY}")
message(STATUS "Shiboken binary: ${SHIBOKEN_BINARY}")
message(STATUS "Shiboken version: ${SHIBOKEN_VERSION}")
# Create shiboken2 target
add_library(Shiboken6::libshiboken SHARED IMPORTED GLOBAL)
if(MSVC)
set_property(TARGET Shiboken6::libshiboken PROPERTY
IMPORTED_IMPLIB ${SHIBOKEN_LIBRARY})
endif()
set_property(TARGET Shiboken6::libshiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_LIBRARY})
set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SHIBOKEN_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}
)
set_property(TARGET Shiboken6::libshiboken APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${PYTHON_LIMITED_LIBRARIES}
)
# Generator target
add_executable(Shiboken6::shiboken IMPORTED GLOBAL)
set_property(TARGET Shiboken6::shiboken PROPERTY IMPORTED_LOCATION ${SHIBOKEN_BINARY})
endif()
find_package_handle_standard_args(
Shiboken6
REQUIRED_VARS SHIBOKEN_BASEDIR SHIBOKEN_INCLUDE_DIR SHIBOKEN_LIBRARY SHIBOKEN_BINARY
VERSION_VAR SHIBOKEN_VERSION
)

View File

@@ -0,0 +1,41 @@
#
# SPDX-FileCopyrightText: 2012-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Some default installation locations. These should be global, with any project
# specific locations added to the end. These paths are all relative to the
# install prefix.
#
# These paths attempt to adhere to the FHS, and are similar to those provided
# by autotools and used in many Linux distributions.
# Use GNU install directories
include(GNUInstallDirs)
if(NOT INSTALL_RUNTIME_DIR)
set(INSTALL_RUNTIME_DIR ${CMAKE_INSTALL_BINDIR})
endif()
if(NOT INSTALL_LIBRARY_DIR)
set(INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT INSTALL_ARCHIVE_DIR)
set(INSTALL_ARCHIVE_DIR ${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT INSTALL_INCLUDE_DIR)
set(INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
endif()
if(NOT INSTALL_DATADIR)
set(INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR})
endif()
if(NOT INSTALL_DOC_DIR)
set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}${${PROJECT_NAME}_LIBRARY_QTID})
endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${INSTALL_LIBRARY_DIR}")
endif()

View File

@@ -0,0 +1,170 @@
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
if(NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX)
# cmake-lint: disable=C0103
set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
CACHE FILEPATH "Custom path to install python bindings."
)
endif()
message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}")
if(WIN32)
set(PATH_SEP "\;")
else()
set(PATH_SEP ":")
endif()
#Qt5 requires C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#remove noisy compiler warnings (as the generated code is not necessarily super-warning-free)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all -Wno-extra")
endif()
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
get_target_property(QtCore_is_framework Qt5::Core FRAMEWORK)
if(QtCore_is_framework)
# Get the path to the framework dir.
list(GET Qt5Core_INCLUDE_DIRS 0 QT_INCLUDE_DIR)
get_filename_component(QT_FRAMEWORK_INCLUDE_DIR "${QT_INCLUDE_DIR}/../" ABSOLUTE)
# QT_INCLUDE_DIR points to the QtCore.framework directory, so we need to adjust this to point
# to the actual include directory, which has include files for non-framework parts of Qt.
get_filename_component(QT_INCLUDE_DIR "${QT_INCLUDE_DIR}/../../include" ABSOLUTE)
endif()
# Flags that we will pass to shiboken-generator
# --generator-set=shiboken: tells the generator that we want to use shiboken to generate code,
# a doc generator is also available
# --enable-parent-ctor-heuristic: Enable heuristics to detect parent relationship on constructors,
# this try to guess parent ownership based on the arguments of the constructors
# --enable-pyside-extensionsL: This will generate code for Qt based classes, adding extra attributes,
# like signal, slot;
# --enable-return-value-heuristic: Similar as --enable-parent-ctor-heuristic this use some logic to guess
# parent child relationship based on the returned argument
# --use-isnull-as-nb_nonzero: If a class have an isNull() const method, it will be used to compute
# the value of boolean casts.
# Example, QImage::isNull() will be used when on python side you do `if (myQImage)`
set(GENERATOR_EXTRA_FLAGS
--generator-set=shiboken
--enable-parent-ctor-heuristic
--enable-pyside-extensions
--enable-return-value-heuristic
--use-isnull-as-nb_nonzero
-std=c++${CMAKE_CXX_STANDARD}
)
# 2017-04-24 The protected hack can unfortunately not be disabled, because
# Clang does produce linker errors when we disable the hack.
# But the ugly workaround in Python is replaced by a shiboken change.
if(WIN32 OR DEFINED AVOID_PROTECTED_HACK)
set(GENERATOR_EXTRA_FLAGS ${GENERATOR_EXTRA_FLAGS} --avoid-protected-hack)
add_definitions(-DAVOID_PROTECTED_HACK)
endif()
# Replace all semicolons in a string with this platform's path separator
macro(make_path varname)
# accepts any number of path variables
string(REPLACE ";" "${PATH_SEP}" ${varname} "${ARGN}")
endmacro()
# Creates a PySide module target based on the arguments
# This will:
# 1 - Create a Cmake custom-target that call shiboken-generator passign the correct arguments
# 2 - Create a Cmake library target called "Py${libraryName}" the output name of this target
# will be changed to match PySide template
# Args:
# libraryName - The name of the output module
# typesystemPaths - A list of paths where shiboken should look for typesystem files
# includePaths - Include paths necessary to parse your class. *This is not the same as build*
# outputSource - The files that will be generated by shiboken
# targetIncludeDirs - This will be passed to target_include_directories
# targetLinkLibraries - This will be passed to targetLinkLibraries
# globalInclude - A header-file that contains all classes that will be generated
# typesystemXML - The target binding typesystem (that should be the full path)
# dependsArg - This var will be passed to add_custom_command(DEPENDS) so a new generation will be
# trigger if one of these files changes
# moduleOutputDir - Where the library file should be stored
macro(create_python_bindings
libraryName
typesystemPaths
includePaths
outputSource
targetIncludeDirs
targetLinkLibraries
globalInclude
typesystemXML
dependsArg
moduleOutputDir)
# Transform the path separators into something shiboken understands.
make_path(shiboken_include_dirs ${includePaths})
make_path(shiboken_typesystem_dirs ${typesystemPaths})
get_property(raw_python_dir_include_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
make_path(python_dir_include_dirs ${raw_python_dir_include_dirs})
set(shiboken_include_dirs "${shiboken_include_dirs}${PATH_SEP}${python_dir_include_dirs}")
set(shiboken_framework_include_dirs_option "")
if(CMAKE_HOST_APPLE)
set(shiboken_framework_include_dirs "${QT_FRAMEWORK_INCLUDE_DIR}")
make_path(shiboken_framework_include_dirs ${shiboken_framework_include_dirs})
set(shiboken_framework_include_dirs_option "--framework-include-paths=${shiboken_framework_include_dirs}")
endif()
set_property(SOURCE ${outputSource} PROPERTY SKIP_AUTOGEN ON)
add_custom_command(
OUTPUT ${outputSource}
COMMAND $<TARGET_PROPERTY:Shiboken2::shiboken,LOCATION> ${GENERATOR_EXTRA_FLAGS}
${globalInclude}
--include-paths=${shiboken_include_dirs}
--typesystem-paths=${shiboken_typesystem_dirs}
${shiboken_framework_include_dirs_option}
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
${typesystemXML}
DEPENDS ${typesystemXML} ${dependsArg}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for ${libraryName} binding..."
)
set(TARGET_NAME "Py${libraryName}")
set(MODULE_NAME "${libraryName}")
add_library(${TARGET_NAME} MODULE ${outputSource})
set_target_properties(
${TARGET_NAME} PROPERTIES
PREFIX ""
OUTPUT_NAME ${MODULE_NAME}
LIBRARY_OUTPUT_DIRECTORY ${moduleOutputDir}
)
if(APPLE)
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
elseif(NOT WIN32) #ie. linux
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()
if(WIN32)
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
endif()
target_include_directories(${TARGET_NAME} PUBLIC ${targetIncludeDirs})
target_link_libraries(
${TARGET_NAME}
${targetLinkLibraries}
PySide2::pyside2
Shiboken2::libshiboken
)
target_compile_definitions(${TARGET_NAME} PRIVATE Py_LIMITED_API=0x03050000)
if(APPLE)
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY LINK_FLAGS "-undefined dynamic_lookup")
endif()
install(
TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
)
endmacro()

View File

@@ -0,0 +1,170 @@
#
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
if(NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX)
# cmake-lint: disable=C0103
set(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
CACHE FILEPATH "Custom path to install python bindings."
)
endif()
message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}")
if(WIN32)
set(PATH_SEP "\;")
else()
set(PATH_SEP ":")
endif()
#Qt6 requires C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#remove noisy compiler warnings (as the generated code is not necessarily super-warning-free)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all -Wno-extra")
endif()
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
get_target_property(QtCore_is_framework Qt6::Core FRAMEWORK)
if(QtCore_is_framework)
# Get the path to the framework dir.
list(GET Qt6Core_INCLUDE_DIRS 0 QT_INCLUDE_DIR)
get_filename_component(QT_FRAMEWORK_INCLUDE_DIR "${QT_INCLUDE_DIR}/../" ABSOLUTE)
# QT_INCLUDE_DIR points to the QtCore.framework directory, so we need to adjust this to point
# to the actual include directory, which has include files for non-framework parts of Qt.
get_filename_component(QT_INCLUDE_DIR "${QT_INCLUDE_DIR}/../../include" ABSOLUTE)
endif()
# Flags that we will pass to shiboken-generator
# --generator-set=shiboken: tells the generator that we want to use shiboken to generate code,
# a doc generator is also available
# --enable-parent-ctor-heuristic: Enable heuristics to detect parent relationship on constructors,
# this try to guess parent ownership based on the arguments of the constructors
# --enable-pyside-extensionsL: This will generate code for Qt based classes, adding extra attributes,
# like signal, slot;
# --enable-return-value-heuristic: Similar as --enable-parent-ctor-heuristic this use some logic to guess
# parent child relationship based on the returned argument
# --use-isnull-as-nb_nonzero: If a class have an isNull() const method, it will be used to compute
# the value of boolean casts.
# Example, QImage::isNull() will be used when on python side you do `if (myQImage)`
set(GENERATOR_EXTRA_FLAGS
--generator-set=shiboken
--enable-parent-ctor-heuristic
--enable-pyside-extensions
--enable-return-value-heuristic
--use-isnull-as-nb_nonzero
-std=c++${CMAKE_CXX_STANDARD}
)
# 2017-04-24 The protected hack can unfortunately not be disabled, because
# Clang does produce linker errors when we disable the hack.
# But the ugly workaround in Python is replaced by a shiboken change.
if(WIN32 OR DEFINED AVOID_PROTECTED_HACK)
set(GENERATOR_EXTRA_FLAGS ${GENERATOR_EXTRA_FLAGS} --avoid-protected-hack)
add_definitions(-DAVOID_PROTECTED_HACK)
endif()
# Replace all semicolons in a string with this platform's path separator
macro(make_path varname)
# accepts any number of path variables
string(REPLACE ";" "${PATH_SEP}" ${varname} "${ARGN}")
endmacro()
# Creates a PySide module target based on the arguments
# This will:
# 1 - Create a Cmake custom-target that call shiboken-generator passign the correct arguments
# 2 - Create a Cmake library target called "Py${libraryName}" the output name of this target
# will be changed to match PySide template
# Args:
# libraryName - The name of the output module
# typesystemPaths - A list of paths where shiboken should look for typesystem files
# includePaths - Include paths necessary to parse your class. *This is not the same as build*
# outputSource - The files that will be generated by shiboken
# targetIncludeDirs - This will be passed to target_include_directories
# targetLinkLibraries - This will be passed to targetLinkLibraries
# globalInclude - A header-file that contains all classes that will be generated
# typesystemXML - The target binding typesystem (that should be the full path)
# dependsArg - This var will be passed to add_custom_command(DEPENDS) so a new generation will be
# trigger if one of these files changes
# moduleOutputDir - Where the library file should be stored
macro(create_python_bindings
libraryName
typesystemPaths
includePaths
outputSource
targetIncludeDirs
targetLinkLibraries
globalInclude
typesystemXML
dependsArg
moduleOutputDir)
# Transform the path separators into something shiboken understands.
make_path(shiboken_include_dirs ${includePaths})
make_path(shiboken_typesystem_dirs ${typesystemPaths})
get_property(raw_python_dir_include_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
make_path(python_dir_include_dirs ${raw_python_dir_include_dirs})
set(shiboken_include_dirs "${shiboken_include_dirs}${PATH_SEP}${python_dir_include_dirs}")
set(shiboken_framework_include_dirs_option "")
if(CMAKE_HOST_APPLE)
set(shiboken_framework_include_dirs "${QT_FRAMEWORK_INCLUDE_DIR}")
make_path(shiboken_framework_include_dirs ${shiboken_framework_include_dirs})
set(shiboken_framework_include_dirs_option "--framework-include-paths=${shiboken_framework_include_dirs}")
endif()
set_property(SOURCE ${outputSource} PROPERTY SKIP_AUTOGEN ON)
add_custom_command(
OUTPUT ${outputSource}
COMMAND $<TARGET_PROPERTY:Shiboken6::shiboken,LOCATION> ${GENERATOR_EXTRA_FLAGS}
${globalInclude}
--include-paths=${shiboken_include_dirs}
--typesystem-paths=${shiboken_typesystem_dirs}
${shiboken_framework_include_dirs_option}
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
${typesystemXML}
DEPENDS ${typesystemXML} ${dependsArg}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for ${libraryName} binding..."
)
set(TARGET_NAME "Py${libraryName}")
set(MODULE_NAME "${libraryName}")
add_library(${TARGET_NAME} MODULE ${outputSource})
set_target_properties(
${TARGET_NAME} PROPERTIES
PREFIX ""
OUTPUT_NAME ${MODULE_NAME}
LIBRARY_OUTPUT_DIRECTORY ${moduleOutputDir}
)
if(APPLE)
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
elseif(NOT WIN32) #ie. linux
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()
if(WIN32)
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
endif()
target_include_directories(${TARGET_NAME} PUBLIC ${targetIncludeDirs})
target_link_libraries(
${TARGET_NAME}
${targetLinkLibraries}
PySide6::pyside6
Shiboken6::libshiboken
)
target_compile_definitions(${TARGET_NAME} PRIVATE Py_LIMITED_API=0x03050000)
if(APPLE)
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY LINK_FLAGS "-undefined dynamic_lookup")
endif()
install(
TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
)
endmacro()

View File

@@ -0,0 +1,52 @@
#
# SPDX-FileCopyrightText: 2016-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Allen Winter <allen.winter@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Assumes you've already found Qt and Qt_VERSION_MAJOR is set
#
# Create variables for all the various install paths for the Qt version in use
# Make sure to have found Qt before using this.
# sets variables like QT_INSTALL_PREFIX, QT_INSTALL_DATA, QT_INSTALL_DOCS, etc.
# run qmake -query to see a full list
if(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: ${QT_QMAKE_EXECUTABLE} -query")
message(FATAL_ERROR "QMake call failed: ${return_code}")
endif()
string(REPLACE "\n" ";" VARS_LIST ${ALL_VARS})
foreach(qval ${VARS_LIST})
if(qval MATCHES "QT_INSTALL_")
string(REPLACE ":" ";" QVAL_LIST ${qval})
list(LENGTH QVAL_LIST listlen)
list(GET QVAL_LIST 0 var)
if(WIN32 AND ${listlen} GREATER 2)
list(GET QVAL_LIST 2 path)
list(GET QVAL_LIST 1 drive)
set(path "${drive}:${path}")
else()
list(GET QVAL_LIST 1 path)
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

@@ -0,0 +1,148 @@
{
"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,
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json"
},
"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,100 @@
{
"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,
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json"
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "kddockwidgets_example",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_example",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"name": "kddockwidgets_minimal_example",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_example",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"name": "kddockwidgets_minimal_mdi_example",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_minimal_mdi_example",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"name": "kddockwidgets_mdi_with_docking_example",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/kddockwidgets_mdi_with_docking_example",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"name": "tst_docks",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build-dev/bin/tst_docks",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"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,148 @@
{
"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,
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json"
},
"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
}
]
}
}

21
conan/README.txt Normal file
View File

@@ -0,0 +1,21 @@
In the following example we assume you have the kddockwidgets source available in
/path/to/kddockwidgets-source. replace '/path/to/kddockwidgets-source' to fit your needs.
$ conan create -s build_type=Release -o kddockwidgets:build_examples=True -o kddockwidgets:build_tests=True /path/to/kddockwidgets-source/conan kdab/stable
Configuration options:
* build_static
Builds static versions of the libraries. Default=False
* build_tests
Build the test harness. Default=False
* build_examples
Build the examples. Default=True
* build_python_bindings
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)

70
conan/conanfile.py Normal file
View File

@@ -0,0 +1,70 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
from conans import ConanFile, CMake, tools
class KDDockWidgetsConan(ConanFile):
name = "kddockwidgets"
version = "1.6.0"
default_user = "kdab"
default_channel = "stable"
license = ("https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-2.0-only.txt",
"https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-3.0-only.txt")
author = "Klaralvdalens Datakonsult AB (KDAB) info@kdab.com"
url = "https://github.com/KDAB/KDDockWidgets"
description = "Advanced Dock Widget Framework for Qt"
generators = "cmake"
topics = ("qt", "dockwidget", "kdab")
settings = "os", "compiler", "build_type", "arch"
options = {
"qt_version": "ANY",
"build_static": [True, False],
"build_examples": [True, False],
"build_tests": [True, False],
"build_python_bindings": [True, False],
"build_for_qt6": [True, False],
}
default_options = {
"qt_version": "qt/[>5.12.0]@kdab/stable",
"build_static": False,
"build_examples": True,
"build_tests": False,
"build_python_bindings": False,
"build_for_qt6": False,
}
def requirements(self):
# Check https://docs.conan.io/en/latest/reference/conanfile/attributes.html#version-ranges for more info about versioning
self.requires(str(self.options.qt_version))
def source(self):
git = tools.Git(folder="")
git.clone(self.url)
def build(self, build_type="Release"):
self.cmake = CMake(self, generator='Ninja', build_type=build_type)
self.cmake.definitions["KDDockWidgets_STATIC"] = self.options.build_static
self.cmake.definitions["KDDockWidgets_EXAMPLES"] = self.options.build_examples
self.cmake.definitions["KDDockWidgets_TESTS"] = self.options.build_tests
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.build()
def package(self):
self.cmake.install()
def package_info(self):
self.env_info.CMAKE_PREFIX_PATH.append(self.package_folder)
def package_id(self):
# Check only the major and minor version!
self.info.requires["qt"].minor_mode()

59
distro/debian.changelog Normal file
View File

@@ -0,0 +1,59 @@
kddockwidgets (1.6.0) release candidate; urgency=high
* 1.6.0 final
-- Allen Winter <allen.winter@kdab.com> Wed, 14 Sep 2022 11:40:00 -0500
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
* 1.2.0 final
-- Allen Winter <allen.winter@kdab.com> Thu, 17 Dec 2020 12:00:00 -0500
kddockwidgets (1.1.1) release candidate; urgency=high
* 1.1.1 final
-- Allen Winter <allen.winter@kdab.com> Fri, 11 Dec 2020 12:00:00 -0500
kddockwidgets (1.1.0) release candidate; urgency=high
* 1.1.0 final
-- Allen Winter <allen.winter@kdab.com> Mon, 26 Oct 2020 12:00:00 -0500
kddockwidgets (1.0.0) release candidate; urgency=high
* 1.0.0 final
-- Allen Winter <allen.winter@kdab.com> Wed, 2 Sep 2020 12:00:00 -0500
kddockwidgets (0.99.9) release candidate; urgency=high
* 1.0.0 release candidate
-- Allen Winter <allen.winter@kdab.com> Thu, 6 Aug 2020 11:00:00 -0500

1
distro/debian.compat Normal file
View File

@@ -0,0 +1 @@
9

12
distro/qt5-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: qt5-kddockwidgets
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: KDAB's Dock Widget Framework for Qt

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

@@ -0,0 +1,4 @@
#!/usr/bin/make -f
DEB_CMAKE_EXTRA_FLAGS = -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.6.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, libfreetype-dev
Files:
00000000000000000000000000000000 00000 qt5-kddockwidgets-1.6.0.tar.gz

View File

@@ -0,0 +1,120 @@
Name: qt5-kddockwidgets
Version: 1.6.0
Release: 1
Summary: KDAB's Dock Widget Framework for Qt5
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: libqt5-qtbase-devel libqt5-qtbase-private-headers-devel libqt5-qtx11extras-devel
%endif
%if %{defined fedora}
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtx11extras-devel desktop-file-utils util-linux
%endif
%if %{defined rhel}
BuildRequires: gcc-c++ qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtx11extras-devel desktop-file-utils
%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 -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
%{_libdir}/libkddockwidgets.so.*
%files devel
%defattr(-,root,root,-)
%if 0%{?sle_version} >= 150200 && 0%{?is_opensuse}
%{_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
%{_includedir}/kddockwidgets/*
%dir %{_libdir}/cmake/KDDockWidgets
%{_libdir}/cmake/KDDockWidgets/*
%{_libdir}/libkddockwidgets.so
%changelog
* Wed Sep 14 2022 Allen Winter <allen.winter@kdab.com> 1.6.0
1.6.0 final
* 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

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.6.0-1
Binary: kddockwidgets
Maintainer: Allen Winter <allen.winter@kdab.com>
Architecture: any
Build-Depends: debhelper (>=9), cdbs, cmake, qt6-base-dev, qt6-base-private-dev, libgl1-mesa-dev, libfontconfig-dev, libfreetype-dev
Files:
00000000000000000000000000000000 00000 qt6-kddockwidgets-1.6.0.tar.gz

View File

@@ -0,0 +1,114 @@
Name: qt6-kddockwidgets
Version: 1.6.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 util-linux
%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,-)
%if 0%{?fedora} > 35
%{_libdir}/qt6/mkspecs/modules/*
%endif
#%dir %{_prefix}/share/mkspecs
#%dir %{_prefix}/share/mkspecs/features
#%{_prefix}/share/mkspecs/features/kddockwidgets.prf
%dir %{_includedir}/kddockwidgets-qt6
%{_includedir}/kddockwidgets-qt6/kddockwidgets/*
%dir %{_libdir}/cmake/KDDockWidgets-qt6
%{_libdir}/cmake/KDDockWidgets-qt6/*
%{_libdir}/libkddockwidgets-qt6.so
%changelog
* Wed Sep 14 2022 Allen Winter <allen.winter@kdab.com> 1.6.0
1.6.0 final
* 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

42
docker/pyside2/Dockerfile Normal file
View File

@@ -0,0 +1,42 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sérgio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
# The purpose of this Dockerfile is just for quickly getting a running python build for testing.
# Instructions:
# $ docker build -t kddw-pyside2 .
# $ docker run -it -v ~/Qt/5.15.2/gcc_64/:/Qt/ -v /tmp/.X11-unix:/tmp/.X11-unix kddw-pyside2
# git checkout 1.6
# cmake --preset=python -G Ninja . && cd build-python/ && ninja
# Test with:
# cd ../python/examples && rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc
# python3 main.py
FROM ubuntu:22.04
MAINTAINER Sergio Martins (sergio.martins@kdab.com)
ENV TZ=Europe/Berlin
ENV LC_CTYPE=C.UTF-8
ENV DISPLAY=:0
ENV PATH=$PATH:/Qt/bin/
ENV LD_LIBRARY_PATH=/Qt/lib/
ENV PYTHONPATH=/KDDockWidgets/build-python/python/
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update
RUN apt install build-essential software-properties-common git ninja-build libssl-dev mesa-common-dev libglu1-mesa-dev libglib2.0-dev libfontconfig libxkbcommon-x11-0 libdbus-1-3 cmake pip libxslt1-dev llvm-dev clang libxcb-keysyms1 libxcb-image0 libxcb-icccm4 libxcb-xinerama0 libxcb-shape0 libxcb-render-util0 -y
RUN pip3 install --index-url=http://download.qt.io/official_releases/QtForPython/ --trusted-host download.qt.io shiboken2 pyside2 shiboken2_generator
WORKDIR /
RUN git clone https://github.com/KDAB/KDDockWidgets.git
WORKDIR /KDDockWidgets/

24
docs/CMakeLists.txt Normal file
View File

@@ -0,0 +1,24 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Allen Winter <allen.winter@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
# Doxygen
find_package(Doxygen)
set_package_properties(
Doxygen PROPERTIES
TYPE OPTIONAL
DESCRIPTION "API Documentation system"
URL "https://www.doxygen.org"
PURPOSE "Needed to build the API documentation."
)
if(DOXYGEN_FOUND)
add_subdirectory(api)
endif()

Binary file not shown.

83
docs/api/CMakeLists.txt Normal file
View File

@@ -0,0 +1,83 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Allen Winter <allen.winter@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
# dot should come with Doxygen find_package(Doxygen)
if(DOXYGEN_DOT_EXECUTABLE)
set(HAVE_DOT "YES")
else()
set(HAVE_DOT "NO")
message(STATUS "Unable to provide inheritance diagrams for the API documentation. "
"To fix, install the graphviz project from https://www.graphviz.org"
)
endif()
# qhelpgenerator
find_program(QHELPGEN_EXECUTABLE qhelpgenerator HINTS ${QT_INSTALL_BINS})
if(QHELPGEN_EXECUTABLE)
set(HAVE_QHELPGEN "YES")
else()
set(HAVE_QHELPGEN "NO")
message(STATUS "Unable to generate the API documentation in qch format. "
"To fix, install the qthelpgenerator program which comes with Qt."
)
endif()
find_file(QDOC_QTCORE_TAG qtcore.tags HINTS ${QT_INSTALL_DOCS}/qtcore ${QT_INSTALL_DATA}/doc/qtcore)
set(QDOC_TAG_DIR "<QDOC_TAG_DIR_not_found>")
if(QDOC_QTCORE_TAG)
get_filename_component(QDOC_TAG_DIR ${QDOC_QTCORE_TAG} DIRECTORY)
get_filename_component(QDOC_TAG_DIR ${QDOC_TAG_DIR} DIRECTORY)
endif()
file(GLOB _dox_deps *.dox *.html)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
#apidox generation using doxygen
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
add_custom_command(
OUTPUT ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch
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
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
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generate the .qch file"
)
add_custom_target(
kddockwidgets-api.qch ALL
DEPENDS ${DOXYGEN_OUTPUT_DIR}/qch/kddockwidgets-api.qch
COMMENT "Target generate the .qch file"
)
add_custom_target(
docs
DEPENDS kddockwidgets-api.qch
COMMENT "Target to generate the documentation"
)
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})

2560
docs/api/Doxyfile.cmake Normal file

File diff suppressed because it is too large Load Diff

20
docs/api/footer.html Normal file
View File

@@ -0,0 +1,20 @@
<hr>
<div style="float: left;">
<img src="kdab-logo-16x16.png">
<font style="font-weight: bold;">&copy; 2019-2022 Klar&auml;lvdalens Datakonsult AB (KDAB)</font>
<br>
"The Qt, C++ and OpenGL Experts"<br>
<a href="https://www.kdab.com/">https://www.kdab.com/</a>
</div>
<div style="text-align: right;">
<img src="kdab-kddockwidgets-logo-16x16.png" />
<font style="font-weight: bold;">KDDockWidgets</font>
<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><br>
$generatedby doxygen $doxygenversion<br>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,29 +1,31 @@
cmake_minimum_required(VERSION 3.3)
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
cmake_minimum_required(VERSION 3.7)
project(kddockwidgets_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)
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()
qt5_add_resources(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_example.qrc)
set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_example.qrc)
add_executable(kddockwidgets_example
main.cpp
MyFrameworkWidgetFactory.cpp
MyMainWindow.cpp
MyWidget.cpp
${RESOURCES_EXAMPLE_SRC}
)
target_link_libraries(kddockwidgets_example
PRIVATE
KDAB::kddockwidgets
add_executable(
kddockwidgets_example main.cpp MyFrameworkWidgetFactory.cpp MyMainWindow.cpp MyWidget.cpp ${RESOURCES_EXAMPLE_SRC}
)
target_link_libraries(kddockwidgets_example PRIVATE KDAB::kddockwidgets)

View File

@@ -1,43 +1,47 @@
/*
This file is part of KDDockWidgets.
Copyright (C) 2018-2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyFrameworkWidgetFactory.h"
#include "MyTitleBar_CSS.h"
#include <kddockwidgets/FrameworkWidgetFactory.h>
//#include <kddockwidgets/widgets/SeparatorWidget_p.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/multisplitter/Separator_qwidget.h>
#include <QApplication>
class MyTitleBar : public KDDockWidgets::TitleBar
// clazy:excludeall=missing-qobject-macro,ctor-missing-parent-argument
class MyTitleBar : public KDDockWidgets::TitleBarWidget
{
public:
explicit MyTitleBar(KDDockWidgets::Frame *frame)
: KDDockWidgets::TitleBar(frame)
: KDDockWidgets::TitleBarWidget(frame)
{
init();
}
explicit MyTitleBar(KDDockWidgets::FloatingWindow *fw)
: KDDockWidgets::TitleBar(fw)
: KDDockWidgets::TitleBarWidget(fw)
{
init();
}
~MyTitleBar() override;
void init()
{
setFixedHeight(60);
@@ -47,7 +51,9 @@ public:
{
QPainter p(this);
QPen pen(Qt::black);
QBrush brush(Qt::yellow);
const QColor focusedBackgroundColor = Qt::yellow;
const QColor backgroundColor = focusedBackgroundColor.darker(115);
QBrush brush(isFocused() ? focusedBackgroundColor : backgroundColor);
pen.setWidth(4);
p.setPen(pen);
p.setBrush(brush);
@@ -56,42 +62,45 @@ public:
f.setPixelSize(30);
f.setBold(true);
p.setFont(f);
p.drawText(QPoint(10,40), title());
p.drawText(QPoint(10, 40), title());
}
};
/*
MyTitleBar::~MyTitleBar() = default;
// Inheriting from SeparatorWidget instead of Separator as it handles moving and mouse cursor changing
class MySeparator : public KDDockWidgets::SeparatorWidget
class MySeparator : public Layouting::SeparatorWidget
{
public:
explicit MySeparator(KDDockWidgets::Anchor *anchor,
KDDockWidgets::QWidgetAdapter *parent = nullptr)
: KDDockWidgets::SeparatorWidget(anchor, parent)
explicit MySeparator(Layouting::Widget *parent)
: Layouting::SeparatorWidget(parent)
{
}
~MySeparator() override;
void paintEvent(QPaintEvent *) override
{
QPainter p(this);
p.fillRect(rect(), isStatic() ? Qt::black : Qt::cyan);
p.fillRect(QWidget::rect(), Qt::cyan);
}
};
*/
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const
MySeparator::~MySeparator() = default;
KDDockWidgets::TitleBar *CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const
{
// Feel free to return MyTitleBar_CSS here instead, but just for education purposes!
return new MyTitleBar(frame);
}
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::FloatingWindow *fw) const
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);
}
/*
KDDockWidgets::Separator * CustomWidgetFactory::createSeparator(KDDockWidgets::Anchor *anchor,
KDDockWidgets::QWidgetAdapter *parent) const
Layouting::Separator *CustomWidgetFactory::createSeparator(Layouting::Widget *parent) const
{
return new MySeparator(anchor, parent);
return new MySeparator(parent);
}
*/

View File

@@ -1,34 +1,27 @@
/*
This file is part of KDDockWidgets.
Copyright (C) 2018-2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#pragma once
#include <kddockwidgets/FrameworkWidgetFactory.h>
#include <kddockwidgets/private/TitleBar_p.h>
#include <QPainter>
// clazy:excludeall=ctor-missing-parent-argument
class CustomWidgetFactory : public KDDockWidgets::DefaultWidgetFactory
{
Q_OBJECT
public:
KDDockWidgets::TitleBar *createTitleBar(KDDockWidgets::Frame *frame) const override;
KDDockWidgets::TitleBar *createTitleBar(KDDockWidgets::FloatingWindow *fw) const override;
/* KDDockWidgets::Separator *createSeparator(KDDockWidgets::Anchor *anchor, // Commented-out as we need to install more headers
KDDockWidgets::QWidgetAdapter *parent = nullptr) const override;*/
Layouting::Separator *createSeparator(Layouting::Widget *parent = nullptr) const override;
};

View File

@@ -1,26 +1,18 @@
/*
This file is part of KDDockWidgets.
Copyright (C) 2018-2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyMainWindow.h"
#include "MyWidget.h"
#include <kddockwidgets/Config.h>
#include <kddockwidgets/LayoutSaver.h>
#include <QMenu>
@@ -29,14 +21,18 @@
#include <QDebug>
#include <QString>
#include <QTextEdit>
#include <QRandomGenerator>
#include <QApplication>
#include <stdlib.h>
#include <time.h>
// clazy:excludeall=qstring-allocations,ctor-missing-parent-argument,detaching-member
static MyWidget *newMyWidget()
{
const int randomNumber = qrand() % 100 + 1;
const int randomNumber = QRandomGenerator::global()->bounded(0, 100) + 1;
if (randomNumber < 50) {
if (randomNumber < 33) {
return new MyWidget1();
@@ -50,21 +46,25 @@ static MyWidget *newMyWidget()
MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore,
bool dock0BlocksCloseEvent,
const QString &affinityName, QWidget *parent)
: MainWindow(uniqueName, options, parent)
, m_dockWidget0IsNonClosable(dockWidget0IsNonClosable)
, m_dockWidget9IsNonDockable(nonDockableDockWidget9)
, m_restoreIsRelative(restoreIsRelative)
, m_maxSizeForDockWidget8(maxSizeForDockWidget8)
, m_dockwidget5DoesntCloseBeforeRestore(dockwidget5DoesntCloseBeforeRestore)
, m_dock0BlocksCloseEvent(dock0BlocksCloseEvent)
{
// qApp->installEventFilter(this);
qsrand(time(nullptr));
auto menubar = menuBar();
auto fileMenu = new QMenu(QStringLiteral("File"));
m_toggleMenu = new QMenu(QStringLiteral("Toggle"));
auto fileMenu = new QMenu(QStringLiteral("File"), this);
m_toggleMenu = new QMenu(QStringLiteral("Toggle"), this);
auto miscMenu = new QMenu(QStringLiteral("Misc"), this);
menubar->addMenu(fileMenu);
menubar->addMenu(m_toggleMenu);
menubar->addMenu(miscMenu);
QAction *newAction = fileMenu->addAction(QStringLiteral("New DockWidget"));
@@ -96,17 +96,36 @@ MyMainWindow::MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowO
saver.restoreFromFile(QStringLiteral("mylayout.json"));
});
auto closeAllAction = fileMenu->addAction(QStringLiteral("Close all"));
auto closeAllAction = fileMenu->addAction(QStringLiteral("Close All"));
connect(closeAllAction, &QAction::triggered, this, [this] {
for (auto dw : m_dockwidgets)
for (auto dw : qAsConst(m_dockwidgets))
dw->close();
});
auto layoutEqually = fileMenu->addAction(QStringLiteral("Layout Equally"));
connect(layoutEqually, &QAction::triggered, this, &MainWindow::layoutEqually);
auto quitAction = fileMenu->addAction(QStringLiteral("Quit"));
connect(quitAction, &QAction::triggered, qApp, &QApplication::quit);
setAffinityName(affinityName);
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 });
createDockWidgets();
if (options & KDDockWidgets::MainWindowOption_HasCentralWidget) {
setPersistentCentralWidget(new MyWidget1());
}
}
MyMainWindow::~MyMainWindow()
{
qDeleteAll(m_dockwidgets);
}
void MyMainWindow::createDockWidgets()
@@ -120,28 +139,27 @@ void MyMainWindow::createDockWidgets()
for (int i = 0; i < numDockWidgets; i++)
m_dockwidgets << newDockWidget();
// MainWindow::addDockWidget() attaches a dock widget to the main window:
addDockWidget(m_dockwidgets[0], KDDockWidgets::Location_OnTop);
addDockWidget(m_dockwidgets.at(0), KDDockWidgets::Location_OnTop);
// Here, for finer granularity we specify right of dockwidgets[0]:
addDockWidget(m_dockwidgets[1], KDDockWidgets::Location_OnRight, m_dockwidgets[0]);
addDockWidget(m_dockwidgets.at(1), KDDockWidgets::Location_OnRight, m_dockwidgets.at(0));
addDockWidget(m_dockwidgets[2], KDDockWidgets::Location_OnLeft);
addDockWidget(m_dockwidgets[3], KDDockWidgets::Location_OnBottom);
addDockWidget(m_dockwidgets[4], KDDockWidgets::Location_OnBottom);
addDockWidget(m_dockwidgets.at(2), KDDockWidgets::Location_OnLeft);
addDockWidget(m_dockwidgets.at(3), KDDockWidgets::Location_OnBottom);
addDockWidget(m_dockwidgets.at(4), KDDockWidgets::Location_OnBottom);
// Tab two dock widgets toghether
m_dockwidgets[3]->addDockWidgetAsTab(m_dockwidgets[5]);
// Tab two dock widgets together
m_dockwidgets[3]->addDockWidgetAsTab(m_dockwidgets.at(5));
// 6 is floating, as it wasn't added to the main window via MainWindow::addDockWidget().
// and we tab 7 with it.
m_dockwidgets[6]->addDockWidgetAsTab(m_dockwidgets[7]);
m_dockwidgets[6]->addDockWidgetAsTab(m_dockwidgets.at(7));
// Floating windows also support nesting, here we add 8 to the bottom of the group
m_dockwidgets[6]->addDockWidgetToContainingWindow(m_dockwidgets[8], KDDockWidgets::Location_OnBottom);
m_dockwidgets[6]->addDockWidgetToContainingWindow(m_dockwidgets.at(8), KDDockWidgets::Location_OnBottom);
auto floatingWindow = m_dockwidgets[6]->window();
auto floatingWindow = m_dockwidgets.at(6)->window();
floatingWindow->move(100, 100);
}
@@ -151,20 +169,33 @@ KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
// Passing options is optional, we just want to illustrate Option_NotClosable here
KDDockWidgets::DockWidget::Options options = KDDockWidgets::DockWidget::Option_None;
KDDockWidgets::DockWidget::LayoutSaverOptions layoutSaverOptions = KDDockWidgets::DockWidget::LayoutSaverOption::None;
if (count == 0 && m_dockWidget0IsNonClosable)
options |= KDDockWidgets::DockWidget::Option_NotClosable;
if (count == 9 && m_dockWidget9IsNonDockable)
options |= KDDockWidgets::DockWidget::Option_NotDockable;
auto dock = new KDDockWidgets::DockWidget(QStringLiteral("DockWidget #%1").arg(count), options);
dock->setAffinityName(affinityName()); // optional, just to show the feature. Pass -mi to the example to see incompatible dock widgets
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
if (count == 1)
dock->setIcon(QIcon::fromTheme(QStringLiteral("mail-message")));
auto myWidget = newMyWidget();
dock->setWidget(myWidget);
auto myWidget = newMyWidget();
if (count == 8 && m_maxSizeForDockWidget8) {
// Set a maximum size on dock #8
myWidget->setMaximumSize(200, 200);
}
if (count == 0 && m_dock0BlocksCloseEvent)
myWidget->blockCloseEvent();
dock->setWidget(myWidget);
if (dock->options() & KDDockWidgets::DockWidget::Option_NotDockable) {
dock->setTitle(QStringLiteral("DockWidget #%1 (%2)").arg(count).arg("non dockable"));
@@ -173,8 +204,8 @@ KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
}
dock->resize(600, 600);
dock->show();
m_toggleMenu->addAction(dock->toggleAction());
dock->toggleAction()->setShortcut(QStringLiteral("ctrl+%1").arg(count));
count++;
return dock;

View File

@@ -1,21 +1,12 @@
/*
This file is part of KDDockWidgets.
Copyright (C) 2018-2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#pragma once
@@ -29,15 +20,20 @@ class MyMainWindow : public KDDockWidgets::MainWindow
public:
explicit MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
bool dockWidget0IsNonClosable, bool nonDockableDockWidget9, bool restoreIsRelative,
bool maxSizeForDockWidget8, bool dockwidget5DoesntCloseBeforeRestore, bool dock0BlocksCloseEvent,
const QString &affinityName = {}, // Usually not needed. Just here to show the feature.
QWidget *parent = nullptr);
~MyMainWindow() override;
private:
void createDockWidgets();
KDDockWidgets::DockWidgetBase* newDockWidget();
KDDockWidgets::DockWidgetBase *newDockWidget();
QMenu *m_toggleMenu = nullptr;
const bool m_dockWidget0IsNonClosable;
const bool m_dockWidget9IsNonDockable;
const bool m_restoreIsRelative;
const bool m_maxSizeForDockWidget8;
const bool m_dockwidget5DoesntCloseBeforeRestore;
const bool m_dock0BlocksCloseEvent;
KDDockWidgets::DockWidget::List m_dockwidgets;
};

View File

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

View File

@@ -1,21 +1,12 @@
/*
This file is part of KDDockWidgets.
Copyright (C) 2018-2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyWidget.h"
@@ -23,8 +14,10 @@
#include <QPainter>
#include <QDebug>
#include <QFile>
#include <QLineEdit>
#include <QCloseEvent>
static QHash<QString, QImage> s_images;
static QHash<QString, QImage> s_images; /// clazy:exclude=non-pod-global-static
MyWidget::MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent)
: QWidget(parent)
@@ -42,6 +35,15 @@ MyWidget::MyWidget(const QString &backgroundFile, const QString &logoFile, QWidg
it = s_images.insert(logoFile, QImage(logoFile));
m_logo = it.value();
}
setFocusPolicy(Qt::StrongFocus);
if (qEnvironmentVariableIsSet("KDDW_DEBUG_FOCUS")) {
// Uncomment to show focus propagation working
new QLineEdit(this);
auto l2 = new QLineEdit(this);
l2->move(0, 100);
setFocusProxy(l2);
}
}
MyWidget::~MyWidget()
@@ -64,11 +66,25 @@ void MyWidget::drawLogo(QPainter &p)
: int(maxHeight / ratio);
const int height = int(width * ratio);
QRect targetLogoRect(0,0, width, height);
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());
}
void MyWidget::blockCloseEvent()
{
m_blocksCloseEvent = true;
}
void MyWidget::closeEvent(QCloseEvent *ev)
{
if (m_blocksCloseEvent) {
ev->ignore();
} else {
QWidget::closeEvent(ev);
}
}
MyWidget1::MyWidget1(MyWidget::QWidget *parent)
: MyWidget(QStringLiteral(":/assets/triangles.png"), QStringLiteral(":/assets/KDAB_bubble_white.png"), parent)
{

View File

@@ -1,21 +1,12 @@
/*
This file is part of KDDockWidgets.
Copyright (C) 2018-2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#ifndef EXAMPLEDOCKABLEWIDGET_H
@@ -35,34 +26,46 @@ class MyWidget : public QWidget
public:
explicit MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent = nullptr);
~MyWidget();
// These two are just for demonstrating how to block the close event, if desired
void blockCloseEvent();
void closeEvent(QCloseEvent *) override;
protected:
void drawLogo(QPainter &);
QImage m_background;
QImage m_logo;
bool m_blocksCloseEvent = false;
};
class MyWidget1 : public MyWidget
{
Q_OBJECT
public:
explicit MyWidget1(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent*) override;
void paintEvent(QPaintEvent *) override;
};
class MyWidget2 : public MyWidget
{
Q_OBJECT
public:
explicit MyWidget2(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent*) override;
void paintEvent(QPaintEvent *) override;
};
class MyWidget3 : public MyWidget
{
Q_OBJECT
public:
explicit MyWidget3(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent*) override;
void paintEvent(QPaintEvent *) override;
QImage m_triangle;
};

View File

@@ -1,27 +1,19 @@
/*
This file is part of KDDockWidgets.
Copyright (C) 2018-2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyWidget.h"
#include "MyMainWindow.h"
#include "MyFrameworkWidgetFactory.h"
#include <algorithm>
#include <kddockwidgets/Config.h>
#include <QStyleFactory>
@@ -29,12 +21,16 @@
#include <QDebug>
#include <QCommandLineParser>
// clazy:excludeall=qstring-allocations
using namespace KDDockWidgets;
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"));
@@ -44,6 +40,7 @@ int main(int argc, char **argv)
parser.setApplicationDescription("KDDockWidgets example application");
parser.addHelpOption();
// Fusion looks better in general, but feel free to change
qApp->setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
QCommandLineOption customStyle("p", QCoreApplication::translate("main", "Shows how to style framework internals via FrameworkWidgetFactory"));
@@ -52,9 +49,15 @@ int main(int argc, char **argv)
QCommandLineOption reorderTabsOption("r", QCoreApplication::translate("main", "Support re-ordering tabs with mouse"));
parser.addOption(reorderTabsOption);
QCommandLineOption noTitleBars("t", QCoreApplication::translate("main", "Never show titlebars"));
QCommandLineOption noTitleBars("t", QCoreApplication::translate("main", "Hide titlebars when tabs are visible"));
parser.addOption(noTitleBars);
QCommandLineOption alwaysTitleBarWhenFloating("q", QCoreApplication::translate("main", "Don't hide title bars if floating, even if Flag_HideTitleBarWhenTabsVisible is specified."));
parser.addOption(alwaysTitleBarWhenFloating);
QCommandLineOption alwaysTabs("z", QCoreApplication::translate("main", "Show tabs even if there's only one"));
parser.addOption(alwaysTabs);
QCommandLineOption lazyResizeOption("l", QCoreApplication::translate("main", "Use lazy resize"));
parser.addOption(lazyResizeOption);
@@ -79,12 +82,83 @@ int main(int argc, char **argv)
QCommandLineOption nonDockable("d", QCoreApplication::translate("main", "DockWidget #9 will be non-dockable"));
parser.addOption(nonDockable);
QCommandLineOption maximizeButton("b", QCoreApplication::translate("main", "DockWidgets have maximize/restore buttons instead of float/dock button"));
parser.addOption(maximizeButton);
QCommandLineOption maximizeButtonOption("b", QCoreApplication::translate("main", "Floating dockWidgets have maximize/restore buttons instead of float/dock button"));
parser.addOption(maximizeButtonOption);
QCommandLineOption minimizeButtonOption("k", QCoreApplication::translate("main", "Floating dockWidgets have a minimize button. Implies not being an utility window (~Qt::Tool)"));
parser.addOption(minimizeButtonOption);
QCommandLineOption segmentedIndicators("y", QCoreApplication::translate("main", "Use segmented indicators instead of classical"));
parser.addOption(segmentedIndicators);
QCommandLineOption noUtilityWindows("u", QCoreApplication::translate("main", "FloatingWindows will be normal windows instead of utility windows"));
parser.addOption(noUtilityWindows);
QCommandLineOption keepAbove("o", QCoreApplication::translate("main", "FloatingWindows will have Qt::WindowStaysOnTopHint. Implies not being an utility window (try it with -u too)"));
parser.addOption(keepAbove);
parser.addPositionalArgument("savedlayout", QCoreApplication::translate("main", "loads the specified json file at startup"));
#ifdef KDDOCKWIDGETS_SUPPORTS_NESTED_MAINWINDOWS
QCommandLineOption dockableMainWindows("j", QCoreApplication::translate("main", "Allow main windows to be docked inside other main windows"));
parser.addOption(dockableMainWindows);
#endif
QCommandLineOption maxSizeOption("g", QCoreApplication::translate("main", "Make dock #8 have a max-size of 200x200."));
parser.addOption(maxSizeOption);
QCommandLineOption centralFrame("f", QCoreApplication::translate("main", "Persistent central frame"));
QCommandLineOption autoHideSupport("w", QCoreApplication::translate("main", "Enables auto-hide/minimization to side-bar support"));
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 blockCloseEvent("block-close-event",
QCoreApplication::translate("main", "DockWidget #0 will block close events"));
parser.addOption(blockCloseEvent);
QCommandLineOption showButtonsInTabBarIfTitleBarHidden("show-buttons-in-tabbar-if-titlebar-hidden",
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);
QCommandLineOption hideCertainDockingIndicators("hide-certain-docking-indicators",
QCoreApplication::translate("main", "Illustrates usage of Config::setDropIndicatorAllowedFunc()"));
parser.addOption(hideCertainDockingIndicators);
#if defined(DOCKS_DEVELOPER_MODE)
QCommandLineOption noCentralFrame("f", QCoreApplication::translate("main", "No central frame"));
parser.addOption(noCentralFrame);
parser.addOption(centralFrame);
QCommandLineOption noQtTool("no-qttool", QCoreApplication::translate("main", "(internal) Don't use Qt::Tool"));
QCommandLineOption noParentForFloating("no-parent-for-floating", QCoreApplication::translate("main", "(internal) FloatingWindows won't have a parent"));
QCommandLineOption nativeTitleBar("native-title-bar", QCoreApplication::translate("main", "(internal) FloatingWindows a native title bar"));
QCommandLineOption noDropIndicators("no-drop-indicators", QCoreApplication::translate("main", "(internal) Don't use any drop indicators"));
parser.addOption(noQtTool);
parser.addOption(noParentForFloating);
parser.addOption(nativeTitleBar);
parser.addOption(noDropIndicators);
#if defined(Q_OS_WIN)
QCommandLineOption noAeroSnap("no-aero-snap", QCoreApplication::translate("main", "(internal) Disable AeroSnap"));
parser.addOption(noAeroSnap);
#endif
#else
Q_UNUSED(centralFrame)
#endif
parser.process(app);
@@ -93,31 +167,92 @@ int main(int argc, char **argv)
Config::self().setFrameworkWidgetFactory(new CustomWidgetFactory()); // Sets our custom factory
// Increase the separator size, just for demo
Config::self().setSeparatorThickness(10, /*static=*/ false);
Config::self().setSeparatorThickness(10);
}
if (parser.isSet(segmentedIndicators))
KDDockWidgets::DefaultWidgetFactory::s_dropIndicatorType = KDDockWidgets::DropIndicatorType::Segmented;
MainWindowOptions options = MainWindowOption_None;
auto flags = KDDockWidgets::Config::self().flags();
#if defined(DOCKS_DEVELOPER_MODE)
options = parser.isSet(noCentralFrame) ? MainWindowOption_None
: MainWindowOption_HasCentralFrame;
auto internalFlags = KDDockWidgets::Config::self().internalFlags();
options = parser.isSet(centralFrame) ? MainWindowOption_HasCentralFrame
: MainWindowOption_None;
if (parser.isSet(centralWidget))
options |= MainWindowOption_HasCentralWidget;
if (parser.isSet(noQtTool))
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows;
if (parser.isSet(keepAbove))
flags |= KDDockWidgets::Config::Flag_KeepAboveIfNotUtilityWindow;
if (parser.isSet(noParentForFloating))
internalFlags |= KDDockWidgets::Config::InternalFlag_DontUseParentForFloatingWindows;
if (parser.isSet(nativeTitleBar))
flags |= KDDockWidgets::Config::Flag_NativeTitleBar;
if (parser.isSet(noDropIndicators))
KDDockWidgets::DefaultWidgetFactory::s_dropIndicatorType = KDDockWidgets::DropIndicatorType::None;
#if defined(Q_OS_WIN)
if (parser.isSet(noAeroSnap))
internalFlags |= KDDockWidgets::Config::InternalFlag_NoAeroSnap;
#endif
Config::self().setInternalFlags(internalFlags);
#endif
auto flags = KDDockWidgets::Config::self().flags();
if (parser.isSet(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))
flags |= KDDockWidgets::Config::Flag_HideTitleBarWhenTabsVisible | KDDockWidgets::Config::Flag_AlwaysShowTabs;
flags |= KDDockWidgets::Config::Flag_HideTitleBarWhenTabsVisible;
if (parser.isSet(noUtilityWindows))
flags |= KDDockWidgets::Config::Flag_DontUseUtilityFloatingWindows;
if (parser.isSet(alwaysTabs))
flags |= KDDockWidgets::Config::Flag_AlwaysShowTabs;
if (parser.isSet(alwaysTitleBarWhenFloating)) {
flags |= KDDockWidgets::Config::Flag_AlwaysTitleBarWhenFloating;
if (!(flags & KDDockWidgets::Config::Flag_HideTitleBarWhenTabsVisible)) {
qWarning() << "Flag_AlwaysTitleBarWhenFloating is unneeded if Flag_HideTitleBarWhenTabsVisible isn't used."
<< "As floating windows already have title bars by default.";
}
}
if (parser.isSet(customStyle) || qEnvironmentVariableIsSet("KDDW_DEBUG_FOCUS"))
flags |= KDDockWidgets::Config::Flag_TitleBarIsFocusable; // also showing title bar focus with -p, just to not introduce another switch
if (parser.isSet(reorderTabsOption))
flags |= KDDockWidgets::Config::Flag_AllowReorderTabs;
if (parser.isSet(maximizeButton))
if (parser.isSet(maximizeButtonOption))
flags |= KDDockWidgets::Config::Flag_TitleBarHasMaximizeButton;
if (parser.isSet(minimizeButtonOption))
flags |= KDDockWidgets::Config::Flag_TitleBarHasMinimizeButton;
if (parser.isSet(lazyResizeOption))
flags |= KDDockWidgets::Config::Flag_LazyResize;
if (parser.isSet(tabsHaveCloseButton))
flags |= KDDockWidgets::Config::Flag_TabsHaveCloseButton;
if (parser.isSet(ctxtMenuOnTabs))
flags |= KDDockWidgets::Config::Flag_AllowSwitchingTabsViaMenu;
if (parser.isSet(doubleClickMaximize))
flags |= KDDockWidgets::Config::Flag_DoubleClickMaximizes;
@@ -127,25 +262,64 @@ int main(int argc, char **argv)
return 1;
}
if (parser.isSet(hideCertainDockingIndicators)) {
// Here we exemplify adding a restriction to "Dock Widget 8"
// Dock widget 8 will only be allowed to dock to the outer areasa
auto func = [](KDDockWidgets::DropLocation location,
const KDDockWidgets::DockWidgetBase::List &source,
const KDDockWidgets::DockWidgetBase::List &target,
KDDockWidgets::DropArea *) {
Q_UNUSED(target); // When dragging into a tab, 'target' would have the list of already tabbed dock widgets
const bool isDraggingDW8 = std::find_if(source.cbegin(), source.cend(), [](KDDockWidgets::DockWidgetBase *dw) {
return dw->uniqueName() == QLatin1String("DockWidget #8");
})
!= source.cend();
return (location & KDDockWidgets::DropLocation_Outter) || !isDraggingDW8;
};
KDDockWidgets::Config::self().setDropIndicatorAllowedFunc(func);
}
KDDockWidgets::Config::self().setFlags(flags);
const bool nonClosableDockWidget0 = parser.isSet(nonClosableDockWidget);
const bool restoreIsRelative = parser.isSet(relativeRestore);
const bool nonDockableDockWidget9 = parser.isSet(nonDockable);
const bool maxSizeForDockWidget8 = parser.isSet(maxSizeOption);
const bool dontCloseDockWidget5BeforeRestore = parser.isSet(dontCloseBeforeRestore);
const bool usesMainWindowsWithAffinity = parser.isSet(multipleMainWindows);
const bool dock0BlocksCloseEvent = parser.isSet(blockCloseEvent);
MyMainWindow mainWindow(QStringLiteral("MyMainWindow"), options, nonClosableDockWidget0, nonDockableDockWidget9, restoreIsRelative);
#ifdef KDDOCKWIDGETS_SUPPORTS_NESTED_MAINWINDOWS
const bool usesDockableMainWindows = parser.isSet(dockableMainWindows);
#else
const bool usesDockableMainWindows = false;
#endif
MyMainWindow mainWindow(QStringLiteral("MyMainWindow"), options, nonClosableDockWidget0,
nonDockableDockWidget9, restoreIsRelative, maxSizeForDockWidget8,
dontCloseDockWidget5BeforeRestore, dock0BlocksCloseEvent);
mainWindow.setWindowTitle("Main Window 1");
mainWindow.resize(1200, 1200);
mainWindow.show();
if (parser.isSet(multipleMainWindows)) {
if (usesMainWindowsWithAffinity) {
if (usesDockableMainWindows) {
qWarning() << "MainWindows with affinity option is incompatible with Dockable Main Windows option";
return 1;
}
// By default a dock widget can dock into any main window.
// By setting an affinity name we can prevent that. Dock widgets of different affinities are incompatible.
const QString affinity = parser.isSet(incompatibleMainWindows) ? QStringLiteral("affinity1")
: QString();
auto mainWindow2 = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
nonClosableDockWidget0, nonDockableDockWidget9, restoreIsRelative, affinity);
nonClosableDockWidget0, nonDockableDockWidget9,
restoreIsRelative, maxSizeForDockWidget8,
dontCloseDockWidget5BeforeRestore, dock0BlocksCloseEvent, affinity);
if (affinity.isEmpty())
mainWindow2->setWindowTitle("Main Window 2");
else
@@ -153,7 +327,35 @@ int main(int argc, char **argv)
mainWindow2->resize(1200, 1200);
mainWindow2->show();
} else if (usesDockableMainWindows) {
auto mainWindowDockWidget = new DockWidget(QStringLiteral("MyMainWindow-2-DW"));
const QString affinity = QStringLiteral("Inner-DockWidgets-2");
auto dockableMainWindow = new MyMainWindow(QStringLiteral("MyMainWindow-2"), options,
false, false, restoreIsRelative, false,
false, false, affinity);
dockableMainWindow->setAffinities({ affinity });
dockableMainWindow->setStyleSheet(QStringLiteral("background: yellow"));
dockableMainWindow->setWindowTitle("Dockable Main Window");
dockableMainWindow->show();
mainWindowDockWidget->setWidget(dockableMainWindow);
mainWindowDockWidget->show();
mainWindowDockWidget->resize(800, 800);
}
const QStringList args = parser.positionalArguments();
if (args.size() >= 1) {
const QString sourceJsonFileName = args[0];
KDDockWidgets::LayoutSaver loader;
if (!loader.restoreFromFile(sourceJsonFileName)) {
qWarning() << Q_FUNC_INFO << "Failed to restore from" << sourceJsonFileName;
return 1;
}
}
return app.exec();
}

View File

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

View File

@@ -0,0 +1,95 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyWidget.h"
#include <kddockwidgets/DockWidget.h>
#include <kddockwidgets/MainWindow.h>
#include <kddockwidgets/MDIArea.h>
#include <QStyleFactory>
#include <QApplication>
#include <QCommandLineParser>
// clazy:excludeall=qstring-allocations
int main(int argc, char **argv)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication app(argc, argv);
app.setOrganizationName(QStringLiteral("KDAB"));
app.setApplicationName(QStringLiteral("App supporting both docking and a MDI area"));
QCommandLineParser parser;
parser.setApplicationDescription("KDDockWidgets MDI mixed with normal docking");
parser.addHelpOption();
QCommandLineOption nestedDocking("n", QCoreApplication::translate("main", "The MDI dock widgets will serve as drop areas, allowing for further nesting"));
parser.addOption(nestedDocking);
parser.process(app);
// Fusion looks better in general, but feel free to change
qApp->setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
// # 1. Create our main window
KDDockWidgets::MainWindow mainWindow(QStringLiteral("MyMainWindow"), KDDockWidgets::MainWindowOption_HasCentralWidget);
mainWindow.setWindowTitle("Main Window");
mainWindow.resize(1600, 1200);
mainWindow.show();
// # 2. Create a dock widget, it needs a unique name
auto dock1 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock1"));
auto widget1 = new MyWidget1();
dock1->setWidget(widget1);
auto dock2 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock2"));
auto widget2 = new MyWidget2();
dock2->setWidget(widget2);
// # 3. Dock them
mainWindow.addDockWidget(dock1, KDDockWidgets::Location_OnLeft, nullptr, KDDockWidgets::InitialOption(QSize(300, 0)));
mainWindow.addDockWidget(dock2, KDDockWidgets::Location_OnBottom, nullptr, KDDockWidgets::InitialOption(QSize(0, 300)));
KDDockWidgets::DockWidgetBase::Options options = {};
if (parser.isSet(nestedDocking)) {
options |= KDDockWidgets::DockWidgetBase::Option_MDINestable;
}
// 4. Create our MDI widgets, which will go into the MDI area
auto mdiWidget1 = new KDDockWidgets::DockWidget(QStringLiteral("MDI widget1"), options);
mdiWidget1->setWidget(new MyWidget1());
auto mdiWidget2 = new KDDockWidgets::DockWidget(QStringLiteral("MDI widget2"), options);
mdiWidget2->setWidget(new MyWidget2());
auto mdiWidget3 = new KDDockWidgets::DockWidget(QStringLiteral("MDI widget3"), options);
auto widget3 = new MyWidget3();
mdiWidget3->setWidget(widget3);
// Just for my personal testing: Overkill to add an option
// widget3->blockCloseEvent();
auto mdiArea = new KDDockWidgets::MDIArea();
mainWindow.setPersistentCentralWidget(mdiArea);
mdiArea->addDockWidget(mdiWidget1, QPoint(10, 10));
mdiArea->addDockWidget(mdiWidget2, QPoint(50, 50));
mdiArea->addDockWidget(mdiWidget3, QPoint(110, 110));
return app.exec();
}

View File

@@ -0,0 +1,32 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# 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)
# Just to reuse MyWidget.h
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/)
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,65 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#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);
// Just for my personal testing: Overkill to add an option
// widget3->blockCloseEvent();
// # 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

@@ -0,0 +1,29 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
cmake_minimum_required(VERSION 3.7)
project(kddockwidgets_minimal_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_example main.cpp ../dockwidgets/MyWidget.cpp ${RESOURCES_EXAMPLE_SRC})
target_link_libraries(kddockwidgets_minimal_example PRIVATE KDAB::kddockwidgets)

View File

@@ -0,0 +1,116 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#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,69 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#ifndef 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

86
examples/minimal/main.cpp Normal file
View File

@@ -0,0 +1,86 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#include "MyWidget.h"
#include <kddockwidgets/DockWidget.h>
#include <kddockwidgets/MainWindow.h>
#include <QStyleFactory>
#include <QApplication>
// clazy:excludeall=qstring-allocations
using namespace KDDockWidgets;
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::MainWindow 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 MyWidget();
dock1->setWidget(widget1);
auto dock2 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock2"));
auto widget2 = new MyWidget(QStringLiteral(":/assets/base.png"),
QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"));
dock2->setWidget(widget2);
auto dock3 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock3"));
auto widget3 = new MyWidget(QStringLiteral(":/assets/base.png"),
QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"));
dock3->setWidget(widget3);
auto dock4 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock4"));
auto widget4 = new MyWidget(QStringLiteral(":/assets/base.png"),
QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"));
dock4->setWidget(widget4);
auto dock5 = new KDDockWidgets::DockWidget(QStringLiteral("MyDock5"));
auto widget5 = new MyWidget(QStringLiteral(":/assets/base.png"),
QStringLiteral(":/assets/KDAB_bubble_fulcolor.png"));
dock5->setWidget(widget5);
// 3. Add them to the main window
mainWindow.addDockWidget(dock1, KDDockWidgets::Location_OnLeft);
mainWindow.addDockWidget(dock2, KDDockWidgets::Location_OnTop);
// 4. Add dock3 to the right of dock2
mainWindow.addDockWidget(dock3, KDDockWidgets::Location_OnRight, dock2);
// 5. dock4 is docked at the bottom, with 200px height
const QSize preferredSize(QSize(/*ignored*/ 0, 200));
mainWindow.addDockWidget(dock4, KDDockWidgets::Location_OnBottom, nullptr, preferredSize);
// 5. dock5 will be its own top level (floating window)
dock5->show();
return app.exec();
}

View File

@@ -0,0 +1,17 @@
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
add_subdirectory(customtitlebar)
add_subdirectory(dockwidgets)
add_subdirectory(mdi)
set_compiler_flags(kddockwidgets_example_quick)
set_compiler_flags(kddockwidgets_example_mdi_quick)
set_compiler_flags(kddockwidgets_customtitlebar_quick)

View File

@@ -0,0 +1,31 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Sergio Martins <sergio.martins@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
cmake_minimum_required(VERSION 3.7)
project(kddockwidgets_customtitlebar_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_example.qrc
${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc
)
add_executable(kddockwidgets_customtitlebar_quick main.cpp ${RESOURCES_EXAMPLE_SRC})
target_link_libraries(kddockwidgets_customtitlebar_quick PRIVATE KDAB::kddockwidgets)

View File

@@ -0,0 +1,36 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sergio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
import QtQuick 2.9
Item {
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,18 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sergio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
import QtQuick 2.9
Guest {
anchors.fill: parent
background: "qrc:/assets/triangles.png"
logo: "qrc:/assets/KDAB_bubble_white.png"
}

View File

@@ -0,0 +1,17 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sergio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
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-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sergio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
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,54 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sergio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
import QtQuick 2.6
// Will be moved to a plugin in the future
import "qrc:/kddockwidgets/private/quick/qml/" as KDDW
KDDW.TitleBarBase {
id: root
color: "black"
border.color: "orange"
border.width: 2
heightWhenVisible: 50
Text {
color: "orange"
font.bold: true
text: root.title
anchors {
left: parent.left
leftMargin: 10
verticalCenter: root.verticalCenter
}
}
Rectangle {
id: closeButton
enabled: root.closeButtonEnabled
radius: 5
color: "green"
height: root.height - 20
width: height
anchors {
right: root.right
rightMargin: 10
verticalCenter: root.verticalCenter
}
MouseArea {
anchors.fill: parent
onClicked: {
root.closeButtonClicked();
}
}
}
}

View File

@@ -0,0 +1,71 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sergio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
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 <QQuickView>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
class CustomFrameworkWidgetFactory : public KDDockWidgets::DefaultWidgetFactory
{
public:
~CustomFrameworkWidgetFactory() override;
QUrl titleBarFilename() const override
{
return QUrl("qrc:/MyTitleBar.qml");
}
};
CustomFrameworkWidgetFactory::~CustomFrameworkWidgetFactory() = default;
int main(int argc, char *argv[])
{
#ifdef Q_OS_WIN
QGuiApplication::setAttribute(Qt::AA_UseOpenGLES);
#endif
QGuiApplication app(argc, argv);
auto &config = KDDockWidgets::Config::self();
auto flags = config.flags();
config.setFlags(flags);
config.setFrameworkWidgetFactory(new CustomFrameworkWidgetFactory());
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(800, 800));
dw1->show();
auto dw2 = new KDDockWidgets::DockWidgetQuick("Dock #2");
dw2->setWidget(QStringLiteral("qrc:/Guest2.qml"));
dw2->resize(QSize(800, 800));
dw2->show();
auto dw3 = new KDDockWidgets::DockWidgetQuick("Dock #3");
dw3->setWidget(QStringLiteral("qrc:/Guest3.qml"));
dw1->addDockWidgetToContainingWindow(dw3, KDDockWidgets::Location_OnRight);
KDDockWidgets::MainWindowBase *mainWindow = KDDockWidgets::DockRegistry::self()->mainwindows().constFirst();
mainWindow->addDockWidget(dw2, KDDockWidgets::Location_OnTop);
return app.exec();
}

View File

@@ -0,0 +1,27 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: 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: 800
KDDW.MainWindowLayout {
id: dockWidgetArea
anchors.fill: parent
uniqueName: "MyMainLayout"
}
}

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