[rkward/frameworks] /: Another subdir is kdelibs4support-free. Mostly removing KVBox, and fixes to previous commit.
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Feb 12 20:33:17 UTC 2016
Git commit 21e0dd20152857f851838d29a4f4af26d214f420 by Thomas Friedrichsmeier.
Committed on 12/02/2016 at 20:32.
Pushed by tfry into branch 'frameworks'.
Another subdir is kdelibs4support-free. Mostly removing KVBox, and fixes to previous commit.
M +5 -1 TODO
M +1 -1 rkward/plugin/CMakeLists.txt
M +0 -1 rkward/plugin/rkmatrixinput.cpp
M +0 -1 rkward/plugin/rkoptionset.cpp
M +3 -4 rkward/plugin/rkpluginframe.cpp
M +0 -1 rkward/plugin/rkpreviewbox.cpp
M +4 -1 rkward/plugin/rkstandardcomponent.cpp
M +2 -2 rkward/plugin/rkstandardcomponentgui.cpp
M +1 -6 rkward/plugin/rktabpage.cpp
http://commits.kde.org/rkward/21e0dd20152857f851838d29a4f4af26d214f420
diff --git a/TODO b/TODO
index 3e5b843..0d82fcc 100644
--- a/TODO
+++ b/TODO
@@ -14,9 +14,13 @@ Things to test at the end:
- Moved installations, moved workspaces.
- Window embedding
Knwon issues to fix:
-- Initial window placement for plugins is completely borked. One way around this seems to be to inherit RKStandardComponentGUI from QDialog.
+- Initial window placement for plugins is completely borked. One way around this seems to be to inherit RKStandardComponentGUI from QDialog. Does that work for inline embedded plugins?
- Initial window placement for plots is always 0, 0 on screen 1, apparently. The above workaround may not be available, here?
+Minor layout stuff to fix in plugins:
+- Barplot: "Display values" should be checkable frame
+- Sort data: optionset should simply use vertical stacking, or fix the horizontal alignment
+
Upcoming porting efforts: Port from QtScript to QJSEngine:
- Unforunately, QJSEngine lacks support for pre-compiled JS (QScriptProgram), ATM (Qt 5.5). We'll need some other optimization.
- Idea: Use _one_ engine for each plugin, _including_ any embedded plugins. Wrap existing JS code into a closure, exporting only the "primary" functions as properties of an object.
diff --git a/rkward/plugin/CMakeLists.txt b/rkward/plugin/CMakeLists.txt
index a0bfaf8..42db6b9 100644
--- a/rkward/plugin/CMakeLists.txt
+++ b/rkward/plugin/CMakeLists.txt
@@ -32,4 +32,4 @@ SET(plugin_STAT_SRCS
)
ADD_LIBRARY(plugin STATIC ${plugin_STAT_SRCS})
-TARGET_LINK_LIBRARIES(plugin Qt5::Widgets Qt5::Script KF5::TextEditor KF5::KDELibs4Support)
+TARGET_LINK_LIBRARIES(plugin Qt5::Widgets Qt5::Script KF5::TextEditor KF5::WindowSystem)
diff --git a/rkward/plugin/rkmatrixinput.cpp b/rkward/plugin/rkmatrixinput.cpp
index 5265d9b..c842968 100644
--- a/rkward/plugin/rkmatrixinput.cpp
+++ b/rkward/plugin/rkmatrixinput.cpp
@@ -24,7 +24,6 @@
#include "../misc/rktableview.h"
#include "../dataeditor/rktextmatrix.h"
#include "kstandardaction.h"
-#include "kaction.h"
#include "klocale.h"
#include "../misc/xmlhelper.h"
diff --git a/rkward/plugin/rkoptionset.cpp b/rkward/plugin/rkoptionset.cpp
index 7baf808..8f88cf6 100644
--- a/rkward/plugin/rkoptionset.cpp
+++ b/rkward/plugin/rkoptionset.cpp
@@ -26,7 +26,6 @@
#include <QMimeData>
#include <klocale.h>
-#include <kvbox.h>
#include "rkstandardcomponent.h"
#include "../misc/rkcommonfunctions.h"
diff --git a/rkward/plugin/rkpluginframe.cpp b/rkward/plugin/rkpluginframe.cpp
index 30ce7a6..bc5a79d 100644
--- a/rkward/plugin/rkpluginframe.cpp
+++ b/rkward/plugin/rkpluginframe.cpp
@@ -20,8 +20,6 @@
#include <QVBoxLayout>
#include <QGroupBox>
-#include <kvbox.h>
-
#include "../rkglobals.h"
#include "../misc/xmlhelper.h"
#include "../debug.h"
@@ -36,8 +34,9 @@ RKPluginFrame::RKPluginFrame (const QDomElement &element, RKComponent *parent_co
frame = new QGroupBox (xml->i18nStringAttribute (element, "label", QString(), DL_INFO), this);
layout->addWidget (frame);
layout = new QVBoxLayout (frame);
- page = new KVBox (frame);
- static_cast<KVBox*> (page)->setSpacing (RKGlobals::spacingHint ());
+ page = new QWidget (frame);
+ QVBoxLayout *pagelayout = new QVBoxLayout (page);
+ pagelayout->setSpacing (RKGlobals::spacingHint ());
layout->addWidget (page);
checked = 0;
diff --git a/rkward/plugin/rkpreviewbox.cpp b/rkward/plugin/rkpreviewbox.cpp
index 738b031..256cf94 100644
--- a/rkward/plugin/rkpreviewbox.cpp
+++ b/rkward/plugin/rkpreviewbox.cpp
@@ -23,7 +23,6 @@
#include <QTextDocument>
#include <klocale.h>
-#include <kvbox.h>
#include "../rkglobals.h"
#include "../rbackend/rinterface.h"
diff --git a/rkward/plugin/rkstandardcomponent.cpp b/rkward/plugin/rkstandardcomponent.cpp
index 0f2efe5..58488be 100644
--- a/rkward/plugin/rkstandardcomponent.cpp
+++ b/rkward/plugin/rkstandardcomponent.cpp
@@ -608,6 +608,8 @@ void RKComponentBuilder::buildElement (const QDomElement &element, XMLHelper &xm
buildElement (e, xml, frame->getPage (), false);
} else if (e.tagName () == QLatin1String ("tabbook")) {
QTabWidget *tabbook = new QTabWidget (parent_widget);
+ // this is not an RKComponent, so we need to add it, manually
+ parent_widget->layout ()->addWidget (tabbook);
QDomNodeList tabs = e.childNodes ();
for (int t=0; t < tabs.count (); ++t) {
QDomElement tab_e = tabs.item (t).toElement ();
@@ -657,7 +659,6 @@ void RKComponentBuilder::buildElement (const QDomElement &element, XMLHelper &xm
}
}
widget = new RKPreviewBox (e, component (), parent_widget);
- parent_widget->layout ()->addWidget (widget);
} else if (e.tagName () == QLatin1String ("saveobject")) {
widget = new RKPluginSaveObject (e, component (), parent_widget);
} else if (e.tagName () == QLatin1String ("embed")) {
@@ -672,6 +673,8 @@ void RKComponentBuilder::buildElement (const QDomElement &element, XMLHelper &xm
// TODO we should use a specialized pushbutton, that changes color if the corresponding component is dissatisfied!
QPushButton *button = new QPushButton (dummy, parent_widget);
component ()->connect (button, &QPushButton::clicked, swidget, &RKStandardComponent::showGUI);
+ add_to_layout = false;
+ parent_widget->layout ()->addWidget (button);
} else {
widget = handle->invoke (component (), parent_widget);
}
diff --git a/rkward/plugin/rkstandardcomponentgui.cpp b/rkward/plugin/rkstandardcomponentgui.cpp
index 6c533f6..a130e7e 100644
--- a/rkward/plugin/rkstandardcomponentgui.cpp
+++ b/rkward/plugin/rkstandardcomponentgui.cpp
@@ -19,7 +19,6 @@
#include <klocale.h>
#include <kactioncollection.h>
-#include <kvbox.h>
#include <qtimer.h>
#include <qpushbutton.h>
@@ -179,7 +178,8 @@ void RKStandardComponentGUI::createDialog (bool switchable) {
QHBoxLayout *hbox = new QHBoxLayout (central_widget);
// build standard elements
- main_widget = new KVBox (central_widget);
+ main_widget = new QWidget (central_widget);
+ new QVBoxLayout (main_widget);
main_widget->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); // HACK to achieve sane initial size. Will be reset to Preferred/Preferred after show.
hbox->addWidget (main_widget);
diff --git a/rkward/plugin/rktabpage.cpp b/rkward/plugin/rktabpage.cpp
index d3b98d5..cdd2583 100644
--- a/rkward/plugin/rktabpage.cpp
+++ b/rkward/plugin/rktabpage.cpp
@@ -21,8 +21,6 @@
#include <qtabwidget.h>
#include <QVBoxLayout>
-#include <kvbox.h>
-
#include "../rkglobals.h"
#include "../misc/xmlhelper.h"
#include "../debug.h"
@@ -34,14 +32,11 @@ RKTabPage::RKTabPage (const QDomElement &element, RKComponent *parent_component,
label = xml->i18nStringAttribute (element, "label", QString (), DL_WARNING);
QVBoxLayout *layout = new QVBoxLayout (this);
- page = new KVBox (this);
- layout->addWidget (page);
+ page = this;
tabbook = parent_widget;
tabbook->addTab (this, label);
index = tabbook->indexOf (this);
- // for whatever reason, this needs to be set *after* the page was added to the tabbook
- page->setSizePolicy (QSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding));
inserted = true;
connect (visibility_property, &RKComponentPropertyBase::valueChanged, this, &RKTabPage::visibleEnabledChanged);
More information about the rkward-tracker
mailing list