我的同事在Linux上创建了一个C ++ Qt项目,然后在Windows上对其进行了“转换”。现在,我是一个功能齐全的GUI,但我不知道为什么,当我使用QtDesigner打开 .ui 文件时,该文件为空,所有小部件都消失了。
任何想法如何取回我的小部件,还是仅因为该文件是在Linux上的QtDesigner上创建的?
这是在Windows上使用文本编辑器打开的ui文件的一部分:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>874</width>
<height>497</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>110</y>
<width>541</width>
<height>331</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>860</width>
<height>700</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="buildMotionTab_3">
<attribute name="title">
<string>Tab 1</string>
</attribute>
<widget class="QFrame" name="centralFrame_3">
<property name="geometry">
<rect>
<x>-10</x>
<y>0</y>
<width>860</width>
<height>851</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>860</width>
<height>851</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>810</width>
<height>851</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QFrame" name="motorFrameP_3">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>281</width>
<height>280</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>280</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>280</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QSpinBox" name="LineDist">
<property name="geometry">
<rect>
<x>190</x>
<y>150</y>
<width>81</width>
<height>32</height>
</rect>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>470</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
[...]
<widget class="QPushButton" name="StandDownButton">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>StandDown</string>
</property>
</widget>
<widget class="QPushButton" name="Homing1Button">
<property name="geometry">
<rect>
<x>120</x>
<y>70</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Homing X</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>874</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>