Using C++ to create Interface Panel with just UI file (QT)
-
I don't understand you. Can you rephrase your question?
So you have an UI file, but you don't want to use it and write the GUI yourself, by hand, only in C++? It is possible, although not flexible and gives no real benefits apart from - maybe - a few miliseconds during compilation.
-
I need to create UI myself, with some of the rules. I can create the UI myself now. But I need help to use the UI with QT creator and build it. (When I put my own UI in Qt current dırectory, it works well with my UI, but at this one I compile programme with QT creator) But I need to do this work with a software (which is c++). when i start that software programmhe, the programme bring my own UI and compile it same as Qt creator then open the Interface panel automaticly.
-
For example my UI is :
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QtTabClass</class>
<widget class="QMainWindow" name="QtTabClass">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>QtTab</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>100</x>
<y>150</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="qttab.qrc"/>
</resources>
<connections/>
</ui> -
@<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QtTabClass</class>
<widget class="QMainWindow" name="QtTabClass">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>QtTab</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>100</x>
<y>150</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="qttab.qrc"/>
</resources>
<connections/>
</ui>@ -
Hi,
It's not very clear from your description but are you searching something like "QUiLoader":http://qt-project.org/doc/qt-4.8/quiloader.html ?
-
I still have no idea what you mean. Please, get a book on Qt, read it, maybe this will clear things up for you.
Please learn better English, too, as it's very hard to understand you now.
I don't mean to be rude, mind you: I want to help you, but right now I simply don't know what you are talking about.