The*_*ast 5 c++ qt header qt-creator qpushbutton
我在 QT Creator 中有一个项目,我希望在使用新对象时自动包含头文件。这就像在 Eclipse 中:在使用 Ctrl+Alt+Space 调用新对象时添加所需的标题:将包含所有需要的标题。
这是一个例子
#include <QApplication>
#include <QPushButton> /* Header that i want to include automatically */
int main( int argc, char *argv[ ] )
{
QApplication app( argc, argv) ;
QWidget fenetre;
/*Add needed headers when invoking a new object like ctrl+alt+space in eclipse*/
QPushButton bouton( "Bonjour", &fenetre) ;
bouton. move(70,60);
fenetre. show( ) ;
return app. exec( ) ;
}
Run Code Online (Sandbox Code Playgroud)
关于如何在 QT Creator 中执行此操作的任何建议?谢谢
小智 5
在 Qt Creator 版本 4.1.0 中,您可以选择:
快捷方式是Alt+Return来触发快速修复,如果它在您的计算机上不起作用Tools -> Options -> Environment -> Keyboard(搜索快速修复),您可以查看它的快捷方式是什么。
| 归档时间: |
|
| 查看次数: |
3291 次 |
| 最近记录: |