⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newprojectdialog.cpp

📁 这是一个用QT做的用加农炮大飞碟的示例程序.对学习QT有很大帮助. 这是最后的例子:一个完整的游戏。 我们添加键盘快捷键并引入鼠标事件到CannonField。我们在CannonField周
💻 CPP
字号:
/****************************************************************************** Form implementation generated from reading ui file 'newprojectdialog.ui'**** Created: 星期四 一月 10 17:18:34 2008**      by: The User Interface Compiler ($Id: qt/main.cpp   3.2.1   edited May 19 14:22 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "newprojectdialog.h"#include <qvariant.h>#include <qpushbutton.h>#include <qlabel.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>/* *  Constructs a NewProjectDialog1 as a child of 'parent', with the *  name 'name' and widget flags set to 'f'. * *  The dialog will by default be modeless, unless you set 'modal' to *  TRUE to construct a modal dialog. */NewProjectDialog1::NewProjectDialog1( QWidget* parent, const char* name, bool modal, WFlags fl )    : QDialog( parent, name, modal, fl ){    if ( !name )	setProperty( "name", "NewProjectDialog" );    setProperty( "sizeGripEnabled", QVariant( TRUE, 0 ) );    QWidget* privateLayoutWidget = new QWidget( this, "Layout1" );    privateLayoutWidget->setProperty( "geometry", QRect( 20, 240, 476, 33 ) );    Layout1 = new QHBoxLayout( privateLayoutWidget, 0, 6, "Layout1");     buttonHelp = new QPushButton( privateLayoutWidget, "buttonHelp" );    buttonHelp->setProperty( "autoDefault", QVariant( TRUE, 0 ) );    Layout1->addWidget( buttonHelp );    QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );    Layout1->addItem( spacer );    buttonApply = new QPushButton( privateLayoutWidget, "buttonApply" );    buttonApply->setProperty( "autoDefault", QVariant( TRUE, 0 ) );    Layout1->addWidget( buttonApply );    buttonOk = new QPushButton( privateLayoutWidget, "buttonOk" );    buttonOk->setProperty( "autoDefault", QVariant( TRUE, 0 ) );    buttonOk->setProperty( "default", QVariant( TRUE, 0 ) );    Layout1->addWidget( buttonOk );    buttonCancel = new QPushButton( privateLayoutWidget, "buttonCancel" );    buttonCancel->setProperty( "autoDefault", QVariant( TRUE, 0 ) );    Layout1->addWidget( buttonCancel );    TextLabel1 = new QLabel( this, "TextLabel1" );    TextLabel1->setProperty( "geometry", QRect( 200, 120, 116, 13 ) );    languageChange();    resize( QSize(519, 285).expandedTo(minimumSizeHint()) );    clearWState( WState_Polished );    // signals and slots connections    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );}/* *  Destroys the object and frees any allocated resources */NewProjectDialog1::~NewProjectDialog1(){    // no need to delete child widgets, Qt does it all for us}/* *  Sets the strings of the subwidgets using the current *  language. */void NewProjectDialog1::languageChange(){    setProperty( "caption", tr( "NewProject" ) );    buttonHelp->setProperty( "text", tr( "&Help" ) );    buttonApply->setProperty( "text", tr( "&Apply" ) );    buttonOk->setProperty( "caption", QString::null );    buttonOk->setProperty( "text", tr( "&OK" ) );    buttonCancel->setProperty( "text", tr( "&Cancel" ) );    TextLabel1->setProperty( "text", tr( "Place your widgets here!" ) );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -