📄 form1.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'form1.ui'**** Created by: The User Interface Compiler ($Id: qt/main.cpp 3.3.8 edited Jan 11 14:47 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "form1.h"#include <qvariant.h>#include <qlineedit.h>#include <qpushbutton.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qimage.h>#include <qpixmap.h>#include "../form1.ui.h"/* * Constructs a Form1 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. */Form1::Form1( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "Form1" ); lineEdit2 = new QLineEdit( this, "lineEdit2" ); lineEdit2->setGeometry( QRect( 20, 60, 330, 22 ) ); lineEdit1 = new QLineEdit( this, "lineEdit1" ); lineEdit1->setGeometry( QRect( 20, 20, 330, 22 ) ); pushButton4 = new QPushButton( this, "pushButton4" ); pushButton4->setGeometry( QRect( 140, 130, 100, 31 ) ); pushButton5 = new QPushButton( this, "pushButton5" ); pushButton5->setGeometry( QRect( 260, 130, 100, 31 ) ); pushButton3 = new QPushButton( this, "pushButton3" ); pushButton3->setGeometry( QRect( 20, 130, 100, 31 ) ); languageChange(); resize( QSize(388, 253).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( pushButton3, SIGNAL( clicked() ), this, SLOT( pushButton3_clicked() ) ); connect( pushButton4, SIGNAL( clicked() ), this, SLOT( pushButton4_clicked() ) ); connect( pushButton5, SIGNAL( clicked() ), this, SLOT( pushButton5_clicked() ) );}/* * Destroys the object and frees any allocated resources */Form1::~Form1(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */void Form1::languageChange(){ setCaption( tr( "Form1" ) ); pushButton4->setText( tr( "Set lineEdit2" ) ); pushButton5->setText( tr( "Exit" ) ); pushButton3->setText( tr( "Set lineEdit1" ) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -