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

Nicolas Brisset nicolas.brisset at eurocopter.com
Sat Sep 25 00:19:36 CEST 2010


SVN commit 1179247 by brisset:

- Really cleanup images.qrc
- Start implementing the improvements to the plot dialog described in bug #252289, but I still have some difficulties:
   => Appearance and Dimensions always appear first, I tried insertItem instead of addPage and it didn't work... ?
   => The _listWidget is always cropped and it's really a pain to have to use the scrollbars for that widget. There is code that should make it grow to accomodate its content but it somehow does not work
   => Implementing the logic desribed in bugzilla to edit the displayed items takes more code than I'm able to produce, so I just added buttons which do nothing. I hope someone steps in to fill the gap, otherwise we will remove or deactivate the buttons until everything works. I wanted to illustrate the idea and it's not too bad as there are already many ways to edit the objects.


 M  +0 -10     images/images.qrc  
 M  +134 -63   libkstapp/contenttab.ui  
 M  +1 -1      libkstapp/dialog.ui  
 M  +26 -25    libkstapp/plotitemdialog.cpp  


--- branches/work/kst/portto4/kst/src/images/images.qrc #1179246:1179247
@@ -1,15 +1,8 @@
 <RCC>
     <qresource prefix="/">
-        <file>hi32-mime-kst.png</file>
         <file>kstplot.png</file>
-        <file>lo16-app-kst.png</file>
-        <file>lo32-mime-kst.png</file>
-        <file>hi16-mime-kst.png</file>
         <file>plainplot.png</file>
-        <file>lo16-mime-kst.png</file>
         <file>kst.png</file>
-        <file>lo32-app-kst.png</file>
-        <file>kst_advance.png</file>
         <file>kst_blank.png</file>
         <file>kst_changefile.png</file>
         <file>kst_changenpts.png</file>
@@ -38,7 +31,6 @@
         <file>kst_gfx_layout.png</file>
         <file>kst_gfx_sharedaxisbox.png</file>
         <file>kst_gfx_breaklayout.png</file>
-        <file>kst_graphfile.png</file>
         <file>kst_graphics.png</file>
         <file>kst_histogramnew.png</file>
         <file>kst_imagenew.png</file>
@@ -95,9 +87,7 @@
         <file>image-x-generic.png</file>
         <file>dialog-information.png</file>
         <file>text-x-log.png</file>
-        <file>folder-development.png</file>
         <file>document-export.png</file>
-        <file>revert.png</file>
         <file>tied-zoom.png</file>
         <file>change-data-file.png</file>
         <file>data-manager.png</file>
--- branches/work/kst/portto4/kst/src/libkstapp/contenttab.ui #1179246:1179247
@@ -6,47 +6,14 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>739</width>
-    <height>469</height>
+    <width>726</width>
+    <height>510</height>
    </rect>
   </property>
-  <layout class="QGridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="1">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>31</width>
-       <height>50</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="1">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>31</width>
-       <height>110</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="0" rowspan="3">
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
     <layout class="QVBoxLayout">
      <property name="margin">
       <number>0</number>
@@ -77,42 +44,52 @@
        </property>
       </widget>
      </item>
-    </layout>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="QPushButton" name="_deselectAllAvailable">
+           <property name="text">
+            <string>Deselect  All</string>
+           </property>
+          </widget>
    </item>
-   <item row="0" column="2" rowspan="3">
-    <layout class="QVBoxLayout">
-     <property name="margin">
-      <number>0</number>
-     </property>
      <item>
-      <widget class="QLabel" name="TextLabel3_3_2">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
+          <widget class="QPushButton" name="_selectAllAvailable">
        <property name="text">
-        <string>&amp;Displayed objects:</string>
+            <string>Select All</string>
        </property>
-       <property name="wordWrap">
-        <bool>false</bool>
-       </property>
-       <property name="buddy">
-        <cstring>_displayedRelationList</cstring>
-       </property>
       </widget>
      </item>
      <item>
-      <widget class="QListWidget" name="_displayedRelationList">
-       <property name="selectionMode">
-        <enum>QAbstractItemView::ExtendedSelection</enum>
+          <widget class="QPushButton" name="_editSelectedAvailable">
+           <property name="text">
+            <string>Edit</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="1" column="1">
+      </layout>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>31</width>
+           <height>50</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
     <layout class="QGridLayout">
      <property name="margin">
       <number>0</number>
@@ -207,8 +184,99 @@
      </item>
     </layout>
    </item>
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>31</width>
+           <height>110</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
   </layout>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QLabel" name="TextLabel3_3_2">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&amp;Displayed objects:</string>
+         </property>
+         <property name="wordWrap">
+          <bool>false</bool>
+         </property>
+         <property name="buddy">
+          <cstring>_displayedRelationList</cstring>
+         </property>
  </widget>
+       </item>
+       <item>
+        <widget class="QListWidget" name="_displayedRelationList">
+         <property name="selectionMode">
+          <enum>QAbstractItemView::ExtendedSelection</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QPushButton" name="_deselectAllDisplayed">
+           <property name="text">
+            <string>Deselect  All</string>
+           </property>
+           <attribute name="buttonGroup">
+            <string>buttonGroup</string>
+           </attribute>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="_selectAllDisplayed">
+           <property name="text">
+            <string>Select All</string>
+           </property>
+           <attribute name="buttonGroup">
+            <string>buttonGroup</string>
+           </attribute>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="_editSelectedDisplayed">
+           <property name="text">
+            <string>Edit</string>
+           </property>
+           <attribute name="buttonGroup">
+            <string>buttonGroup</string>
+           </attribute>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="Line" name="line">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
  <tabstops>
   <tabstop>_displayedRelationList</tabstop>
   <tabstop>_availableRelationList</tabstop>
@@ -219,4 +287,7 @@
  </tabstops>
  <resources/>
  <connections/>
+ <buttongroups>
+  <buttongroup name="buttonGroup"/>
+ </buttongroups>
 </ui>
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.ui #1179246:1179247
@@ -103,7 +103,7 @@
        </property>
        <widget class="QListWidget" name="_listWidget">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
--- branches/work/kst/portto4/kst/src/libkstapp/plotitemdialog.cpp #1179246:1179247
@@ -45,6 +45,13 @@
 
   setWindowTitle(tr("Edit Plot Item"));
 
+  _contentTab = new ContentTab(this);
+  connect(_contentTab, SIGNAL(apply()), this, SLOT(contentChanged()));
+  DialogPage *page = new DialogPage(this);
+  page->setPageTitle(tr("Contents"));
+  page->addDialogTab(_contentTab);
+  addDialogPage(page, true);
+
   _labelTab = new LabelTab(_plotItem, this);
   _topLabelTab = new OverrideLabelTab(tr("Top Font"), this);
   _bottomLabelTab = new OverrideLabelTab(tr("Bottom Font"), this);
@@ -60,7 +67,7 @@
   _labelPage->addDialogTab(_leftLabelTab);
   _labelPage->addDialogTab(_rightLabelTab);
   _labelPage->addDialogTab(_axisLabelTab);
-  addDialogPage(_labelPage);
+  addDialogPage(_labelPage, true);
 
   connect(_labelTab, SIGNAL(apply()), this, SLOT(labelsChanged()));
   connect(_labelTab, SIGNAL(globalFontUpdate()), this, SLOT(globalFontUpdate()));
@@ -71,53 +78,45 @@
   connect(_rightLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useRightDefaultChanged(bool)));
   connect(_axisLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useAxisDefaultChanged(bool)));
 
+  _rangeTab = new RangeTab(_plotItem, this);
+  DialogPage *rangePage = new DialogPage(this);
+  rangePage->setPageTitle(tr("Range/Zoom"));
+  rangePage->addDialogTab(_rangeTab);
+  addDialogPage(rangePage, true);
+  connect(_rangeTab, SIGNAL(apply()), this, SLOT(rangeChanged()));
+
   _xAxisTab = new AxisTab(this);
   DialogPage *xAxisPage = new DialogPage(this);
-  xAxisPage->setPageTitle(tr("x-Axis"));
+  xAxisPage->setPageTitle(tr("X-Axis"));
   xAxisPage->addDialogTab(_xAxisTab);
-  addDialogPage(xAxisPage);
+  addDialogPage(xAxisPage, true);
   connect(_xAxisTab, SIGNAL(apply()), this, SLOT(xAxisChanged()));
 
   _yAxisTab = new AxisTab(this);
   DialogPage *yAxisPage = new DialogPage(this);
-  yAxisPage->setPageTitle(tr("y-Axis"));
+  yAxisPage->setPageTitle(tr("Y-Axis"));
   yAxisPage->addDialogTab(_yAxisTab);
-  addDialogPage(yAxisPage);
+  addDialogPage(yAxisPage, true);
   connect(_yAxisTab, SIGNAL(apply()), this, SLOT(yAxisChanged()));
 
-  _rangeTab = new RangeTab(_plotItem, this);
-  DialogPage *rangePage = new DialogPage(this);
-  rangePage->setPageTitle(tr("Range"));
-  rangePage->addDialogTab(_rangeTab);
-  addDialogPage(rangePage);
-  connect(_rangeTab, SIGNAL(apply()), this, SLOT(rangeChanged()));
-
   _xMarkersTab = new MarkersTab(this);
   DialogPage *xMarkersPage = new DialogPage(this);
-  xMarkersPage->setPageTitle(tr("x-Axis markers"));
+  xMarkersPage->setPageTitle(tr("X-Axis Markers"));
   xMarkersPage->addDialogTab(_xMarkersTab);
-  addDialogPage(xMarkersPage);
+  addDialogPage(xMarkersPage, true);
   _xMarkersTab->setObjectStore(_store);
   connect(_xMarkersTab, SIGNAL(apply()), this, SLOT(xAxisPlotMarkersChanged()));
 
   _yMarkersTab = new MarkersTab(this);
   DialogPage *yMarkersPage = new DialogPage(this);
-  yMarkersPage->setPageTitle(tr("y-Axis markers"));
+  yMarkersPage->setPageTitle(tr("Y-Axis Markers"));
   yMarkersPage->addDialogTab(_yMarkersTab);
-  addDialogPage(yMarkersPage);
+  addDialogPage(yMarkersPage, true);
   _yMarkersTab->setObjectStore(_store);
   connect(yMarkersPage, SIGNAL(apply()), this, SLOT(yAxisPlotMarkersChanged()));
 
-  _contentTab = new ContentTab(this);
-  connect(_contentTab, SIGNAL(apply()), this, SLOT(contentChanged()));
+  // addRelations(); This tends to clutter the plot dialog, let's test skipping it
 
-  DialogPage *page = new DialogPage(this);
-  page->setPageTitle(tr("Content"));
-  page->addDialogTab(_contentTab);
-  addDialogPage(page);
-
-  addRelations();
-
   setupContent();
   setupAxis();
   setupRange();
@@ -143,6 +142,8 @@
   connect(this, SIGNAL(editMultipleMode()), this, SLOT(editMultiple()));
   connect(this, SIGNAL(editSingleMode()), this, SLOT(editSingle()));
   connect(this, SIGNAL(apply()), this, SLOT(slotApply()));
+
+  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // Make sure the labels are visible, doesn't work right now :-)
 }
 
 


More information about the Kst mailing list