📄 phonebookeditdlg.cpp
字号:
#include <klocale.h>/****************************************************************************** Form implementation generated from reading ui file './phonebookeditdlg.ui'**** Created: Mon Feb 19 21:40:19 2001** by: The User Interface Compiler (uic)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "phonebookeditdlg.h"#include <qgroupbox.h>#include <qlabel.h>#include <qlineedit.h>#include <qpushbutton.h>#include <qlayout.h>#include <qvariant.h>#include <qtooltip.h>#include <qwhatsthis.h>/* * Constructs a PhonebookEditDialog which is 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. */PhonebookEditDialog::PhonebookEditDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "phonebookEditDlg" ); resize( 400, 151 ); setCaption( i18n( "Phonebook Editor" ) ); setSizeGripEnabled( TRUE ); setMinimumSize( QSize( 400, 150 ) ); phonebookEditDlgLayout = new QVBoxLayout( this ); phonebookEditDlgLayout->setSpacing( 6 ); phonebookEditDlgLayout->setMargin( 11 ); GroupBox1 = new QGroupBox( this, "GroupBox1" ); GroupBox1->setTitle( i18n( "Edit Phonebook Entry" ) ); GroupBox1->setColumnLayout(0, Qt::Vertical ); GroupBox1->layout()->setSpacing( 0 ); GroupBox1->layout()->setMargin( 0 ); GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); GroupBox1Layout->setAlignment( Qt::AlignTop ); GroupBox1Layout->setSpacing( 6 ); GroupBox1Layout->setMargin( 11 ); TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); TextLabel1->setText( i18n( "Name:" ) ); GroupBox1Layout->addWidget( TextLabel1, 0, 0 ); TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); TextLabel2->setText( i18n( "Number:" ) ); GroupBox1Layout->addWidget( TextLabel2, 1, 0 ); nameEdit = new QLineEdit( GroupBox1, "nameEdit" ); GroupBox1Layout->addWidget( nameEdit, 0, 1 ); numberEdit = new QLineEdit( GroupBox1, "numberEdit" ); GroupBox1Layout->addWidget( numberEdit, 1, 1 ); phonebookEditDlgLayout->addWidget( GroupBox1 ); Layout1 = new QHBoxLayout; Layout1->setSpacing( 6 ); Layout1->setMargin( 0 ); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout1->addItem( spacer ); buttonOk = new QPushButton( this, "buttonOk" ); buttonOk->setText( i18n( "&OK" ) ); buttonOk->setAutoDefault( TRUE ); buttonOk->setDefault( TRUE ); Layout1->addWidget( buttonOk ); buttonCancel = new QPushButton( this, "buttonCancel" ); buttonCancel->setText( i18n( "&Cancel" ) ); buttonCancel->setAutoDefault( TRUE ); Layout1->addWidget( buttonCancel ); phonebookEditDlgLayout->addLayout( Layout1 ); // signals and slots connections connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );}/* * Destroys the object and frees any allocated resources */PhonebookEditDialog::~PhonebookEditDialog(){ // no need to delete child widgets, Qt does it all for us}#include "phonebookeditdlg.moc"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -