Cpper
C/C++高级工程师 Android高级软件工程师 IT集成工程师 音频工程师 熟悉c,c++,java,c#,py,js,asp等多种语言 程序猿
还不太完善
#ifndef REGISTER_DLG_H
#define REGISTER_DLG_H

#include 
<QtGui/QDialog>
#include 
<QtGui/QVBoxLayout>
#include 
<QtGui/QHBoxLayout>
#include 
<QtGui/QGridLayout>
#include 
<QtGui/QLabel>
#include 
<QtGui/QLineEdit>
#include 
<QtGui/QPushButton>

class RegisterDlg : public QDialog
{
    Q_OBJECT
public:
    RegisterDlg(QWidget 
*parent = 0);
    
~RegisterDlg();
public slots:
    
void checkRegister();
private:
    QVBoxLayout
*  layout;
    QLabel
*       label;
    QGridLayout
*  gridlayout;
    QLabel
*       namelabel;
    QLineEdit
*    nameedit;
    QLabel
*       codelabel;
    QLineEdit
*    codeedit;
    QHBoxLayout
*  hlayout;
    QPushButton
*  confirm;
    QPushButton
*  cancel;
};

#endif
//! ccsdu2004
cxx
#include <QtGui/QMessageBox>
#include 
"registerdlg.h"

RegisterDlg::RegisterDlg(QWidget 
*parent)
    : QDialog(parent)
{
    layout 
= new QVBoxLayout;
    label  
= new QLabel(tr("Please input register info below"));
    layout
->addWidget(label);
    gridlayout 
= new QGridLayout;
    namelabel  
= new QLabel(tr("User Name"));
    nameedit   
= new QLineEdit();
    codelabel  
= new QLabel(tr("Register Code"));
    codeedit   
= new QLineEdit();
    gridlayout
->addWidget(namelabel,0,0);
    gridlayout
->addWidget(nameedit,0,1);
    gridlayout
->addWidget(codelabel,1,0);
    gridlayout
->addWidget(codeedit,1,1);
    layout
->addLayout(gridlayout);
    hlayout 
= new QHBoxLayout;
    confirm 
= new QPushButton(tr("Confirm"));
    cancel  
= new QPushButton(tr("Cancel"));
    hlayout
->addWidget(confirm);
    hlayout
->addWidget(cancel);
    layout
->addLayout(hlayout);
    
this->setLayout(layout);
    
this->setWindowTitle(tr("Register"));

    connect(
this->cancel,SIGNAL(clicked()),this,SLOT(close()));
    connect(
this->confirm,SIGNAL(clicked()),this,SLOT(checkRegister()));
}

RegisterDlg::
~RegisterDlg()
{
}

void RegisterDlg::checkRegister()
{
}
posted on 2011-08-01 21:55 ccsdu2009 阅读(782) 评论(0)  编辑 收藏 引用 所属分类: QT编程

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理