📄 mydialog.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'mydialog.ui'**** Created: 五 7月 4 09:26:14 2008** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.6 edited Aug 31 2005 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "mydialog.h"#include <qvariant.h>#include <qpushbutton.h>#include <qlcdnumber.h>#include <qslider.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include "../mydialog.ui.h"/* * Constructs a MyDialog 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. */MyDialog::MyDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "MyDialog" ); setSizeGripEnabled( TRUE ); pushButton1 = new QPushButton( this, "pushButton1" ); pushButton1->setGeometry( QRect( 210, 30, 60, 21 ) ); QFont pushButton1_font( pushButton1->font() ); pushButton1_font.setPointSize( 18 ); pushButton1->setFont( pushButton1_font ); pushButton2 = new QPushButton( this, "pushButton2" ); pushButton2->setGeometry( QRect( 200, 70, 70, 21 ) ); QFont pushButton2_font( pushButton2->font() ); pushButton2_font.setPointSize( 18 ); pushButton2->setFont( pushButton2_font ); lCDNumber1 = new QLCDNumber( this, "lCDNumber1" ); lCDNumber1->setGeometry( QRect( 30, 40, 111, 41 ) ); slider1 = new QSlider( this, "slider1" ); slider1->setGeometry( QRect( 30, 110, 111, 24 ) ); slider1->setOrientation( QSlider::Horizontal ); languageChange(); resize( QSize(297, 200).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( pushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( pushButton2, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( slider1, SIGNAL( valueChanged(int) ), this, SLOT( newSlot(int) ) );}/* * Destroys the object and frees any allocated resources */MyDialog::~MyDialog(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */void MyDialog::languageChange(){ setCaption( tr( "MyDialog" ) ); pushButton1->setText( tr( "OK" ) ); pushButton2->setText( tr( "CANCEL" ) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -