[Kst] branches/work/kst/portto4/kst/src/libkstapp

Mike Fenton mike at staikos.net
Mon Jan 12 22:10:56 CET 2009


SVN commit 910237 by fenton:

Update sizing for dialog ListView Size.


 M  +5 -0      dialog.cpp  
 M  +11 -5     dialog.ui  


--- branches/work/kst/portto4/kst/src/libkstapp/dialog.cpp #910236:910237
@@ -46,6 +46,11 @@
   _listWidget->addItem(item);
   _stackedWidget->addWidget(page);
   _itemHash.insert(item, page);
+  if (_listWidget->width() < item->text().length() * 7) {
+    int extra = (item->text().length() * 7) - _listWidget->width();
+    _listWidget->setMinimumSize(_listWidget->size().width() + extra, _listWidget->size().height());
+    resize(minimumSizeHint());
+  }
 }
 
 
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.ui #910236:910237
@@ -75,12 +75,18 @@
         <bool>false</bool>
        </property>
        <widget class="QListWidget" name="_listWidget" >
-        <property name="minimumSize" >
-         <size>
-          <width>175</width>
-          <height>0</height>
-         </size>
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
         </property>
+        <property name="resizeMode" >
+         <enum>QListView::Adjust</enum>
+        </property>
+        <property name="uniformItemSizes" >
+         <bool>true</bool>
+        </property>
        </widget>
        <widget class="QStackedWidget" name="_stackedWidget" >
         <property name="sizePolicy" >


More information about the Kst mailing list