示例#1
0
文件: mcmui.cpp 项目: OffieCao/MCM
MCMui::MCMui(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::MCMui)
{
    ui->setupUi(this);
    setWindowTitle(tr("MCM UI"));
    modeWidget = new QWidget;
    mcmWidget = new QWidget;

    initModeSelect();
    initMCMInfo();

    /*********addTab**********/
    tabWidget = new QTabWidget();
    testTabLabelPWS = new QLabel(tr("PWS part: wait for details"));
    testTabLabelHCWS = new QLabel(tr("HCWS part: wait for details"));
    testTabLabelCAS = new QLabel(tr("CAS part: wait for details"));
    testTabLabelHAWE = new QLabel(tr("HAWE part: wait for details"));
    testTabLabelTCM = new QLabel(tr("TCM part: wait for details"));
    tabWidget->addTab(modeWidget,"Mode");
    tabWidget->addTab(mcmWidget,"MCM");
    tabWidget->addTab(testTabLabelPWS,"PWS");
    tabWidget->addTab(testTabLabelHCWS,"HCWS");
    tabWidget->addTab(testTabLabelCAS,"CAS");
    tabWidget->addTab(testTabLabelHAWE,"HAWE");
    tabWidget->addTab(testTabLabelTCM,"TCM");

    /*********modeSelectLayout**********/
    QHBoxLayout *modeSelectGroupLayout = new QHBoxLayout();
    modeSelectGroupLayout->addWidget(modeInfoWidget,0,Qt::AlignCenter);
    //modeSelectGroupLayout->setSizeConstraint(QLayout::SetFixedSize);  //固定大小
    //modeSelectGroupLayout->setSpacing(5);
    //modeSelectGroupLayout->setContentsMargins(50,100,50,50);
    modeWidget->setLayout(modeSelectGroupLayout);
    //modeWidget->serAlignment(Qt::AlignCenter);


    /*********mcmInfoLayout**********/
    QVBoxLayout * mcmInfoLayout = new QVBoxLayout;
    mcmInfoLayout->addWidget(mcmInfoWidget);
    mcmInfoLayout->addWidget(textWidget);
    mcmInfoLayout->addWidget(btnWidget);
    //mcmInfoLayout->setSizeConstraint(QLayout::SetFixedSize);  //固定大小
    //mcmInfoLayout->setSpacing(5);
    mcmWidget->setLayout(mcmInfoLayout);

    QHBoxLayout * tabLayout = new QHBoxLayout;
    tabLayout->addWidget(tabWidget);
    this->setLayout(tabLayout);

    //connect(objListSelect,SIGNAL(currentRowChanged(int)),objListStack,SLOT(setCurrentIndex(int)));
    connect(refreshButton,SIGNAL(clicked()),this,SLOT(updateUI()));
    connect(getDataIndexButton,SIGNAL(clicked()),this,SLOT(openDataIndexSlot()));

    connect(startServerButton,SIGNAL(clicked()),this,SLOT(startServerSlot()));
    connect(startClientButton,SIGNAL(clicked()),this,SLOT(startClientSlot()));
    //updateUI();
}
示例#2
0
/*
 *  Constructs a server2WidgetBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
server2WidgetBase::server2WidgetBase( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "server2widgetbase" );
    setMinimumSize( QSize( 400, 350 ) );

    textLabel1 = new QLabel( this, "textLabel1" );
    textLabel1->setGeometry( QRect( 0, 30, 130, 31 ) );

    textLabel1_2 = new QLabel( this, "textLabel1_2" );
    textLabel1_2->setGeometry( QRect( 0, 120, 121, 20 ) );

    textLabel2_2 = new QLabel( this, "textLabel2_2" );
    textLabel2_2->setGeometry( QRect( 0, 160, 110, 20 ) );

    textLabel3 = new QLabel( this, "textLabel3" );
    textLabel3->setGeometry( QRect( 0, 200, 113, 20 ) );

    textLabel4 = new QLabel( this, "textLabel4" );
    textLabel4->setGeometry( QRect( 0, 240, 71, 20 ) );

    stopServerPushButton = new QPushButton( this, "stopServerPushButton" );
    stopServerPushButton->setGeometry( QRect( 180, 290, 151, 41 ) );

    startServerButton = new QPushButton( this, "startServerButton" );
    startServerButton->setGeometry( QRect( 10, 290, 131, 41 ) );

    textLabel2 = new QLabel( this, "textLabel2" );
    textLabel2->setGeometry( QRect( 0, 80, 101, 21 ) );

    portNumberLineEdit = new QLineEdit( this, "portNumberLineEdit" );
    portNumberLineEdit->setGeometry( QRect( 130, 70, 240, 31 ) );

    workingDirectoryLineEdit = new QLineEdit( this, "workingDirectoryLineEdit" );
    workingDirectoryLineEdit->setGeometry( QRect( 130, 30, 240, 31 ) );

    serverUserNameLineEdit = new QLineEdit( this, "serverUserNameLineEdit" );
    serverUserNameLineEdit->setGeometry( QRect( 130, 120, 240, 24 ) );

    serverPasswordLineEdit = new QLineEdit( this, "serverPasswordLineEdit" );
    serverPasswordLineEdit->setGeometry( QRect( 130, 160, 240, 24 ) );

    serverHostnameLineEdit = new QLineEdit( this, "serverHostnameLineEdit" );
    serverHostnameLineEdit->setGeometry( QRect( 130, 200, 240, 24 ) );

    serverDBNameLineEdit = new QLineEdit( this, "serverDBNameLineEdit" );
    serverDBNameLineEdit->setGeometry( QRect( 130, 240, 240, 24 ) );

    textLabel1_3 = new QLabel( this, "textLabel1_3" );
    textLabel1_3->setGeometry( QRect( 10, 340, 360, 60 ) );
    textLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    languageChange();
    resize( QSize(431, 405).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( startServerButton, SIGNAL( clicked() ), this, SLOT( startServerSlot() ) );
    connect( stopServerPushButton, SIGNAL( clicked() ), this, SLOT( stopServerSlot() ) );

    // tab order
    setTabOrder( workingDirectoryLineEdit, portNumberLineEdit );
    setTabOrder( portNumberLineEdit, serverUserNameLineEdit );
    setTabOrder( serverUserNameLineEdit, serverPasswordLineEdit );
    setTabOrder( serverPasswordLineEdit, serverHostnameLineEdit );
    setTabOrder( serverHostnameLineEdit, serverDBNameLineEdit );
    setTabOrder( serverDBNameLineEdit, startServerButton );
    setTabOrder( startServerButton, stopServerPushButton );
}