summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--src/androiddeployqt/main.cpp88
-rw-r--r--src/assistant/assistant/helpenginewrapper.cpp6
-rw-r--r--src/assistant/assistant/helpenginewrapper.h1
-rw-r--r--src/assistant/assistant/helpviewer.cpp6
-rw-r--r--src/assistant/assistant/preferencesdialog.cpp143
-rw-r--r--src/assistant/assistant/preferencesdialog.h9
-rw-r--r--src/assistant/assistant/preferencesdialog.ui42
-rw-r--r--src/designer/data/generate_impl.xsl3
-rw-r--r--src/designer/src/components/formeditor/formwindow.cpp14
-rw-r--r--src/designer/src/components/formeditor/formwindowsettings.cpp2
-rw-r--r--src/designer/src/components/propertyeditor/designerpropertymanager.cpp16
-rw-r--r--src/designer/src/components/propertyeditor/fontpropertymanager.cpp7
-rw-r--r--src/designer/src/designer/qdesigner.cpp2
-rw-r--r--src/designer/src/lib/shared/actioneditor.cpp20
-rw-r--r--src/designer/src/lib/shared/actioneditor_p.h2
-rw-r--r--src/designer/src/lib/shared/iconselector.cpp1
-rw-r--r--src/designer/src/lib/shared/morphmenu.cpp15
-rw-r--r--src/designer/src/lib/shared/morphmenu_p.h3
-rw-r--r--src/designer/src/lib/shared/previewmanager.cpp4
-rw-r--r--src/designer/src/lib/shared/promotiontaskmenu.cpp18
-rw-r--r--src/designer/src/lib/shared/promotiontaskmenu_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_taskmenu.cpp1
-rw-r--r--src/designer/src/lib/shared/qdesigner_taskmenu_p.h1
-rw-r--r--src/designer/src/lib/shared/qdesigner_utils.cpp26
-rw-r--r--src/designer/src/lib/shared/qlayout_widget.cpp12
-rw-r--r--src/designer/src/lib/shared/rcc.cpp4
-rw-r--r--src/designer/src/lib/shared/richtexteditor.cpp4
-rw-r--r--src/designer/src/lib/shared/stylesheeteditor.cpp45
-rw-r--r--src/designer/src/lib/uilib/ui4.cpp105
-rw-r--r--src/macdeployqt/macdeployqt/main.cpp12
-rw-r--r--src/macdeployqt/shared/shared.cpp29
-rw-r--r--src/macdeployqt/shared/shared.h2
-rw-r--r--src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp6
-rw-r--r--src/shared/qtpropertybrowser/qtpropertymanager.cpp26
-rw-r--r--tests/auto/cmake/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_add_translation_macro/CMakeLists.txt23
-rw-r--r--tests/auto/cmake/test_add_translation_macro/myi18nobject.cpp (renamed from tests/auto/cmake/test_translation_macros/myi18nobject.cpp)0
-rw-r--r--tests/auto/cmake/test_add_translation_macro/myobject_de.ts (renamed from tests/auto/cmake/test_translation_macros/myobject_de.ts)6
-rw-r--r--tests/auto/cmake/test_add_translation_macro/some_dir/some_include.h (renamed from tests/auto/cmake/test_translation_macros/some_dir/some_include.h)0
-rw-r--r--tests/auto/cmake/test_create_translation_macro/CMakeLists.txt (renamed from tests/auto/cmake/test_translation_macros/CMakeLists.txt)5
-rw-r--r--tests/auto/cmake/test_create_translation_macro/myi18nobject.cpp51
-rw-r--r--tests/auto/cmake/test_create_translation_macro/myobject_de.ts12
-rw-r--r--tests/auto/cmake/test_create_translation_macro/some_dir/some_include.h41
-rw-r--r--tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro1
-rw-r--r--tests/auto/qhelpenginecore/qhelpenginecore.pro1
-rw-r--r--tests/auto/qhelpindexmodel/qhelpindexmodel.pro1
-rw-r--r--tests/auto/qhelpprojectdata/qhelpprojectdata.pro1
48 files changed, 479 insertions, 345 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 9450b8383..33a2710f6 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,4 +1,4 @@
load(qt_build_config)
CONFIG += qt_example_installs
-MODULE_VERSION = 5.6.1
+MODULE_VERSION = 5.7.0
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp
index 3414102dc..74e4f8f1f 100644
--- a/src/androiddeployqt/main.cpp
+++ b/src/androiddeployqt/main.cpp
@@ -100,8 +100,6 @@ struct Options
, generateAssetsFileList(true)
, build(true)
, gradle(false)
- , minimumAndroidVersion(9)
- , targetAndroidVersion(10)
, deploymentMechanism(Bundled)
, releasePackage(false)
, digestAlg(QLatin1String("SHA1"))
@@ -167,8 +165,6 @@ struct Options
QString ndkHost;
// Package information
- int minimumAndroidVersion;
- int targetAndroidVersion;
DeploymentMechanism deploymentMechanism;
QString packageName;
QStringList extraLibs;
@@ -921,7 +917,6 @@ void cleanAndroidFiles(const Options &options)
cleanTopFolders(options, options.androidSourceDirectory, options.outputDirectory);
cleanTopFolders(options, options.qtInstallDirectory + QLatin1String("/src/android/templates"), options.outputDirectory);
- cleanTopFolders(options, options.qtInstallDirectory + QLatin1String("/src/android/java"), options.outputDirectory + QLatin1String("__qt5__android__files__"));
}
bool copyAndroidTemplate(const Options &options, const QString &androidTemplate, const QString &outDirPrefix = QString())
@@ -970,8 +965,10 @@ bool copyAndroidTemplate(const Options &options)
if (!copyAndroidTemplate(options, QLatin1String("/src/android/templates")))
return false;
- return copyAndroidTemplate(options, QLatin1String("/src/android/java"),
- options.gradle ? QLatin1String("/__qt5__android__files__/") : QString());
+ if (options.gradle)
+ return true;
+
+ return copyAndroidTemplate(options, QLatin1String("/src/android/java"));
}
bool copyAndroidSources(const Options &options)
@@ -1345,10 +1342,10 @@ bool updateAndroidManifest(Options &options)
options.packageName = reader.attributes().value(QLatin1String("package")).toString();
} else if (reader.name() == QLatin1String("uses-sdk")) {
if (reader.attributes().hasAttribute(QLatin1String("android:minSdkVersion")))
- options.minimumAndroidVersion = reader.attributes().value(QLatin1String("android:minSdkVersion")).toInt();
-
- if (reader.attributes().hasAttribute(QLatin1String("android:targetSdkVersion")))
- options.targetAndroidVersion = reader.attributes().value(QLatin1String("android:targetSdkVersion")).toInt();
+ if (reader.attributes().value(QLatin1String("android:minSdkVersion")).toInt() < 16) {
+ fprintf(stderr, "Invalid minSdkVersion version, minSdkVersion must be >= 16\n");
+ return false;
+ }
} else if ((reader.name() == QLatin1String("application") ||
reader.name() == QLatin1String("activity")) &&
reader.attributes().hasAttribute(QLatin1String("android:label")) &&
@@ -1373,70 +1370,6 @@ bool updateAndroidManifest(Options &options)
return true;
}
-bool updateJavaFiles(const Options &options)
-{
- if (options.verbose)
- fprintf(stdout, " -- /src/org/qtproject/qt5/android/bindings/QtActivity.java\n");
-
-
- QString fileName(options.outputDirectory +
- (options.gradle ? QLatin1String("/__qt5__android__files__")
- : QString()) +
- QLatin1String("/src/org/qtproject/qt5/android/bindings/QtActivity.java"));
-
- QFile file(fileName);
- if (!file.open(QIODevice::ReadOnly)) {
- fprintf(stderr, "Cannot open %s.\n", qPrintable(fileName));
- return false;
- }
-
- QByteArray contents;
-
- while (!file.atEnd()) {
- QByteArray line = file.readLine();
- if (line.startsWith("//@ANDROID-")) {
- bool ok;
- int requiredSdkVersion = line.mid(sizeof("//@ANDROID-") - 1).trimmed().toInt(&ok);
- if (requiredSdkVersion <= options.minimumAndroidVersion)
- contents += line;
-
- if (ok) {
- while (!file.atEnd()) {
- line = file.readLine();
- if (requiredSdkVersion <= options.minimumAndroidVersion)
- contents += line;
-
- if (line.startsWith(QByteArray("//@ANDROID-") + QByteArray::number(requiredSdkVersion)))
- break;
- }
-
- if (!line.startsWith(QByteArray("//@ANDROID-") + QByteArray::number(requiredSdkVersion))) {
- fprintf(stderr, "Mismatched tag ANDROID-%d in %s\n", requiredSdkVersion, qPrintable(fileName));
- return false;
- }
- } else {
- fprintf(stderr, "Warning: Misformatted tag in %s: %s\n", qPrintable(fileName), line.constData());
- }
- } else {
- contents += line;
- }
- }
-
- file.close();
-
- if (!file.open(QIODevice::WriteOnly)) {
- fprintf(stderr, "Can't open %s for writing.\n", qPrintable(fileName));
- return false;
- }
-
- if (file.write(contents) < contents.size()) {
- fprintf(stderr, "Failed to write contents to %s.\n", qPrintable(fileName));
- return false;
- }
-
- return true;
-}
-
bool updateAndroidFiles(Options &options)
{
if (options.verbose)
@@ -1448,9 +1381,6 @@ bool updateAndroidFiles(Options &options)
if (!updateAndroidManifest(options))
return false;
- if (!updateJavaFiles(options))
- return false;
-
return true;
}
@@ -2440,7 +2370,7 @@ bool buildGradleProject(const Options &options)
QString gradlePropertiesPath = options.outputDirectory + QLatin1String("gradle.properties");
GradleProperties gradleProperties = readGradleProperties(gradlePropertiesPath);
gradleProperties["buildDir"] = "build";
- gradleProperties["qt5AndroidDir"] = "__qt5__android__files__";
+ gradleProperties["qt5AndroidDir"] = (options.qtInstallDirectory + QLatin1String("/src/android/java")).toUtf8();
gradleProperties["androidCompileSdkVersion"] = options.androidPlatform.split(QLatin1Char('-')).last().toLocal8Bit();
if (gradleProperties["androidBuildToolsVersion"].isEmpty())
gradleProperties["androidBuildToolsVersion"] = options.sdkBuildToolsVersion.toLocal8Bit();
diff --git a/src/assistant/assistant/helpenginewrapper.cpp b/src/assistant/assistant/helpenginewrapper.cpp
index 619aa8881..390499390 100644
--- a/src/assistant/assistant/helpenginewrapper.cpp
+++ b/src/assistant/assistant/helpenginewrapper.cpp
@@ -221,6 +221,12 @@ const QStringList HelpEngineWrapper::registeredDocumentations() const
return d->m_helpEngine->registeredDocumentations();
}
+QString HelpEngineWrapper::documentationFileName(const QString &namespaceName) const
+{
+ TRACE_OBJ
+ return d->m_helpEngine->documentationFileName(namespaceName);
+}
+
const QString HelpEngineWrapper::collectionFile() const
{
TRACE_OBJ
diff --git a/src/assistant/assistant/helpenginewrapper.h b/src/assistant/assistant/helpenginewrapper.h
index 735e49693..9a83d181d 100644
--- a/src/assistant/assistant/helpenginewrapper.h
+++ b/src/assistant/assistant/helpenginewrapper.h
@@ -77,6 +77,7 @@ public:
QHelpIndexWidget *indexWidget();
bool setupData();
const QStringList registeredDocumentations() const;
+ QString documentationFileName(const QString &namespaceName) const;
const QString collectionFile() const;
bool registerDocumentation(const QString &docFile);
bool unregisterDocumentation(const QString &namespaceName);
diff --git a/src/assistant/assistant/helpviewer.cpp b/src/assistant/assistant/helpviewer.cpp
index 7002e4af4..fdf1be4c0 100644
--- a/src/assistant/assistant/helpviewer.cpp
+++ b/src/assistant/assistant/helpviewer.cpp
@@ -116,10 +116,10 @@ bool HelpViewer::isLocalUrl(const QUrl &url)
|| scheme == QLatin1String("about");
}
-bool HelpViewer::canOpenPage(const QString &url)
+bool HelpViewer::canOpenPage(const QString &path)
{
TRACE_OBJ
- return !mimeFromUrl(url).isEmpty();
+ return !mimeFromUrl(QUrl::fromLocalFile(path)).isEmpty();
}
QString HelpViewer::mimeFromUrl(const QUrl &url)
@@ -147,7 +147,7 @@ bool HelpViewer::launchWithExternalApp(const QUrl &url)
if (!resolvedUrl.isValid())
return false;
- const QString& path = resolvedUrl.path();
+ const QString& path = resolvedUrl.toLocalFile();
if (!canOpenPage(path)) {
QTemporaryFile tmpTmpFile;
if (!tmpTmpFile.open())
diff --git a/src/assistant/assistant/preferencesdialog.cpp b/src/assistant/assistant/preferencesdialog.cpp
index 2e68d41ec..47a1f3beb 100644
--- a/src/assistant/assistant/preferencesdialog.cpp
+++ b/src/assistant/assistant/preferencesdialog.cpp
@@ -39,8 +39,11 @@
#include "openpagesmanager.h"
#include "tracer.h"
+#include <QtCore/QAbstractListModel>
#include <QtCore/QtAlgorithms>
#include <QtCore/QFileSystemWatcher>
+#include <QtCore/QSortFilterProxyModel>
+#include <QtCore/QVector>
#include <QtWidgets/QDesktopWidget>
#include <QtWidgets/QFileDialog>
@@ -51,25 +54,114 @@
#include <QtHelp/QHelpEngineCore>
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
+struct RegisteredDocEntry
+{
+ QString nameSpace;
+ QString fileName;
+};
+
+typedef QVector<RegisteredDocEntry> RegisteredDocEntries;
+
+class RegisteredDocsModel : public QAbstractListModel {
+public:
+
+ explicit RegisteredDocsModel(const RegisteredDocEntries &e = RegisteredDocEntries(), QObject *parent = nullptr)
+ : QAbstractListModel(parent), m_docEntries(e) {}
+
+ int rowCount(const QModelIndex & = QModelIndex()) const override { return m_docEntries.size(); }
+ QVariant data(const QModelIndex &index, int role) const override;
+
+ bool contains(const QString &nameSpace) const
+ {
+ return m_docEntries.cend() !=
+ std::find_if(m_docEntries.cbegin(), m_docEntries.cend(),
+ [nameSpace] (const RegisteredDocEntry &e) { return e.nameSpace == nameSpace; });
+ }
+
+ void append(const RegisteredDocEntry &e);
+
+ const RegisteredDocEntries &docEntries() const { return m_docEntries; }
+ void setDocEntries(const RegisteredDocEntries &);
+
+private:
+ RegisteredDocEntries m_docEntries;
+};
+
+QVariant RegisteredDocsModel::data(const QModelIndex &index, int role) const
+{
+ QVariant result;
+ const int row = index.row();
+ if (index.isValid() && row < m_docEntries.size()) {
+ switch (role) {
+ case Qt::DisplayRole:
+ result = QVariant(m_docEntries.at(row).nameSpace);
+ break;
+ case Qt::ToolTipRole:
+ result = QVariant(QDir::toNativeSeparators(m_docEntries.at(row).fileName));
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
+
+void RegisteredDocsModel::append(const RegisteredDocEntry &e)
+{
+ beginInsertRows(QModelIndex(), m_docEntries.size(), m_docEntries.size());
+ m_docEntries.append(e);
+ endInsertRows();
+}
+
+void RegisteredDocsModel::setDocEntries(const RegisteredDocEntries &e)
+{
+ beginResetModel();
+ m_docEntries = e;
+ endResetModel();
+}
+
+static RegisteredDocEntries registeredDocEntries(const HelpEngineWrapper &wrapper)
+{
+ RegisteredDocEntries result;
+ const QStringList nameSpaces = wrapper.registeredDocumentations();
+ result.reserve(nameSpaces.size());
+ foreach (const QString &nameSpace, nameSpaces) {
+ RegisteredDocEntry entry;
+ entry.nameSpace = nameSpace;
+ entry.fileName = wrapper.documentationFileName(nameSpace);
+ result.append(entry);
+ }
+ return result;
+}
+
PreferencesDialog::PreferencesDialog(QWidget *parent)
: QDialog(parent)
, m_appFontChanged(false)
, m_browserFontChanged(false)
, helpEngine(HelpEngineWrapper::instance())
+ , m_hideFiltersTab(!helpEngine.filterFunctionalityEnabled())
+ , m_hideDocsTab(!helpEngine.documentationManagerEnabled())
{
TRACE_OBJ
m_ui.setupUi(this);
+ m_registeredDocsModel =
+ new RegisteredDocsModel(m_hideDocsTab ? RegisteredDocEntries() : registeredDocEntries(helpEngine));
+ m_registereredDocsFilterModel = new QSortFilterProxyModel(m_ui.registeredDocsListView);
+ m_registereredDocsFilterModel->setSourceModel(m_registeredDocsModel);
+ m_ui.registeredDocsListView->setModel(m_registereredDocsFilterModel);
+ connect(m_ui.registeredDocsFilterLineEdit, &QLineEdit::textChanged,
+ m_registereredDocsFilterModel, &QSortFilterProxyModel::setFilterFixedString);
+
connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
this, SLOT(applyChanges()));
connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
this, SLOT(reject()));
- m_hideFiltersTab = !helpEngine.filterFunctionalityEnabled();
- m_hideDocsTab = !helpEngine.documentationManagerEnabled();
-
if (!m_hideFiltersTab) {
m_ui.attributeWidget->header()->hide();
m_ui.attributeWidget->setRootIsDecorated(false);
@@ -97,8 +189,9 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
connect(m_ui.docRemoveButton, SIGNAL(clicked()), this,
SLOT(removeDocumentation()));
- m_docsBackup = helpEngine.registeredDocumentations();
- m_ui.registeredDocsListWidget->addItems(m_docsBackup);
+ m_docsBackup.reserve(m_registeredDocsModel->rowCount());
+ foreach (const RegisteredDocEntry &e, m_registeredDocsModel->docEntries())
+ m_docsBackup.append(e.nameSpace);
} else {
m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab));
}
@@ -254,14 +347,16 @@ void PreferencesDialog::addDocumentationLocal()
continue;
}
- if (m_ui.registeredDocsListWidget->findItems(nameSpace,
- Qt::MatchFixedString).count()) {
+ if (m_registeredDocsModel->contains(nameSpace)) {
alreadyRegistered.append(nameSpace);
continue;
}
if (helpEngine.registerDocumentation(fileName)) {
- m_ui.registeredDocsListWidget->addItem(nameSpace);
+ RegisteredDocEntry entry;
+ entry.nameSpace = nameSpace;
+ entry.fileName = fileName;
+ m_registeredDocsModel->append(entry);
m_regDocs.append(nameSpace);
m_unregDocs.removeAll(nameSpace);
}
@@ -291,14 +386,28 @@ void PreferencesDialog::addDocumentationLocal()
updateFilterPage();
}
+QList<int> PreferencesDialog::currentRegisteredDocsSelection() const
+{
+ QList<int> result;
+ foreach (const QModelIndex &index, m_ui.registeredDocsListView->selectionModel()->selectedRows())
+ result.append(m_registereredDocsFilterModel->mapToSource(index).row());
+ return result;
+}
+
void PreferencesDialog::removeDocumentation()
{
TRACE_OBJ
+ const QList<int> currentSelection = currentRegisteredDocsSelection();
+ if (currentSelection.isEmpty())
+ return;
+
+ RegisteredDocEntries entries = m_registeredDocsModel->docEntries();
+
bool foundBefore = false;
- QList<QListWidgetItem*> l = m_ui.registeredDocsListWidget->selectedItems();
- foreach (QListWidgetItem* item, l) {
- const QString& ns = item->text();
+ for (int i = currentSelection.size() - 1; i >= 0; --i) {
+ const int row = currentSelection.at(i);
+ const QString& ns = entries.at(row).nameSpace;
if (!foundBefore && OpenPagesManager::instance()->pagesOpenForNamespace(ns)) {
if (0 == QMessageBox::information(this, tr("Remove Documentation"),
tr("Some documents currently opened in Assistant reference the "
@@ -309,13 +418,15 @@ void PreferencesDialog::removeDocumentation()
}
m_unregDocs.append(ns);
- delete m_ui.registeredDocsListWidget->takeItem(
- m_ui.registeredDocsListWidget->row(item));
+ entries.removeAt(row);
}
- if (m_ui.registeredDocsListWidget->count()) {
- m_ui.registeredDocsListWidget->setCurrentRow(0,
- QItemSelectionModel::ClearAndSelect);
+ m_registeredDocsModel->setDocEntries(entries);
+
+ if (m_registereredDocsFilterModel->rowCount()) {
+ const QModelIndex first = m_registereredDocsFilterModel->index(0, 0);
+ m_ui.registeredDocsListView->selectionModel()->setCurrentIndex(first,
+ QItemSelectionModel::ClearAndSelect);
}
}
diff --git a/src/assistant/assistant/preferencesdialog.h b/src/assistant/assistant/preferencesdialog.h
index 79fe9a18c..cf7c0258f 100644
--- a/src/assistant/assistant/preferencesdialog.h
+++ b/src/assistant/assistant/preferencesdialog.h
@@ -41,7 +41,9 @@ QT_BEGIN_NAMESPACE
class FontPanel;
class HelpEngineWrapper;
+class RegisteredDocsModel;
class QFileSystemWatcher;
+class QSortFilterProxyModel;
class PreferencesDialog : public QDialog
{
@@ -79,14 +81,15 @@ private:
void updateFilterPage();
void updateFontSettingsPage();
void updateOptionsPage();
+ QList<int> currentRegisteredDocsSelection() const;
Ui::PreferencesDialogClass m_ui;
- bool m_hideFiltersTab;
- bool m_hideDocsTab;
QMap<QString, QStringList> m_filterMapBackup;
QMap<QString, QStringList> m_filterMap;
QStringList m_removedFilters;
QStringList m_docsBackup;
+ RegisteredDocsModel *m_registeredDocsModel;
+ QSortFilterProxyModel *m_registereredDocsFilterModel;
QStringList m_regDocs;
QStringList m_unregDocs;
FontPanel *m_appFontPanel;
@@ -94,6 +97,8 @@ private:
bool m_appFontChanged;
bool m_browserFontChanged;
HelpEngineWrapper &helpEngine;
+ const bool m_hideFiltersTab;
+ const bool m_hideDocsTab;
bool m_showTabs;
};
diff --git a/src/assistant/assistant/preferencesdialog.ui b/src/assistant/assistant/preferencesdialog.ui
index 1c6833ad9..ebefa2458 100644
--- a/src/assistant/assistant/preferencesdialog.ui
+++ b/src/assistant/assistant/preferencesdialog.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>375</width>
- <height>275</height>
+ <height>342</height>
</rect>
</property>
<property name="windowTitle">
@@ -119,7 +119,7 @@
<attribute name="title">
<string>Documentation</string>
</attribute>
- <layout class="QVBoxLayout">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
@@ -128,28 +128,33 @@
</widget>
</item>
<item>
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
- <widget class="QListWidget" name="registeredDocsListWidget">
- <property name="selectionMode">
- <enum>QAbstractItemView::ExtendedSelection</enum>
- </property>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLineEdit" name="registeredDocsFilterLineEdit">
+ <property name="placeholderText">
+ <string>&lt;Filter&gt;</string>
+ </property>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListView" name="registeredDocsListView">
+ <property name="selectionMode">
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
- <property name="margin">
- <number>0</number>
- </property>
<item>
<widget class="QPushButton" name="docAddButton">
<property name="text">
@@ -347,9 +352,6 @@
<property name="spacing">
<number>6</number>
</property>
- <property name="margin">
- <number>0</number>
- </property>
<item>
<spacer>
<property name="orientation">
diff --git a/src/designer/data/generate_impl.xsl b/src/designer/data/generate_impl.xsl
index 4f1c3955f..ba4311d8b 100644
--- a/src/designer/data/generate_impl.xsl
+++ b/src/designer/data/generate_impl.xsl
@@ -270,7 +270,8 @@
<xsl:if test="$node/xs:attribute">
<xsl:text>&endl;</xsl:text>
- <xsl:text> foreach (const QXmlStreamAttribute &amp;attribute, reader.attributes()) {&endl;</xsl:text>
+ <xsl:text> const QXmlStreamAttributes attributes = reader.attributes();&endl;</xsl:text>
+ <xsl:text> for (const QXmlStreamAttribute &amp;attribute : attributes) {&endl;</xsl:text>
<xsl:text> QStringRef name = attribute.name();&endl;</xsl:text>
<xsl:for-each select="$node/xs:attribute">
diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp
index 4d1d0abd9..3d09740ad 100644
--- a/src/designer/src/components/formeditor/formwindow.cpp
+++ b/src/designer/src/components/formeditor/formwindow.cpp
@@ -184,10 +184,8 @@ FormWindow::Selection::~Selection()
void FormWindow::Selection::clear()
{
if (!m_usedSelections.empty()) {
- const SelectionHash::iterator mend = m_usedSelections.end();
- for (SelectionHash::iterator it = m_usedSelections.begin(); it != mend; ++it) {
+ for (auto it = m_usedSelections.begin(), mend = m_usedSelections.end(); it != mend; ++it)
it.value()->setWidget(0);
- }
m_usedSelections.clear();
}
}
@@ -208,8 +206,7 @@ WidgetSelection *FormWindow::Selection::addWidget(FormWindow* fw, QWidget *w)
return rc;
}
// find a free one in the pool
- const SelectionPool::iterator pend = m_selectionPool.end();
- for (SelectionPool::iterator it = m_selectionPool.begin(); it != pend; ++it) {
+ for (auto it = m_selectionPool.constBegin(), pend = m_selectionPool.constEnd(); it != pend; ++it) {
if (! (*it)->isUsed()) {
rc = *it;
break;
@@ -249,10 +246,8 @@ void FormWindow::Selection::repaintSelection(QWidget *w)
void FormWindow::Selection::repaintSelection()
{
- const SelectionHash::iterator mend = m_usedSelections.end();
- for (SelectionHash::iterator it = m_usedSelections.begin(); it != mend; ++it) {
+ for (auto it = m_usedSelections.begin(), mend = m_usedSelections.end(); it != mend; ++it)
it.value()->update();
- }
}
bool FormWindow::Selection::isWidgetSelected(QWidget *w) const{
@@ -266,8 +261,7 @@ QWidgetList FormWindow::Selection::selectedWidgets() const
void FormWindow::Selection::raiseList(const QWidgetList& l)
{
- const SelectionHash::iterator mend = m_usedSelections.end();
- for (SelectionHash::iterator it = m_usedSelections.begin(); it != mend; ++it) {
+ for (auto it = m_usedSelections.constBegin(), mend = m_usedSelections.constEnd(); it != mend; ++it) {
WidgetSelection *w = it.value();
if (l.contains(w->widget()))
w->show();
diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp
index d73fb2881..45589e313 100644
--- a/src/designer/src/components/formeditor/formwindowsettings.cpp
+++ b/src/designer/src/components/formeditor/formwindowsettings.cpp
@@ -116,7 +116,7 @@ void FormWindowData::fromFormWindow(FormWindowBase* fw)
fw->layoutDefault(&defaultMargin, &defaultSpacing);
QStyle *style = fw->formContainer()->style();
- layoutDefaultEnabled = defaultMargin != INT_MIN || defaultMargin != INT_MIN;
+ layoutDefaultEnabled = defaultMargin != INT_MIN || defaultSpacing != INT_MIN;
if (defaultMargin == INT_MIN)
defaultMargin = style->pixelMetric(QStyle::PM_DefaultChildMargin, 0);
if (defaultSpacing == INT_MIN)
diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
index 85f462f1d..9df5e702a 100644
--- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
+++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
@@ -216,9 +216,7 @@ int TranslatablePropertyManager<PropertySheetValue>::setValue(QtVariantPropertyM
int expectedTypeId,
const QVariant &variantValue)
{
- typedef typename QMap<QtProperty *, PropertySheetValue>::iterator Iterator;
-
- const Iterator it = m_values.find(property);
+ const auto it = m_values.find(property);
if (it == m_values.end())
return DesignerPropertyManager::NoMatch;
if (variantValue.userType() != expectedTypeId)
@@ -239,9 +237,7 @@ int TranslatablePropertyManager<PropertySheetValue>::setValue(QtVariantPropertyM
template <class PropertySheetValue>
bool TranslatablePropertyManager<PropertySheetValue>::value(const QtProperty *property, QVariant *rc) const
{
- typedef typename QMap<QtProperty *, PropertySheetValue>::const_iterator ConstIterator;
-
- ConstIterator it = m_values.constFind(const_cast<QtProperty *>(property));
+ const auto it = m_values.constFind(const_cast<QtProperty *>(property));
if (it == m_values.constEnd())
return false;
*rc = QVariant::fromValue(it.value());
@@ -2251,12 +2247,10 @@ void DesignerEditorFactory::disconnectPropertyManager(QtVariantPropertyManager *
template <class EditorContainer, class Editor, class SetterParameter, class Value>
static inline void applyToEditors(const EditorContainer &list, void (Editor::*setter)(SetterParameter), const Value &value)
{
- typedef typename EditorContainer::const_iterator ListIterator;
if (list.empty()) {
return;
}
- const ListIterator end = list.constEnd();
- for (ListIterator it = list.constBegin(); it != end; ++it) {
+ for (auto it = list.constBegin(), end = list.constEnd(); it != end; ++it) {
Editor &editor = *(*it);
(editor.*setter)(value);
}
@@ -2627,9 +2621,7 @@ template <class Editor>
QtProperty *findPropertyForEditor(const QMap<Editor *, QtProperty *> &editorMap,
const QObject *sender)
{
- typedef typename QMap<Editor *, QtProperty *>::const_iterator Iterator;
- const Iterator cend = editorMap.constEnd();
- for (Iterator it = editorMap.constBegin(); it != cend; ++it)
+ for (auto it = editorMap.constBegin(), cend = editorMap.constEnd(); it != cend; ++it)
if (it.key() == sender)
return it.value();
return 0;
diff --git a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp
index f3f4f92cd..b7e995418 100644
--- a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp
+++ b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp
@@ -95,10 +95,9 @@ namespace qdesigner_internal {
if (nm.empty())
return families;
- const FontPropertyManager::NameMap::const_iterator ncend = nm.constEnd();
- const QStringList::iterator end = families.end();
- for (QStringList::iterator it = families.begin(); it != end; ++it) {
- const FontPropertyManager::NameMap::const_iterator nit = nm.constFind(*it);
+ const auto ncend = nm.constEnd();
+ for (auto it = families.begin(), end = families.end(); it != end; ++it) {
+ const auto nit = nm.constFind(*it);
if (nit != ncend)
*it = nit.value();
}
diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp
index 5e6a3db9c..23f35f2d7 100644
--- a/src/designer/src/designer/qdesigner.cpp
+++ b/src/designer/src/designer/qdesigner.cpp
@@ -150,7 +150,7 @@ QDesignerServer *QDesigner::server() const
return m_server;
}
-static void showHelp(QCommandLineParser &parser, const QString errorMessage = QString())
+static void showHelp(QCommandLineParser &parser, const QString &errorMessage = QString())
{
QString text;
QTextStream str(&text);
diff --git a/src/designer/src/lib/shared/actioneditor.cpp b/src/designer/src/lib/shared/actioneditor.cpp
index a12bec729..fdbc0cd9a 100644
--- a/src/designer/src/lib/shared/actioneditor.cpp
+++ b/src/designer/src/lib/shared/actioneditor.cpp
@@ -71,7 +71,6 @@
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
-#include <QtCore/QSignalMapper>
#include <QtCore/QBuffer>
Q_DECLARE_METATYPE(QAction*)
@@ -125,8 +124,7 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent,
m_viewModeGroup(new QActionGroup(this)),
m_iconViewAction(0),
m_listViewAction(0),
- m_filterWidget(0),
- m_selectAssociatedWidgetsMapper(0)
+ m_filterWidget(0)
{
m_actionView->initialize(m_core);
m_actionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
@@ -780,16 +778,6 @@ void ActionEditor::slotPaste()
void ActionEditor::slotContextMenuRequested(QContextMenuEvent *e, QAction *item)
{
- typedef void (QSignalMapper::*MapperQWidgetSignal)(QWidget *);
- typedef void (QSignalMapper::*MapperVoidSlot)();
-
- // set up signal mapper
- if (!m_selectAssociatedWidgetsMapper) {
- m_selectAssociatedWidgetsMapper = new QSignalMapper(this);
- connect(m_selectAssociatedWidgetsMapper, static_cast<MapperQWidgetSignal>(&QSignalMapper::mapped),
- this, &ActionEditor::slotSelectAssociatedWidget);
- }
-
QMenu menu(this);
menu.addAction(m_actionNew);
menu.addSeparator();
@@ -803,10 +791,8 @@ void ActionEditor::slotContextMenuRequested(QContextMenuEvent *e, QAction *item)
if (!associatedWidgets.empty()) {
QMenu *associatedWidgetsSubMenu = menu.addMenu(tr("Used In"));
foreach (QWidget *w, associatedWidgets) {
- QAction *action = associatedWidgetsSubMenu->addAction(w->objectName());
- m_selectAssociatedWidgetsMapper->setMapping(action, w);
- connect(action, &QAction::triggered,
- m_selectAssociatedWidgetsMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
+ associatedWidgetsSubMenu->addAction(w->objectName(),
+ this, [this, w] { this->slotSelectAssociatedWidget(w); });
}
}
}
diff --git a/src/designer/src/lib/shared/actioneditor_p.h b/src/designer/src/lib/shared/actioneditor_p.h
index e96a185ff..b9b563ebb 100644
--- a/src/designer/src/lib/shared/actioneditor_p.h
+++ b/src/designer/src/lib/shared/actioneditor_p.h
@@ -56,7 +56,6 @@ class QDesignerPropertyEditorInterface;
class QDesignerSettingsInterface;
class QMenu;
class QActionGroup;
-class QSignalMapper;
class QItemSelection;
class QListWidget;
class QPushButton;
@@ -156,7 +155,6 @@ private:
QString m_filter;
QWidget *m_filterWidget;
- QSignalMapper *m_selectAssociatedWidgetsMapper;
};
} // namespace qdesigner_internal
diff --git a/src/designer/src/lib/shared/iconselector.cpp b/src/designer/src/lib/shared/iconselector.cpp
index 1e90ee284..357ddbf8b 100644
--- a/src/designer/src/lib/shared/iconselector.cpp
+++ b/src/designer/src/lib/shared/iconselector.cpp
@@ -46,7 +46,6 @@
#include <QtDesigner/QExtensionManager>
#include <QtWidgets/QToolButton>
-#include <QtCore/QSignalMapper>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QAction>
#include <QtWidgets/QDialogButtonBox>
diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp
index 57ce92fa0..072791aa7 100644
--- a/src/designer/src/lib/shared/morphmenu.cpp
+++ b/src/designer/src/lib/shared/morphmenu.cpp
@@ -71,7 +71,6 @@
#include <QtCore/QStringList>
#include <QtCore/QMap>
#include <QtCore/QVariant>
-#include <QtCore/QSignalMapper>
#include <QtCore/QDebug>
Q_DECLARE_METATYPE(QWidgetList)
@@ -562,7 +561,6 @@ MorphMenu::MorphMenu(QObject *parent) :
QObject(parent),
m_subMenuAction(0),
m_menu(0),
- m_mapper(0),
m_widget(0),
m_formWindow(0)
{
@@ -587,9 +585,6 @@ void MorphMenu::slotMorph(const QString &newClassName)
bool MorphMenu::populateMenu(QWidget *w, QDesignerFormWindowInterface *fw)
{
- typedef void (QSignalMapper::*MapperVoidSlot)();
- typedef void (QSignalMapper::*MapperStringSignal)(const QString &);
-
m_widget = 0;
m_formWindow = 0;
@@ -616,19 +611,15 @@ bool MorphMenu::populateMenu(QWidget *w, QDesignerFormWindowInterface *fw)
m_subMenuAction = new QAction(tr("Morph into"), this);
m_menu = new QMenu;
m_subMenuAction->setMenu(m_menu);
- m_mapper = new QSignalMapper(this);
- connect(m_mapper, static_cast<MapperStringSignal>(&QSignalMapper::mapped),
- this, &MorphMenu::slotMorph);
}
// Add actions
const QStringList::const_iterator cend = c.constEnd();
for (QStringList::const_iterator it = c.constBegin(); it != cend; ++it) {
if (*it != oldClassName) {
- QAction *a = m_menu->addAction(*it);
- m_mapper->setMapping (a, *it);
- connect(a, &QAction::triggered,
- m_mapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
+ const QString className = *it;
+ m_menu->addAction(className,
+ this, [this, className] { this->slotMorph(className); });
}
}
m_subMenuAction->setVisible(true);
diff --git a/src/designer/src/lib/shared/morphmenu_p.h b/src/designer/src/lib/shared/morphmenu_p.h
index cf8b5f55c..ce7bf1a61 100644
--- a/src/designer/src/lib/shared/morphmenu_p.h
+++ b/src/designer/src/lib/shared/morphmenu_p.h
@@ -51,7 +51,6 @@
QT_BEGIN_NAMESPACE
class QAction;
-class QSignalMapper;
class QMenu;
namespace qdesigner_internal {
@@ -76,8 +75,6 @@ private:
QAction *m_subMenuAction;
QMenu *m_menu;
- QSignalMapper *m_mapper;
-
QWidget *m_widget;
QDesignerFormWindowInterface *m_formWindow;
};
diff --git a/src/designer/src/lib/shared/previewmanager.cpp b/src/designer/src/lib/shared/previewmanager.cpp
index 12bab9ff7..0bbd3b9c6 100644
--- a/src/designer/src/lib/shared/previewmanager.cpp
+++ b/src/designer/src/lib/shared/previewmanager.cpp
@@ -823,12 +823,10 @@ QWidget *PreviewManager::raise(const QDesignerFormWindowInterface *fw, const Pre
void PreviewManager::closeAllPreviews()
{
- typedef PreviewManagerPrivate::PreviewDataList PreviewDataList;
if (!d->m_previews.empty()) {
d->m_updateBlocked = true;
d->m_activePreview = 0;
- const PreviewDataList::iterator cend = d->m_previews.end();
- for (PreviewDataList::iterator it = d->m_previews.begin(); it != cend ;++it) {
+ for (auto it = d->m_previews.constBegin(), cend = d->m_previews.constEnd(); it != cend ;++it) {
if (it->m_widget)
it->m_widget->close();
}
diff --git a/src/designer/src/lib/shared/promotiontaskmenu.cpp b/src/designer/src/lib/shared/promotiontaskmenu.cpp
index 4697447f7..9b0944247 100644
--- a/src/designer/src/lib/shared/promotiontaskmenu.cpp
+++ b/src/designer/src/lib/shared/promotiontaskmenu.cpp
@@ -50,7 +50,6 @@
#include <QtWidgets/QAction>
#include <QtWidgets/QWidget>
#include <QtWidgets/QMenu>
-#include <QtCore/QSignalMapper>
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
@@ -73,7 +72,6 @@ PromotionTaskMenu::PromotionTaskMenu(QWidget *widget,Mode mode, QObject *parent)
QObject(parent),
m_mode(mode),
m_widget(widget),
- m_promotionMapper(0),
m_globalEditAction(new QAction(tr("Promoted widgets..."), this)),
m_EditPromoteToAction(new QAction(tr("Promote to ..."), this)),
m_EditSignalsSlotsAction(new QAction(tr("Change signals/slots..."), this)),
@@ -117,9 +115,6 @@ void PromotionTaskMenu::setDemoteLabel(const QString &demoteLabel)
PromotionTaskMenu::PromotionState PromotionTaskMenu::createPromotionActions(QDesignerFormWindowInterface *formWindow)
{
- typedef void (QSignalMapper::*MapperVoidSlot)();
- typedef void (QSignalMapper::*MapperStringSignal)(const QString &);
-
// clear out old
if (!m_promotionActions.empty()) {
qDeleteAll(m_promotionActions);
@@ -151,12 +146,6 @@ PromotionTaskMenu::PromotionState PromotionTaskMenu::createPromotionActions(QDe
// Is this thing promotable at all?
return QDesignerPromotionDialog::baseClassNames(core->promotion()).contains(baseClassName) ? CanPromote : NotApplicable;
}
- // Set up a signal mapper to associate class names
- if (!m_promotionMapper) {
- m_promotionMapper = new QSignalMapper(this);
- connect(m_promotionMapper, static_cast<MapperStringSignal>(&QSignalMapper::mapped),
- this, &PromotionTaskMenu::slotPromoteToCustomWidget);
- }
QMenu *candidatesMenu = new QMenu();
// Create a sub menu
@@ -164,11 +153,8 @@ PromotionTaskMenu::PromotionState PromotionTaskMenu::createPromotionActions(QDe
// Set up actions and map class names
for (WidgetDataBaseItemList::const_iterator it = candidates.constBegin(); it != cend; ++it) {
const QString customClassName = (*it)->name();
- QAction *action = new QAction((*it)->name(), this);
- connect(action, &QAction::triggered,
- m_promotionMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
- m_promotionMapper->setMapping(action, customClassName);
- candidatesMenu->addAction(action);
+ candidatesMenu->addAction(customClassName,
+ this, [this, customClassName] { this->slotPromoteToCustomWidget(customClassName); });
}
// Sub menu action
QAction *subMenuAction = new QAction(m_promoteLabel, this);
diff --git a/src/designer/src/lib/shared/promotiontaskmenu_p.h b/src/designer/src/lib/shared/promotiontaskmenu_p.h
index 1d0d2e157..0f8a3f2db 100644
--- a/src/designer/src/lib/shared/promotiontaskmenu_p.h
+++ b/src/designer/src/lib/shared/promotiontaskmenu_p.h
@@ -59,7 +59,6 @@ class QDesignerFormEditorInterface;
class QAction;
class QMenu;
class QWidget;
-class QSignalMapper;
namespace qdesigner_internal {
@@ -124,7 +123,6 @@ private:
QPointer<QWidget> m_widget;
- QSignalMapper *m_promotionMapper;
// Per-Widget actions
QList<QAction *> m_promotionActions;
diff --git a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp
index fad08b1e1..f25a2e875 100644
--- a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp
+++ b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp
@@ -76,7 +76,6 @@
#include <QtWidgets/QPushButton>
#include <QtWidgets/QUndoStack>
#include <QtCore/QDebug>
-#include <QtCore/QSignalMapper>
#include <QtCore/QCoreApplication>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_taskmenu_p.h b/src/designer/src/lib/shared/qdesigner_taskmenu_p.h
index c74c2aaa3..7502afd90 100644
--- a/src/designer/src/lib/shared/qdesigner_taskmenu_p.h
+++ b/src/designer/src/lib/shared/qdesigner_taskmenu_p.h
@@ -59,7 +59,6 @@ class QDesignerFormWindowInterface;
class QDesignerFormEditorInterface;
class QWidget;
-class QSignalMapper;
namespace qdesigner_internal {
class QDesignerTaskMenuPrivate;
diff --git a/src/designer/src/lib/shared/qdesigner_utils.cpp b/src/designer/src/lib/shared/qdesigner_utils.cpp
index 1f3173638..a6bd9e37f 100644
--- a/src/designer/src/lib/shared/qdesigner_utils.cpp
+++ b/src/designer/src/lib/shared/qdesigner_utils.cpp
@@ -177,11 +177,9 @@ namespace qdesigner_internal
QStringList DesignerMetaFlags::flags(int ivalue) const
{
- typedef MetaEnum<uint>::KeyToValueMap::const_iterator KeyToValueMapIterator;
QStringList rc;
const uint v = static_cast<uint>(ivalue);
- const KeyToValueMapIterator cend = keyToValueMap().constEnd();
- for (KeyToValueMapIterator it = keyToValueMap().constBegin();it != cend; ++it ) {
+ for (auto it = keyToValueMap().constBegin(), cend = keyToValueMap().constEnd(); it != cend; ++it ) {
const uint itemValue = it.value();
// Check for equality first as flag values can be 0 or -1, too. Takes preference over a bitwise flag
if (v == itemValue) {
@@ -229,8 +227,7 @@ namespace qdesigner_internal
uint flags = 0;
bool valueOk = true;
QStringList keys = s.split(QString(QLatin1Char('|')));
- const QStringList::iterator cend = keys.end();
- for (QStringList::iterator it = keys.begin(); it != cend; ++it) {
+ for (auto it = keys.constBegin(), cend = keys.constEnd(); it != cend; ++it) {
const uint flagValue = keyToValue(*it, &valueOk);
if (!valueOk) {
flags = 0;
@@ -422,9 +419,7 @@ namespace qdesigner_internal
QIcon DesignerIconCache::icon(const PropertySheetIconValue &value) const
{
- typedef PropertySheetIconValue::ModeStateToPixmapMap::const_iterator ModeStateToPixmapMapConstIt;
-
- QMap<PropertySheetIconValue, QIcon>::const_iterator it = m_cache.constFind(value);
+ const auto it = m_cache.constFind(value);
if (it != m_cache.constEnd())
return it.value();
@@ -440,9 +435,8 @@ namespace qdesigner_internal
QIcon icon;
const PropertySheetIconValue::ModeStateToPixmapMap &paths = value.paths();
- const ModeStateToPixmapMapConstIt cend = paths.constEnd();
- for (ModeStateToPixmapMapConstIt it = paths.constBegin(); it != cend; ++it) {
- const QPair<QIcon::Mode, QIcon::State> pair = it.key();
+ for (auto it = paths.constBegin(), cend = paths.constEnd(); it != cend; ++it) {
+ const auto pair = it.key();
icon.addFile(it.value().path(), QSize(), pair.first, pair.second);
}
m_cache.insert(value, icon);
@@ -619,11 +613,8 @@ namespace qdesigner_internal
uint PropertySheetIconValue::mask() const
{
- typedef ModeStateToPixmapMap::const_iterator ModeStateToPixmapMapConstIt;
-
uint flags = 0;
- const ModeStateToPixmapMapConstIt cend = m_data->m_paths.constEnd();
- for (ModeStateToPixmapMapConstIt it = m_data->m_paths.constBegin(); it != cend; ++it)
+ for (auto it = m_data->m_paths.constBegin(), cend = m_data->m_paths.constEnd(); it != cend; ++it)
flags |= iconStateToSubPropertyFlag(it.key().first, it.key().second);
if (!m_data->m_theme.isEmpty())
flags |= ThemeIconMask;
@@ -680,14 +671,11 @@ namespace qdesigner_internal
QDESIGNER_SHARED_EXPORT QDebug operator<<(QDebug d, const PropertySheetIconValue &p)
{
- typedef PropertySheetIconValue::ModeStateToPixmapMap::const_iterator ModeStateToPixmapMapConstIt;
-
QDebug nospace = d.nospace();
nospace << "PropertySheetIconValue theme='" << p.theme() << "' ";
const PropertySheetIconValue::ModeStateToPixmapMap &paths = p.paths();
- const ModeStateToPixmapMapConstIt cend = paths.constEnd();
- for (ModeStateToPixmapMapConstIt it = paths.constBegin(); it != cend; ++it)
+ for (auto it = paths.constBegin(), cend = paths.constEnd(); it != cend; ++it)
nospace << " mode=" << it.key().first << ",state=" << it.key().second
<< ",'" << it.value().path() << '\'';
nospace << " mask=0x" << QString::number(p.mask(), 16);
diff --git a/src/designer/src/lib/shared/qlayout_widget.cpp b/src/designer/src/lib/shared/qlayout_widget.cpp
index b520894c4..f45206a77 100644
--- a/src/designer/src/lib/shared/qlayout_widget.cpp
+++ b/src/designer/src/lib/shared/qlayout_widget.cpp
@@ -762,8 +762,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const
void GridLayoutState::insertRow(int row)
{
rowCount++;
- const WidgetItemMap::iterator iend = widgetItemMap.end();
- for (WidgetItemMap::iterator it = widgetItemMap.begin(); it != iend; ++it) {
+ for (auto it = widgetItemMap.begin(), iend = widgetItemMap.end(); it != iend; ++it) {
const int topRow = it.value().y();
if (topRow >= row) {
it.value().translate(0, 1);
@@ -778,8 +777,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const
void GridLayoutState::insertColumn(int column)
{
colCount++;
- const WidgetItemMap::iterator iend = widgetItemMap.end();
- for (WidgetItemMap::iterator it = widgetItemMap.begin(); it != iend; ++it) {
+ for (auto it = widgetItemMap.begin(), iend = widgetItemMap.end(); it != iend; ++it) {
const int leftColumn = it.value().x();
if (leftColumn >= column) {
it.value().translate(1, 0);
@@ -843,8 +841,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const
void GridLayoutState::removeFreeRow(int removeRow)
{
- const WidgetItemMap::iterator iend = widgetItemMap.end();
- for (WidgetItemMap::iterator it = widgetItemMap.begin(); it != iend; ++it) {
+ for (auto it = widgetItemMap.begin(), iend = widgetItemMap.end(); it != iend; ++it) {
const int r = it.value().y();
Q_ASSERT(r != removeRow); // Free rows only
if (r < removeRow) { // Does the item span it? - shrink it
@@ -863,8 +860,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const
void GridLayoutState::removeFreeColumn(int removeColumn)
{
- const WidgetItemMap::iterator iend = widgetItemMap.end();
- for (WidgetItemMap::iterator it = widgetItemMap.begin(); it != iend; ++it) {
+ for (auto it = widgetItemMap.begin(), iend = widgetItemMap.end(); it != iend; ++it) {
const int c = it.value().x();
Q_ASSERT(c != removeColumn); // Free columns only
if (c < removeColumn) { // Does the item span it? - shrink it
diff --git a/src/designer/src/lib/shared/rcc.cpp b/src/designer/src/lib/shared/rcc.cpp
index 8f3c78f26..582cf731d 100644
--- a/src/designer/src/lib/shared/rcc.cpp
+++ b/src/designer/src/lib/shared/rcc.cpp
@@ -685,10 +685,8 @@ QStringList RCCResourceLibrary::dataFiles() const
// Determine map of resource identifier (':/newPrefix/images/p1.png') to file via recursion
static void resourceDataFileMapRecursion(const RCCFileInfo *m_root, const QString &path, RCCResourceLibrary::ResourceDataFileMap &m)
{
- typedef QHash<QString, RCCFileInfo*>::const_iterator ChildConstIterator;
const QChar slash = QLatin1Char('/');
- const ChildConstIterator cend = m_root->m_children.constEnd();
- for (ChildConstIterator it = m_root->m_children.constBegin(); it != cend; ++it) {
+ for (auto it = m_root->m_children.constBegin(), cend = m_root->m_children.constEnd(); it != cend; ++it) {
const RCCFileInfo *child = it.value();
QString childName = path;
childName += slash;
diff --git a/src/designer/src/lib/shared/richtexteditor.cpp b/src/designer/src/lib/shared/richtexteditor.cpp
index e8eed095e..24682529e 100644
--- a/src/designer/src/lib/shared/richtexteditor.cpp
+++ b/src/designer/src/lib/shared/richtexteditor.cpp
@@ -88,8 +88,6 @@ static inline void filterAttributes(const QStringRef &name,
QXmlStreamAttributes *atts,
bool *paragraphAlignmentFound)
{
- typedef QXmlStreamAttributes::iterator AttributeIt;
-
if (atts->isEmpty())
return;
@@ -101,7 +99,7 @@ static inline void filterAttributes(const QStringRef &name,
// Clean out everything except 'align' for 'p'
if (name == QStringLiteral("p")) {
- for (AttributeIt it = atts->begin(); it != atts->end(); ) {
+ for (auto it = atts->begin(); it != atts->end(); ) {
if (it->name() == QStringLiteral("align")) {
++it;
*paragraphAlignmentFound = true;
diff --git a/src/designer/src/lib/shared/stylesheeteditor.cpp b/src/designer/src/lib/shared/stylesheeteditor.cpp
index 25df6bce4..91dcfd8b2 100644
--- a/src/designer/src/lib/shared/stylesheeteditor.cpp
+++ b/src/designer/src/lib/shared/stylesheeteditor.cpp
@@ -47,7 +47,6 @@
#include <QtDesigner/QDesignerSettingsInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtCore/QSignalMapper>
#include <QtWidgets/QAction>
#include <QtWidgets/QColorDialog>
#include <QtWidgets/QDialogButtonBox>
@@ -87,9 +86,6 @@ StyleSheetEditorDialog::StyleSheetEditorDialog(QDesignerFormEditorInterface *cor
m_addColorAction(new QAction(tr("Add Color..."), this)),
m_addFontAction(new QAction(tr("Add Font..."), this))
{
- typedef void (QSignalMapper::*MapperVoidSlot)();
- typedef void (QSignalMapper::*MapperQStringSignal)(const QString &);
-
setWindowTitle(tr("Edit Style Sheet"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@@ -114,20 +110,12 @@ StyleSheetEditorDialog::StyleSheetEditorDialog(QDesignerFormEditorInterface *cor
connect(m_editor, &QWidget::customContextMenuRequested,
this, &StyleSheetEditorDialog::slotContextMenuRequested);
- QSignalMapper *resourceActionMapper = new QSignalMapper(this);
- QSignalMapper *gradientActionMapper = new QSignalMapper(this);
- QSignalMapper *colorActionMapper = new QSignalMapper(this);
-
- resourceActionMapper->setMapping(m_addResourceAction, QString());
- gradientActionMapper->setMapping(m_addGradientAction, QString());
- colorActionMapper->setMapping(m_addColorAction, QString());
-
connect(m_addResourceAction, &QAction::triggered,
- resourceActionMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
+ this, [this] { this->slotAddResource(QString()); });
connect(m_addGradientAction, &QAction::triggered,
- gradientActionMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
+ this, [this] { this->slotAddGradient(QString()); });
connect(m_addColorAction, &QAction::triggered,
- colorActionMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
+ this, [this] { this->slotAddColor(QString()); });
connect(m_addFontAction, &QAction::triggered, this, &StyleSheetEditorDialog::slotAddFont);
m_addResourceAction->setEnabled(mode == ModePerForm);
@@ -159,30 +147,19 @@ StyleSheetEditorDialog::StyleSheetEditorDialog(QDesignerFormEditorInterface *cor
QMenu *colorActionMenu = new QMenu(this);
for (int resourceProperty = 0; resourceProperties[resourceProperty]; ++resourceProperty) {
- QAction *action = resourceActionMenu->addAction(QLatin1String(resourceProperties[resourceProperty]));
- connect(action, &QAction::triggered,
- resourceActionMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
- resourceActionMapper->setMapping(action, QLatin1String(resourceProperties[resourceProperty]));
+ const QString resourcePropertyName = QLatin1String(resourceProperties[resourceProperty]);
+ resourceActionMenu->addAction(resourcePropertyName,
+ this, [this, resourcePropertyName] { this->slotAddResource(resourcePropertyName); });
}
for (int colorProperty = 0; colorProperties[colorProperty]; ++colorProperty) {
- QAction *gradientAction = gradientActionMenu->addAction(QLatin1String(colorProperties[colorProperty]));
- QAction *colorAction = colorActionMenu->addAction(QLatin1String(colorProperties[colorProperty]));
- connect(gradientAction, &QAction::triggered,
- gradientActionMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
- connect(colorAction, &QAction::triggered,
- colorActionMapper, static_cast<MapperVoidSlot>(&QSignalMapper::map));
- gradientActionMapper->setMapping(gradientAction, QLatin1String(colorProperties[colorProperty]));
- colorActionMapper->setMapping(colorAction, QLatin1String(colorProperties[colorProperty]));
+ const QString colorPropertyName = QLatin1String(colorProperties[colorProperty]);
+ colorActionMenu->addAction(colorPropertyName,
+ this, [this, colorPropertyName] { this->slotAddColor(colorPropertyName); });
+ gradientActionMenu->addAction(colorPropertyName,
+ this, [this, colorPropertyName] { this->slotAddGradient(colorPropertyName); } );
}
- connect(resourceActionMapper, static_cast<MapperQStringSignal>(&QSignalMapper::mapped),
- this, &StyleSheetEditorDialog::slotAddResource);
- connect(gradientActionMapper, static_cast<MapperQStringSignal>(&QSignalMapper::mapped),
- this, &StyleSheetEditorDialog::slotAddGradient);
- connect(colorActionMapper, static_cast<MapperQStringSignal>(&QSignalMapper::mapped),
- this, &StyleSheetEditorDialog::slotAddColor);
-
m_addResourceAction->setMenu(resourceActionMenu);
m_addGradientAction->setMenu(gradientActionMenu);
m_addColorAction->setMenu(colorActionMenu);
diff --git a/src/designer/src/lib/uilib/ui4.cpp b/src/designer/src/lib/uilib/ui4.cpp
index dda6e7414..e72f9b5d4 100644
--- a/src/designer/src/lib/uilib/ui4.cpp
+++ b/src/designer/src/lib/uilib/ui4.cpp
@@ -129,7 +129,8 @@ DomUI::~DomUI()
void DomUI::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("version")) {
setAttributeVersion(attribute.value().toString());
@@ -777,7 +778,8 @@ DomInclude::~DomInclude()
void DomInclude::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
@@ -854,7 +856,8 @@ DomResources::~DomResources()
void DomResources::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -936,7 +939,8 @@ DomResource::~DomResource()
void DomResource::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
@@ -1018,7 +1022,8 @@ DomActionGroup::~DomActionGroup()
void DomActionGroup::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -1158,7 +1163,8 @@ DomAction::~DomAction()
void DomAction::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -1263,7 +1269,8 @@ DomActionRef::~DomActionRef()
void DomActionRef::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -1337,7 +1344,8 @@ DomButtonGroup::~DomButtonGroup()
void DomButtonGroup::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -1583,7 +1591,8 @@ DomImage::~DomImage()
void DomImage::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -1686,7 +1695,8 @@ DomImageData::~DomImageData()
void DomImageData::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("format")) {
setAttributeFormat(attribute.value().toString());
@@ -1832,7 +1842,8 @@ DomHeader::~DomHeader()
void DomHeader::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
@@ -2371,7 +2382,8 @@ DomPropertyData::~DomPropertyData()
void DomPropertyData::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("type")) {
setAttributeType(attribute.value().toString());
@@ -2537,7 +2549,8 @@ DomLayoutDefault::~DomLayoutDefault()
void DomLayoutDefault::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("spacing")) {
setAttributeSpacing(attribute.value().toInt());
@@ -2612,7 +2625,8 @@ DomLayoutFunction::~DomLayoutFunction()
void DomLayoutFunction::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("spacing")) {
setAttributeSpacing(attribute.value().toString());
@@ -2777,7 +2791,8 @@ DomLayout::~DomLayout()
void DomLayout::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("class")) {
setAttributeClass(attribute.value().toString());
@@ -2963,7 +2978,8 @@ DomLayoutItem::~DomLayoutItem()
void DomLayoutItem::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
setAttributeRow(attribute.value().toInt());
@@ -3300,7 +3316,8 @@ DomItem::~DomItem()
void DomItem::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
setAttributeRow(attribute.value().toInt());
@@ -3463,7 +3480,8 @@ DomWidget::~DomWidget()
void DomWidget::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("class")) {
setAttributeClass(attribute.value().toString());
@@ -3767,7 +3785,8 @@ DomSpacer::~DomSpacer()
void DomSpacer::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -3857,7 +3876,8 @@ DomColor::~DomColor()
void DomColor::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("alpha")) {
setAttributeAlpha(attribute.value().toInt());
@@ -3986,7 +4006,8 @@ DomGradientStop::~DomGradientStop()
void DomGradientStop::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("position")) {
setAttributePosition(attribute.value().toDouble());
@@ -4132,7 +4153,8 @@ DomGradient::~DomGradient()
void DomGradient::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("startx")) {
setAttributeStartX(attribute.value().toDouble());
@@ -4312,7 +4334,8 @@ DomBrush::~DomBrush()
void DomBrush::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("brushstyle")) {
setAttributeBrushStyle(attribute.value().toString());
@@ -4467,7 +4490,8 @@ DomColorRole::~DomColorRole()
void DomColorRole::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("role")) {
setAttributeRole(attribute.value().toString());
@@ -5307,7 +5331,8 @@ DomLocale::~DomLocale()
void DomLocale::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("language")) {
setAttributeLanguage(attribute.value().toString());
@@ -5390,7 +5415,8 @@ DomSizePolicy::~DomSizePolicy()
void DomSizePolicy::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("hsizetype")) {
setAttributeHSizeType(attribute.value().toString());
@@ -6047,7 +6073,8 @@ DomStringList::~DomStringList()
void DomStringList::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("notr")) {
setAttributeNotr(attribute.value().toString());
@@ -6144,7 +6171,8 @@ DomResourcePixmap::~DomResourcePixmap()
void DomResourcePixmap::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("resource")) {
setAttributeResource(attribute.value().toString());
@@ -6252,7 +6280,8 @@ DomResourceIcon::~DomResourceIcon()
void DomResourceIcon::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("theme")) {
setAttributeTheme(attribute.value().toString());
@@ -6586,7 +6615,8 @@ DomString::~DomString()
void DomString::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("notr")) {
setAttributeNotr(attribute.value().toString());
@@ -7255,7 +7285,8 @@ DomProperty::~DomProperty()
void DomProperty::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -8391,7 +8422,8 @@ DomConnectionHint::~DomConnectionHint()
void DomConnectionHint::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("type")) {
setAttributeType(attribute.value().toString());
@@ -8497,7 +8529,8 @@ DomScript::~DomScript()
void DomScript::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("source")) {
setAttributeSource(attribute.value().toString());
@@ -8890,7 +8923,8 @@ DomPropertyToolTip::~DomPropertyToolTip()
void DomPropertyToolTip::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@@ -8960,7 +8994,8 @@ DomStringPropertySpecification::~DomStringPropertySpecification()
void DomStringPropertySpecification::read(QXmlStreamReader &reader)
{
- foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ const QXmlStreamAttributes attributes = reader.attributes();
+ for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp
index 9a47e0f2c..c5fa33207 100644
--- a/src/macdeployqt/macdeployqt/main.cpp
+++ b/src/macdeployqt/macdeployqt/main.cpp
@@ -96,6 +96,7 @@ int main(int argc, char **argv)
extern bool runCodesign;
extern QString codesignIdentiy;
extern bool appstoreCompliant;
+ extern bool deployFramework;
for (int i = 2; i < argc; ++i) {
QByteArray argument = QByteArray(argv[i]);
@@ -151,13 +152,22 @@ int main(int argc, char **argv)
} else if (argument == QByteArray("-appstore-compliant")) {
LogDebug() << "Argument found:" << argument;
appstoreCompliant = true;
+
+ // Undocumented option, may not work as intented
+ } else if (argument == QByteArray("-deploy-framework")) {
+ LogDebug() << "Argument found:" << argument;
+ deployFramework = true;
+
} else if (argument.startsWith("-")) {
LogError() << "Unknown argument" << argument << "\n";
return 1;
}
}
- DeploymentInfo deploymentInfo = deployQtFrameworks(appBundlePath, additionalExecutables, useDebugLibs);
+ DeploymentInfo deploymentInfo = deployQtFrameworks(appBundlePath, additionalExecutables, useDebugLibs);
+
+ if (deployFramework && deploymentInfo.isFramework)
+ fixupFramework(appBundlePath);
// Convenience: Look for .qml files in the current directoty if no -qmldir specified.
if (qmlDirs.isEmpty()) {
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index 4f72d5a10..f92110276 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -58,6 +58,7 @@ bool runCodesign = false;
QString codesignIdentiy;
bool appstoreCompliant = false;
int logLevel = 1;
+bool deployFramework = false;
using std::cout;
using std::endl;
@@ -769,6 +770,11 @@ void changeInstallName(const QString &bundlePath, const FrameworkInfo &framework
}
}
+void addRPath(const QString &rpath, const QString &binaryPath)
+{
+ runInstallNameTool(QStringList() << "-add_rpath" << rpath << binaryPath);
+}
+
void deployRPaths(const QString &bundlePath, const QSet<QString> &rpaths, const QString &binaryPath, bool useLoaderPath)
{
const QString absFrameworksPath = QFileInfo(bundlePath).absoluteFilePath()
@@ -856,6 +862,7 @@ DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks,
QStringList copiedFrameworks;
DeploymentInfo deploymentInfo;
deploymentInfo.useLoaderPath = useLoaderPath;
+ deploymentInfo.isFramework = bundlePath.contains(".framework");
QSet<QString> rpathsUsed;
while (frameworks.isEmpty() == false) {
@@ -1407,3 +1414,25 @@ void createDiskImage(const QString &appBundlePath)
hdutil.start("hdiutil", options);
hdutil.waitForFinished(-1);
}
+
+void fixupFramework(const QString &frameworkName)
+{
+ // Expected framework name looks like "Foo.framework"
+ QStringList parts = frameworkName.split(".");
+ if (parts.count() < 2) {
+ LogError() << "fixupFramework: Unexpected framework name" << frameworkName;
+ return;
+ }
+
+ // Assume framework binary path is Foo.framework/Foo
+ QString frameworkBinary = frameworkName + QStringLiteral("/") + parts[0];
+
+ // Xcode expects to find Foo.framework/Versions/A when code
+ // signing, while qmake typically generates numeric versions.
+ // Create symlink to the actual version in the framework.
+ linkFilePrintStatus("Current", frameworkName + "/Versions/A");
+
+ // Set up @rpath structure.
+ changeIdentification("@rpath/" + frameworkBinary, frameworkBinary);
+ addRPath("@loader_path/../../Contents/Frameworks/", frameworkBinary);
+}
diff --git a/src/macdeployqt/shared/shared.h b/src/macdeployqt/shared/shared.h
index a6d58607c..2368b370d 100644
--- a/src/macdeployqt/shared/shared.h
+++ b/src/macdeployqt/shared/shared.h
@@ -84,6 +84,7 @@ public:
QStringList deployedFrameworks;
QSet<QString> rpathsUsed;
bool useLoaderPath;
+ bool isFramework;
};
inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info);
@@ -112,6 +113,7 @@ void codesignFile(const QString &identity, const QString &filePath);
QSet<QString> codesignBundle(const QString &identity, const QString &appBundlePath);
void codesign(const QString &identity, const QString &appBundlePath);
void createDiskImage(const QString &appBundlePath);
+void fixupFramework(const QString &appBundlePath);
#endif
diff --git a/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp
index 9f1f177bd..a6b84048d 100644
--- a/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp
+++ b/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp
@@ -410,8 +410,7 @@ void QtButtonPropertyBrowserPrivate::insertRow(QGridLayout *layout, int row) con
}
}
- const QMap<QLayoutItem *, QRect>::ConstIterator icend = itemToPos.constEnd();
- for(QMap<QLayoutItem *, QRect>::ConstIterator it = itemToPos.constBegin(); it != icend; ++it) {
+ for (auto it = itemToPos.constBegin(), icend = itemToPos.constEnd(); it != icend; ++it) {
const QRect r = it.value();
layout->addItem(it.key(), r.x(), r.y(), r.width(), r.height());
}
@@ -431,8 +430,7 @@ void QtButtonPropertyBrowserPrivate::removeRow(QGridLayout *layout, int row) con
}
}
- const QMap<QLayoutItem *, QRect>::ConstIterator icend = itemToPos.constEnd();
- for(QMap<QLayoutItem *, QRect>::ConstIterator it = itemToPos.constBegin(); it != icend; ++it) {
+ for (auto it = itemToPos.constBegin(), icend = itemToPos.constEnd(); it != icend; ++it) {
const QRect r = it.value();
layout->addItem(it.key(), r.x(), r.y(), r.width(), r.height());
}
diff --git a/src/shared/qtpropertybrowser/qtpropertymanager.cpp b/src/shared/qtpropertybrowser/qtpropertymanager.cpp
index eea0900ce..4f435f4df 100644
--- a/src/shared/qtpropertybrowser/qtpropertymanager.cpp
+++ b/src/shared/qtpropertybrowser/qtpropertymanager.cpp
@@ -181,9 +181,7 @@ static Value getData(const QMap<const QtProperty *, PrivateData> &propertyMap,
Value PrivateData::*data,
const QtProperty *property, const Value &defaultValue = Value())
{
- typedef QMap<const QtProperty *, PrivateData> PropertyToData;
- typedef typename PropertyToData::const_iterator PropertyToDataConstIterator;
- const PropertyToDataConstIterator it = propertyMap.constFind(property);
+ const auto it = propertyMap.constFind(property);
if (it == propertyMap.constEnd())
return defaultValue;
return it.value().*data;
@@ -217,9 +215,7 @@ static void setSimpleValue(QMap<const QtProperty *, Value> &propertyMap,
void (PropertyManager::*valueChangedSignal)(QtProperty *, ValueChangeParameter),
QtProperty *property, const Value &val)
{
- typedef QMap<const QtProperty *, Value> PropertyToData;
- typedef typename PropertyToData::iterator PropertyToDataIterator;
- const PropertyToDataIterator it = propertyMap.find(property);
+ const auto it = propertyMap.find(property);
if (it == propertyMap.end())
return;
@@ -239,14 +235,11 @@ static void setValueInRange(PropertyManager *manager, PropertyManagerPrivate *ma
QtProperty *property, const Value &val,
void (PropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, ValueChangeParameter))
{
- typedef typename PropertyManagerPrivate::Data PrivateData;
- typedef QMap<const QtProperty *, PrivateData> PropertyToData;
- typedef typename PropertyToData::iterator PropertyToDataIterator;
- const PropertyToDataIterator it = managerPrivate->m_values.find(property);
+ const auto it = managerPrivate->m_values.find(property);
if (it == managerPrivate->m_values.end())
return;
- PrivateData &data = it.value();
+ auto &data = it.value();
if (data.val == val)
return;
@@ -274,10 +267,7 @@ static void setBorderValues(PropertyManager *manager, PropertyManagerPrivate *ma
void (PropertyManagerPrivate::*setSubPropertyRange)(QtProperty *,
ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
{
- typedef typename PropertyManagerPrivate::Data PrivateData;
- typedef QMap<const QtProperty *, PrivateData> PropertyToData;
- typedef typename PropertyToData::iterator PropertyToDataIterator;
- const PropertyToDataIterator it = managerPrivate->m_values.find(property);
+ const auto it = managerPrivate->m_values.find(property);
if (it == managerPrivate->m_values.end())
return;
@@ -285,7 +275,7 @@ static void setBorderValues(PropertyManager *manager, PropertyManagerPrivate *ma
Value toVal = maxVal;
orderBorders(fromVal, toVal);
- PrivateData &data = it.value();
+ auto &data = it.value();
if (data.minVal == fromVal && data.maxVal == toVal)
return;
@@ -318,9 +308,7 @@ static void setBorderValue(PropertyManager *manager, PropertyManagerPrivate *man
void (PropertyManagerPrivate::*setSubPropertyRange)(QtProperty *,
ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
{
- typedef QMap<const QtProperty *, PrivateData> PropertyToData;
- typedef typename PropertyToData::iterator PropertyToDataIterator;
- const PropertyToDataIterator it = managerPrivate->m_values.find(property);
+ const auto it = managerPrivate->m_values.find(property);
if (it == managerPrivate->m_values.end())
return;
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 5b54a45f0..bf69829fb 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -30,7 +30,8 @@ find_package(Qt5Core REQUIRED)
include("${_Qt5CTestMacros}")
if(NOT CMAKE_CROSSCOMPILING)
- expect_pass(test_translation_macros)
+ expect_pass(test_create_translation_macro)
+ expect_pass(test_add_translation_macro)
endif()
if (NOT NO_WIDGETS)
diff --git a/tests/auto/cmake/test_add_translation_macro/CMakeLists.txt b/tests/auto/cmake/test_add_translation_macro/CMakeLists.txt
new file mode 100644
index 000000000..90e7f67f5
--- /dev/null
+++ b/tests/auto/cmake/test_add_translation_macro/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(test_add_translation_macro)
+
+find_package(Qt5Core 5.0.0 REQUIRED)
+find_package(Qt5LinguistTools 5.0.0 REQUIRED)
+
+include_directories(
+ ${Qt5Core_INCLUDE_DIRS}
+)
+
+add_definitions(${Qt5Core_DEFINITIONS})
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+
+set(my_srcs myi18nobject.cpp)
+
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/some_dir")
+
+qt5_add_translation(qm_files myobject_de.ts)
+
+add_executable(test_add_translation ${my_srcs} ${qm_files})
+target_link_libraries(test_add_translation ${Qt5Core_LIBRARIES})
diff --git a/tests/auto/cmake/test_translation_macros/myi18nobject.cpp b/tests/auto/cmake/test_add_translation_macro/myi18nobject.cpp
index d6b0611f7..d6b0611f7 100644
--- a/tests/auto/cmake/test_translation_macros/myi18nobject.cpp
+++ b/tests/auto/cmake/test_add_translation_macro/myi18nobject.cpp
diff --git a/tests/auto/cmake/test_translation_macros/myobject_de.ts b/tests/auto/cmake/test_add_translation_macro/myobject_de.ts
index 3b8f8bb55..240ffb389 100644
--- a/tests/auto/cmake/test_translation_macros/myobject_de.ts
+++ b/tests/auto/cmake/test_add_translation_macro/myobject_de.ts
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.0" language="de_DE">
+<TS version="2.1" language="de_DE">
<context>
<name>QObject</name>
<message>
- <location filename="myi18nobject.cpp" line="15"/>
+ <location filename="myi18nobject.cpp" line="49"/>
<source>Hello, world!</source>
- <translation>Hallo, Welt</translation>
+ <translation type="unfinished"></translation>
</message>
</context>
</TS>
diff --git a/tests/auto/cmake/test_translation_macros/some_dir/some_include.h b/tests/auto/cmake/test_add_translation_macro/some_dir/some_include.h
index 24657b9f1..24657b9f1 100644
--- a/tests/auto/cmake/test_translation_macros/some_dir/some_include.h
+++ b/tests/auto/cmake/test_add_translation_macro/some_dir/some_include.h
diff --git a/tests/auto/cmake/test_translation_macros/CMakeLists.txt b/tests/auto/cmake/test_create_translation_macro/CMakeLists.txt
index 14ecb40e3..100d689c7 100644
--- a/tests/auto/cmake/test_translation_macros/CMakeLists.txt
+++ b/tests/auto/cmake/test_create_translation_macro/CMakeLists.txt
@@ -1,7 +1,6 @@
-
cmake_minimum_required(VERSION 2.8)
-project(test_translation_macros)
+project(test_create_translation_macros)
find_package(Qt5Core 5.0.0 REQUIRED)
find_package(Qt5LinguistTools 5.0.0 REQUIRED)
@@ -18,7 +17,7 @@ set(my_srcs myi18nobject.cpp)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/some_dir")
-qt5_create_translation(qm_files ${my_srcs} myobject_de.ts)
+qt5_create_translation(qm_files ${my_srcs} myobject_de.ts OPTIONS -pro-debug) # play around with OPTIONS
add_executable(myobject ${my_srcs} ${qm_files})
target_link_libraries(myobject ${Qt5Core_LIBRARIES})
diff --git a/tests/auto/cmake/test_create_translation_macro/myi18nobject.cpp b/tests/auto/cmake/test_create_translation_macro/myi18nobject.cpp
new file mode 100644
index 000000000..d6b0611f7
--- /dev/null
+++ b/tests/auto/cmake/test_create_translation_macro/myi18nobject.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include <QCoreApplication>
+#include <QTranslator>
+
+#include "some_include.h"
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+ QTranslator *myappTranslator = new QTranslator;
+ QString localeName = QLocale::system().name();
+ myappTranslator->load("myobject_" + localeName + ".qm", qApp->applicationDirPath());
+ myappTranslator->setObjectName("myobject_" + localeName);
+ app.installTranslator(myappTranslator);
+
+ qDebug() << QObject::tr("Hello, world!");
+ return 0;
+}
diff --git a/tests/auto/cmake/test_create_translation_macro/myobject_de.ts b/tests/auto/cmake/test_create_translation_macro/myobject_de.ts
new file mode 100644
index 000000000..240ffb389
--- /dev/null
+++ b/tests/auto/cmake/test_create_translation_macro/myobject_de.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_DE">
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="myi18nobject.cpp" line="49"/>
+ <source>Hello, world!</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/cmake/test_create_translation_macro/some_dir/some_include.h b/tests/auto/cmake/test_create_translation_macro/some_dir/some_include.h
new file mode 100644
index 000000000..24657b9f1
--- /dev/null
+++ b/tests/auto/cmake/test_create_translation_macro/some_dir/some_include.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SOME_INCLUDE_H
+#define SOME_INCLUDE_H
+
+enum {
+ Non_Empty_File
+};
+
+#endif
diff --git a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro
index 94cdd9a0f..13a7d47bb 100644
--- a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro
+++ b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro
@@ -19,4 +19,3 @@ wince*: {
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qhelpenginecore/qhelpenginecore.pro b/tests/auto/qhelpenginecore/qhelpenginecore.pro
index 85b68d7ac..4fa425838 100644
--- a/tests/auto/qhelpenginecore/qhelpenginecore.pro
+++ b/tests/auto/qhelpenginecore/qhelpenginecore.pro
@@ -20,4 +20,3 @@ wince*: {
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qhelpindexmodel/qhelpindexmodel.pro b/tests/auto/qhelpindexmodel/qhelpindexmodel.pro
index 261afc81d..18c118f2d 100644
--- a/tests/auto/qhelpindexmodel/qhelpindexmodel.pro
+++ b/tests/auto/qhelpindexmodel/qhelpindexmodel.pro
@@ -6,4 +6,3 @@ QT += help sql testlib
DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_USE_USING_NAMESPACE
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qhelpprojectdata/qhelpprojectdata.pro b/tests/auto/qhelpprojectdata/qhelpprojectdata.pro
index 0272ac2bb..ec2e313d5 100644
--- a/tests/auto/qhelpprojectdata/qhelpprojectdata.pro
+++ b/tests/auto/qhelpprojectdata/qhelpprojectdata.pro
@@ -7,4 +7,3 @@ QT += help-private testlib
DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_USE_USING_NAMESPACE
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0