undocking/detaching toolviews to regular windows instead of tool windows
kfunk at kde.org
Sat Oct 14 10:34:31 BST 2017
On Friday, 13 October 2017 22:13:05 CEST René J.V. Bertin wrote:
> On Thursday October 12 2017 15:43:16 Kevin Funk wrote:
> >Seems to do the job. But please investigate some more yourself, please make
> >sure that doesn't break any other integration within the Sublime
> >architecture. Only then file a patch,
> Almost there...
> >best with some unit test.
> I think the test_viewactivation test could be adapted to use
> IdealDockWidgets instead of QDockWidgets, but that requires exporting at
> least IdealDockController, IdealButtonBarWidget, IdealToolWidget and
> IdealLayout (I've already exported IdealDockWidgets itself so that doc
> plugins can configure it to use regular instead of floating windows).
> I guess that those classes would require exporting for any unittest, is that
> worth it? I mean, you cannot really unit-test how those windows behave, if
> they render their content as it should etc, can you?
That probably makes sense, yes.
Note that we shouldn't export the symbols of those classes in all cases (as it
has an performance impact).
Please try to use something like this (just hacked this together) for classes
only needed to be exported for unit tests:
diff --git a/kdevplatform/config-kdevplatform.h.cmake b/kdevplatform/config-
index 7e3bdd9e0a..4ae2c01dd6 100644
@@ -3,4 +3,12 @@
#define KDEV_ITEMREPOSITORY_VERSION @KDEV_ITEMREPOSITORY_VERSION@
+#define KDEV_AUTOTEST_EXPORT(EXPORT_DEFINE) EXPORT_DEFINE
diff --git a/kdevplatform/sublime/idealbuttonbarwidget.h b/kdevplatform/
index f087f8ce7c..88289e4e71 100644
@@ -23,6 +23,9 @@
@@ -40,7 +43,7 @@ class IdealDockWidget;
-class IdealButtonBarWidget: public QWidget
+class KDEV_AUTOTEST_EXPORT(KDEVPLATFORMSUBLIME_EXPORT) IdealButtonBarWidget:
> FWIW, I also get the test to link when I add the source files for the
> classes above to the test sources. The result doesn't crash straight away.
Yep, but that a) increases compile, b) you need to collectively add all the
source files a certain source file depends on, too (maintenance burden)
Better use something like above.
> I know this is safe with C, but is it also safe with C++?
I think that hasn't anything to do with whether it's C or C++
Kevin Funk | kfunk at kde.org | http://kfunk.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 163 bytes
Desc: This is a digitally signed message part.
More information about the KDevelop