diff --git a/copasi/UI/CQFittingWidget.cpp b/copasi/UI/CQFittingWidget.cpp index c89aaa6731..d54e6ca653 100644 --- a/copasi/UI/CQFittingWidget.cpp +++ b/copasi/UI/CQFittingWidget.cpp @@ -374,25 +374,23 @@ void CQFittingWidget::init() mpExperimentSet = NULL; mpCrossValidationSet = NULL; - // add 2 more tab pages that when clicked will increase / decrease the height of the tab widget + // add corner widget for increase / decrease the height of the tab widget + QWidget * pGroup = new QWidget(); + QLayout * pGroupLayout = new QHBoxLayout(pGroup); + QToolButton * tb = new QToolButton(); tb->setText("+"); QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotIncreaseTabHeight())); - // Add empty, not enabled tab to tabWidget - mpTabWidget->addTab(new QLabel("Add height by pressing \"+\""), QString()); - mpTabWidget->setTabEnabled(2, false); - // Add tab button to current tab. Button will be enabled, but tab -- not - mpTabWidget->tabBar()->setTabButton(2, QTabBar::RightSide, tb); + pGroupLayout->addWidget(tb); tb = new QToolButton(); tb->setText("-"); QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotDecreaseTabHeight())); - // Add empty, not enabled tab to tabWidget - mpTabWidget->addTab(new QLabel("Remove height by pressing \"-\""), QString()); - mpTabWidget->setTabEnabled(3, false); - // Add tab button to current tab. Button will be enabled, but tab -- not - mpTabWidget->tabBar()->setTabButton(3, QTabBar::RightSide, tb); + pGroupLayout->addWidget(tb); + + pGroupLayout->setContentsMargins(0, 0, 0, 0); + mpTabWidget->setCornerWidget(pGroup); } diff --git a/copasi/UI/CQOptimizationWidget.cpp b/copasi/UI/CQOptimizationWidget.cpp index c8877b8e7c..7e8863923a 100644 --- a/copasi/UI/CQOptimizationWidget.cpp +++ b/copasi/UI/CQOptimizationWidget.cpp @@ -243,24 +243,24 @@ void CQOptimizationWidget::init() mpCurrentList = mpParameters; - // add 2 more tab pages that when clicked will increase / decrease the height of the tab widget + // add corner widget for increase / decrease the height of the tab widget + QWidget * pGroup = new QWidget(); + QLayout * pGroupLayout = new QHBoxLayout(pGroup); + QToolButton * tb = new QToolButton(); tb->setText("+"); QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotIncreaseTabHeight())); - // Add empty, not enabled tab to tabWidget - mpTabWidget->addTab(new QLabel("Add height by pressing \"+\""), QString()); - mpTabWidget->setTabEnabled(2, false); - // Add tab button to current tab. Button will be enabled, but tab -- not - mpTabWidget->tabBar()->setTabButton(2, QTabBar::RightSide, tb); + pGroupLayout->addWidget(tb); + tb = new QToolButton(); tb->setText("-"); QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotDecreaseTabHeight())); - // Add empty, not enabled tab to tabWidget - mpTabWidget->addTab(new QLabel("Remove height by pressing \"-\""), QString()); - mpTabWidget->setTabEnabled(3, false); - // Add tab button to current tab. Button will be enabled, but tab -- not - mpTabWidget->tabBar()->setTabButton(3, QTabBar::RightSide, tb); + pGroupLayout->addWidget(tb); + + pGroupLayout->setContentsMargins(0, 0, 0, 0); + + mpTabWidget->setCornerWidget(pGroup); } void CQOptimizationWidget::slotIncreaseTabHeight()