summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2020-06-01 12:00:25 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2020-06-02 11:37:56 (GMT)
commit44f1744bed50e6ef47b179810a7533538b31722b (patch)
treea12f837abee90116c7bda1d5e04aef6dfa5f6fb8 /Source/QtDialog/CMakeSetupDialog.cxx
parent6950706ca0c656ef1ae2ee296a6bd7f3b4791620 (diff)
downloadCMake-44f1744bed50e6ef47b179810a7533538b31722b.zip
CMake-44f1744bed50e6ef47b179810a7533538b31722b.tar.gz
CMake-44f1744bed50e6ef47b179810a7533538b31722b.tar.bz2
QtDialog: avoid using deprecated APIs
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 930f300..5916a96 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -595,7 +595,11 @@ void CMakeSetupDialog::doHelp()
QDialog dialog;
QFontMetrics met(this->font());
+#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
+ int msgWidth = met.horizontalAdvance(msg);
+#else
int msgWidth = met.width(msg);
+#endif
dialog.setMinimumSize(msgWidth / 15, 20);
dialog.setWindowTitle(tr("Help"));
QVBoxLayout* l = new QVBoxLayout(&dialog);