我想要一个带有自定义小部件的。
我创建了一个自定义小部件(包括.ui、.h和.cpp文件)。
我将此自定义小部件添加到我的的第一页,但在QtCreator的设计师中没有显示出该小部件的内容。
我将我的自定义小部件提升为。
当我运行程序时,这个设置编译并按预期工作,但我的自定义控件不会在QtCreator的设计师中显示出来。
我应该怎么做才能让我的自定义控件在QtCreator的设计器中显示出来呢?
下面是MainWindow.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>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>my title </string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>10</y>
<width>801</width>
<height>551</height>
</rect>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="Tab1Custom" name="myTab1">
<attribute name="title">
<string>My Tab number 1</string>
</attribute>
</widget>
....