diff options
author | dou fu <doufu3344@gmail.com> | 2022-09-01 07:28:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-09-01 14:12:06 (GMT) |
commit | 5671c5270b78e146a0e4c30837522dc61e5a8150 (patch) | |
tree | 46a696073dfeab399a72dc285d0d3da8e4176e17 /Source/QtDialog | |
parent | 8ac6634b2f4ffdafd0b167efc4d17e9dd8bbf212 (diff) | |
download | CMake-5671c5270b78e146a0e4c30837522dc61e5a8150.zip CMake-5671c5270b78e146a0e4c30837522dc61e5a8150.tar.gz CMake-5671c5270b78e146a0e4c30837522dc61e5a8150.tar.bz2 |
cmake-gui: Fix selected item mismatched CMAKE_GENERATOR_PLATFORM env
The first empty item in the combobox causes a misalignment with the
actual setting by `CMAKE_GENERATOR_PLATFORM` environment variable.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/FirstConfigure.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx index f3c4a8b..707eaae 100644 --- a/Source/QtDialog/FirstConfigure.cxx +++ b/Source/QtDialog/FirstConfigure.cxx @@ -244,7 +244,8 @@ void StartCompilerSetup::onGeneratorChanged(int index) if (!DefaultGeneratorPlatform.isEmpty()) { int platform_index = platforms.indexOf(DefaultGeneratorPlatform); if (platform_index != -1) { - this->PlatformOptions->setCurrentIndex(platform_index); + // The index is off-by-one due to the first empty item added above. + this->PlatformOptions->setCurrentIndex(platform_index + 1); } } } else { |