📄 form1.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'form1.ui'**** Created: 一 2月 25 20:45:26 2008** by: The User Interface Compiler ($Id: qt/main.cpp 3.1.1 edited Nov 21 17:40 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "form1.h"#include <qvariant.h>#include <qlabel.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" ); textLabel1 = new QLabel( this, "textLabel1" ); textLabel1->setGeometry( QRect( 31, 41, 74, 22 ) ); QFont textLabel1_font( textLabel1->font() ); textLabel1_font.setPointSize( 12 ); textLabel1->setFont( textLabel1_font ); lineEdit1 = new QLineEdit( this, "lineEdit1" ); lineEdit1->setGeometry( QRect( 121, 51, 108, 22 ) ); lineEdit2 = new QLineEdit( this, "lineEdit2" ); lineEdit2->setGeometry( QRect( 121, 79, 108, 22 ) ); pushButton3 = new QPushButton( this, "pushButton3" ); pushButton3->setGeometry( QRect( 190, 160, 80, 31 ) ); pushButton1 = new QPushButton( this, "pushButton1" ); pushButton1->setGeometry( QRect( 10, 160, 80, 31 ) ); pushButton2 = new QPushButton( this, "pushButton2" ); pushButton2->setGeometry( QRect( 100, 160, 80, 31 ) ); languageChange(); resize( QSize(281, 277).expandedTo(minimumSizeHint()) ); // signals and slots connections connect( pushButton1, SIGNAL( clicked() ), this, SLOT( link() ) ); connect( pushButton2, SIGNAL( clicked() ), this, SLOT( send() ) ); connect( pushButton3, SIGNAL( clicked() ), this, SLOT( close() ) ); // buddies textLabel1->setBuddy( lineEdit1 );}/* * 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( "server" ) ); textLabel1->setText( tr( "&comment " ) ); pushButton3->setText( tr( "&Close" ) ); pushButton1->setText( tr( "&Connect" ) ); pushButton2->setText( tr( "&Send" ) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -