📄 testhrmsdialogbase.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file '.\testhrmsdialogbase.ui'**** Created: 星期三 十二月 31 16:09:38 2003** by: The User Interface Compiler ($Id: qt/main.cpp 3.1.2 edited Dec 19 11:45 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "testhrmsdialogbase.h"#include <qvariant.h>#include <qtable.h>#include <qpushbutton.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include "testhrmsdialogbase.ui.h"/* * Constructs a testHRMSDialogBase 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. */testHRMSDialogBase::testHRMSDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "testHRMSDialogBase" ); setSizeGripEnabled( TRUE ); table1 = new QTable( this, "table1" ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, trUtf8( "姓名" ) ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, trUtf8( "性别" ) ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, trUtf8( "年龄" ) ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, trUtf8( "工作单位" ) ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, trUtf8( "职务" ) ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, trUtf8( "电话" ) ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, trUtf8( "住址" ) ); table1->setNumCols( table1->numCols() + 1 ); table1->horizontalHeader()->setLabel( table1->numCols() - 1, tr( "ID" ) ); table1->setGeometry( QRect( 20, 20, 500, 410 ) ); table1->setNumRows( 0 ); table1->setNumCols( 8 ); QWidget* privateLayoutWidget = new QWidget( this, "Layout1" ); privateLayoutWidget->setGeometry( QRect( 20, 450, 500, 33 ) ); Layout1 = new QHBoxLayout( privateLayoutWidget, 0, 6, "Layout1"); buttonEnd = new QPushButton( privateLayoutWidget, "buttonEnd" ); buttonEnd->setAutoDefault( TRUE ); Layout1->addWidget( buttonEnd ); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout1->addItem( spacer ); buttonQuary = new QPushButton( privateLayoutWidget, "buttonQuary" ); buttonQuary->setAutoDefault( TRUE ); Layout1->addWidget( buttonQuary ); buttonAdd = new QPushButton( privateLayoutWidget, "buttonAdd" ); buttonAdd->setAutoDefault( TRUE ); buttonAdd->setDefault( TRUE ); Layout1->addWidget( buttonAdd ); buttonDelete = new QPushButton( privateLayoutWidget, "buttonDelete" ); buttonDelete->setAutoDefault( TRUE ); Layout1->addWidget( buttonDelete ); languageChange(); resize( QSize(541, 498).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( buttonEnd, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( buttonQuary, SIGNAL( clicked() ), this, SLOT( buttonQuary_clicked() ) ); connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( buttonAdd_clicked() ) ); connect( buttonDelete, SIGNAL( clicked() ), this, SLOT( buttonDelete_clicked() ) ); connect( table1, SIGNAL( valueChanged(int,int) ), this, SLOT( table1_valueChanged(int,int) ) ); connect( table1, SIGNAL( doubleClicked(int,int,int,const QPoint&) ), this, SLOT( table1_doubleClicked(int,int,int,const QPoint&) ) );}/* * Destroys the object and frees any allocated resources */testHRMSDialogBase::~testHRMSDialogBase(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */void testHRMSDialogBase::languageChange(){ setCaption( tr( "testHRMS" ) ); table1->horizontalHeader()->setLabel( 0, trUtf8( "姓名" ) ); table1->horizontalHeader()->setLabel( 1, trUtf8( "性别" ) ); table1->horizontalHeader()->setLabel( 2, trUtf8( "年龄" ) ); table1->horizontalHeader()->setLabel( 3, trUtf8( "工作单位" ) ); table1->horizontalHeader()->setLabel( 4, trUtf8( "职务" ) ); table1->horizontalHeader()->setLabel( 5, trUtf8( "电话" ) ); table1->horizontalHeader()->setLabel( 6, trUtf8( "住址" ) ); table1->horizontalHeader()->setLabel( 7, tr( "ID" ) ); buttonEnd->setText( trUtf8( "退出(&O)" ) ); buttonQuary->setText( trUtf8( "查询" ) ); buttonAdd->setCaption( QString::null ); buttonAdd->setText( trUtf8( "新增" ) ); buttonDelete->setText( trUtf8( "删除" ) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -