diff options
author | Kai Koehne <kai.koehne@qt.io> | 2017-11-28 10:27:11 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-09 15:20:40 +0000 |
commit | a8372327daac7f672106645e3b93014e3c71c67a (patch) | |
tree | c80588bbf14a5cf479f113ccf603612847060b83 /examples/webenginewidgets | |
parent | 7473a43beff891c93a245620b6307f3a073dba28 (diff) |
stylesheet example: Make dialog adapt to different sizes
The old code had fixed pixel sizes, which broke with high dpi and
different font sizes. Also, simplify the hierarchy by replacing
the top widget and the nested layouts with a Frame and grid layout.
Task-number: QTBUG-64816
Change-Id: Ifeb458fb5d5e709e8add9c77c274dee13307d4c6
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'examples/webenginewidgets')
-rw-r--r-- | examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui | 199 |
1 files changed, 63 insertions, 136 deletions
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui b/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui index 3e70ce89a..19db267e8 100644 --- a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui +++ b/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui @@ -5,154 +5,81 @@ <property name="windowModality"> <enum>Qt::ApplicationModal</enum> </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>547</width> - <height>431</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>547</width> - <height>431</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>547</width> - <height>431</height> - </size> - </property> <property name="windowTitle"> <string>Stylesheets</string> </property> <property name="modal"> <bool>true</bool> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QWidget" name="widget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <widget class="QWidget" name="horizontalLayoutWidget"> - <property name="geometry"> - <rect> - <x>9</x> - <y>9</y> - <width>511</width> - <height>371</height> - </rect> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item> - <widget class="QListWidget" name="styleSheetList"/> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="fileNameLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Stylesheet name:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="fileNameEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <widget class="QLabel" name="sourceLabel"> - <property name="text"> - <string>Source code:</string> - </property> - </widget> - </item> - <item> - <widget class="QPlainTextEdit" name="sourceCodeEdit"> - <property name="font"> - <font> - <family>Courier New</family> - <pointsize>10</pointsize> - </font> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QPushButton" name="addButton"> - <property name="text"> - <string>Add</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="removeButton"> - <property name="text"> - <string>Remove</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - </widget> - </item> - <item> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="3" column="1"> <widget class="QDialogButtonBox" name="buttonBox"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="standardButtons"> - <set>QDialogButtonBox::Ok</set> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + <item row="0" column="0" rowspan="3"> + <widget class="QListWidget" name="styleSheetList"/> + </item> + <item row="0" column="1" rowspan="3"> + <widget class="QFrame" name="frame"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="fileNameLabel"> + <property name="text"> + <string>Stylesheet name:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="fileNameEdit"/> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="sourceLabel"> + <property name="text"> + <string>Source code:</string> + </property> + </widget> + </item> + <item row="2" column="0" colspan="2"> + <widget class="QPlainTextEdit" name="sourceCodeEdit"> + <property name="font"> + <font> + <family>Courier New</family> + <pointsize>10</pointsize> + </font> + </property> + </widget> + </item> + <item row="3" column="0" colspan="2"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="addButton"> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="removeButton"> + <property name="text"> + <string>Remove</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> </layout> |