Skip to content

Commit

Permalink
- use a corner widget instead
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Oct 15, 2024
1 parent e0d4238 commit b613c80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
20 changes: 9 additions & 11 deletions copasi/UI/CQFittingWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down
22 changes: 11 additions & 11 deletions copasi/UI/CQOptimizationWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b613c80

Please sign in to comment.