Skip to content

Commit

Permalink
Avoiding QComboBox::setCurrentText()
Browse files Browse the repository at this point in the history
as it doesn't exist in QT 4.x
  • Loading branch information
Jan Šilar authored and hkiel committed Jul 27, 2017
1 parent b69c216 commit 7dd1e00
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions OMEdit/OMEditGUI/Plotting/PlotWindowContainer.cpp
Expand Up @@ -248,8 +248,12 @@ void PlotWindowContainer::addArrayPlotWindow(bool maximized)
pPlotWindow->setLegendPosition("top");
pPlotWindow->setAutoScale(OptionsDialog::instance()->getPlottingPage()->getAutoScaleCheckBox()->isChecked());
QComboBox* unitComboBox = MainWindow::instance()->getVariablesWidget()->getSimulationTimeComboBox();
if (unitComboBox->currentText() == "")
unitComboBox->setCurrentText("s");
if (unitComboBox->currentText() == ""){
int currentIndex = unitComboBox->findText("s", Qt::MatchExactly);
if (currentIndex > -1) {
unitComboBox->setCurrentIndex(currentIndex);
}
}
pPlotWindow->setTimeUnit(unitComboBox->currentText());
pPlotWindow->setXLabel(QString("index"));
pPlotWindow->installEventFilter(this);
Expand Down Expand Up @@ -279,8 +283,12 @@ void PlotWindowContainer::addArrayParametricPlotWindow()
pPlotWindow->setLegendPosition("top");
pPlotWindow->setAutoScale(OptionsDialog::instance()->getPlottingPage()->getAutoScaleCheckBox()->isChecked());
QComboBox* unitComboBox = MainWindow::instance()->getVariablesWidget()->getSimulationTimeComboBox();
if (unitComboBox->currentText() == "")
unitComboBox->setCurrentText("s");
if (unitComboBox->currentText() == ""){
int currentIndex = unitComboBox->findText("s", Qt::MatchExactly);
if (currentIndex > -1) {
unitComboBox->setCurrentIndex(currentIndex);
}
}
pPlotWindow->setTimeUnit(unitComboBox->currentText());
pPlotWindow->installEventFilter(this);
QMdiSubWindow *pSubWindow = addSubWindow(pPlotWindow);
Expand Down

0 comments on commit 7dd1e00

Please sign in to comment.