[rkward-cvs] SF.net SVN: rkward:[4003] trunk/rkward/rkward/plugin/rkvarslot.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Oct 27 07:58:42 UTC 2011


Revision: 4003
          http://rkward.svn.sourceforge.net/rkward/?rev=4003&view=rev
Author:   tfry
Date:     2011-10-27 07:58:42 +0000 (Thu, 27 Oct 2011)
Log Message:
-----------
Fix height of single variable varslots

Modified Paths:
--------------
    trunk/rkward/rkward/plugin/rkvarslot.cpp

Modified: trunk/rkward/rkward/plugin/rkvarslot.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkvarslot.cpp	2011-10-26 18:00:26 UTC (rev 4002)
+++ trunk/rkward/rkward/plugin/rkvarslot.cpp	2011-10-27 07:58:42 UTC (rev 4003)
@@ -2,7 +2,7 @@
                           rkvarslot.cpp  -  description
                              -------------------
     begin                : Thu Nov 7 2002
-    copyright            : (C) 2002, 2007, 2008, 2009 by Thomas Friedrichsmeier
+    copyright            : (C) 2002, 2007, 2008, 2009, 2011 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -74,10 +74,11 @@
 
 		// make it look like a line-edit
 		list->header ()->hide ();
-		QTreeWidgetItem* dummy = new QTreeWidgetItem (list);
-		dummy->setText (0, " ");
-		list->setFixedHeight (list->visualItemRect (dummy).height () + 2*list->visualItemRect (dummy).top () + 4);
-		delete dummy;
+		QTreeWidgetItem dummy (list);
+		dummy.setText (0, "Tg");
+		int top, left, bottom, right;
+		list->getContentsMargins (&left, &top, &right, &bottom);
+		list->setFixedHeight (list->visualItemRect (&dummy).height () + 2*list->visualItemRect (&dummy).top () + top + bottom);
 		list->header ()->setStretchLastSection (true);
 		list->hideColumn (0);
 		list->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);

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