QStandardItemModel::beginResetModel() and
QStandardItemModel::endResetModel() calls cannot be nested, and Qt will
produce warnings at runtime if such nesting is detected.
The nesting happened in two places:
1. QCMakeCacheModel::setViewType calls QCMakeCacheModel::setProperties.
Both called beginResetModel.
2. QCMakeCacheModel::setProperties calls QStandardItemModel::clear(),
which also calls beginResetModel.
The fix for 1 is to remove the {begin|end}ResetModel calls from
setViewType. The setProperties calls take care of the
{begin|end}ResetModel calls.
The fix for 2 is to replace the clear() call with a call that removes
all data rows.
Issue: #27376
The explicit initialization with empty paths from commit 57bdc1a2f7
(cmState: Compute and store directory components., 2015-05-04,
v3.3.0-rc1~61^2~4) has not been needed since commit 6afd35b98a (cmState:
remove unused code, 2016-06-16, v3.7.0-rc1~90^2).
In commit cbf0d3da52 (cmake-gui: Port away from deprecated API in Qt >=
6.7, 2025-02-21, v4.1.0-rc1~755^2~4) we assumed that `Qt::CheckState` is
implemented as an `int`. Spell out the type explicitly for the Qt 6.7+
callback signatures.
Move logic from commit c85524a94a (Ensure stdin, stdout, and stderr pipes
are always open, 2019-05-02, v3.15.0-rc1~171^2) and commit 96010cc968
(Ensure stdin, stdout, stderr FILE streams are open on Windows, 2024-01-24,
v3.29.0-rc1~65^2) to a dedicated source. Expose it through an `Init` class
constructor to make it optionally available during static initialization.
Issue: #26924
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
Since commit a872844908 (cmake-gui: Handle relative paths in the build
directory text input, 2024-04-24, v3.30.0-rc1~5^2), `cmake-gui` gave an
incidental error message even when a valid build directory was being
passed. Fix this by checking for a non-empty path before using it.
Fixes: #26744
Previously the presets handler in the GUI was on a timer. Because of
this, error messages got suppressed after the first one (even if the
error message is different from the one originally suppressed).
Add a "reload presets" button which forces the preset to reload, and
always provides an error message if the reload failed.
Fixes: #26707
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Issue: #26123
Since commit 249a9bb44d (cmake-gui: use BundleUtilities in place of
custom script., 2010-10-14, v2.8.4~299^2) our install scripts include
the `BundleUtilities` module from our own source, rather than from the
`cmake` that's running at install time. We've now long required a
`cmake` version high enough to have the `BundleUtilities` we need.
Avoid including a `BundleUtilities` that may be newer than the running
`cmake` understands.
Our development workflow tooling prevents trailing blank lines
from being added, but some such lines remain from before that
was enforced. Remove them to make it easier to rename files
without triggering enforcement.
This makes a difference when projects compare things like
CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR and the source
directory has a trailing slash in the GUI. The command line cmake invocation
cleans the paths at the beginning, so such comparisons return true. But the
GUI currently passes the paths unmodified, so such comparisons return false.
Change the logic to sanitize the paths used through the GUI in the same way
that the command line invocation does.
Fixes: #21421
MSVC 14.38+ toolsets deprecate `stdext::checked_array_iterator`.
Support building with versions of Qt that have not been updated
to avoid the deprecated API.
Qt-Issue: https://bugreports.qt.io/browse/QTBUG-118993
Instead of stating that the default is the native compilers,
say we will use the compilers from the preset. This makes it
more clear that the preset is working as expected.
There is no need for them cuz:
- the last field has a default value
- all static instances use 2 arguments convertible to `std::string`
- "dynamic" instances used for _Generator_ doc entries access
fields diectly using default constructed instance
Moreover, compiler may generate move ctor/assign when needed.
Use fixed size arrays of `cmDocumentationEntry` items instead of
open arrays of two `char` pointers when describe program options
help screens.
Also, drop `const char*[][2]` overloads of methods of
`cmDocumentation` and `cmDocumentationSection` classes in the sake
of generic (template) appenders introduced earlier.