Commits

Alain Leufroy committed 9f53fca

[gui.qt] add item definition

  • Participants
  • Parent commits b43af17

Comments (0)

Files changed (2)

File ui/gui/qt/item.py

+"""
+This module contains the Qt user interface for an item
+"""
+
+from PyQt4 import QtGui
+from limma.ui.gui.qt import UiFromDesigner
+
+__all__ = ['Item']
+
+class Item(UiFromDesigner, QtGui.QWidget):
+    __ui__ = 'item'
+
+
+# used for tests
+if __name__ == '__main__':
+    import sys
+    from limma.ui.gui.qt.mainwindow import MainWindow
+    from limma.ui.gui.qt.sheet import Sheet
+    app = QtGui.QApplication(sys.argv)
+    main_window = MainWindow()
+    sheet = Sheet(main_window)
+    item0 = Item(sheet)
+    item1 = Item(sheet)
+    item2 = Item(sheet)
+    sheet.append(item1)
+    sheet.insert(0, item0)
+    sheet.append(item2)
+    main_window.setCentralWidget(sheet)
+    main_window.show()
+
+    sys.exit(app.exec_())
+

File ui/gui/qt/uis/item.ui

+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>item</class>
+ <widget class="QWidget" name="item">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>919</width>
+    <height>285</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QHBoxLayout" name="horizontalLayout_2">
+   <item>
+    <layout class="QHBoxLayout" name="container">
+     <item>
+      <widget class="QLabel" name="label">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>1</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTabWidget" name="elements">
+       <property name="tabPosition">
+        <enum>QTabWidget::East</enum>
+       </property>
+       <property name="currentIndex">
+        <number>0</number>
+       </property>
+       <widget class="QWidget" name="edition">
+        <attribute name="title">
+         <string>Form</string>
+        </attribute>
+       </widget>
+       <widget class="QWidget" name="results">
+        <attribute name="title">
+         <string>Results</string>
+        </attribute>
+       </widget>
+      </widget>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="buttons">
+       <item>
+        <widget class="QPushButton" name="edit">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&amp;Edit</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="remove">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&amp;Remove</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="run">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>R&amp;un</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="vertical_spacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>