Commit Graph

37 Commits

Author SHA1 Message Date
Sergio Martins
ee256284cc Remove View::isWindow(), use isRootView() instead.
QWidget::isWindow() is misnamed in Qt, it's an artifact from Qt4
times.
2022-04-30 01:10:24 +01:00
Sergio Martins
f3934ebd2c Rename View::isTopLevel() to isRootView() 2022-04-30 01:06:03 +01:00
Sergio Martins
3d1b450cbb Remove View::minimumSizeHint()
It's a QWidget specific concept, so move it to the qtwidgets
frontendcode. QtQuick won't need it.
2022-04-29 00:27:07 +01:00
Sergio Martins
1b8ac876ce Port away from WidgetType typedef
Introduces View::childViews(), required for the porting
2022-04-26 00:13:07 +01:00
Sergio Martins
420a85943a Finally remove View::asQWidget()
Soon we can start the QtQuick port to the new architecture
2022-04-26 00:00:23 +01:00
Sergio Martins
0f61ef63a2 Split DropArea and MDILayout into View/Controller 2022-04-25 18:50:41 +01:00
Sergio Martins
6ebb432932 Port LayoutWidget away from QWidget
DropArea and MDILayout now inherit from it, in addittion to QWidget.
This mean DropArea can now be split into View/Controller alone,
without having to port LayoutWidget and MDILayout in the same commit,
which would be hard to review.
2022-04-24 12:57:20 +01:00
Sergio Martins
dc6d77e266 Fold MultiSplitter into DropArea
The separation was never very useful. There's was always only
one derived class, the DropArea. Merge the two.
2022-04-23 15:22:38 +01:00
Sergio Martins
6d2d5ca0ed Add View::setMouseTracking() 2022-04-21 22:50:46 +01:00
Sergio Martins
e71c54f041 Add View::setCursor() 2022-04-21 22:41:52 +01:00
Sergio Martins
f9c3a301b5 Add View::render() 2022-04-21 22:31:11 +01:00
Sergio Martins
2c162630f4 Add View::setWindowOpacity() 2022-04-21 22:24:18 +01:00
Sergio Martins
554deb22da Add View::releaseKeyboard(), removes some asQWidget() usage 2022-04-21 20:13:10 +01:00
Sergio Martins
0249b0e933 Remove more usages of asQWidget()
Adds View::mapTo()
2022-04-20 23:18:41 +01:00
Sergio Martins
a3d1990857 tests: Port more tests away from asQWidget() 2022-04-14 18:05:23 +01:00
Sergio Martins
d6fd54cec4 Por all usages of QWindop/windowHandle to KDDockWidgets::Window
Removes a lot of asQWidget() code and is also prepared for non-Qt
views.
2022-04-09 19:21:56 +01:00
Sergio Martins
43faf85eb4 Add View::isNull()
ViewWrappers don't have ownership of the gui element.
The gui element might have been deleted, leaving us with a
stale wrapper

For impl simply use a QPointer in the QtWidgets and QtQuick
backends
2022-04-05 21:50:21 +01:00
Sergio Martins
ccd7557c75 Add View::beingDestroyed signal
It's emitted in ~View
2022-04-05 10:11:37 +01:00
Sergio Martins
55ab08129a Deal the wrappers in shared_ptr instead of unique_ptr
Easier to pass around and better for our use case, where we
actual can have shared usage
2022-04-04 22:14:19 +01:00
Sergio Martins
b76e45064f Add View_qtquick stub 2022-04-04 19:06:17 +01:00
Sergio Martins
84fb080d13 Remove more QWidget dependencies 2022-04-03 23:40:01 +01:00
Sergio Martins
81e5d14e4f Cleanup DropArea and base classes re receiving QWidget
They receive View now
2022-04-03 23:19:53 +01:00
Sergio Martins
e9f287e2d7 More porting away from _qtwidgets 2022-04-03 21:09:37 +01:00
Sergio Martins
79f9f72ef4 DockWidget: decouple more from QtWidgets 2022-04-03 20:06:31 +01:00
Sergio Martins
a70b419c34 Remove one usage of DockWidget_qtwidgets 2022-04-03 00:23:39 +01:00
Sergio Martins
9b18ffb05c Port away from asQWidget()->screen(), use screen() directly 2022-04-02 15:45:00 +01:00
Sergio Martins
dcdd9333d4 Remove a bunch of asQWidget() calls 2022-04-02 15:34:38 +01:00
Sergio Martins
8ea346ca4a Added View::asFrameController() 2022-03-31 18:39:52 +01:00
Sergio Martins
6687485e4c Introduce View::handle() and View::equals()
So we can compare two windows without calling asQWidget().
2022-03-31 17:34:37 +01:00
Sergio Martins
79abef21a5 Introduce View::parentView()
Similar to QWidget::parentWidget(), but not tied to QWidgets.

Allows to start removing some asQWidget() calls, as seen in Frame::floatingWindow(),
did it for POC.

Still need to find a generic way to compare 2 QWidget pointers
2022-03-31 16:47:37 +01:00
Sergio Martins
3fe1a8e79f Add View::asFloatingWindowController() 2022-03-31 16:27:37 +01:00
Sergio Martins
cb2930f0e9 Move Type enum out of View, into KDDockWidgets namespace 2022-03-31 11:45:28 +01:00
Sergio Martins
2574e91634 Add convenience View::is(Type) 2022-03-30 23:09:08 +01:00
Sergio Martins
15cb93ed43 Port away from Controller::window() returning a QWidget
It now returns a ViewWrapper, which is agnostic to QtWidgets
2022-03-30 19:30:18 +01:00
Sergio Martins
15601fc3c9 Split MainWindow into view/controller 2022-03-30 11:51:31 +01:00
Sergio Martins
90a9159748 Introduce ViewWrapper - a non-owning view
In many cases we need to access widgets that weren't created by
KDDW, in that case we have no View. Since all our APIs want to
deal in View and not in QWidget, we need a way to wrap stuff like
QWidget::window() and windowHandle()

All methods are unimplemented. Will only implement those that
are required/used.
2022-03-25 10:03:46 +00:00
Sergio Martins
c6d95c42a8 Split most widgets into a Controller and a View
Controllers don't have any GUI and don't depend on the frontend
technology.

Views are implemented in a specific GUI tech (QtWidgets, QtQuick, etc).

For now only QtWidgets work. There's still a lot to decouple.

This will make it easier to introduce non-Qt backends.
2022-03-24 16:05:37 +00:00