summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets/stylesheet
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/widgets/stylesheet')
-rw-r--r--examples/widgets/widgets/stylesheet/images/checkbox_checked.pngbin0 -> 263 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/checkbox_checked_hover.pngbin0 -> 266 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/checkbox_checked_pressed.pngbin0 -> 425 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/checkbox_unchecked.pngbin0 -> 159 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/checkbox_unchecked_hover.pngbin0 -> 159 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/checkbox_unchecked_pressed.pngbin0 -> 320 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/down_arrow.pngbin0 -> 175 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/down_arrow_disabled.pngbin0 -> 174 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/frame.pngbin0 -> 253 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/pagefold.pngbin0 -> 1545 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/pushbutton.pngbin0 -> 533 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/pushbutton_hover.pngbin0 -> 525 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/pushbutton_pressed.pngbin0 -> 513 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/radiobutton_checked.pngbin0 -> 355 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/radiobutton_checked_hover.pngbin0 -> 532 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/radiobutton_checked_pressed.pngbin0 -> 599 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/radiobutton_unchecked.pngbin0 -> 240 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_hover.pngbin0 -> 492 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_pressed.pngbin0 -> 556 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/sizegrip.pngbin0 -> 129 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spindown.pngbin0 -> 276 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spindown_hover.pngbin0 -> 268 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spindown_off.pngbin0 -> 249 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spindown_pressed.pngbin0 -> 264 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spinup.pngbin0 -> 283 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spinup_hover.pngbin0 -> 277 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spinup_off.pngbin0 -> 274 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/spinup_pressed.pngbin0 -> 277 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/up_arrow.pngbin0 -> 197 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/images/up_arrow_disabled.pngbin0 -> 172 bytes
-rw-r--r--examples/widgets/widgets/stylesheet/layouts/default.ui329
-rw-r--r--examples/widgets/widgets/stylesheet/layouts/pagefold.ui349
-rw-r--r--examples/widgets/widgets/stylesheet/main.cpp53
-rw-r--r--examples/widgets/widgets/stylesheet/mainwindow.cpp74
-rw-r--r--examples/widgets/widgets/stylesheet/mainwindow.h66
-rw-r--r--examples/widgets/widgets/stylesheet/mainwindow.ui356
-rw-r--r--examples/widgets/widgets/stylesheet/qss/coffee.qss112
-rw-r--r--examples/widgets/widgets/stylesheet/qss/default.qss1
-rw-r--r--examples/widgets/widgets/stylesheet/qss/pagefold.qss299
-rw-r--r--examples/widgets/widgets/stylesheet/stylesheet.desktop11
-rw-r--r--examples/widgets/widgets/stylesheet/stylesheet.pro18
-rw-r--r--examples/widgets/widgets/stylesheet/stylesheet.qrc39
-rw-r--r--examples/widgets/widgets/stylesheet/stylesheeteditor.cpp93
-rw-r--r--examples/widgets/widgets/stylesheet/stylesheeteditor.h67
-rw-r--r--examples/widgets/widgets/stylesheet/stylesheeteditor.ui171
45 files changed, 2038 insertions, 0 deletions
diff --git a/examples/widgets/widgets/stylesheet/images/checkbox_checked.png b/examples/widgets/widgets/stylesheet/images/checkbox_checked.png
new file mode 100644
index 0000000000..cbf06f6513
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/checkbox_checked.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/checkbox_checked_hover.png b/examples/widgets/widgets/stylesheet/images/checkbox_checked_hover.png
new file mode 100644
index 0000000000..fb4d4d3fdb
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/checkbox_checked_hover.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/checkbox_checked_pressed.png b/examples/widgets/widgets/stylesheet/images/checkbox_checked_pressed.png
new file mode 100644
index 0000000000..852fcc0306
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/checkbox_checked_pressed.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/checkbox_unchecked.png b/examples/widgets/widgets/stylesheet/images/checkbox_unchecked.png
new file mode 100644
index 0000000000..5f5465582a
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/checkbox_unchecked.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/checkbox_unchecked_hover.png b/examples/widgets/widgets/stylesheet/images/checkbox_unchecked_hover.png
new file mode 100644
index 0000000000..687364497e
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/checkbox_unchecked_hover.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/checkbox_unchecked_pressed.png b/examples/widgets/widgets/stylesheet/images/checkbox_unchecked_pressed.png
new file mode 100644
index 0000000000..6a768c44de
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/checkbox_unchecked_pressed.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/down_arrow.png b/examples/widgets/widgets/stylesheet/images/down_arrow.png
new file mode 100644
index 0000000000..85004aeaf6
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/down_arrow.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/down_arrow_disabled.png b/examples/widgets/widgets/stylesheet/images/down_arrow_disabled.png
new file mode 100644
index 0000000000..d9eefed4c8
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/down_arrow_disabled.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/frame.png b/examples/widgets/widgets/stylesheet/images/frame.png
new file mode 100644
index 0000000000..05a600502e
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/frame.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/pagefold.png b/examples/widgets/widgets/stylesheet/images/pagefold.png
new file mode 100644
index 0000000000..69be8f2a38
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/pagefold.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/pushbutton.png b/examples/widgets/widgets/stylesheet/images/pushbutton.png
new file mode 100644
index 0000000000..c7529ba02d
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/pushbutton.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/pushbutton_hover.png b/examples/widgets/widgets/stylesheet/images/pushbutton_hover.png
new file mode 100644
index 0000000000..af0ef9d561
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/pushbutton_hover.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/pushbutton_pressed.png b/examples/widgets/widgets/stylesheet/images/pushbutton_pressed.png
new file mode 100644
index 0000000000..f7381f752a
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/pushbutton_pressed.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/radiobutton_checked.png b/examples/widgets/widgets/stylesheet/images/radiobutton_checked.png
new file mode 100644
index 0000000000..8ab9157578
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/radiobutton_checked.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/radiobutton_checked_hover.png b/examples/widgets/widgets/stylesheet/images/radiobutton_checked_hover.png
new file mode 100644
index 0000000000..d68cb009a7
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/radiobutton_checked_hover.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/radiobutton_checked_pressed.png b/examples/widgets/widgets/stylesheet/images/radiobutton_checked_pressed.png
new file mode 100644
index 0000000000..e3cd5a59e4
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/radiobutton_checked_pressed.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked.png b/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked.png
new file mode 100644
index 0000000000..321a9a1558
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_hover.png b/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_hover.png
new file mode 100644
index 0000000000..666a3b0bdd
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_hover.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_pressed.png b/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_pressed.png
new file mode 100644
index 0000000000..c4b0567aa9
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/radiobutton_unchecked_pressed.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/sizegrip.png b/examples/widgets/widgets/stylesheet/images/sizegrip.png
new file mode 100644
index 0000000000..350583aaac
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/sizegrip.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spindown.png b/examples/widgets/widgets/stylesheet/images/spindown.png
new file mode 100644
index 0000000000..7ff3c64926
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spindown.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spindown_hover.png b/examples/widgets/widgets/stylesheet/images/spindown_hover.png
new file mode 100644
index 0000000000..1486c4dfe4
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spindown_hover.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spindown_off.png b/examples/widgets/widgets/stylesheet/images/spindown_off.png
new file mode 100644
index 0000000000..a90ab3f038
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spindown_off.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spindown_pressed.png b/examples/widgets/widgets/stylesheet/images/spindown_pressed.png
new file mode 100644
index 0000000000..f6271cbde2
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spindown_pressed.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spinup.png b/examples/widgets/widgets/stylesheet/images/spinup.png
new file mode 100644
index 0000000000..1069dd00df
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spinup.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spinup_hover.png b/examples/widgets/widgets/stylesheet/images/spinup_hover.png
new file mode 100644
index 0000000000..884c8d77c5
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spinup_hover.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spinup_off.png b/examples/widgets/widgets/stylesheet/images/spinup_off.png
new file mode 100644
index 0000000000..02dad1fb29
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spinup_off.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/spinup_pressed.png b/examples/widgets/widgets/stylesheet/images/spinup_pressed.png
new file mode 100644
index 0000000000..b1843e2a1f
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/spinup_pressed.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/up_arrow.png b/examples/widgets/widgets/stylesheet/images/up_arrow.png
new file mode 100644
index 0000000000..e7f7ddb3a6
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/up_arrow.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/images/up_arrow_disabled.png b/examples/widgets/widgets/stylesheet/images/up_arrow_disabled.png
new file mode 100644
index 0000000000..4d2c27770f
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/images/up_arrow_disabled.png
Binary files differ
diff --git a/examples/widgets/widgets/stylesheet/layouts/default.ui b/examples/widgets/widgets/stylesheet/layouts/default.ui
new file mode 100644
index 0000000000..431a40956e
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/layouts/default.ui
@@ -0,0 +1,329 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>388</width>
+ <height>413</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="text" >
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>nameCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="3" >
+ <widget class="QComboBox" name="nameCombo" >
+ <property name="toolTip" >
+ <string>Specify your name</string>
+ </property>
+ <property name="editable" >
+ <bool>true</bool>
+ </property>
+ <property name="currentIndex" >
+ <number>-1</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Girish</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Jasmin</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Simon</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Zack</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QRadioButton" name="femaleRadioButton" >
+ <property name="toolTip" >
+ <string>Check this if you are female</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Female</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="4" >
+ <widget class="QCheckBox" name="agreeCheckBox" >
+ <property name="toolTip" >
+ <string>Please read the license before checking this</string>
+ </property>
+ <property name="text" >
+ <string>I &amp;accept the terms and conditions</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QRadioButton" name="maleRadioButton" >
+ <property name="toolTip" >
+ <string>Check this if you are male</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Male</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="genderLabel" >
+ <property name="text" >
+ <string>Gender:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="3" >
+ <widget class="QSpinBox" name="ageSpinBox" >
+ <property name="toolTip" >
+ <string>Specify your age</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your age here</string>
+ </property>
+ <property name="minimum" >
+ <number>12</number>
+ </property>
+ <property name="value" >
+ <number>22</number>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="2" colspan="2" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="ageLabel" >
+ <property name="text" >
+ <string>&amp;Age:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>ageSpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="passwordLabel" >
+ <property name="text" >
+ <string>&amp;Password:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>passwordEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="3" >
+ <widget class="QLineEdit" name="passwordEdit" >
+ <property name="toolTip" >
+ <string>Specify your password</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your password here</string>
+ </property>
+ <property name="text" >
+ <string>Password</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Profession</string>
+ </property>
+ <property name="buddy" >
+ <cstring>professionList</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="countryLabel" >
+ <property name="text" >
+ <string>&amp;Country</string>
+ </property>
+ <property name="buddy" >
+ <cstring>professionList</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" colspan="3" >
+ <widget class="QListWidget" name="professionList" >
+ <property name="toolTip" >
+ <string>Select your profession</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select your profession</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Select your profession</string>
+ </property>
+ <property name="currentRow" >
+ <number>1</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Developer</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Student</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Fisherman</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="3" >
+ <widget class="QComboBox" name="countryCombo" >
+ <property name="toolTip" >
+ <string>Specify your country</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your country here</string>
+ </property>
+ <property name="currentIndex" >
+ <number>2</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Germany</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>India</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Norway</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>United States Of America</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>United Kingdom</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>388</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_File" >
+ <property name="title" >
+ <string>&amp;File</string>
+ </property>
+ <addaction name="editStyleAction" />
+ <addaction name="separator" />
+ <addaction name="exitAction" />
+ </widget>
+ <widget class="QMenu" name="menu_Help" >
+ <property name="title" >
+ <string>&amp;Help</string>
+ </property>
+ <addaction name="aboutAction" />
+ <addaction name="separator" />
+ <addaction name="aboutQtAction" />
+ </widget>
+ <addaction name="menu_File" />
+ <addaction name="menu_Help" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ <action name="exitAction" >
+ <property name="text" >
+ <string>&amp;Exit</string>
+ </property>
+ </action>
+ <action name="aboutQtAction" >
+ <property name="text" >
+ <string>About Qt</string>
+ </property>
+ </action>
+ <action name="editStyleAction" >
+ <property name="text" >
+ <string>Edit &amp;Style</string>
+ </property>
+ </action>
+ <action name="aboutAction" >
+ <property name="text" >
+ <string>About</string>
+ </property>
+ </action>
+ </widget>
+ <tabstops>
+ <tabstop>maleRadioButton</tabstop>
+ <tabstop>femaleRadioButton</tabstop>
+ <tabstop>ageSpinBox</tabstop>
+ <tabstop>passwordEdit</tabstop>
+ <tabstop>professionList</tabstop>
+ <tabstop>agreeCheckBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/widgets/widgets/stylesheet/layouts/pagefold.ui b/examples/widgets/widgets/stylesheet/layouts/pagefold.ui
new file mode 100644
index 0000000000..7ae313c331
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/layouts/pagefold.ui
@@ -0,0 +1,349 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>392</width>
+ <height>412</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QFrame" name="mainFrame" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="1" colspan="3" >
+ <widget class="QComboBox" name="nameCombo" >
+ <property name="toolTip" >
+ <string>Specify your name</string>
+ </property>
+ <property name="editable" >
+ <bool>true</bool>
+ </property>
+ <property name="currentIndex" >
+ <number>-1</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Girish</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Jasmin</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Simon</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Zack</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QRadioButton" name="femaleRadioButton" >
+ <property name="styleSheet" >
+ <string>Check this if you are female</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Female</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="genderLabel" >
+ <property name="text" >
+ <string>Gender:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="ageLabel" >
+ <property name="text" >
+ <string>&amp;Age:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>ageSpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QRadioButton" name="maleRadioButton" >
+ <property name="toolTip" >
+ <string>Check this if you are male</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Male</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="text" >
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>nameCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="passwordLabel" >
+ <property name="text" >
+ <string>&amp;Password:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>passwordEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="3" >
+ <widget class="QSpinBox" name="ageSpinBox" >
+ <property name="toolTip" >
+ <string>Specify your age</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your age</string>
+ </property>
+ <property name="minimum" >
+ <number>12</number>
+ </property>
+ <property name="value" >
+ <number>22</number>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="2" colspan="2" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="4" >
+ <widget class="QCheckBox" name="agreeCheckBox" >
+ <property name="toolTip" >
+ <string>Please read the LICENSE file before checking</string>
+ </property>
+ <property name="text" >
+ <string>I &amp;accept the terms and &amp;conditions</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="3" >
+ <widget class="QLineEdit" name="passwordEdit" >
+ <property name="toolTip" >
+ <string>Specify your password</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your password</string>
+ </property>
+ <property name="text" >
+ <string>Password</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" colspan="3" >
+ <widget class="QListWidget" name="professionList" >
+ <property name="toolTip" >
+ <string>Select your profession</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your name here</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Specify your name here</string>
+ </property>
+ <property name="currentRow" >
+ <number>0</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Developer</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Student</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Fisherman</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Profession:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>professionList</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="3" >
+ <widget class="QComboBox" name="countryCombo" >
+ <property name="toolTip" >
+ <string>Specify country of origin</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify country of origin</string>
+ </property>
+ <property name="currentIndex" >
+ <number>6</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Egypt</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>France</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Germany</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>India</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Italy</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Korea</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Norway</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="countryLabel" >
+ <property name="text" >
+ <string>Pro&amp;fession</string>
+ </property>
+ <property name="buddy" >
+ <cstring>professionList</cstring>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>392</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_File" >
+ <property name="title" >
+ <string>&amp;File</string>
+ </property>
+ <addaction name="editStyleAction" />
+ <addaction name="separator" />
+ <addaction name="exitAction" />
+ </widget>
+ <widget class="QMenu" name="menu_Help" >
+ <property name="title" >
+ <string>&amp;Help</string>
+ </property>
+ <addaction name="aboutAction" />
+ <addaction name="separator" />
+ <addaction name="aboutQtAction" />
+ </widget>
+ <addaction name="menu_File" />
+ <addaction name="menu_Help" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ <action name="exitAction" >
+ <property name="text" >
+ <string>&amp;Exit</string>
+ </property>
+ </action>
+ <action name="aboutQtAction" >
+ <property name="text" >
+ <string>About Qt</string>
+ </property>
+ </action>
+ <action name="editStyleAction" >
+ <property name="text" >
+ <string>Edit &amp;Style</string>
+ </property>
+ </action>
+ <action name="aboutAction" >
+ <property name="text" >
+ <string>About</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/widgets/widgets/stylesheet/main.cpp b/examples/widgets/widgets/stylesheet/main.cpp
new file mode 100644
index 0000000000..0ddd63c298
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/main.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWidgets>
+
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ Q_INIT_RESOURCE(stylesheet);
+
+ QApplication app(argc, argv);
+ MainWindow window;
+ window.show();
+ return app.exec();
+}
diff --git a/examples/widgets/widgets/stylesheet/mainwindow.cpp b/examples/widgets/widgets/stylesheet/mainwindow.cpp
new file mode 100644
index 0000000000..0732d78347
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/mainwindow.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWidgets>
+
+#include "mainwindow.h"
+#include "stylesheeteditor.h"
+
+MainWindow::MainWindow()
+{
+ ui.setupUi(this);
+
+ ui.nameLabel->setProperty("class", "mandatory QLabel");
+
+ styleSheetEditor = new StyleSheetEditor(this);
+
+ statusBar()->addWidget(new QLabel(tr("Ready")));
+
+ connect(ui.exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(ui.aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+}
+
+void MainWindow::on_editStyleAction_triggered()
+{
+ styleSheetEditor->show();
+ styleSheetEditor->activateWindow();
+}
+
+void MainWindow::on_aboutAction_triggered()
+{
+ QMessageBox::about(this, tr("About Style sheet"),
+ tr("The <b>Style Sheet</b> example shows how widgets can be styled "
+ "using <a href=\"http://qt.nokia.com/doc/4.5/stylesheet.html\">Qt "
+ "Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop up the "
+ "style editor, and either choose an existing style sheet or design "
+ "your own."));
+}
diff --git a/examples/widgets/widgets/stylesheet/mainwindow.h b/examples/widgets/widgets/stylesheet/mainwindow.h
new file mode 100644
index 0000000000..2ccaf9ba02
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/mainwindow.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtWidgets>
+
+#include "ui_mainwindow.h"
+
+class StyleSheetEditor;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+private slots:
+ void on_editStyleAction_triggered();
+ void on_aboutAction_triggered();
+
+private:
+ StyleSheetEditor *styleSheetEditor;
+ Ui::MainWindow ui;
+};
+
+#endif
diff --git a/examples/widgets/widgets/stylesheet/mainwindow.ui b/examples/widgets/widgets/stylesheet/mainwindow.ui
new file mode 100644
index 0000000000..cc29257afb
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/mainwindow.ui
@@ -0,0 +1,356 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>413</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Style Sheet</string>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QFrame" name="mainFrame" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="6" column="0" colspan="5" >
+ <widget class="QCheckBox" name="agreeCheckBox" >
+ <property name="toolTip" >
+ <string>Please read the LICENSE file before checking</string>
+ </property>
+ <property name="text" >
+ <string>I accept the terms and &amp;conditions</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Profession:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
+ </property>
+ <property name="buddy" >
+ <cstring>professionList</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="nameLabel" >
+ <property name="text" >
+ <string>&amp;Name:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy" >
+ <cstring>nameCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QRadioButton" name="maleRadioButton" >
+ <property name="toolTip" >
+ <string>Check this if you are male</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Male</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="passwordLabel" >
+ <property name="text" >
+ <string>&amp;Password:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy" >
+ <cstring>passwordEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="4" >
+ <widget class="QComboBox" name="countryCombo" >
+ <property name="toolTip" >
+ <string>Specify country of origin</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify country of origin</string>
+ </property>
+ <property name="currentIndex" >
+ <number>6</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Egypt</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>France</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Germany</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>India</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Italy</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Norway</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Pakistan</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="ageLabel" >
+ <property name="text" >
+ <string>&amp;Age:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy" >
+ <cstring>ageSpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="countryLabel" >
+ <property name="text" >
+ <string>Country:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy" >
+ <cstring>countryCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="genderLabel" >
+ <property name="text" >
+ <string>Gender:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="4" >
+ <widget class="QLineEdit" name="passwordEdit" >
+ <property name="toolTip" >
+ <string>Specify your password</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your password</string>
+ </property>
+ <property name="text" >
+ <string>Password</string>
+ </property>
+ <property name="echoMode" >
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" colspan="2" >
+ <widget class="QRadioButton" name="femaleRadioButton" >
+ <property name="toolTip">
+ <string>Check this if you are female</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Female</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="2" >
+ <widget class="QSpinBox" name="ageSpinBox" >
+ <property name="toolTip" >
+ <string>Specify your age</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your age</string>
+ </property>
+ <property name="minimum" >
+ <number>12</number>
+ </property>
+ <property name="value" >
+ <number>22</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="4" >
+ <widget class="QComboBox" name="nameCombo" >
+ <property name="toolTip" >
+ <string>Specify your name</string>
+ </property>
+ <property name="editable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="3" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>61</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="7" column="3" colspan="2" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" colspan="4" >
+ <widget class="QListWidget" name="professionList" >
+ <property name="toolTip" >
+ <string>Select your profession</string>
+ </property>
+ <property name="statusTip" >
+ <string>Specify your name here</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Specify your name here</string>
+ </property>
+ <property name="currentRow" >
+ <number>0</number>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Developer</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Student</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Fisherman</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_File" >
+ <property name="title" >
+ <string>&amp;File</string>
+ </property>
+ <addaction name="editStyleAction" />
+ <addaction name="separator" />
+ <addaction name="exitAction" />
+ </widget>
+ <widget class="QMenu" name="menu_Help" >
+ <property name="title" >
+ <string>&amp;Help</string>
+ </property>
+ <addaction name="aboutAction" />
+ <addaction name="aboutQtAction" />
+ </widget>
+ <addaction name="menu_File" />
+ <addaction name="menu_Help" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ <action name="exitAction" >
+ <property name="text" >
+ <string>&amp;Exit</string>
+ </property>
+ </action>
+ <action name="aboutQtAction" >
+ <property name="text" >
+ <string>About Qt</string>
+ </property>
+ </action>
+ <action name="editStyleAction" >
+ <property name="text" >
+ <string>Edit &amp;Style...</string>
+ </property>
+ </action>
+ <action name="aboutAction" >
+ <property name="text" >
+ <string>About</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/widgets/widgets/stylesheet/qss/coffee.qss b/examples/widgets/widgets/stylesheet/qss/coffee.qss
new file mode 100644
index 0000000000..4571d42d7e
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/qss/coffee.qss
@@ -0,0 +1,112 @@
+.QWidget {
+ background-color: beige;
+}
+
+/* Nice Windows-XP-style password character. */
+QLineEdit[echoMode="2"] {
+ lineedit-password-character: 9679;
+}
+
+/* We provide a min-width and min-height for push buttons
+ so that they look elegant regardless of the width of the text. */
+QPushButton {
+ background-color: palegoldenrod;
+ border-width: 2px;
+ border-color: darkkhaki;
+ border-style: solid;
+ border-radius: 5;
+ padding: 3px;
+ min-width: 9ex;
+ min-height: 2.5ex;
+}
+
+QPushButton:hover {
+ background-color: khaki;
+}
+
+/* Increase the padding, so the text is shifted when the button is
+ pressed. */
+QPushButton:pressed {
+ padding-left: 5px;
+ padding-top: 5px;
+ background-color: #d0d67c;
+}
+
+QLabel, QAbstractButton {
+ font: bold;
+}
+
+/* Mark mandatory fields with a brownish color. */
+.mandatory {
+ color: brown;
+}
+
+/* Bold text on status bar looks awful. */
+QStatusBar QLabel {
+ font: normal;
+}
+
+QStatusBar::item {
+ border-width: 1;
+ border-color: darkkhaki;
+ border-style: solid;
+ border-radius: 2;
+}
+
+QComboBox, QLineEdit, QSpinBox, QTextEdit, QListView {
+ background-color: cornsilk;
+ selection-color: #0a214c;
+ selection-background-color: #C19A6B;
+}
+
+QListView {
+ show-decoration-selected: 1;
+}
+
+QListView::item:hover {
+ background-color: wheat;
+}
+
+/* We reserve 1 pixel space in padding. When we get the focus,
+ we kill the padding and enlarge the border. This makes the items
+ glow. */
+QLineEdit, QFrame {
+ border-width: 2px;
+ padding: 1px;
+ border-style: solid;
+ border-color: darkkhaki;
+ border-radius: 5px;
+}
+
+/* As mentioned above, eliminate the padding and increase the border. */
+QLineEdit:focus, QFrame:focus {
+ border-width: 3px;
+ padding: 0px;
+}
+
+/* A QLabel is a QFrame ... */
+QLabel {
+ border: none;
+ padding: 0;
+ background: none;
+}
+
+/* A QToolTip is a QLabel ... */
+QToolTip {
+ border: 2px solid darkkhaki;
+ padding: 5px;
+ border-radius: 3px;
+ opacity: 200;
+}
+
+/* Nice to have the background color change when hovered. */
+QRadioButton:hover, QCheckBox:hover {
+ background-color: wheat;
+}
+
+/* Force the dialog's buttons to follow the Windows guidelines. */
+QDialogButtonBox {
+ button-layout: 0;
+}
+
+
diff --git a/examples/widgets/widgets/stylesheet/qss/default.qss b/examples/widgets/widgets/stylesheet/qss/default.qss
new file mode 100644
index 0000000000..84eb5e0bc2
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/qss/default.qss
@@ -0,0 +1 @@
+/* empty stylesheet */
diff --git a/examples/widgets/widgets/stylesheet/qss/pagefold.qss b/examples/widgets/widgets/stylesheet/qss/pagefold.qss
new file mode 100644
index 0000000000..3701fc713c
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/qss/pagefold.qss
@@ -0,0 +1,299 @@
+/* Customize any plain widget that is a child of a QMainWindow. */
+QMainWindow > .QWidget {
+ background-color: gainsboro;
+ background-image: url(:/images/pagefold.png);
+ background-position: top right;
+ background-repeat: no-repeat
+}
+
+/* Provide a padding for the layout inside the frame. The frame
+ exists only to provide a padding for the top-right image, so we
+ explicitly disable the border. */
+#mainFrame {
+ padding-right: 30px;
+ border-style: none;
+ border-image: none; /* since we set a border-image below */
+}
+
+/* mainFrame won't have this border-image since we have
+ explicitly set it to 'none' using a more specific selector. */
+QFrame, QLineEdit, QComboBox[editable="true"], QSpinBox {
+ border-image: url(:/images/frame.png) 4;
+ border-width: 3;
+}
+
+QLabel {
+ border: none;
+ border-image: none;
+ padding: 0;
+ background: none;
+}
+
+/* Make text in message boxes selectable. */
+QMessageBox {
+ /* LinksAccessibleByMouse | TextSelectableByMouse */
+ messagebox-text-interaction-flags: 5;
+}
+
+/* Set the selection colors for all widgets. */
+QWidget {
+ selection-color: black;
+ selection-background-color: Silver;
+ color: black;
+}
+
+/* Make the entire row selected in item views. */
+QAbstractItemView {
+ show-decoration-selected: 1;
+}
+
+/* Nice WindowsXP-style password character for password line edits. */
+QLineEdit[echoMode="2"] {
+ lineedit-password-character: 9679;
+}
+
+/* Customize tooltips. */
+QToolTip {
+ background-color: rgb(200,200,255);
+ border-color: darkslategray;
+ border-width: 1px;
+ border-style: solid;
+ padding: 3px;
+ font: bold;
+ border-radius: 3px;
+ opacity: 200;
+}
+
+/* Customize radio buttons. */
+
+QRadioButton {
+ spacing: 5px;
+}
+
+QRadioButton::indicator {
+ width: 13px;
+ height: 13px;
+}
+
+QRadioButton::indicator::unchecked {
+ image: url(:/images/radiobutton_unchecked.png);
+}
+
+QRadioButton::indicator:unchecked:hover {
+ image: url(:/images/radiobutton_unchecked_hover.png);
+}
+
+QRadioButton::indicator:unchecked:pressed {
+ image: url(:/images/radiobutton_unchecked_pressed.png);
+}
+
+QRadioButton::indicator::checked {
+ image: url(:/images/radiobutton_checked.png);
+}
+
+QRadioButton::indicator:checked:hover {
+ image: url(:/images/radiobutton_checked_hover.png);
+}
+
+QRadioButton::indicator:checked:pressed {
+ image: url(:/images/radiobutton_checked_pressed.png);
+}
+
+/* Customize arrows. */
+
+*::down-arrow, *::menu-indicator {
+ image: url(:/images/down_arrow.png);
+ width: 7px;
+ height: 7px;
+}
+
+*::down-arrow:disabled, *::down-arrow:off {
+ image: url(:/images/down_arrow_disabled.png);
+}
+
+*::up-arrow {
+ image: url(:/images/up_arrow.png);
+ width: 7px;
+ height: 7px;
+}
+
+*::up-arrow:disabled, *::up-arrow:off {
+ image: url(:/images/up_arrow_disabled.png);
+}
+
+/* Customize push buttons and comboboxes. Our read-only combobox
+ is very similar to a push button, so they share the same border image. */
+
+QPushButton {
+ min-width: 4em;
+}
+
+QPushButton, QComboBox[editable="false"],
+QComboBox[editable="true"]::drop-down {
+ border-image: url(:/images/pushbutton.png) 5;
+ border-width: 5;
+}
+
+QPushButton:hover, QComboBox[editable="false"]:hover,
+QComboBox[editable="true"]::drop-down:hover, QMenuBar::item:hover {
+ border-image: url(:/images/pushbutton_hover.png) 5;
+ border-width: 5;
+}
+
+QPushButton:pressed, QComboBox[editable="false"]:on,
+QComboBox[editable="true"]::drop-down:on, QMenuBar::item:on {
+ border-image: url(:/images/pushbutton_pressed.png) 5;
+ border-width: 5;
+}
+
+/* Customize read-only comboboxes. */
+
+QComboBox[editable="false"] {
+ padding-left: 3px;
+ padding-right: 20px; /* space for the arrow */
+}
+
+QComboBox[editable="false"]::drop-down {
+ subcontrol-origin: padding;
+ subcontrol-position: top right;
+ width: 15px;
+ border-left-style: solid;
+ border-left-color: darkgray;
+ border-left-width: 1px;
+}
+
+QComboBox[editable="false"]::down-arrow {
+ subcontrol-origin: content;
+ subcontrol-position: center;
+ position: relative;
+ left: 1px; /* 1 pixel dropdown border */
+}
+
+/* The combobox arrow is on when the popup is open. */
+QComboBox[editable="false"]::down-arrow:on {
+ position: relative;
+ top: 1px;
+ left: 2px;
+}
+
+/* Customize editable comboboxes. */
+
+QComboBox[editable="true"] {
+ padding-right: 16px;
+}
+
+QComboBox[editable="true"]::drop-down {
+ subcontrol-origin: border;
+ subcontrol-position: top right;
+ width: 13px;
+ position: absolute;
+ top: 2px;
+ bottom: 2px;
+ right: 2px;
+}
+
+QComboBox[editable="true"]::drop-down,
+QComboBox[editable="true"]::drop-down:hover,
+QComboBox[editable="true"]::drop-down:on {
+ border-width: 0px;
+ border-left-width: 3px; /* we need only left and center part */
+}
+
+/* Shift the arrow when it's open. */
+QComboBox[editable="true"]::down-arrow:on {
+ position: relative;
+ top: 1px;
+ left: 1px;
+}
+
+/* Customize check boxes. */
+QCheckBox {
+ spacing: 5px;
+}
+
+QCheckBox::indicator {
+ width: 13px;
+ height: 13px;
+}
+
+QCheckBox::indicator:unchecked {
+ image: url(:/images/checkbox_unchecked.png);
+}
+
+QCheckBox::indicator:unchecked:hover {
+ image: url(:/images/checkbox_unchecked_hover.png);
+}
+
+QCheckBox::indicator:unchecked:pressed {
+ image: url(:/images/checkbox_unchecked_pressed.png);
+}
+
+QCheckBox::indicator:checked {
+ image: url(:/images/checkbox_checked.png);
+}
+
+QCheckBox::indicator:checked:hover {
+ image: url(:/images/checkbox_checked_hover.png);
+}
+
+QCheckBox::indicator:checked:pressed {
+ image: url(:/images/checkbox_checked_pressed.png);
+}
+
+/* Customize the size grip. */
+QSizeGrip {
+ image: url(:/images/sizegrip.png);
+ width: 16px;
+ height: 16px;
+}
+
+/* Customize the menu bar. */
+QMenuBar {
+ border-image: none;
+ border-style: none;
+ border-width: 1px;
+ border-bottom-style: solid;
+ border-bottom-color: darkslategray;
+ padding: 2px;
+}
+
+/* Customize spin boxes. */
+
+QSpinBox {
+ padding-right: 15px;
+}
+
+QSpinBox::up-button {
+ subcontrol-origin: border;
+ subcontrol-position: top right;
+
+ width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
+ border-image: url(:/images/spinup.png) 1;
+ border-width: 1px;
+}
+
+QSpinBox::up-button:hover {
+ border-image: url(:/images/spinup_hover.png) 1;
+}
+
+QSpinBox::up-button:pressed {
+ border-image: url(:/images/spinup_pressed.png) 1;
+}
+
+QSpinBox::down-button {
+ subcontrol-origin: border;
+ subcontrol-position: bottom right;
+
+ width: 16px;
+ border-image: url(:/images/spindown.png) 1;
+ border-width: 1px;
+ border-top-width: 0;
+}
+
+QSpinBox::down-button:hover {
+ border-image: url(:/images/spindown_hover.png) 1;
+}
+
+QSpinBox::down-button:pressed {
+ border-image: url(:/images/spindown_pressed.png) 1;
+}
diff --git a/examples/widgets/widgets/stylesheet/stylesheet.desktop b/examples/widgets/widgets/stylesheet/stylesheet.desktop
new file mode 100644
index 0000000000..0550b19ba2
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/stylesheet.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Style Sheet
+Exec=/opt/usr/bin/stylesheet
+Icon=stylesheet
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/widgets/stylesheet/stylesheet.pro b/examples/widgets/widgets/stylesheet/stylesheet.pro
new file mode 100644
index 0000000000..4d609a9210
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/stylesheet.pro
@@ -0,0 +1,18 @@
+HEADERS = mainwindow.h \
+ stylesheeteditor.h
+FORMS = mainwindow.ui \
+ stylesheeteditor.ui
+RESOURCES = stylesheet.qrc
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ stylesheeteditor.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/stylesheet
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images layouts qss
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/stylesheet
+INSTALLS += target sources
+
+QT += widgets
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/widgets/stylesheet/stylesheet.qrc b/examples/widgets/widgets/stylesheet/stylesheet.qrc
new file mode 100644
index 0000000000..e1e61a920a
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/stylesheet.qrc
@@ -0,0 +1,39 @@
+<RCC>
+<qresource prefix="/">
+ <file>layouts/default.ui</file>
+ <file>layouts/pagefold.ui</file>
+ <file>qss/coffee.qss</file>
+ <file>qss/default.qss</file>
+ <file>qss/pagefold.qss</file>
+ <file>images/pagefold.png</file>
+ <file>images/frame.png</file>
+ <file>images/radiobutton_unchecked.png</file>
+ <file>images/radiobutton_unchecked_pressed.png</file>
+ <file>images/radiobutton_unchecked_hover.png</file>
+ <file>images/radiobutton_checked.png</file>
+ <file>images/radiobutton_checked_pressed.png</file>
+ <file>images/radiobutton_checked_hover.png</file>
+ <file>images/pushbutton.png</file>
+ <file>images/pushbutton_hover.png</file>
+ <file>images/pushbutton_pressed.png</file>
+ <file>images/checkbox_unchecked.png</file>
+ <file>images/checkbox_unchecked_pressed.png</file>
+ <file>images/checkbox_unchecked_hover.png</file>
+ <file>images/checkbox_checked.png</file>
+ <file>images/checkbox_checked_pressed.png</file>
+ <file>images/checkbox_checked_hover.png</file>
+ <file>images/down_arrow.png</file>
+ <file>images/down_arrow_disabled.png</file>
+ <file>images/up_arrow.png</file>
+ <file>images/up_arrow_disabled.png</file>
+ <file>images/sizegrip.png</file>
+ <file>images/spinup.png</file>
+ <file>images/spinup_off.png</file>
+ <file>images/spinup_hover.png</file>
+ <file>images/spinup_pressed.png</file>
+ <file>images/spindown.png</file>
+ <file>images/spindown_off.png</file>
+ <file>images/spindown_hover.png</file>
+ <file>images/spindown_pressed.png</file>
+</qresource>
+</RCC>
diff --git a/examples/widgets/widgets/stylesheet/stylesheeteditor.cpp b/examples/widgets/widgets/stylesheet/stylesheeteditor.cpp
new file mode 100644
index 0000000000..5514291a7f
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/stylesheeteditor.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWidgets>
+
+#include "stylesheeteditor.h"
+
+StyleSheetEditor::StyleSheetEditor(QWidget *parent)
+ : QDialog(parent)
+{
+ ui.setupUi(this);
+
+ QRegExp regExp(".(.*)\\+?Style");
+ QString defaultStyle = QApplication::style()->metaObject()->className();
+
+ if (regExp.exactMatch(defaultStyle))
+ defaultStyle = regExp.cap(1);
+
+ ui.styleCombo->addItems(QStyleFactory::keys());
+ ui.styleCombo->setCurrentIndex(ui.styleCombo->findText(defaultStyle, Qt::MatchContains));
+ ui.styleSheetCombo->setCurrentIndex(ui.styleSheetCombo->findText("Coffee"));
+ loadStyleSheet("Coffee");
+}
+
+void StyleSheetEditor::on_styleCombo_activated(const QString &styleName)
+{
+ qApp->setStyle(styleName);
+ ui.applyButton->setEnabled(false);
+}
+
+void StyleSheetEditor::on_styleSheetCombo_activated(const QString &sheetName)
+{
+ loadStyleSheet(sheetName);
+}
+
+void StyleSheetEditor::on_styleTextEdit_textChanged()
+{
+ ui.applyButton->setEnabled(true);
+}
+
+void StyleSheetEditor::on_applyButton_clicked()
+{
+ qApp->setStyleSheet(ui.styleTextEdit->toPlainText());
+ ui.applyButton->setEnabled(false);
+}
+
+void StyleSheetEditor::loadStyleSheet(const QString &sheetName)
+{
+ QFile file(":/qss/" + sheetName.toLower() + ".qss");
+ file.open(QFile::ReadOnly);
+ QString styleSheet = QString::fromLatin1(file.readAll());
+
+ ui.styleTextEdit->setPlainText(styleSheet);
+ qApp->setStyleSheet(styleSheet);
+ ui.applyButton->setEnabled(false);
+}
diff --git a/examples/widgets/widgets/stylesheet/stylesheeteditor.h b/examples/widgets/widgets/stylesheet/stylesheeteditor.h
new file mode 100644
index 0000000000..36b18d91fb
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/stylesheeteditor.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef STYLESHEETEDITOR_H
+#define STYLESHEETEDITOR_H
+
+#include <QDialog>
+
+#include "ui_stylesheeteditor.h"
+
+class StyleSheetEditor : public QDialog
+{
+ Q_OBJECT
+
+public:
+ StyleSheetEditor(QWidget *parent = 0);
+
+private slots:
+ void on_styleCombo_activated(const QString &styleName);
+ void on_styleSheetCombo_activated(const QString &styleSheetName);
+ void on_styleTextEdit_textChanged();
+ void on_applyButton_clicked();
+
+private:
+ void loadStyleSheet(const QString &sheetName);
+
+ Ui::StyleSheetEditor ui;
+};
+
+#endif
diff --git a/examples/widgets/widgets/stylesheet/stylesheeteditor.ui b/examples/widgets/widgets/stylesheet/stylesheeteditor.ui
new file mode 100644
index 0000000000..34cd7f6d04
--- /dev/null
+++ b/examples/widgets/widgets/stylesheet/stylesheeteditor.ui
@@ -0,0 +1,171 @@
+<ui version="4.0" >
+ <class>StyleSheetEditor</class>
+ <widget class="QWidget" name="StyleSheetEditor" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>445</width>
+ <height>289</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Style Editor</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="6" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>32</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>32</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="5" >
+ <widget class="QComboBox" name="styleSheetCombo" >
+ <item>
+ <property name="text" >
+ <string>Default</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Coffee</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Pagefold</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>10</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QComboBox" name="styleCombo" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="label_7" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Style:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="7" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>321</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="applyButton" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" colspan="7" >
+ <widget class="QTextEdit" name="styleTextEdit" />
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLabel" name="label_8" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Style Sheet:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>