Build the Windows platform plugin with QT_NO_FOREACH
...for consistency with the other platform plugins. Change-Id: I85946d610a62c19140618c83f80c4aa63fce4bc3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>bb10
parent
033a1a2793
commit
6173e1d6f8
|
|
@ -547,7 +547,7 @@ void QWindowsContext::unregisterWindowClasses()
|
|||
{
|
||||
const HINSTANCE appInstance = static_cast<HINSTANCE>(GetModuleHandle(0));
|
||||
|
||||
foreach (const QString &name, d->m_registeredWindowClassNames) {
|
||||
for (const QString &name : qAsConst(d->m_registeredWindowClassNames)) {
|
||||
if (!UnregisterClass(reinterpret_cast<LPCWSTR>(name.utf16()), appInstance) && QWindowsContext::verbose)
|
||||
qErrnoWarning("UnregisterClass failed for '%s'", qPrintable(name));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,7 @@ static QList<FilterSpec> filterSpecs(const QStringList &filters,
|
|||
Q_ASSERT(filterSeparatorRE.isValid());
|
||||
// Split filter specification as 'Texts (*.txt[;] *.doc)', '*.txt[;] *.doc'
|
||||
// into description and filters specification as '*.txt;*.doc'
|
||||
foreach (const QString &filterString, filters) {
|
||||
for (const QString &filterString : filters) {
|
||||
const int openingParenPos = filterString.lastIndexOf(QLatin1Char('('));
|
||||
const int closingParenPos = openingParenPos != -1 ?
|
||||
filterString.indexOf(QLatin1Char(')'), openingParenPos + 1) : -1;
|
||||
|
|
@ -1321,7 +1321,7 @@ void QWindowsNativeSaveFileDialog::setNameFilters(const QStringList &f)
|
|||
// filter only if a default suffix is set (see docs). Set the first available
|
||||
// suffix unless we have a defaultSuffix.
|
||||
if (!hasDefaultSuffix()) {
|
||||
foreach (const QString &filter, f) {
|
||||
for (const QString &filter : f) {
|
||||
const QString suffix = suffixFromFilter(filter);
|
||||
if (!suffix.isEmpty()) {
|
||||
setDefaultSuffixSys(suffix);
|
||||
|
|
@ -1780,12 +1780,12 @@ void QWindowsXpNativeFileDialog::populateOpenFileName(OPENFILENAME *ofn, HWND ow
|
|||
|
||||
// Create a buffer with the filter strings.
|
||||
int totalStringLength = 0;
|
||||
QList<FilterSpec> specs =
|
||||
const QList<FilterSpec> specs =
|
||||
filterSpecs(m_options->nameFilters(), m_options->options() & QFileDialogOptions::HideNameFilterDetails, &totalStringLength);
|
||||
const int size = specs.size();
|
||||
wchar_t *ptr = new wchar_t[totalStringLength + 2 * size + 1];
|
||||
ofn->lpstrFilter = ptr;
|
||||
foreach (const FilterSpec &spec, specs) {
|
||||
for (const FilterSpec &spec : specs) {
|
||||
ptr += spec.description.toWCharArray(ptr);
|
||||
*ptr++ = 0;
|
||||
ptr += spec.filter.toWCharArray(ptr);
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static inline unsigned parseOptions(const QStringList ¶mList,
|
|||
QtWindows::ProcessDpiAwareness *dpiAwareness)
|
||||
{
|
||||
unsigned options = 0;
|
||||
foreach (const QString ¶m, paramList) {
|
||||
for (const QString ¶m : paramList) {
|
||||
if (param.startsWith(QLatin1String("fontengine="))) {
|
||||
if (param.endsWith(QLatin1String("freetype"))) {
|
||||
options |= QWindowsIntegration::FontDatabaseFreeType;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ static inline QByteArray msgConversionError(const char *func, const char *format
|
|||
msg += ": Unable to convert DIB image. The image converter plugin for '";
|
||||
msg += format;
|
||||
msg += "' is not available. Available formats: ";
|
||||
foreach (const QByteArray &af, QImageReader::supportedImageFormats()) {
|
||||
const QList<QByteArray> &formats = QImageReader::supportedImageFormats();
|
||||
for (const QByteArray &af : formats) {
|
||||
msg += af;
|
||||
msg += ' ';
|
||||
}
|
||||
|
|
@ -1598,7 +1599,7 @@ QVariant QWindowsMimeConverter::convertToMime(const QStringList &mimeTypes,
|
|||
QVariant::Type preferredType,
|
||||
QString *formatIn /* = 0 */) const
|
||||
{
|
||||
foreach (const QString &format, mimeTypes) {
|
||||
for (const QString &format : mimeTypes) {
|
||||
if (const QWindowsMime *converter = converterToMime(format, pDataObj)) {
|
||||
if (converter->canConvertToMime(format, pDataObj)) {
|
||||
const QVariant dataV = converter->convertToMime(format, pDataObj, preferredType);
|
||||
|
|
|
|||
|
|
@ -274,9 +274,12 @@ QList<QPlatformScreen *> QWindowsScreen::virtualSiblings() const
|
|||
{
|
||||
QList<QPlatformScreen *> result;
|
||||
if (m_data.flags & QWindowsScreenData::VirtualDesktop) {
|
||||
foreach (QWindowsScreen *screen, QWindowsContext::instance()->screenManager().screens())
|
||||
const QWindowsScreenManager::WindowsScreenList screens
|
||||
= QWindowsContext::instance()->screenManager().screens();
|
||||
for (QWindowsScreen *screen : screens) {
|
||||
if (screen->data().flags & QWindowsScreenData::VirtualDesktop)
|
||||
result.push_back(screen);
|
||||
}
|
||||
} else {
|
||||
result.push_back(const_cast<QWindowsScreen *>(this));
|
||||
}
|
||||
|
|
@ -505,7 +508,8 @@ void QWindowsScreenManager::removeScreen(int index)
|
|||
// move those manually.
|
||||
if (screen != primaryScreen) {
|
||||
unsigned movedWindowCount = 0;
|
||||
foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
|
||||
const QWindowList tlws = QGuiApplication::topLevelWindows();
|
||||
for (QWindow *w : tlws) {
|
||||
if (w->screen() == screen && w->handle() && w->type() != Qt::Desktop) {
|
||||
if (w->isVisible() && w->windowState() != Qt::WindowMinimized
|
||||
&& (QWindowsWindow::baseWindowOf(w)->exStyle() & WS_EX_TOOLWINDOW)) {
|
||||
|
|
@ -530,9 +534,9 @@ void QWindowsScreenManager::removeScreen(int index)
|
|||
bool QWindowsScreenManager::handleScreenChanges()
|
||||
{
|
||||
// Look for changed monitors, add new ones
|
||||
WindowsScreenDataList newDataList = monitorData();
|
||||
const WindowsScreenDataList newDataList = monitorData();
|
||||
const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen);
|
||||
foreach (const QWindowsScreenData &newData, newDataList) {
|
||||
for (const QWindowsScreenData &newData : newDataList) {
|
||||
const int existingIndex = indexOfMonitor(m_screens, newData.name);
|
||||
if (existingIndex != -1) {
|
||||
m_screens.at(existingIndex)->handleChanges(newData);
|
||||
|
|
@ -564,7 +568,7 @@ void QWindowsScreenManager::clearScreens()
|
|||
|
||||
const QWindowsScreen *QWindowsScreenManager::screenAtDp(const QPoint &p) const
|
||||
{
|
||||
foreach (QWindowsScreen *scr, m_screens) {
|
||||
for (QWindowsScreen *scr : m_screens) {
|
||||
if (scr->geometry().contains(p))
|
||||
return scr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1886,7 +1886,8 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state)
|
|||
fireExpose(QRegion(0, 0, w->width(), w->height()));
|
||||
exposeEventsSent = true;
|
||||
}
|
||||
foreach (QWindow *child, QGuiApplication::allWindows()) {
|
||||
const QWindowList allWindows = QGuiApplication::allWindows();
|
||||
for (QWindow *child : allWindows) {
|
||||
if (child != w && child->isVisible() && child->transientParent() == w) {
|
||||
QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(child);
|
||||
if (platformWindow && platformWindow->isLayered()) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ mingw: LIBS *= -luuid
|
|||
# For the dialog helpers:
|
||||
LIBS += -lshlwapi -lshell32 -ladvapi32
|
||||
|
||||
DEFINES *= QT_NO_CAST_FROM_ASCII
|
||||
DEFINES *= QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/qwindowswindow.cpp \
|
||||
|
|
|
|||
Loading…
Reference in New Issue