【发布时间】:2013-06-11 08:52:55
【问题描述】:
我在 Qt 设计器中创建了一个QComboBox。现在我想在我的mainwidget 中访问那个QComboBox。但是当创建者不认识ui->comboboxName。可能有一个简单的解决方案,但我似乎找不到。
这是我的ui文件中的QCombobox,我无法访问小部件标题或小部件源中的rolKeuze
<widget class="QComboBox" name="rolKeuze">
<item>
<property name="text">
<string>Bouwmeester</string>
</property>
</item>
<item>
<property name="text">
<string>Burgemeester</string>
</property>
</item>
</widget>
【问题讨论】:
-
请发布您的 cpp 和 ui 文件。
-
我们需要更多代码。至少你试图访问 rolKeuze 的头文件和 .cpp 文件
-
清除所有,手动运行 qmake 并重建,通常会有帮助。
标签: c++ qt user-interface