Commits

Alain Leufroy committed e99fb9c

[gui.qt] add form/result ui into Item

  • Participants
  • Parent commits 5da2666

Comments (0)

Files changed (4)

ui/gui/qt/__init__.py

 
     def __init__(self, *ags, **kws):
         super(UiFromDesigner, self).__init__(*ags, **kws)
+        self._ui = None
+        self.setupUi()
+
+    def setupUi(self):
         assert self.__ui__ is not None, 'class property __ui__ must be set'
         self._ui = load_ui(self.__ui__)()
         self._ui.setupUi(self)

ui/gui/qt/item.py

 """
 
 from PyQt4 import QtGui, QtCore
-from limma.ui.gui.qt import UiFromDesigner
+from limma.ui.gui.qt import UiFromDesigner, load_ui
 
 __all__ = ['Item']
 
 class Item(UiFromDesigner, QtGui.QWidget):
     __ui__ = 'item'
+    __form_ui__ = None
+    __result_ui__ = None
 
     removed = QtCore.pyqtSignal(QtGui.QWidget)
 
         super(Item, self).__init__(*ags, **kws)
         self._ui.remove.released.connect(self.remove)
 
+    def setupUi(self, *ags, **kws):
+        super(Item, self).setupUi(*ags, **kws)
+        assert self.__form_ui__ is not None
+        assert self.__result_ui__ is not None
+        self._form_ui = load_ui(self.__form_ui__)()
+        self._result_ui = load_ui(self.__result_ui__)()
+        self._form_ui.setupUi(self._ui.form_container)
+        self._result_ui.setupUi(self._ui.result_container)
+
     def remove(self):
         self.removed.emit(self)
 

ui/gui/qt/uis/item.ui

    <rect>
     <x>0</x>
     <y>0</y>
-    <width>919</width>
-    <height>285</height>
+    <width>442</width>
+    <height>234</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout_2">
+  <layout class="QVBoxLayout" name="verticalLayout_3">
    <item>
     <layout class="QHBoxLayout" name="container">
      <item>
        <property name="currentIndex">
         <number>0</number>
        </property>
-       <widget class="QWidget" name="edition">
+       <widget class="QWidget" name="form">
         <attribute name="title">
          <string>Form</string>
         </attribute>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QWidget" name="form_container" native="true"/>
+         </item>
+         <item>
+          <widget class="QDialogButtonBox" name="form_buttons">
+           <property name="standardButtons">
+            <set>QDialogButtonBox::Reset|QDialogButtonBox::Save</set>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </widget>
-       <widget class="QWidget" name="results">
+       <widget class="QWidget" name="result">
         <attribute name="title">
          <string>Results</string>
         </attribute>
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <item>
+          <widget class="QWidget" name="result_container" native="true"/>
+         </item>
+        </layout>
        </widget>
       </widget>
      </item>

ui/gui/qt/uis/sheet.ui

 <ui version="4.0">
  <class>container</class>
  <widget class="QWidget" name="container">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>94</width>
+    <height>93</height>
+   </rect>
+  </property>
   <property name="sizePolicy">
    <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
     <horstretch>0</horstretch>
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>822</width>
-        <height>646</height>
+        <width>72</width>
+        <height>71</height>
        </rect>
       </property>
       <property name="sizePolicy">