Further enhancements to the QSS previewer. eric7

Tue, 21 Dec 2021 20:42:32 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 21 Dec 2021 20:42:32 +0100
branch
eric7
changeset 8848
c3d1b62da058
parent 8847
8c5812ca27e1
child 8849
cb2dfb596bd6

Further enhancements to the QSS previewer.

eric7/UI/Previewers/PreviewerQSS.py file | annotate | diff | comparison | revisions
eric7/UI/Previewers/PreviewerQSS.ui file | annotate | diff | comparison | revisions
--- a/eric7/UI/Previewers/PreviewerQSS.py	Tue Dec 21 20:42:09 2021 +0100
+++ b/eric7/UI/Previewers/PreviewerQSS.py	Tue Dec 21 20:42:32 2021 +0100
@@ -41,12 +41,24 @@
         
         self.__lastEditor = None
         
-        # menu for the tool button
-        self.__toolButtonMenu = QMenu(self)
-        self.__toolButtonMenu.addAction(self.tr("Action 1"))
-        self.__toolButtonMenu.addSeparator()
-        self.__toolButtonMenu.addAction(self.tr("Action 2"))
-        self.toolButton.setMenu(self.__toolButtonMenu)
+        # menu for the tool buttons
+        self.__toolButtonMenu_1 = QMenu(self)
+        self.__toolButtonMenu_1.addAction(self.tr("Action 1.1"))
+        self.__toolButtonMenu_1.addSeparator()
+        self.__toolButtonMenu_1.addAction(self.tr("Action 2.1"))
+        self.toolButton_1.setMenu(self.__toolButtonMenu_1)
+        
+        self.__toolButtonMenu_2 = QMenu(self)
+        self.__toolButtonMenu_2.addAction(self.tr("Action 1.2"))
+        self.__toolButtonMenu_2.addSeparator()
+        self.__toolButtonMenu_2.addAction(self.tr("Action 2.2"))
+        self.toolButton_2.setMenu(self.__toolButtonMenu_2)
+        
+        self.__toolButtonMenu_3 = QMenu(self)
+        self.__toolButtonMenu_3.addAction(self.tr("Action 1.3"))
+        self.__toolButtonMenu_3.addSeparator()
+        self.__toolButtonMenu_3.addAction(self.tr("Action 2.3"))
+        self.toolButton_3.setMenu(self.__toolButtonMenu_3)
         
         # a MDI window
         self.__mdi = self.mdiArea.addSubWindow(QLabel(self.tr("MDI")))
@@ -112,7 +124,11 @@
                     self.scrollAreaWidgetContents.setStyleSheet(styleSheet)
                 else:
                     self.scrollAreaWidgetContents.setStyleSheet("")
-                self.toolButton.menu().setStyleSheet(
+                self.toolButton_1.menu().setStyleSheet(
+                    self.scrollAreaWidgetContents.styleSheet())
+                self.toolButton_2.menu().setStyleSheet(
+                    self.scrollAreaWidgetContents.styleSheet())
+                self.toolButton_3.menu().setStyleSheet(
                     self.scrollAreaWidgetContents.styleSheet())
     
     @pyqtSlot(int)
--- a/eric7/UI/Previewers/PreviewerQSS.ui	Tue Dec 21 20:42:09 2021 +0100
+++ b/eric7/UI/Previewers/PreviewerQSS.ui	Tue Dec 21 20:42:32 2021 +0100
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>600</width>
-    <height>800</height>
+    <height>970</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -74,7 +74,7 @@
         <x>0</x>
         <y>0</y>
         <width>566</width>
-        <height>712</height>
+        <height>882</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -130,10 +130,29 @@
                   <property name="text">
                    <string notr="true">PushButton</string>
                   </property>
+                  <property name="checkable">
+                   <bool>true</bool>
+                  </property>
                  </widget>
                 </item>
                 <item row="1" column="1">
-                 <widget class="QToolButton" name="toolButton">
+                 <widget class="QToolButton" name="toolButton_1">
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string notr="true">ToolButton 1</string>
+                  </property>
+                  <property name="popupMode">
+                   <enum>QToolButton::DelayedPopup</enum>
+                  </property>
+                 </widget>
+                </item>
+                <item row="2" column="0">
+                 <widget class="QToolButton" name="toolButton_2">
                   <property name="sizePolicy">
                    <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
                     <horstretch>0</horstretch>
@@ -141,26 +160,42 @@
                    </sizepolicy>
                   </property>
                   <property name="text">
-                   <string notr="true">ToolButton</string>
+                   <string notr="true">ToolButton 2</string>
+                  </property>
+                  <property name="popupMode">
+                   <enum>QToolButton::MenuButtonPopup</enum>
+                  </property>
+                 </widget>
+                </item>
+                <item row="2" column="1">
+                 <widget class="QToolButton" name="toolButton_3">
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string notr="true">ToolButton 3</string>
                   </property>
                   <property name="popupMode">
                    <enum>QToolButton::InstantPopup</enum>
                   </property>
                  </widget>
                 </item>
-                <item row="2" column="0">
+                <item row="3" column="0">
                  <widget class="QSpinBox" name="spinBox"/>
                 </item>
-                <item row="2" column="1">
+                <item row="3" column="1">
                  <widget class="QDoubleSpinBox" name="doubleSpinBox"/>
                 </item>
-                <item row="3" column="0">
+                <item row="4" column="0">
                  <widget class="QTimeEdit" name="timeEdit"/>
                 </item>
-                <item row="3" column="1">
+                <item row="4" column="1">
                  <widget class="QDateEdit" name="dateEdit"/>
                 </item>
-                <item row="4" column="0">
+                <item row="5" column="0">
                  <widget class="QLCDNumber" name="lcdNumber">
                   <property name="digitCount">
                    <number>10</number>
@@ -170,7 +205,7 @@
                   </property>
                  </widget>
                 </item>
-                <item row="4" column="1">
+                <item row="5" column="1">
                  <widget class="QLabel" name="label">
                   <property name="text">
                    <string notr="true">Label with &lt;a href=&quot;http://google.com&quot;&gt;link&lt;/a&gt;</string>
@@ -284,7 +319,11 @@
                  </layout>
                 </item>
                 <item>
-                 <widget class="QDateTimeEdit" name="dateTimeEdit"/>
+                 <widget class="QDateTimeEdit" name="dateTimeEdit">
+                  <property name="calendarPopup">
+                   <bool>true</bool>
+                  </property>
+                 </widget>
                 </item>
                </layout>
               </item>
@@ -437,6 +476,9 @@
                   <property name="text">
                    <string notr="true">PushButton</string>
                   </property>
+                  <property name="checkable">
+                   <bool>true</bool>
+                  </property>
                  </widget>
                 </item>
                 <item row="1" column="1">
@@ -453,6 +495,9 @@
                   <property name="text">
                    <string notr="true">ToolButton</string>
                   </property>
+                  <property name="checkable">
+                   <bool>true</bool>
+                  </property>
                   <property name="popupMode">
                    <enum>QToolButton::InstantPopup</enum>
                   </property>
@@ -641,6 +686,9 @@
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
+                  <property name="calendarPopup">
+                   <bool>true</bool>
+                  </property>
                  </widget>
                 </item>
                </layout>
@@ -1139,7 +1187,7 @@
                     <x>0</x>
                     <y>0</y>
                     <width>500</width>
-                    <height>408</height>
+                    <height>529</height>
                    </rect>
                   </property>
                   <layout class="QGridLayout" name="gridLayout_9">
@@ -1192,7 +1240,7 @@
                         <x>0</x>
                         <y>0</y>
                         <width>68</width>
-                        <height>326</height>
+                        <height>447</height>
                        </rect>
                       </property>
                       <attribute name="label">
@@ -1204,8 +1252,8 @@
                        <rect>
                         <x>0</x>
                         <y>0</y>
-                        <width>98</width>
-                        <height>28</height>
+                        <width>100</width>
+                        <height>30</height>
                        </rect>
                       </property>
                       <attribute name="label">
@@ -1272,7 +1320,7 @@
   <tabstop>radioButton</tabstop>
   <tabstop>checkBox</tabstop>
   <tabstop>pushButton</tabstop>
-  <tabstop>toolButton</tabstop>
+  <tabstop>toolButton_1</tabstop>
   <tabstop>spinBox</tabstop>
   <tabstop>doubleSpinBox</tabstop>
   <tabstop>timeEdit</tabstop>
@@ -1321,12 +1369,28 @@
    <slot>setChecked(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>88</x>
-     <y>135</y>
+     <x>112</x>
+     <y>171</y>
     </hint>
     <hint type="destinationlabel">
-     <x>333</x>
-     <y>134</y>
+     <x>422</x>
+     <y>171</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>pushButton</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>disabledPushButton</receiver>
+   <slot>setChecked(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>70</x>
+     <y>189</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>366</x>
+     <y>195</y>
     </hint>
    </hints>
   </connection>

eric ide

mercurial