[rkward-cvs] SF.net SVN: rkward: [1659] trunk/rkward/rkward/plugin

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Mar 20 14:22:34 UTC 2007


Revision: 1659
          http://svn.sourceforge.net/rkward/?rev=1659&view=rev
Author:   tfry
Date:     2007-03-20 07:22:34 -0700 (Tue, 20 Mar 2007)

Log Message:
-----------
work around a QComboBox bug

Modified Paths:
--------------
    trunk/rkward/rkward/plugin/rkdropdown.cpp
    trunk/rkward/rkward/plugin/rkdropdown.h

Modified: trunk/rkward/rkward/plugin/rkdropdown.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkdropdown.cpp	2007-03-20 14:13:13 UTC (rev 1658)
+++ trunk/rkward/rkward/plugin/rkdropdown.cpp	2007-03-20 14:22:34 UTC (rev 1659)
@@ -51,13 +51,25 @@
 	addOptionsAndInit (element);
 
 	vbox->addWidget (box);
-	connect (box, SIGNAL (activated (int)), this, SLOT (itemSelected (int)));
+	connect (box, SIGNAL (activated (int)), this, SLOT (comboItemActivated (int)));
 }
 
 RKDropDown::~RKDropDown(){
 	RK_TRACE (PLUGIN);
 }
 
+void RKDropDown::comboItemActivated (int id) {
+	RK_TRACE (PLUGIN);
+
+	QListBox *list = box->listBox ();
+	RK_ASSERT (list);
+	QListBoxItem *item = list->item (id);
+	RK_ASSERT (item);
+	if (!item->isSelectable ()) return;		// yes, apparently not selectable items can be "activated"
+
+	itemSelected (id);
+}
+
 void RKDropDown::setItemInGUI (int id) {
 	RK_TRACE (PLUGIN);
 

Modified: trunk/rkward/rkward/plugin/rkdropdown.h
===================================================================
--- trunk/rkward/rkward/plugin/rkdropdown.h	2007-03-20 14:13:13 UTC (rev 1658)
+++ trunk/rkward/rkward/plugin/rkdropdown.h	2007-03-20 14:22:34 UTC (rev 1659)
@@ -31,6 +31,9 @@
 	RKDropDown (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget);
 	~RKDropDown ();
 	int type () { return ComponentDropDown; };
+public slots:
+	// workaround for a qt bug
+	void comboItemActivated (int id);
 protected:
 	void setItemInGUI (int id);
 	void addOptionToGUI (const QString &label, int id);


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