[rkward-cvs] SF.net SVN: rkward: [2225] branches/KDE4_port/rkward/plugin

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Nov 15 00:37:10 UTC 2007


Revision: 2225
          http://rkward.svn.sourceforge.net/rkward/?rev=2225&view=rev
Author:   tfry
Date:     2007-11-14 16:37:09 -0800 (Wed, 14 Nov 2007)

Log Message:
-----------
Continuing to remove Qt3 support code

Modified Paths:
--------------
    branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp
    branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.cpp
    branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.h
    branches/KDE4_port/rkward/plugin/rktabpage.cpp
    branches/KDE4_port/rkward/plugin/rktabpage.h

Modified: branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp	2007-11-14 23:51:13 UTC (rev 2224)
+++ branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp	2007-11-15 00:37:09 UTC (rev 2225)
@@ -18,20 +18,17 @@
 #include "rkstandardcomponent.h"
 
 #include <qfileinfo.h>
-#include <qlayout.h>
-#include <q3vbox.h>
-#include <q3hbox.h>
 #include <q3groupbox.h>
-#include <q3frame.h>
 #include <qtabwidget.h>
 #include <qlabel.h>
 #include <qapplication.h>
 #include <qtimer.h>
-//Added by qt3to4:
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
 
 #include <klocale.h>
 #include <kmessagebox.h>
+#include <kvbox.h>
+#include <khbox.h>
 
 #include "rkstandardcomponentgui.h"
 #include "../scriptbackends/phpbackend.h"
@@ -134,9 +131,8 @@
 				build_wizard = false;
 
 				QWidget *fake_page = parent_component->addPage ();
-				Q3VBoxLayout *layout = new Q3VBoxLayout (fake_page);	
-				Q3VBox *box = new Q3VBox (fake_page);
-				box->setSpacing (RKGlobals::spacingHint ());
+				QVBoxLayout *layout = new QVBoxLayout (fake_page);	
+				KVBox *box = new KVBox (fake_page);
 				layout->addWidget (box);
 				parent_widget = box;
 			}
@@ -500,38 +496,41 @@
 
 		if (allow_pages && (e.tagName () == "page")) {
 			widget = component ()->addPage ();
-			Q3VBoxLayout *layout = new Q3VBoxLayout (widget);
-			Q3VBox *box = new Q3VBox (widget);
-			box->setSpacing (RKGlobals::spacingHint ());
+			QVBoxLayout *layout = new QVBoxLayout (widget);
+			KVBox *box = new KVBox (widget);
 			layout->addWidget (box);
 			buildElement (e, box, false);
 		} else if (e.tagName () == "row") {
 			widget = new RKComponent (component (), parent_widget);		// wrapping this (and column, frame below) inside an RKComponent has the benefit, that it can have an id, and hence can be set to visibile/hidden, enabled/disabled
-			Q3VBoxLayout *layout = new Q3VBoxLayout (widget);
-			Q3HBox *box = new Q3HBox (widget);
-			box->setSpacing (RKGlobals::spacingHint ());
+			QVBoxLayout *layout = new QVBoxLayout (widget);
+			layout->setContentsMargins (0, 0, 0, 0);
+			KHBox *box = new KHBox (widget);
 			layout->addWidget (box);
 			buildElement (e, box, false);
 		} else if (e.tagName () == "stretch") {
 			QWidget *stretch = new QWidget (parent_widget);
 			stretch->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-			Q3HBox *box = dynamic_cast<Q3HBox *> (parent_widget);
+			KHBox *box = dynamic_cast<KHBox *> (parent_widget);
 			// RK_ASSERT (box);  <- NO, also meaningful in a <frame>
 			if (box) box->setStretchFactor (stretch, 100);
 		} else if (e.tagName () == "column") {
 			widget = new RKComponent (component (), parent_widget);
-			Q3VBoxLayout *layout = new Q3VBoxLayout (widget);
-			Q3VBox *box = new Q3VBox (widget);
-			box->setSpacing (RKGlobals::spacingHint ());
+			QVBoxLayout *layout = new QVBoxLayout (widget);
+			layout->setContentsMargins (0, 0, 0, 0);
+			KVBox *box = new KVBox (widget);
 			layout->addWidget (box);
 			buildElement (e, box, false);
 		} else if (e.tagName () == "frame") {
 			widget = new RKComponent (component (), parent_widget);
-			Q3VBoxLayout *layout = new Q3VBoxLayout (widget);
-			Q3GroupBox *box = new Q3GroupBox (1, Qt::Horizontal, e.attribute ("label"), widget);
-			box->setInsideSpacing (RKGlobals::spacingHint ());
+			QVBoxLayout *layout = new QVBoxLayout (widget);
+			layout->setContentsMargins (0, 0, 0, 0);
+			QGroupBox *box = new QGroupBox (e.attribute ("label"), widget);
 			layout->addWidget (box);
-			buildElement (e, box, false);
+			QVBoxLayout* internal_layout = new QVBoxLayout (box);
+			KVBox* internal_box = new KVBox (box);
+			internal_box->setSpacing (RKGlobals::spacingHint ());
+			internal_layout->addWidget (internal_box);
+			buildElement (e, internal_box, false);
 		} else if (e.tagName () == "tabbook") {
 			QTabWidget *tabbook = new QTabWidget (parent_widget);
 			QDomNodeList tabs = e.childNodes ();

Modified: branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.cpp	2007-11-14 23:51:13 UTC (rev 2224)
+++ branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.cpp	2007-11-15 00:37:09 UTC (rev 2225)
@@ -75,25 +75,26 @@
 void RKStandardComponentGUI::createDialog (bool switchable) {
 	RK_TRACE (PLUGIN);
 
-	Q3VBoxLayout *main_vbox = new Q3VBoxLayout (this);
+	QVBoxLayout *main_vbox = new QVBoxLayout (this);
+	main_vbox->setContentsMargins (0, 0, 0, 0);
 	QWidget *upper_widget = new QWidget (this);
 	
-	Q3HBoxLayout *hbox = new Q3HBoxLayout (upper_widget, RKGlobals::marginHint (), RKGlobals::spacingHint ());
-	Q3VBoxLayout *vbox = new Q3VBoxLayout (hbox, RKGlobals::spacingHint ());
+	QHBoxLayout *hbox = new QHBoxLayout (upper_widget);
 
 	// build standard elements
 	main_widget = new Q3VBox (upper_widget);
 	hbox->addWidget (main_widget);
 
 	// lines
-	Q3Frame *line;
-	line = new Q3Frame (upper_widget);
-	line->setFrameShape (Q3Frame::VLine);
-	line->setFrameShadow (Q3Frame::Plain);	
+	QFrame *line = new QFrame (upper_widget);
+	line->setFrameShape (QFrame::VLine);
+	line->setFrameShadow (QFrame::Plain);	
 	hbox->addWidget (line);
 
 	// buttons
-	vbox = new Q3VBoxLayout (hbox, RKGlobals::spacingHint ());
+	QVBoxLayout* vbox = new QVBoxLayout (hbox);
+	vbox->setContentsMargins (0, 0, 0, 0);
+	vbox->setSpacing (RKGlobals::spacingHint ());
 	ok_button = new QPushButton (i18n ("Submit"), upper_widget);
 	connect (ok_button, SIGNAL (clicked ()), this, SLOT (ok ()));
 	vbox->addWidget (ok_button);
@@ -274,10 +275,9 @@
 
 	// build standard elements
 	// lines
-	Q3Frame *line;
-	line = new Q3Frame (main_widget);
-	line->setFrameShape (Q3Frame::HLine);
-	line->setFrameShadow (Q3Frame::Plain);
+	QFrame *line = new QFrame (main_widget);
+	line->setFrameShape (QFrame::HLine);
+	line->setFrameShadow (QFrame::Plain);
 	main_grid->addMultiCellWidget (line, 1, 1, 0, 3);
 
 	// buttons
@@ -454,8 +454,8 @@
 		return false;
 	}
 
-	for (PageComponents::const_iterator it = current_def->page_components.constBegin (); it != current_def->page_components.constEnd (); ++it) {
-		if (!((*it)->isSatisfied ())) {
+	for (int i = 0; i < current_def->page_components.size (); ++i) {
+		if (!((current_def->page_components[i])->isSatisfied ())) {
 			return false;
 		}
 	}

Modified: branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.h
===================================================================
--- branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.h	2007-11-14 23:51:13 UTC (rev 2224)
+++ branches/KDE4_port/rkward/plugin/rkstandardcomponentgui.h	2007-11-15 00:37:09 UTC (rev 2225)
@@ -19,9 +19,7 @@
 #define RKSTANDARDCOMPONENTGUI_H
 
 #include <q3widgetstack.h>
-//Added by qt3to4:
-#include <Q3ValueList>
-#include <QCloseEvent>
+#include <QList>
 
 #include "rkstandardcomponent.h"
 
@@ -49,7 +47,7 @@
 	void addComponentToCurrentPage (RKComponent *component);
 private:
 /** pages are NOT the parent of their components (that would be theoretically possible, but a terrible mess, requiring a fully transparent type of RKComponent), hence we keep a manual list for each page */
-	typedef Q3ValueList<RKComponent *> PageComponents;
+	typedef QList<RKComponent *> PageComponents;
 	struct PageDef {
 		PageComponents page_components;
 		RKComponent *page;
@@ -71,6 +69,7 @@
 class QPushButton;
 class QTimer;
 class QSplitter;
+class QCloseEvent;
 
 /** contains the standard GUI elements for a top-level RKStandardComponent. The base class creates a dialog interface. For a wizard interface use RKStandardComponentWizard. You *must* call createDialog () after construction, since I can't virualize this for reasons I don't understand!
 

Modified: branches/KDE4_port/rkward/plugin/rktabpage.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rktabpage.cpp	2007-11-14 23:51:13 UTC (rev 2224)
+++ branches/KDE4_port/rkward/plugin/rktabpage.cpp	2007-11-15 00:37:09 UTC (rev 2225)
@@ -18,11 +18,11 @@
 #include "rktabpage.h"
 
 #include <qstring.h>
-#include <qlayout.h>
 #include <qtabwidget.h>
-//Added by qt3to4:
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
 
+#include <kvbox.h>
+
 #include "../rkglobals.h"
 #include "../misc/xmlhelper.h"
 #include "../debug.h"
@@ -33,9 +33,8 @@
 	XMLHelper* xml = XMLHelper::getStaticHelper ();
 	label = xml->getStringAttribute (element, "label", QString::null, DL_WARNING);
 
-	Q3VBoxLayout *layout = new Q3VBoxLayout (this);
-	page = new Q3VBox (this);
-	page->setSpacing (RKGlobals::spacingHint ());
+	QVBoxLayout *layout = new QVBoxLayout (this);
+	page = new KVBox (this);
 	layout->addWidget (page);
 
 	tabbook = parent_widget;

Modified: branches/KDE4_port/rkward/plugin/rktabpage.h
===================================================================
--- branches/KDE4_port/rkward/plugin/rktabpage.h	2007-11-14 23:51:13 UTC (rev 2224)
+++ branches/KDE4_port/rkward/plugin/rktabpage.h	2007-11-15 00:37:09 UTC (rev 2225)
@@ -21,10 +21,10 @@
 #include "rkcomponent.h"
 
 #include <qstring.h>
-#include <q3vbox.h>
 
 class QDomElement;
 class QTabWidget;
+class KVBox;
 
 /** A passive component acting as a page in a tabbook. The only function is, that if the component is hidden, the corresponding tab in the tabbook is also hidden.
 
@@ -38,7 +38,7 @@
 	~RKTabPage ();
 
 	// returns the page child elements should be drawn in
-	Q3VBox *getPage () { return page; };
+	KVBox *getPage () { return page; };
 
 	int type () { return ComponentTab; };
 
@@ -46,7 +46,7 @@
 /** called when visibile or enabled properties change */
 	void visibleEnabledChanged (RKComponentPropertyBase *property);
 private:
-	Q3VBox *page;
+	KVBox *page;
 	QTabWidget *tabbook;
 	int index;
 	QString label;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list