Commit Graph

3536 Commits

Author SHA1 Message Date
Sergio Martins
0f2da43737 Rename guestWidget to guestView
As we deal in View now
2022-04-07 20:12:47 +01:00
Sergio Martins
558bd42447 tests: Remove more QWidget dependencies 2022-04-07 00:49:36 +01:00
Sergio Martins
7107bfe3e6 Remove _qtwidget include from utils.h 2022-04-07 00:40:25 +01:00
Sergio Martins
be150c1c52 Port DockRegistry away from QGuiApplication::focusObjectChanged
Use the Qt agnostic way, from Platform.h
2022-04-07 00:24:06 +01:00
Sergio Martins
9f4cb1a13e Port FocusScope away from QGuiApplication 2022-04-05 23:01:29 +01:00
Sergio Martins
0addad590e ViewGuard: Add a -> const operator too
So we can call it if const
2022-04-05 23:00:20 +01:00
Sergio Martins
793e48150a Don't access qApp directly from Platform's ctor
QApplication might not be created yet, so delay it
With a timer for now. Don't guarantee this will stay.
Explicit init by the user might be an alternative.
2022-04-05 22:29:01 +01:00
Sergio Martins
3ba4bc2d08 Add Platform::focusedView() and respective signal
Implemented as QGuiApplication::focusObjectChanged() for Qt,
other frontends will have their own impl.
2022-04-05 21:53:52 +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
ad3febd87e Add copyright headers to tst_viewguard 2022-04-05 21:29:35 +01:00
Sergio Martins
3e4d172765 ViewGuard: Add a copy-ctor 2022-04-05 21:29:35 +01:00
Waqar Ahmed
607ec01feb Extend tst_viewguard to test signal trigger after destruction 2022-04-06 01:13:50 +05:00
Sergio Martins
dc14a309a7 ViewGuard: Fix potential crash if the ViewGuard is deleted.
There was nothing disconnecting from the lambda.
Probably KDBindings needs a ConnectionHolder RAII class
2022-04-05 20:28:05 +01:00
Sergio Martins
fdc56b938e ViewGuard: Fix ctor and assign operator having different behaviours
The difference was very small: The ctor honoured View::inDtor()
while the assign op didn't. It's easy to make them behave the same
by creating a setView() method

As a side-effect the duplicate connect() is also gone now
2022-04-05 20:25:14 +01:00
Sergio Martins
4b62714ef5 ViewGuard: Fix clear() not disconnecting
When clear is called we should disconnect the signal, as it won't
be needed anymore. Benign though.
2022-04-05 20:18:09 +01:00
Sergio Martins
2763aec6c2 ViewGuard: Fix English typo in comment 2022-04-05 20:15:05 +01:00
Sergio Martins
73b874ec0b Remove stray qDebug from Platform.cpp 2022-04-05 20:10:24 +01:00
Sergio Martins
124b521308 ViewGuard: Add copyright headers
Some formatting too.
2022-04-05 20:09:24 +01:00
Waqar Ahmed
b573d3f0f7 Introduce ViewGuard: A weak ptr to View 2022-04-05 17:05:17 +05:00
Waqar Ahmed
84497f422d Fix fallthrough warning 2022-04-05 10:11:46 +01:00
Sergio Martins
ccd7557c75 Add View::beingDestroyed signal
It's emitted in ~View
2022-04-05 10:11:37 +01:00
Sergio Martins
1116eff816 Don't create ViewWrappers with nullptr
Instead return a null shared ptr
2022-04-04 22:36:16 +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
c94705593f Update qtquick stubs
Not compilable yet, but not in cmake either
2022-04-04 21:54:27 +01:00
Sergio Martins
4f0f82f6b4 Add ViewWrapper_qtquick stub 2022-04-04 21:52:41 +01:00
Sergio Martins
b76e45064f Add View_qtquick stub 2022-04-04 19:06:17 +01:00
Sergio Martins
97653f03be qtquick: Move old (unported) files to old/ folder
We'll start moving them to views/ and cleaning/porting them
2022-04-04 18:35:12 +01:00
Waqar Ahmed
96f3100f77 Cleanup nlohmann_qt_helpers 2022-04-04 22:27:29 +05:00
Waqar Ahmed
06501c8a70 Header include guards for nlohmann_qt_helpers 2022-04-04 22:20:59 +05:00
Waqar Ahmed
dc93db9276 Add nlohmann QDebug helper 2022-04-04 22:20:59 +05:00
Waqar Ahmed
d6e678883c remove toVariantMap/fromVariantMap functions 2022-04-04 21:51:16 +05:00
Waqar Ahmed
3c424474ee Restore layout using nlohmann directly 2022-04-04 21:51:16 +05:00
Sergio Martins
631736b202 Abstract away a call to qApp->activePopupWidget()
It's now generic and doesn't depend on QApplication.
Removes an ifdef.
2022-04-04 16:43:01 +01:00
Sergio Martins
495ef0dd6a Move QmlTypes references out of DockRegistry
As it's specific to QtQuick
2022-04-04 16:36:17 +01:00
Sergio Martins
2a379d8735 Add Platform_qtquick
CMake hacked for now. Not sure if we should allow building
both QtWidgets and QtQuick frontends at the same time
2022-04-04 16:30:57 +01:00
Sergio Martins
6fcc55ce60 Add missing include 2022-04-04 16:30:41 +01:00
Sergio Martins
a36f85aae3 Add Platform and Platform_qtwidgets
So we can start removing QtWidgets vs QtQuick ifdefs.
Each "platform" will implement the differences
2022-04-04 16:21:35 +01:00
Sergio Martins
ac5cb637e7 Move DebugWindow to qtwidgets
As it's QtWidgets specific
2022-04-04 14:51:15 +01:00
Allen Winter
185ef5eb63 appveyor.yml - exclude wip/v2 branch 2022-04-04 14:51:15 +01:00
Waqar Ahmed
46b4e50a23 Save layout directly using nlohmann 2022-04-04 12:28:06 +05:00
Sergio Martins
e593233b8f Renamed views_qtwidgets/ into qtwidgets/views/
As there will be some files that are specific to QtWidgets and
but aren't views
2022-04-03 23:51:02 +01:00
Sergio Martins
852ff762c5 Rename views_qtquick/ qtquick/views/ 2022-04-03 23:44:31 +01:00
Sergio Martins
c12b0c161f Port layoutlinter away from direct QtWidget dependencies 2022-04-03 23:43:02 +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
ad1b77f79e Add MainWindow view interface 2022-04-03 22:25:57 +01:00
Sergio Martins
6cbf7247ce Fix crash, was mis-ported 2022-04-03 21:29:04 +01:00
Sergio Martins
d5700d94e6 MainWindow controller now receives View parent instead of QWidget 2022-04-03 21:23:03 +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