📄 gotopagedialog.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'gotopagedialog.ui'**** Created: 日 7月 22 15:28:27 2007** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.2 edited Nov 24 13:47 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "gotopagedialog.h"#include <qvariant.h>#include <qpushbutton.h>#include <qlabel.h>#include <qlineedit.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>
#include <qvalidator.h>/* * Constructs a Gotopagedialog 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. */Gotopagedialog::Gotopagedialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "Gotopagedialog" ); label = new QLabel( this, "label" ); label->setGeometry( 12, 13, 46, 25 ); lineEdit = new QLineEdit( this, "lineEdit" ); lineEdit->setGeometry( 64, 13, 142, 25 ); okButton = new QPushButton( this, "okButton" );
okButton->setGeometry( 36, 47, 82, 30 ); okButton->setEnabled( FALSE ); okButton->setDefault( TRUE ); cancelButton = new QPushButton( this, "cancelButton" ); cancelButton->setGeometry( 124, 47, 82, 30 );
languageChange(); resize( QSize(218, 80).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( lineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( enableOkButton() ) ); // buddies label->setBuddy( lineEdit );
init();}/* * Destroys the object and frees any allocated resources */Gotopagedialog::~Gotopagedialog(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */
void Gotopagedialog::init()
{
//QRegExp regExp("[1-9][0-9]{0,8}");
lineEdit->setValidator(new QIntValidator(1, 9999, this));
}void Gotopagedialog::languageChange(){ setCaption( tr( "GotoPage" ) ); label->setText( tr( "Page:" ) ); okButton->setText( tr( "ok" ) ); cancelButton->setText( tr( "cancel" ) );}void Gotopagedialog::enableOkButton(){ //qWarning( "Gotopagedialog::enableOkButton(): Not implemented yet" );
okButton->setEnabled( TRUE ); //lineEdit->hasAcceptableInput()}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -