Commit Graph

43 Commits

Author SHA1 Message Date
Sergio Martins
da6df47706 Merge pull request #50 from KDAB/python
Python
2020-06-17 11:12:27 +01:00
Renato Araujo Oliveira Filho
a599736c1b Create Python bidings
Added Cmake files
Ported examples
2020-06-16 15:12:41 -03: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
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
d4d83111ff Added DockWidgetBase::isMainWindow() 2020-05-25 20:25:33 +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
d9badf3ffd Fix build 2020-05-25 06:10:18 +01:00
Sergio Martins
3d95263b40 Fix examples build with installed kddw 2020-05-23 19:00:12 +01:00
Sergio Martins
0c776b6595 Fix non-developer build 2020-05-22 12:26:21 +01:00
Sergio Martins
4917da9e7c Minor: factorout some code into DockWidget::saveLastFloatingGeometry() 2020-05-22 11:37:25 +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
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
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
adedcfd6db Use fully qualified types in signals 2020-05-17 19:06:24 +01:00
Sergio Martins
be1a2a3878 Fix build on Windows 2020-05-13 20:04:48 +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
Colin Ogilvie
68f0c64954 Add a DockWidgetBase::floatAction()
Helper action to allow docking/detaching
2020-04-30 13:39:02 +01:00
Sergio Martins
ab0fc1e328 Add DockWidget::Option_NonDockable
A dock widget with this option will always be floating and not be
able to dock into anything. Other widgets can't dock into it either.
2020-04-13 13:23:38 +01:00
Sergio Martins
acfd53672c Add DockWidget::raise()
Mostly like QWindow::raise(), but if in a tab widget, makes the tab
widget current too.
2020-03-24 22:06:13 +00:00
Sergio Martins
f77d052dbb Allow to change NonClosable mid game
Before it was immutable, now you can change it
2020-03-23 16:28:16 +00:00
Sergio Martins
cc1e1eaa51 Don't flicker when showing a floating dock widget
Create the FloatingWindow directly, instead of creating the DockWidget
then reparenting it
2020-03-07 21:15:44 +00:00
Sergio Martins
579b222418 Make AddingOption_StartHidden also work for tabs
You can now pass that option to DockWidget::addDockWidgetAsTab().
2020-02-19 16:36:50 +00:00
Sergio Martins
d6997eaf7f Introduce main window affinity
By default a dock widget can dock into any main window.
With affinities, we can now have a dock widget "belong" to a main window
and only be able to dock into it (or into other floating dock widgets
with the same affinity).

See DockWidgetBase::setAffinity() and MainWindowBase::setAffinity().
2020-02-09 21:02:21 +00:00
Sergio Martins
1cac350547 Add convenience method DockWidget::isOpen() 2020-02-01 19:47:16 +00:00
Allen Winter
df692686e7 various - update copyright year 2020-01-07 11:36:56 -05:00
Sergio Martins
945dbc1f27 Fix build with namespaced Qt
Fixes #18
2019-11-27 16:17:48 +00:00
Sergio Martins
b5fad9a601 docs++ 2019-10-05 12:54:25 +01:00
Sergio Martins
eb96288534 docs: Improved @file docs 2019-10-04 17:33:42 +01:00
Albert Astals Cid
262d57b890 Add a few const &
as suggested by clang-tidy
2019-09-30 15:57:03 +02:00
Sergio Martins
68a536bb67 Minor renaming, deserialize() no matches serialized() 2019-09-21 16:18:19 +01:00
Sergio Martins
c80a16d2c1 Also use the intermediate representation when serializing 2019-09-21 15:15:44 +01:00
Sergio Martins
65c9693a62 Restoring now reads from the intermediate representation
Only the intermediate representation is filled in from the stream
now. TODO: GUI->intermediate.
2019-09-20 17:24:22 +01:00
Sergio Martins
59cdadf386 Add DockWidgetBase::titleBar() 2019-08-24 22:55:06 +01:00
Sergio Martins
2a0e8f1404 Remove DockWidgetBase::setLocked()
It's not implemented and not sure we need it
2019-08-18 18:33:17 +01:00
Sergio Martins
5325b93573 Add a DockWidget::setLocked() stub 2019-08-08 22:31:14 +01:00
Sergio Martins
990e487fed rename name() to uniqueName() for readability 2019-08-08 22:30:29 +01:00
Sergio Martins
020571b6f5 The QtQuick stuff compiles now 2019-08-08 12:52:18 +01:00
Sergio Martins
89757def76 Abstract TabWidget away from QtWidgets, so can be used for QtQuick 2019-08-08 00:41:48 +01:00
Sergio Martins
eafc00657b Separator: Decouple the QWidget dependency
There's no Separator and SeparatorWidget. The former only with
state/logic. To be reused by QtQuick.
2019-08-06 13:32:06 +01:00
Sergio Martins
8742da76ae DockWidgetBase: Move layouting code into DockWidget.cpp
We don't want QWidget related code in the base class, to be
shared with QML
2019-08-06 12:58:07 +01:00
Sergio Martins
464ef4fd93 Move widget specific stuff from DockWidgetBase to DockWidget 2019-08-06 00:36:00 +01:00
Sergio Martins
fb837b7713 Move DockWidget.cpp into widgets/
As it's specific to QtWidgets. It's mostly empty now
and inheriting from DockWidgetBase, but we'll move a few stuff.
2019-08-05 23:35:44 +01:00