Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
- <property name="windowTitle">
- <string>Designer Composite Custom Widget Demo</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <property name="leftMargin">
- <number>12</number>
- </property>
- <property name="topMargin">
- <number>12</number>
- </property>
- <property name="rightMargin">
- <number>12</number>
- </property>
- <property name="bottomMargin">
- <number>12</number>
- </property>
- <property name="spacing">
- <number>10</number>
- </property>
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>This main.ui references a custom widget class (LampIndicator) via promotion metadata.</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="LampIndicator" name="lampStatus">
- <property name="minimumSize">
- <size>
- <width>220</width>
- <height>28</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="buttonsLayout">
- <item>
- <widget class="QPushButton" name="btnOn">
- <property name="text">
- <string>ON</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="btnOff">
- <property name="text">
- <string>OFF</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="btnAlarm">
- <property name="text">
- <string>ALARM</string>
- </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>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar"/>
- <widget class="QStatusBar" name="statusbar"/>
- </widget>
- <customwidgets>
- <customwidget>
- <class>LampIndicator</class>
- <extends>QWidget</extends>
- <header>my_widgets.lamp_indicator</header>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
- </ui>
Advertisement
Comments
-
- its a lamp like on a PLC, but my issue is that the object in Qt Designer renders as a rectangle, making it hard to design around. there might be some way to make it render in the designer, but I haven't figured that out yet.
Add Comment
Please, Sign In to add comment