问题描述
在设计器中,当我右键单击小部件时,然后单击升级以得到此窗口。请参见下面的屏幕截图。
In the designer when I right click a widget, and I click promote to I get this window. See the screenshot below.
我从未使用过此功能。基本上,头文件使我感到困惑。这是为了什么这是否意味着我可以在这种情况下创建一个新类,继承QLineEdit并为其添加更多方法?升级的类名称是什么?
I have never used this feature. Basically, the header file is confusing me. What is it for? Does that mean I can create a new class in this case, inheriting QLineEdit and add more methods to it? What is the promoted class name?
推荐答案
这使您可以使用在其他地方定义的自定义窗口小部件,否则设计人员将不会知道。
This allows you to use custom widgets defined elsewhere, which designer otherwise wouldn't know about.
例如,如果您定义了从或 #include< mypackage / mycomponent.h> for c ++)
Global include is ignored by pyuic, it only affects uic (generate #include "mypackage/mycomponent.h" or #include <mypackage/mycomponent.h> for c++)
这篇关于如何在pyqt4的Qt Designer中使用升级到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!