📄 form1.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'form1.ui'**** Created: 四 9月 4 10:23:04 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 <qpushbutton.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qimage.h>#include <qpixmap.h>#include <qbitmap.h>/* * Constructs a Form1 as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */Form1::Form1( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ){ if ( !name ) setName( "Form1" ); setMinimumSize( QSize( 240, 320 ) ); setMaximumSize( QSize( 240, 320 ) ); setPaletteBackgroundPixmap( QPixmap::fromMimeSource( "seaside.png" ) ); pushButton1 = new QPushButton( this, "pushButton1" ); pushButton1->setGeometry( QRect( 60, 60, 120, 120 ) ); pushButton1->setPixmap( QPixmap::fromMimeSource( "tmp.png" ) ); QBitmap maskBitmap("mask.png"); pushButton1->setMask(maskBitmap); connect(pushButton1,SIGNAL(clicked()),this,SLOT(close())); languageChange(); resize( QSize(240, 320).expandedTo(minimumSizeHint()) );}/* * 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( "right-02" ) ); pushButton1->setText( QString::null );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -