bool MainWindow::createGUI
{
mpTopLabal
= new QLabel( tr
( "Hello" ), layoutWidget
);
mpTopLabel->setAlignment( Qt::AlignRight );
mpTopLabel->setMaximumHeight( 30 );
mainLayout->addWidget( mpTopLabel );
mpDisplayBox = new QVGroupBox( tr( "Display Constraints:" ), constraintWidget );
createDisplayBox( );
constraintLayout->addWidget( mpDisplayBox );
// I will work with the table later but I want to add the 2nd item to the splitter.
// A splitter with just one item seems pretty useless and I will have a 2nd item
// once the left side is done.
mainLayout->addWidget( mainSplitter );
mpBottomLabel
= new QLabel( tr
( "Bye" ), layoutWidget
);
mpBottomLabel->setAlignment( Qt::AlignLeft );
mpBottomLabel->setMaximumHeight( 30 );
mainLayout->addWidget( mpBottomLabel );
setCentralWidget( mainFrame );
return true;
}
bool MainWindow::createGUI
{
QFrame *mainFrame = new QFrame( this );
QWidget *layoutWidget = new QWidget( mainFrame );
QVBoxLayout *mainLayout = new QVBoxLayout( layoutWidget );
mpTopLabal = new QLabel( tr( "Hello" ), layoutWidget );
mpTopLabel->setAlignment( Qt::AlignRight );
mpTopLabel->setMaximumHeight( 30 );
mainLayout->addWidget( mpTopLabel );
QSplitter *mainSplitter = new QSPlitter( QSplitter::Horizontal, layoutWidget );
QFrame *constraintFrame = new QFrame( mainSplitter );
QWidget *constraintWidget = new QWidget( constraintFrame );
QVBoxLayout *constraintLayout = new QVBoxLayout( constraintWidget );
mpDisplayBox = new QVGroupBox( tr( "Display Constraints:" ), constraintWidget );
createDisplayBox( );
constraintLayout->addWidget( mpDisplayBox );
// I will work with the table later but I want to add the 2nd item to the splitter.
// A splitter with just one item seems pretty useless and I will have a 2nd item
// once the left side is done.
QFrame *tableFrame = new QFrame( mainSplitter );
mainLayout->addWidget( mainSplitter );
mpBottomLabel = new QLabel( tr( "Bye" ), layoutWidget );
mpBottomLabel->setAlignment( Qt::AlignLeft );
mpBottomLabel->setMaximumHeight( 30 );
mainLayout->addWidget( mpBottomLabel );
setCentralWidget( mainFrame );
return true;
}
To copy to clipboard, switch view to plain text mode
bool MainWindow::createDisplayBox( )
{
QLabel *collectorsLabel
= new QLabel( tr
( "Collectors: ), dummyWidget ); QLabel *minLabal = new QLabel( tr( "Min:" ), dummyWidget );
QLabel *maxLabel = new QLabel( tr( "Max:" ), dummyWidget );
mpCollectorsBox = new QComboBox( dummyWidget );
mpMinLineEdit = new QLineEdit( dummyWidget );
mpMaxLineEdit = new QLineEdit( dummyWidget );
mpCollectorsBox->insertItem( tr( "1" ) );
mpCollectorsBox->insertItem( tr( "2" ) );
mpCollectorsBox->insertItem( tr( "3" ) );
mpCollectorsBox->insertItem( tr( "4" ) );
mpCollectorsBox->insertItem( tr( "5" ) );
displayLayout->addMultiCellWidget( collectorsLabel, 0, 0, 0, 1 );
displayLayout->addMutliCellWidget( mpCollectorsBox, 0, 0, 3, 3 );
displayLayout->addMutliCellWidget( minLabel, 1, 1, 0, 0 );
displayLayout->addMutliCellWidget( mpMinLineEdit, 1, 1, 1, 3 );
displayLayout->addMutliCellWidget( maxLabel, 2, 2, 0, 0 );
displayLayout->addMutliCellWidget( mpMaxLineEdit, 2, 2, 1, 3 );
displayLayout->setColStretch( 0, 0 );
displayLayout->setColStretch( 1, 5 );
displayLayout->setColStretch( 2, 5 );
return true;
}
bool MainWindow::createDisplayBox( )
{
QWidget *dummyWidget = new QWidget( mpDisplayBox );
QGridLayout *displayLayout = new QGridLayout( dummyWidget );
QLabel *collectorsLabel = new QLabel( tr( "Collectors: ), dummyWidget );
QLabel *minLabal = new QLabel( tr( "Min:" ), dummyWidget );
QLabel *maxLabel = new QLabel( tr( "Max:" ), dummyWidget );
mpCollectorsBox = new QComboBox( dummyWidget );
mpMinLineEdit = new QLineEdit( dummyWidget );
mpMaxLineEdit = new QLineEdit( dummyWidget );
mpCollectorsBox->insertItem( tr( "1" ) );
mpCollectorsBox->insertItem( tr( "2" ) );
mpCollectorsBox->insertItem( tr( "3" ) );
mpCollectorsBox->insertItem( tr( "4" ) );
mpCollectorsBox->insertItem( tr( "5" ) );
displayLayout->addMultiCellWidget( collectorsLabel, 0, 0, 0, 1 );
displayLayout->addMutliCellWidget( mpCollectorsBox, 0, 0, 3, 3 );
displayLayout->addMutliCellWidget( minLabel, 1, 1, 0, 0 );
displayLayout->addMutliCellWidget( mpMinLineEdit, 1, 1, 1, 3 );
displayLayout->addMutliCellWidget( maxLabel, 2, 2, 0, 0 );
displayLayout->addMutliCellWidget( mpMaxLineEdit, 2, 2, 1, 3 );
displayLayout->setColStretch( 0, 0 );
displayLayout->setColStretch( 1, 5 );
displayLayout->setColStretch( 2, 5 );
return true;
}
To copy to clipboard, switch view to plain text mode
Bookmarks