summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2019-08-27 07:51:01 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2019-08-27 07:51:01 +0300
commitb5e21475344d575a7f07f9d6f3dd2a9d82cf4a50 (patch)
tree75adaf9abab6a9e3052ef9d35dd7709628215cbd
parentd33c53dd3cf4f750f4c78a9b453df98e1726e827 (diff)
parent142831bf69b321369a25371e191a24dadd81fee1 (diff)
Merge dev into 5.14
-rw-r--r--src/assistant/assistant/mainwindow.cpp2
-rw-r--r--src/assistant/assistant/preferencesdialog.cpp55
-rw-r--r--src/assistant/assistant/preferencesdialog.h4
-rw-r--r--src/distancefieldgenerator/mainwindow.cpp2
-rw-r--r--src/qdoc/clangcodeparser.cpp6
-rw-r--r--src/qdoc/doc/examples/cpp.qdoc.sample2
-rw-r--r--src/qdoc/main.cpp3
-rw-r--r--src/qdoc/qdoccommandlineparser.cpp36
-rw-r--r--src/qdoc/qdoccommandlineparser.h4
-rw-r--r--src/qdoc/qdocglobals.cpp51
-rw-r--r--src/qdoc/qdocglobals.h9
11 files changed, 91 insertions, 83 deletions
diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp
index 2b9c87bbf..fc5fe5b3f 100644
--- a/src/assistant/assistant/mainwindow.cpp
+++ b/src/assistant/assistant/mainwindow.cpp
@@ -842,7 +842,7 @@ void MainWindow::showPreferences()
m_centralWidget, &CentralWidget::updateBrowserFont);
connect(&dia, &PreferencesDialog::updateUserInterface,
m_centralWidget, &CentralWidget::updateUserInterface);
- dia.showDialog();
+ dia.exec();
}
void MainWindow::syncContents()
diff --git a/src/assistant/assistant/preferencesdialog.cpp b/src/assistant/assistant/preferencesdialog.cpp
index 1f87b5a25..66d6381d3 100644
--- a/src/assistant/assistant/preferencesdialog.cpp
+++ b/src/assistant/assistant/preferencesdialog.cpp
@@ -152,31 +152,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
setFont(helpEngine.appFont());
}
-PreferencesDialog::~PreferencesDialog()
-{
- if (m_appFontChanged) {
- helpEngine.setAppFont(m_appFontPanel->selectedFont());
- helpEngine.setUseAppFont(m_appFontPanel->isChecked());
- helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem());
- emit updateApplicationFont();
- }
-
- if (m_browserFontChanged) {
- helpEngine.setBrowserFont(m_browserFontPanel->selectedFont());
- helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked());
- helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem());
- emit updateBrowserFont();
- }
-
- QString homePage = m_ui.homePageLineEdit->text();
- if (homePage.isEmpty())
- homePage = QLatin1String("help");
- helpEngine.setHomePage(homePage);
-
- int option = m_ui.helpStartComboBox->currentIndex();
- helpEngine.setStartOption(option);
-}
-
FilterSetup PreferencesDialog::readOriginalSetup() const
{
FilterSetup filterSetup;
@@ -205,12 +180,6 @@ FilterSetup PreferencesDialog::readOriginalSetup() const
return filterSetup;
}
-void PreferencesDialog::showDialog()
-{
- if (exec() != Accepted)
- m_appFontChanged = m_browserFontChanged = false;
-}
-
void PreferencesDialog::updateFilterPage()
{
if (m_hideFiltersTab)
@@ -593,6 +562,30 @@ void PreferencesDialog::applyChanges()
helpEngine.setShowTabs(m_ui.showTabs->isChecked());
if (m_showTabs != m_ui.showTabs->isChecked())
emit updateUserInterface();
+
+ if (m_appFontChanged) {
+ helpEngine.setAppFont(m_appFontPanel->selectedFont());
+ helpEngine.setUseAppFont(m_appFontPanel->isChecked());
+ helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem());
+ emit updateApplicationFont();
+ m_appFontChanged = false;
+ }
+
+ if (m_browserFontChanged) {
+ helpEngine.setBrowserFont(m_browserFontPanel->selectedFont());
+ helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked());
+ helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem());
+ emit updateBrowserFont();
+ m_browserFontChanged = false;
+ }
+
+ QString homePage = m_ui.homePageLineEdit->text();
+ if (homePage.isEmpty())
+ homePage = QLatin1String("help");
+ helpEngine.setHomePage(homePage);
+
+ const int option = m_ui.helpStartComboBox->currentIndex();
+ helpEngine.setStartOption(option);
}
void PreferencesDialog::updateFontSettingsPage()
diff --git a/src/assistant/assistant/preferencesdialog.h b/src/assistant/assistant/preferencesdialog.h
index 732d11752..b0601e280 100644
--- a/src/assistant/assistant/preferencesdialog.h
+++ b/src/assistant/assistant/preferencesdialog.h
@@ -29,6 +29,7 @@
#ifndef PREFERENCESDIALOG_H
#define PREFERENCESDIALOG_H
+#include <QtCore/QVersionNumber>
#include <QtWidgets/QDialog>
#include <QtHelp/QHelpFilterData>
#include "ui_preferencesdialog.h"
@@ -60,9 +61,6 @@ class PreferencesDialog : public QDialog
public:
PreferencesDialog(QWidget *parent = nullptr);
- ~PreferencesDialog() override;
-
- void showDialog();
private slots:
void filterSelected(QListWidgetItem *item);
diff --git a/src/distancefieldgenerator/mainwindow.cpp b/src/distancefieldgenerator/mainwindow.cpp
index 3717330b4..ee4475ada 100644
--- a/src/distancefieldgenerator/mainwindow.cpp
+++ b/src/distancefieldgenerator/mainwindow.cpp
@@ -551,7 +551,7 @@ QByteArray MainWindow::createSfntTable()
glyphRecord.boundingRectY = qToBigEndian(TO_FIXED_POINT(glyphData.boundingRect.y()));
glyphRecord.boundingRectWidth = qToBigEndian(TO_FIXED_POINT(glyphData.boundingRect.width()));
glyphRecord.boundingRectHeight = qToBigEndian(TO_FIXED_POINT(glyphData.boundingRect.height()));
- glyphRecord.textureIndex = qToBigEndian(glyphData.textureIndex);
+ glyphRecord.textureIndex = qToBigEndian(quint16(glyphData.textureIndex));
buffer.write(reinterpret_cast<char *>(&glyphRecord), sizeof(QtdfGlyphRecord));
int expectedWidth = qCeil(glyphData.texCoord.width + glyphData.texCoord.xMargin * 2);
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index bbe3f9ba7..475becf4d 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -1127,13 +1127,14 @@ static const char *defaultArgs_[] = {
"-DQ_QDOC",
"-DQ_CLANG_QDOC",
"-DQT_DISABLE_DEPRECATED_BEFORE=0",
- "-DQT_ANNOTATE_CLASS(type,...)=static_assert(sizeof(#__VA_ARGS__), #type);",
- "-DQT_ANNOTATE_CLASS2(type,a1,a2)=static_assert(sizeof(#a1, #a2), #type);",
+ "-DQT_ANNOTATE_CLASS(type,...)=static_assert(sizeof(#__VA_ARGS__),#type);",
+ "-DQT_ANNOTATE_CLASS2(type,a1,a2)=static_assert(sizeof(#a1,#a2),#type);",
"-DQT_ANNOTATE_FUNCTION(a)=__attribute__((annotate(#a)))",
"-DQT_ANNOTATE_ACCESS_SPECIFIER(a)=__attribute__((annotate(#a)))",
"-Wno-constant-logical-operand",
"-Wno-macro-redefined",
"-Wno-nullability-completeness",
+ "-ferror-limit=0",
"-I" CLANG_RESOURCE_DIR
};
@@ -1304,6 +1305,7 @@ void ClangCodeParser::buildPCH()
out << line << "\n";
}
}
+ tmpHeaderFile.close();
}
if (printParsingErrors_ == 0)
Location::logToStdErrAlways("clang not printing errors; include paths were guessed");
diff --git a/src/qdoc/doc/examples/cpp.qdoc.sample b/src/qdoc/doc/examples/cpp.qdoc.sample
index 892e9c30d..0524a6756 100644
--- a/src/qdoc/doc/examples/cpp.qdoc.sample
+++ b/src/qdoc/doc/examples/cpp.qdoc.sample
@@ -46,7 +46,7 @@
\snippet code/doc_src_qcache.cpp 1
- ... detailed description ommitted
+ ... detailed description omitted
\sa QPixmapCache, QHash, QMap
*/
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp
index 3ce7ef9ea..39ad0c9a2 100644
--- a/src/qdoc/main.cpp
+++ b/src/qdoc/main.cpp
@@ -581,7 +581,8 @@ int main(int argc, char **argv)
// Set the globals declared at the top of this file:
QDocCommandLineParser parser;
- parser.process(app.arguments(), qdocGlobals);
+ parser.process(app.arguments());
+ qdocGlobals.setOptions(parser);
config.setOptions(parser);
postProcess(parser);
diff --git a/src/qdoc/qdoccommandlineparser.cpp b/src/qdoc/qdoccommandlineparser.cpp
index be8513e4b..33009c512 100644
--- a/src/qdoc/qdoccommandlineparser.cpp
+++ b/src/qdoc/qdoccommandlineparser.cpp
@@ -28,7 +28,6 @@
#include "qdoccommandlineparser.h"
-#include "config.h"
#include "loggingcategory.h"
#include "utilities.h"
@@ -179,44 +178,11 @@ static QStringList argumentsFromCommandLineAndFile(const QStringList &arguments)
return allArguments;
}
-void QDocCommandLineParser::process(const QStringList &arguments, QDocGlobals &qdocGlobals)
+void QDocCommandLineParser::process(const QStringList &arguments)
{
auto allArguments = argumentsFromCommandLineAndFile(arguments);
QCommandLineParser::process(allArguments);
- qdocGlobals.addDefine(values(defineOption));
- qdocGlobals.dependModules() += values(dependsOption);
- qdocGlobals.enableHighlighting(isSet(highlightingOption));
- qdocGlobals.setShowInternal(isSet(showInternalOption));
- qdocGlobals.setSingleExec(isSet(singleExecOption));
- qdocGlobals.setWriteQaPages(isSet(writeQaPagesOption));
- qdocGlobals.setRedirectDocumentationToDevNull(isSet(redirectDocumentationToDevNullOption));
-
- const auto indexDirs = values(indexDirOption);
- for (const auto &indexDir : indexDirs) {
- if (QFile::exists(indexDir))
- qdocGlobals.appendToIndexDirs(indexDir);
- else
- qDebug() << "Cannot find index directory" << indexDir;
- }
- qdocGlobals.setObsoleteLinks(isSet(obsoleteLinksOption));
- qdocGlobals.setNoLinkErrors(isSet(noLinkErrorsOption) || qEnvironmentVariableIsSet("QDOC_NOLINKERRORS"));
- qdocGlobals.setAutolinkErrors(isSet(autoLinkErrorsOption));
-
if (isSet(singleExecOption) && isSet(indexDirOption))
qDebug("WARNING: -indexdir option ignored: Index files are not used in single-exec mode.");
-
- QDir currentDir = QDir::current();
- const auto paths = values(includePathOption);
- for (const auto &i : paths)
- qdocGlobals.addIncludePath("-I", currentDir.absoluteFilePath(i));
-
-#ifdef QDOC_PASS_ISYSTEM
- const auto paths2 = values(includePathSystemOption);
- for (const auto &i : paths2)
- qdocGlobals.addIncludePath("-isystem", currentDir.absoluteFilePath(i));
-#endif
- const auto paths3 = values(frameworkOption);
- for (const auto &i : paths3)
- qdocGlobals.addIncludePath("-F", currentDir.absoluteFilePath(i));
}
diff --git a/src/qdoc/qdoccommandlineparser.h b/src/qdoc/qdoccommandlineparser.h
index e669765a6..d88cb6ffc 100644
--- a/src/qdoc/qdoccommandlineparser.h
+++ b/src/qdoc/qdoccommandlineparser.h
@@ -29,8 +29,6 @@
#ifndef QDOCCOMMANDLINEPARSER_H
#define QDOCCOMMANDLINEPARSER_H
-#include "qdocglobals.h"
-
#include <QtCore/qcommandlineparser.h>
QT_BEGIN_NAMESPACE
@@ -38,7 +36,7 @@ QT_BEGIN_NAMESPACE
struct QDocCommandLineParser : public QCommandLineParser
{
QDocCommandLineParser();
- void process(const QStringList &arguments, QDocGlobals &qdocGlobals);
+ void process(const QStringList &arguments);
QCommandLineOption defineOption, dependsOption, highlightingOption;
QCommandLineOption showInternalOption, redirectDocumentationToDevNullOption;
diff --git a/src/qdoc/qdocglobals.cpp b/src/qdoc/qdocglobals.cpp
index a79d47405..22e9beb70 100644
--- a/src/qdoc/qdocglobals.cpp
+++ b/src/qdoc/qdocglobals.cpp
@@ -27,10 +27,11 @@
****************************************************************************/
#include "qdocglobals.h"
+#include "qdoccommandlineparser.h"
-QDocGlobals::QDocGlobals()
-{
-}
+#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfile.h>
bool QDocGlobals::highlighting()
{
@@ -166,3 +167,47 @@ void QDocGlobals::setPreviousCurrentDir(const QString &path)
m_previousCurrentDir = path;
}
+void QDocGlobals::setIncludePaths(const QDocCommandLineParser &parser)
+{
+ QDir currentDir = QDir::current();
+ auto includePaths = parser.values(parser.includePathOption);
+ for (const auto &path : qAsConst(includePaths))
+ addIncludePath("-I", currentDir.absoluteFilePath(path));
+
+#ifdef QDOC_PASS_ISYSTEM
+ includePaths = parser.values(parser.includePathSystemOption);
+ for (const auto &path : qAsConst(includePaths))
+ addIncludePath("-isystem", currentDir.absoluteFilePath(path));
+#endif
+ includePaths = parser.values(parser.frameworkOption);
+ for (const auto &path : qAsConst(includePaths))
+ addIncludePath("-F", currentDir.absoluteFilePath(path));
+}
+
+void QDocGlobals::setIndexDirs(const QDocCommandLineParser &parser)
+{
+ const auto indexDirs = parser.values(parser.indexDirOption);
+ for (const auto &indexDir : indexDirs) {
+ if (QFile::exists(indexDir))
+ appendToIndexDirs(indexDir);
+ else
+ qDebug() << "Cannot find index directory" << indexDir;
+ }
+}
+
+void QDocGlobals::setOptions(const QDocCommandLineParser &parser)
+{
+ addDefine(parser.values(parser.defineOption));
+ m_dependModules += parser.values(parser.dependsOption);
+ enableHighlighting(parser.isSet(parser.highlightingOption));
+ setShowInternal(parser.isSet(parser.showInternalOption));
+ setSingleExec(parser.isSet(parser.singleExecOption));
+ setWriteQaPages(parser.isSet(parser.writeQaPagesOption));
+ setRedirectDocumentationToDevNull(parser.isSet(parser.redirectDocumentationToDevNullOption));
+ setIndexDirs(parser);
+ setObsoleteLinks(parser.isSet(parser.obsoleteLinksOption));
+ setNoLinkErrors(parser.isSet(parser.noLinkErrorsOption) ||
+ qEnvironmentVariableIsSet("QDOC_NOLINKERRORS"));
+ setAutolinkErrors(parser.isSet(parser.autoLinkErrorsOption));
+ setIncludePaths(parser);
+}
diff --git a/src/qdoc/qdocglobals.h b/src/qdoc/qdocglobals.h
index c849df19b..d1198db37 100644
--- a/src/qdoc/qdocglobals.h
+++ b/src/qdoc/qdocglobals.h
@@ -34,11 +34,12 @@
#include <QtCore/qtranslator.h>
QT_BEGIN_NAMESPACE
+
+struct QDocCommandLineParser;
+
class QDocGlobals
{
public:
- QDocGlobals();
-
bool highlighting();
void enableHighlighting(bool value);
@@ -80,8 +81,12 @@ public:
QString previousCurrentDir();
void setPreviousCurrentDir(const QString &path);
+ void setOptions(const QDocCommandLineParser &parser);
private:
+ void setIncludePaths(const QDocCommandLineParser &parser);
+ void setIndexDirs(const QDocCommandLineParser &parser);
+
bool m_highlighting = false;
bool m_showInternal = false;
bool m_singleExec = false;