Skip to content

Commit

Permalink
Remove QApplication::desktop()
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Jun 10, 2024
1 parent 3e0d514 commit 2e60f0d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions OMEdit/OMEditLIB/Element/ElementProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,11 @@ void Parameter::setValueWidget(QString value, bool defaultValue, QString fromUni
* If the items width is greater than the value text than use it.
*/
fm = QFontMetrics(mpValueComboBox->lineEdit()->font());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
// Allow to take 70% of screen width
int screenWidth = QApplication::primaryScreen()->availableGeometry().width() * 0.7;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
mpValueComboBox->setMinimumWidth(qMin(qMax(fm.horizontalAdvance(value), mpValueComboBox->minimumSizeHint().width()), screenWidth) + 50);
#else // QT_VERSION_CHECK
int screenWidth = QApplication::desktop()->availableGeometry().width() * 0.7;
mpValueComboBox->setMinimumWidth(qMin(qMax(fm.width(value), mpValueComboBox->minimumSizeHint().width()), screenWidth) + 50);
#endif // QT_VERSION_CHECK
}
Expand Down

0 comments on commit 2e60f0d

Please sign in to comment.