summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-29 11:29:07 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-29 11:29:07 +0200
commit3b1da8a7754b37d5767aeb55a7ca46e4180a6109 (patch)
tree6748bf907f7751375379318bab45cf1fb8deb107
parent2b062a567c5ab282ce663ac5edf03b2cb56265ce (diff)
parent0731b64ee6d3439e6ddfa3ee58a7e909b170ebb0 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/assistant/assistant/doc/src/assistant-manual.qdoc Change-Id: I136caf5f26eff4d1c2574459b8dff9937c2c372d
-rw-r--r--.qmake.conf1
-rw-r--r--LICENSE.GPLv32
-rw-r--r--LICENSE.LGPLv212
-rw-r--r--LICENSE.LGPLv32
-rw-r--r--src/androiddeployqt/main.cpp3
-rw-r--r--src/assistant/assistant/assistant.qchbin548864 -> 546816 bytes
-rw-r--r--src/assistant/assistant/doc/internal/README9
-rw-r--r--src/assistant/assistant/doc/internal/assistant.qdocconf22
-rw-r--r--src/assistant/assistant/doc/internal/internal.pro2
-rw-r--r--src/assistant/assistant/doc/src/assistant-manual.qdoc295
-rw-r--r--src/assistant/assistant/doc/src/assistant-quick-guide.qdoc324
-rw-r--r--src/assistant/assistant/helpviewer.cpp5
-rw-r--r--src/assistant/clucene/qclucene-config_p.h6
-rw-r--r--src/assistant/help/qhelpgenerator.cpp6
-rw-r--r--src/designer/src/lib/shared/actioneditor.cpp1
-rw-r--r--src/designer/src/lib/shared/newformwidget.cpp41
-rw-r--r--src/designer/src/lib/shared/qtresourceview.cpp2
-rw-r--r--src/linguist/linguist/errorsview.cpp2
-rw-r--r--src/linguist/linguist/mainwindow.cpp3
-rw-r--r--src/macdeployqt/shared/shared.cpp8
-rw-r--r--src/qdoc/cppcodeparser.cpp5
-rw-r--r--src/qdoc/doc/examples/samples.qdocinc2
-rw-r--r--src/qdoc/doc/qdoc-manual-markupcmds.qdoc6
-rw-r--r--src/qdoc/helpprojectwriter.cpp19
-rw-r--r--src/qdoc/htmlgenerator.cpp10
-rw-r--r--src/qdoc/node.cpp57
-rw-r--r--src/qdoc/node.h8
-rw-r--r--src/qdoc/qdocindexfiles.cpp84
-rw-r--r--tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp33
29 files changed, 546 insertions, 414 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 33a2710f6..4ef70163b 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,4 +1,3 @@
load(qt_build_config)
-CONFIG += qt_example_installs
MODULE_VERSION = 5.7.0
diff --git a/LICENSE.GPLv3 b/LICENSE.GPLv3
index 0c0f8e15f..98dd6dd37 100644
--- a/LICENSE.GPLv3
+++ b/LICENSE.GPLv3
@@ -3,7 +3,7 @@
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ You may use, distribute and copy the Qt Toolkit under the terms of
GNU Lesser General Public License version 3. That license references
the General Public License version 3, that is displayed below. Other
portions of the Qt Toolkit may be licensed directly under this license.
diff --git a/LICENSE.LGPLv21 b/LICENSE.LGPLv21
index ca5adae7e..15a208b48 100644
--- a/LICENSE.LGPLv21
+++ b/LICENSE.LGPLv21
@@ -3,7 +3,7 @@
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ You may use, distribute and copy the Qt Toolkit under the terms of
GNU Lesser General Public License version 2.1, which is displayed below.
-------------------------------------------------------------------------
diff --git a/LICENSE.LGPLv3 b/LICENSE.LGPLv3
index d3268e665..849103ad9 100644
--- a/LICENSE.LGPLv3
+++ b/LICENSE.LGPLv3
@@ -3,7 +3,7 @@
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ You may use, distribute and copy the Qt Toolkit under the terms of
GNU Lesser General Public License version 3, which is displayed below.
This license makes reference to the version 3 of the GNU General
Public License, which you can find in the LICENSE.GPLv3 file.
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp
index 51bcb61eb..8a8e59172 100644
--- a/src/androiddeployqt/main.cpp
+++ b/src/androiddeployqt/main.cpp
@@ -774,13 +774,12 @@ bool readInputFile(Options *options)
if (QFileInfo(path).isDir()) {
QDirIterator iterator(path, QDirIterator::Subdirectories);
while (iterator.hasNext()) {
+ iterator.next();
if (iterator.fileInfo().isFile()) {
QString subPath = iterator.filePath();
options->qtDependencies.append(QtDependency(subPath.mid(options->qtInstallDirectory.length() + 1),
subPath));
}
-
- iterator.next();
}
} else {
options->qtDependencies.append(QtDependency(dependency, path));
diff --git a/src/assistant/assistant/assistant.qch b/src/assistant/assistant/assistant.qch
index b023d53b0..fded08e62 100644
--- a/src/assistant/assistant/assistant.qch
+++ b/src/assistant/assistant/assistant.qch
Binary files differ
diff --git a/src/assistant/assistant/doc/internal/README b/src/assistant/assistant/doc/internal/README
new file mode 100644
index 000000000..04182d7c8
--- /dev/null
+++ b/src/assistant/assistant/doc/internal/README
@@ -0,0 +1,9 @@
+This directory contains a documentation project that can be used for building
+or updating the internal Qt Assistant help file (assistant.qch).
+
+Usage:
+
+ /path/to/qmake internal.pro
+ make docs
+
+Then, copy the generated assistant.qch to ../../assistant.qch
diff --git a/src/assistant/assistant/doc/internal/assistant.qdocconf b/src/assistant/assistant/doc/internal/assistant.qdocconf
new file mode 100644
index 000000000..419463f85
--- /dev/null
+++ b/src/assistant/assistant/doc/internal/assistant.qdocconf
@@ -0,0 +1,22 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults-offline.qdocconf)
+
+project = Assistant
+qhp.projects = Assistant
+
+qhp.Assistant.file = assistant.qhp
+qhp.Assistant.namespace = org.qt-project.assistantinternal-1.0.0
+qhp.Assistant.virtualFolder = assistant
+qhp.Assistant.indexTitle = Qt Assistant Quick Guide
+
+sources = ../src/assistant-quick-guide.qdoc
+imagedirs = ../images
+
+
+defines = ASSISTANT_INTERNAL
+navigation.homepage = "Qt Assistant Quick Guide"
+
+# Remove all unused definitions and files from the qt-module-defaults template
+HTML.headerstyles = \
+ " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline-simple.css\" />\n"
+qhp.extraFiles = style/offline-simple.css
+buildversion = " "
diff --git a/src/assistant/assistant/doc/internal/internal.pro b/src/assistant/assistant/doc/internal/internal.pro
new file mode 100644
index 000000000..d6c3cea46
--- /dev/null
+++ b/src/assistant/assistant/doc/internal/internal.pro
@@ -0,0 +1,2 @@
+TEMPLATE = aux
+QMAKE_DOCS = $$PWD/assistant.qdocconf
diff --git a/src/assistant/assistant/doc/src/assistant-manual.qdoc b/src/assistant/assistant/doc/src/assistant-manual.qdoc
index e65cf4b01..f29233233 100644
--- a/src/assistant/assistant/doc/src/assistant-manual.qdoc
+++ b/src/assistant/assistant/doc/src/assistant-manual.qdoc
@@ -59,301 +59,6 @@
*/
/*!
- \contentspage {Qt Assistant Manual}{Contents}
- \previouspage Qt Assistant Manual
- \page assistant-quick-guide.html
- \nextpage Using Qt Assistant
-
- \title Qt Assistant Quick Guide
-
- Once you have installed Qt, you can start Qt Assistant in the same way as
- any other application on the development host.
-
- The \QA main window contains a sidebar (1) with navigation windows for:
-
- \list
- \li Viewing a list of documents in Qt help format that are installed on
- the development host.
- \li Managing bookmarks.
- \li Searching for keywords in the index.
- \li Searching for information using a free text search function.
- \li Switching between open topics.
- \endlist
-
- The selected topic in the selected document is displayed in the
- \b Documentation window (2).
-
- \image assistant-assistant.png
-
- Click the \gui Previous and \gui Next toolbar buttons (3) to navigate within
- the topics you have visited.
-
- \section1 Managing Bookmarks
-
- \image assistant-bookmarks.png
-
- To bookmark topics of particular interest, select \gui Bookmarks >
- \gui {Add Bookmark} (or press \key{Ctrl+B}). A bookmark for the
- page that is currently showing in the \gui Documentation window is added.
-
- You can view and manage bookmarks in the \gui Bookmarks window.
- Double-click a bookmark to open the topic in the \gui Documentation window.
- You can also right-click the bookmark and select \gui{Show Bookmark} in the
- context menu.
-
- To rename or delete the highlighted bookmark, select \gui {Rename Bookmark}
- or \gui {Delete Bookmark} in the context menu.
-
- \section1 Searching for Keywords
-
- \image assistant-index.png
-
- To perform an index search, click the \gui{Index} tab on the sidebar
- (or press \key{Alt+I}). In the \gui{Look For} field, enter the search term.
- As you type, words are found and highlighted in a list beneath the field.
- If the highlighted text matches what you are
- looking for, double-click it or press \key{Enter}. The
- \gui Documentation window displays the relevant topic. You rarely have
- to type in the whole word before \QA finds a match. Note that for some
- words there may be more than one possible topic that is relevant.
-
- \section1 Using Free Text Search
-
- \image assistant-search.png
-
- \QA also provides full text searching for finding specific words in the
- documentation. To activate the full text search, either press \key(Alt+S)
- or click the \gui{Search} tab on the sidebar. Then enter the term you are
- looking for and click \gui{Search}. All documents containing the specified
- term are listed.
-*/
-
-/*!
- \page assistant-details.html
- \title Using Qt Assistant
-
- \contentspage {Qt Assistant Manual}{Contents}
- \previouspage Qt Assistant Quick Guide
- \nextpage Customizing Qt Assistant
-
- \image assistant-dockwidgets.png
-
- You can read documentation in the \gui Documentation window. To open a topic
- in a new tab, right click it in the \gui Contents window to open a context
- menu and select \gui {Open Link in New Tab}. All open topics are listed in
- the \gui {Open Pages} window. Select a topic to view it in the
- \gui Documentation window.
-
- If you want the \gui{Documentation} window to use as much space as possible,
- you can easily group, move or hide the sidebar windows. To group the windows,
- drag one on top of the other and release the mouse. If one or all sidebar
- windows are not shown, select keyboard shortcuts to display them. You can
- view the keyboard shortcuts in the \gui View menu.
-
- The sidebar windows can be docked into the main window, so you can drag them
- to the top, left, right or bottom of the main window, or you can
- drag them outside \QA to float them as independent windows.
-
- To change the font family and font sizes of the browser window displaying
- the documentation or the application itself, select \gui Edit >
- \gui Preferences > \gui Fonts.
-
- \image assistant-preferences-fonts.png
-
- To temporarily increase or decrease the font size in the \gui Documentation
- window, select \gui View > \gui {Zoom in} or \gui {Zoom out}. To reset the
- font size, select \gui View > \gui {Normal Size}.
-
- To navigate between pages, select \gui Go > \gui Previous or \gui Next. This
- takes you to the previous or next page in the history. To return to the home
- page, select \gui Go > \gui Home. To specify the home page, select
- \gui Edit > \gui Preferences > \gui Options.
-
- To synchronize the \gui{Contents} window with the page currently shown in
- the \gui{Documentation} window, select \gui Go >
- \gui {Sync with Table of Contents}.
-
- The address toolbar provides a fast way to enter a specific URL for a
- documentation file. To show the address toolbar, select \gui View >
- \gui Toolbars > \gui {Address Toolbar}.
-
- \section1 Searching from Page Contents
-
- To find text on the current page, select \gui Edit > \gui {Find in Text}.
- Enter the search term in the field. The search is incremental, meaning that
- the most relevant result is shown as you enter characters into the field.
-
- If you select the \gui{Case sensitive} checkbox, the search considers the
- case of the search term. For example, if you search for \b spin, it matches
- \b spin but not \b Spin.
-
- To search forwards or backwards from your current position on the page,
- click \gui Previous or \gui Next.
-
- To hide the find control, either click \gui Close or press \key Esc.
-
- \section1 Full Text Searching
-
- \img assistant-search.png
-
- \QA provides a powerful full text search engine. You can search for certain
- words or text in the \gui Search window. Enter the text you want to look for
- and press \key{Enter} or click \gui{Search}. The search is not case sensitive.
- For example, \b Foo, \b fOo and \b FOO are all treated as the same. The
- following are examples of common search patterns:
-
- \list
- \li \c deep -- lists all the documents that contain the word \b deep
- \li \c{deep*} -- lists all the documents that contain a word beginning
- with \b deep
- \li \c{deep copy} -- lists all documents that contain both \b deep \e
- and \b copy
- \li \c{"deep copy"} -- list all documents that contain the phrase
- \b {deep copy}
- \endlist
-
- Use the \gui{Advanced search} for more flexibility.
- You can specify some words so that hits containing these are excluded from the
- result, or you can search for an exact phrase. Searching for similar words will
- give results like these:
-
- \list
- \li \c{QStin} -- lists all the documents with titles that are similar, such as \c{QString}
- \li \c{QSting} -- lists all the documents with titles that are similar, such as \c{QString}
- \li \c{QStrin} -- lists all the documents with titles that are similar, such as \c{QString}
- \endlist
-
- Options can be combined to improve the search results.
-
- The list of documents found is ordered according to the number of
- occurrences of the search text which they contain, with those containing
- the highest number of occurrences appearing first. Simply click any
- document in the list to display it in the \gui{Documentation} window.
-
- If the documentation has changed \mdash for example, if documents have been added
- or removed \mdash \QA will index them again.
-
- \section1 Filtering Help Contents
-
- \QA allows you to install any kind of documentation as long as it is organized
- in Qt compressed help files (*.qch). For example, you can view
- Qt reference documentation for several Qt versions at the same time. In many
- respects, this is very convenient since only one version of \QA is needed.
- However, at the same time it becomes more complicated when performing tasks like
- searching the index because most keywords are defined in more than one Qt
- version. This means that \QA will always ask the user to choose which one
- should be displayed.
-
- We use documentation filters to solve this issue. A filter is identified by its
- name, and contains a list of filter attributes. An attribute is just a string and
- can be freely chosen. Attributes are defined by the documentation itself,
- which means that every documentation set usually has one or more attributes.
-
- For example, the \QA documentation defines the attributes \c {assistant} and
- \c{tools}, whereas \QD defines \c{designer} and \c{tools}.
- The filter to display all tools would then define only the attribute
- \c{tools} since this attribute is part of both documentation sets.
- Adding the attribute \c{assistant} to the filter would then only show \QA
- documentation since the \QD documentation does not contain this
- attribute. Having an empty list of attributes in a filter will match all
- documentation. That is, it is equivalent to requesting unfiltered documentation.
-
- To create and remove documentation filters, select \gui Edit >
- \gui Preferences > \gui Filters.
-
- \image assistant-preferences-filters.png
-
- To add a new filter, click \gui Add,
- specify a filter name, and click \gui OK. Then select the filter attributes
- in the \gui Attributes field.
-
- To delete a filter, select it and click \gui Remove.
-
- The filter toolbar allows you to apply a filter to the currently installed
- documentation. To show the filter toolbar, select \gui View > \gui Toolbars
- > \gui {Filter Toolbar}.
-
- \section1 Adding Documentation
-
- To install and remove compressed help files, select \gui Edit >
- \gui Preferences > \gui Documentation.
-
- \image assistant-preferences-documentation.png
-
- Click the \gui{Install} button and
- choose the path of the compressed help file (*.qch) you would like to install.
- To delete a help file, select a documentation set in the list and click
- \gui{Remove}.
-
- \section1 Specifying Home Page
-
- To specify the homepage \QA displays when you click the \gui{Home} button,
- select \gui Edit > \gui Preferences > \gui Options.
-
- \image assistant-preferences-options.png
-
- Enter the URL of the home page or select \gui{Current Page} to set the
- currently displayed page as your home page. To leave the home page blank,
- select \gui {Blank page}. Select \gui{Restore to default} to reset your home
- page to the default home page.
-
- \section1 Using Command Line Options
-
- \QA handles the following command line options:
-
- \table
- \header
- \li Command Line Option
- \li Brief Description
- \row
- \li -collectionFile <file.qhc>
- \li Uses the specified collection file instead of the default one.
- \row
- \li -showUrl <URL>
- \li Shows the document referenced by URL.
- \row
- \li -enableRemoteControl
- \li Enables \QA to be remotely controlled.
- \row
- \li -show <widget>
- \li Shows the specified sidebar window which can be "contents", "index",
- "bookmarks" or "search".
- \row
- \li -hide <widget>
- \li Hides the specified sidebar window which can be "contents", "index",
- "bookmarks" or "search".
- \row
- \li -activate <widget>
- \li Activates the specified sidebar window which can be "contents",
- "index", "bookmarks" or "search".
- \row
- \li -register <doc.qch>
- \li Registers the specified compressed help file in the given help
- collection.
- \row
- \li -unregister <doc.qch>
- \li Unregisters the specified compressed help file from the given
- collection file.
- \row
- \li -remove-search-index
- \li Purges the help search engine's index. This option is
- useful in case the associated index files get corrupted.
- \QA will re-index the documentation at the next start-up.
- \row
- \li -rebuild-search-index
- \li Rebuilds the help search engine's index.
- Note that this operation may take a while to finish.
- \row
- \li -setCurrentFilter <filter>
- \li Sets the given filter as the active filter.
- \row
- \li -quiet
- \li Does not show any error, warning or success messages.
- \endtable
-
-*/
-
-/*!
\page assistant-custom-help-viewer.html
\title Customizing Qt Assistant
diff --git a/src/assistant/assistant/doc/src/assistant-quick-guide.qdoc b/src/assistant/assistant/doc/src/assistant-quick-guide.qdoc
new file mode 100644
index 000000000..66f0a7222
--- /dev/null
+++ b/src/assistant/assistant/doc/src/assistant-quick-guide.qdoc
@@ -0,0 +1,324 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \if !defined(ASSISTANT_INTERNAL)
+ \contentspage {Qt Assistant Manual}{Contents}
+ \previouspage Qt Assistant Manual
+ \endif
+ \page assistant-quick-guide.html
+ \nextpage Using Qt Assistant
+
+ \title Qt Assistant Quick Guide
+
+ Once you have installed Qt, you can start Qt Assistant in the same way as
+ any other application on the development host.
+
+ The \QA main window contains a sidebar (1) with navigation windows for:
+
+ \list
+ \li Viewing a list of documents in Qt help format that are installed on
+ the development host.
+ \li Managing bookmarks.
+ \li Searching for keywords in the index.
+ \li Searching for information using a free text search function.
+ \li Switching between open topics.
+ \endlist
+
+ The selected topic in the selected document is displayed in the
+ \b Documentation window (2).
+
+ \image assistant-assistant.png
+
+ Click the \gui Previous and \gui Next toolbar buttons (3) to navigate within
+ the topics you have visited.
+
+ \section1 Managing Bookmarks
+
+ \image assistant-bookmarks.png
+
+ To bookmark topics of particular interest, select \gui Bookmarks >
+ \gui {Add Bookmark} (or press \key{Ctrl+B}). A bookmark for the
+ page that is currently showing in the \gui Documentation window is added.
+
+ You can view and manage bookmarks in the \gui Bookmarks window.
+ Double-click a bookmark to open the topic in the \gui Documentation window.
+ You can also right-click the bookmark and select \gui{Show Bookmark} in the
+ context menu.
+
+ To rename or delete the highlighted bookmark, select \gui {Rename Bookmark}
+ or \gui {Delete Bookmark} in the context menu.
+
+ \section1 Searching for Keywords
+
+ \image assistant-index.png
+
+ To perform an index search, click the \gui{Index} tab on the sidebar
+ (or press \key{Alt+I}). In the \gui{Look For} field, enter the search term.
+ As you type, words are found and highlighted in a list beneath the field.
+ If the highlighted text matches what you are
+ looking for, double-click it or press \key{Enter}. The
+ \gui Documentation window displays the relevant topic. You rarely have
+ to type in the whole word before \QA finds a match. Note that for some
+ words there may be more than one possible topic that is relevant.
+
+ \section1 Using Free Text Search
+
+ \image assistant-search.png
+
+ \QA also provides full text searching for finding specific words in the
+ documentation. To activate the full text search, either press \key(Alt+S)
+ or click the \gui{Search} tab on the sidebar. Then enter the term you are
+ looking for and click \gui{Search}. All documents containing the specified
+ term are listed.
+*/
+
+/*!
+ \if !defined(ASSISTANT_INTERNAL)
+ \contentspage {Qt Assistant Manual}{Contents}
+ \nextpage Customizing Qt Assistant
+ \endif
+ \page assistant-details.html
+ \title Using Qt Assistant
+ \previouspage Qt Assistant Quick Guide
+
+ \image assistant-dockwidgets.png
+
+ You can read documentation in the \gui Documentation window. To open a topic
+ in a new tab, right click it in the \gui Contents window to open a context
+ menu and select \gui {Open Link in New Tab}. All open topics are listed in
+ the \gui {Open Pages} window. Select a topic to view it in the
+ \gui Documentation window.
+
+ If you want the \gui{Documentation} window to use as much space as possible,
+ you can easily group, move or hide the sidebar windows. To group the windows,
+ drag one on top of the other and release the mouse. If one or all sidebar
+ windows are not shown, select keyboard shortcuts to display them. You can
+ view the keyboard shortcuts in the \gui View menu.
+
+ The sidebar windows can be docked into the main window, so you can drag them
+ to the top, left, right or bottom of the main window, or you can
+ drag them outside \QA to float them as independent windows.
+
+ To change the font family and font sizes of the browser window displaying
+ the documentation or the application itself, select \gui Edit >
+ \gui Preferences > \gui Fonts.
+
+ \image assistant-preferences-fonts.png
+
+ To temporarily increase or decrease the font size in the \gui Documentation
+ window, select \gui View > \gui {Zoom in} or \gui {Zoom out}. To reset the
+ font size, select \gui View > \gui {Normal Size}.
+
+ To navigate between pages, select \gui Go > \gui Previous or \gui Next. This
+ takes you to the previous or next page in the history. To return to the home
+ page, select \gui Go > \gui Home. To specify the home page, select
+ \gui Edit > \gui Preferences > \gui Options.
+
+ To synchronize the \gui{Contents} window with the page currently shown in
+ the \gui{Documentation} window, select \gui Go >
+ \gui {Sync with Table of Contents}.
+
+ The address toolbar provides a fast way to enter a specific URL for a
+ documentation file. To show the address toolbar, select \gui View >
+ \gui Toolbars > \gui {Address Toolbar}.
+
+ \section1 Searching from Page Contents
+
+ To find text on the current page, select \gui Edit > \gui {Find in Text}.
+ Enter the search term in the field. The search is incremental, meaning that
+ the most relevant result is shown as you enter characters into the field.
+
+ If you select the \gui{Case sensitive} checkbox, the search considers the
+ case of the search term. For example, if you search for \b spin, it matches
+ \b spin but not \b Spin.
+
+ To search forwards or backwards from your current position on the page,
+ click \gui Previous or \gui Next.
+
+ To hide the find control, either click \gui Close or press \key Esc.
+
+ \section1 Full Text Searching
+
+ \img assistant-search.png
+
+ \QA provides a powerful full text search engine. You can search for certain
+ words or text in the \gui Search window. Enter the text you want to look for
+ and press \key{Enter} or click \gui{Search}. The search is not case sensitive.
+ For example, \b Foo, \b fOo and \b FOO are all treated as the same. The
+ following are examples of common search patterns:
+
+ \list
+ \li \c deep -- lists all the documents that contain the word \b deep
+ \li \c{deep*} -- lists all the documents that contain a word beginning
+ with \b deep
+ \li \c{deep copy} -- lists all documents that contain both \b deep \e
+ and \b copy
+ \li \c{"deep copy"} -- list all documents that contain the phrase
+ \b {deep copy}
+ \endlist
+
+ Use the \gui{Advanced search} for more flexibility.
+ You can specify some words so that hits containing these are excluded from the
+ result, or you can search for an exact phrase. Searching for similar words will
+ give results like these:
+
+ \list
+ \li \c{QStin} -- lists all the documents with titles that are similar, such as \c{QString}
+ \li \c{QSting} -- lists all the documents with titles that are similar, such as \c{QString}
+ \li \c{QStrin} -- lists all the documents with titles that are similar, such as \c{QString}
+ \endlist
+
+ Options can be combined to improve the search results.
+
+ The list of documents found is ordered according to the number of
+ occurrences of the search text which they contain, with those containing
+ the highest number of occurrences appearing first. Simply click any
+ document in the list to display it in the \gui{Documentation} window.
+
+ If the documentation has changed \mdash for example, if documents have been added
+ or removed \mdash \QA will index them again.
+
+ \section1 Filtering Help Contents
+
+ \QA allows you to install any kind of documentation as long as it is organized
+ in Qt compressed help files (*.qch). For example, you can view
+ Qt reference documentation for several Qt versions at the same time. In many
+ respects, this is very convenient since only one version of \QA is needed.
+ However, at the same time it becomes more complicated when performing tasks like
+ searching the index because most keywords are defined in more than one Qt
+ version. This means that \QA will always ask the user to choose which one
+ should be displayed.
+
+ We use documentation filters to solve this issue. A filter is identified by its
+ name, and contains a list of filter attributes. An attribute is just a string and
+ can be freely chosen. Attributes are defined by the documentation itself,
+ which means that every documentation set usually has one or more attributes.
+
+ For example, the \QA documentation defines the attributes \c {assistant} and
+ \c{tools}, whereas \QD defines \c{designer} and \c{tools}.
+ The filter to display all tools would then define only the attribute
+ \c{tools} since this attribute is part of both documentation sets.
+ Adding the attribute \c{assistant} to the filter would then only show \QA
+ documentation since the \QD documentation does not contain this
+ attribute. Having an empty list of attributes in a filter will match all
+ documentation. That is, it is equivalent to requesting unfiltered documentation.
+
+ To create and remove documentation filters, select \gui Edit >
+ \gui Preferences > \gui Filters.
+
+ \image assistant-preferences-filters.png
+
+ To add a new filter, click \gui Add,
+ specify a filter name, and click \gui OK. Then select the filter attributes
+ in the \gui Attributes field.
+
+ To delete a filter, select it and click \gui Remove.
+
+ The filter toolbar allows you to apply a filter to the currently installed
+ documentation. To show the filter toolbar, select \gui View > \gui Toolbars
+ > \gui {Filter Toolbar}.
+
+ \section1 Adding Documentation
+
+ To install and remove compressed help files, select \gui Edit >
+ \gui Preferences > \gui Documentation.
+
+ \image assistant-preferences-documentation.png
+
+ Click the \gui{Install} button and
+ choose the path of the compressed help file (*.qch) you would like to install.
+ To delete a help file, select a documentation set in the list and click
+ \gui{Remove}.
+
+ \section1 Specifying Home Page
+
+ To specify the homepage \QA displays when you click the \gui{Home} button,
+ select \gui Edit > \gui Preferences > \gui Options.
+
+ \image assistant-preferences-options.png
+
+ Enter the URL of the home page or select \gui{Current Page} to set the
+ currently displayed page as your home page. To leave the home page blank,
+ select \gui {Blank page}. Select \gui{Restore to default} to reset your home
+ page to the default home page.
+
+ \section1 Using Command Line Options
+
+ \QA handles the following command line options:
+
+ \table
+ \header
+ \li Command Line Option
+ \li Brief Description
+ \row
+ \li -collectionFile <file.qhc>
+ \li Uses the specified collection file instead of the default one.
+ \row
+ \li -showUrl <URL>
+ \li Shows the document referenced by URL.
+ \row
+ \li -enableRemoteControl
+ \li Enables \QA to be remotely controlled.
+ \row
+ \li -show <widget>
+ \li Shows the specified sidebar window which can be "contents", "index",
+ "bookmarks" or "search".
+ \row
+ \li -hide <widget>
+ \li Hides the specified sidebar window which can be "contents", "index",
+ "bookmarks" or "search".
+ \row
+ \li -activate <widget>
+ \li Activates the specified sidebar window which can be "contents",
+ "index", "bookmarks" or "search".
+ \row
+ \li -register <doc.qch>
+ \li Registers the specified compressed help file in the given help
+ collection.
+ \row
+ \li -unregister <doc.qch>
+ \li Unregisters the specified compressed help file from the given
+ collection file.
+ \row
+ \li -remove-search-index
+ \li Purges the help search engine's index. This option is
+ useful in case the associated index files get corrupted.
+ \QA will re-index the documentation at the next start-up.
+ \row
+ \li -rebuild-search-index
+ \li Rebuilds the help search engine's index.
+ Note that this operation may take a while to finish.
+ \row
+ \li -setCurrentFilter <filter>
+ \li Sets the given filter as the active filter.
+ \row
+ \li -quiet
+ \li Does not show any error, warning or success messages.
+ \endtable
+
+*/
diff --git a/src/assistant/assistant/helpviewer.cpp b/src/assistant/assistant/helpviewer.cpp
index 32f71d786..2ea72270b 100644
--- a/src/assistant/assistant/helpviewer.cpp
+++ b/src/assistant/assistant/helpviewer.cpp
@@ -158,10 +158,9 @@ bool HelpViewer::launchWithExternalApp(const QUrl &url)
actualTmpFile.close();
return QDesktopServices::openUrl(QUrl(actualTmpFile.fileName()));
}
- } else if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("mailto")) {
- return QDesktopServices::openUrl(url);
+ return false;
}
- return false;
+ return QDesktopServices::openUrl(url);
}
// -- public slots
diff --git a/src/assistant/clucene/qclucene-config_p.h b/src/assistant/clucene/qclucene-config_p.h
index 72b47d3a4..0b927a47d 100644
--- a/src/assistant/clucene/qclucene-config_p.h
+++ b/src/assistant/clucene/qclucene-config_p.h
@@ -328,8 +328,10 @@ configure.
#endif
/* Define to 1 if you have the <sys/timeb.h> header file. */
-#ifndef _CL_HAVE_SYS_TIMEB_H
-#define _CL_HAVE_SYS_TIMEB_H 1
+#if !defined(__OpenBSD__)
+# ifndef _CL_HAVE_SYS_TIMEB_H
+# define _CL_HAVE_SYS_TIMEB_H 1
+# endif
#endif
/* Define to 1 if you have the <sys/types.h> header file. */
diff --git a/src/assistant/help/qhelpgenerator.cpp b/src/assistant/help/qhelpgenerator.cpp
index 3be0c8587..dc9bc1314 100644
--- a/src/assistant/help/qhelpgenerator.cpp
+++ b/src/assistant/help/qhelpgenerator.cpp
@@ -561,8 +561,10 @@ bool QHelpGenerator::insertFiles(const QStringList &files, const QString &rootPa
d->query->exec(QLatin1String("BEGIN"));
QMap<int, QSet<int> >::const_iterator it = tmpFileFilterMap.constBegin();
while (it != tmpFileFilterMap.constEnd()) {
- QSet<int>::const_iterator si = it.value().constBegin();
- while (si != it.value().constEnd()) {
+ QList<int> filterValues = it.value().toList();
+ std::sort(filterValues.begin(), filterValues.end());
+ QList<int>::const_iterator si = filterValues.constBegin();
+ while (si != filterValues.constEnd()) {
d->query->prepare(QLatin1String("INSERT INTO FileFilterTable "
"VALUES(?, ?)"));
d->query->bindValue(0, *si);
diff --git a/src/designer/src/lib/shared/actioneditor.cpp b/src/designer/src/lib/shared/actioneditor.cpp
index fa2ec36a4..bbbe2a55b 100644
--- a/src/designer/src/lib/shared/actioneditor.cpp
+++ b/src/designer/src/lib/shared/actioneditor.cpp
@@ -191,6 +191,7 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent,
// filter
m_filterWidget = new QWidget(toolbar);
QHBoxLayout *filterLayout = new QHBoxLayout(m_filterWidget);
+ filterLayout->setContentsMargins(0, 0, 0, 0);
QLineEdit *filterLineEdit = new QLineEdit(m_filterWidget);
connect(filterLineEdit, &QLineEdit::textChanged, this, &ActionEditor::setFilter);
filterLineEdit->setPlaceholderText(tr("Filter"));
diff --git a/src/designer/src/lib/shared/newformwidget.cpp b/src/designer/src/lib/shared/newformwidget.cpp
index 38020cf12..72efc4b05 100644
--- a/src/designer/src/lib/shared/newformwidget.cpp
+++ b/src/designer/src/lib/shared/newformwidget.cpp
@@ -48,6 +48,8 @@
#include <QtCore/QDir>
#include <QtCore/QTextStream>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QDesktopWidget>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QTreeWidgetItem>
#include <QtGui/QPainter>
@@ -315,18 +317,23 @@ QImage NewFormWidget::grabForm(QDesignerFormEditorInterface *core,
QPixmap NewFormWidget::formPreviewPixmap(QIODevice &file, const QString &workingDir) const
{
- const int margin = 7;
- const int shadow = 7;
- const int previewSize = 256;
+ const QSizeF screenSize(QApplication::desktop()->screenGeometry(this).size());
+ const int previewSize = qRound(screenSize.width() / 7.5); // 256 on 1920px screens.
+ const int margin = previewSize / 32 - 1; // 7 on 1920px screens.
+ const int shadow = margin;
const QImage wimage = grabForm(m_core, file, workingDir, currentDeviceProfile());
if (wimage.isNull())
return QPixmap();
- const QImage image = wimage.scaled(previewSize - margin * 2, previewSize - margin * 2,
- Qt::KeepAspectRatio,
- Qt::SmoothTransformation);
-
- QImage dest(previewSize, previewSize, QImage::Format_ARGB32_Premultiplied);
+ const qreal devicePixelRatio = wimage.devicePixelRatioF();
+ const QSize imageSize(previewSize - margin * 2, previewSize - margin * 2);
+ QImage image = wimage.scaled((QSizeF(imageSize) * devicePixelRatio).toSize(),
+ Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ image.setDevicePixelRatio(devicePixelRatio);
+
+ QImage dest((QSizeF(previewSize, previewSize) * devicePixelRatio).toSize(),
+ QImage::Format_ARGB32_Premultiplied);
+ dest.setDevicePixelRatio(devicePixelRatio);
dest.fill(0);
QPainter p(&dest);
@@ -334,14 +341,14 @@ QPixmap NewFormWidget::formPreviewPixmap(QIODevice &file, const QString &working
p.setPen(QPen(palette().brush(QPalette::WindowText), 0));
- p.drawRect(margin-1, margin-1, image.width() + 1, image.height() + 1);
+ p.drawRect(QRectF(margin - 1, margin - 1, imageSize.width() + 1.5, imageSize.height() + 1.5));
const QColor dark(Qt::darkGray);
const QColor light(Qt::transparent);
// right shadow
{
- const QRect rect(margin + image.width() + 1, margin + shadow, shadow, image.height() - shadow + 1);
+ const QRect rect(margin + imageSize.width() + 1, margin + shadow, shadow, imageSize.height() - shadow + 1);
QLinearGradient lg(rect.topLeft(), rect.topRight());
lg.setColorAt(0, dark);
lg.setColorAt(1, light);
@@ -350,7 +357,7 @@ QPixmap NewFormWidget::formPreviewPixmap(QIODevice &file, const QString &working
// bottom shadow
{
- const QRect rect(margin + shadow, margin + image.height() + 1, image.width() - shadow + 1, shadow);
+ const QRect rect(margin + shadow, margin + imageSize.height() + 1, imageSize.width() - shadow + 1, shadow);
QLinearGradient lg(rect.topLeft(), rect.bottomLeft());
lg.setColorAt(0, dark);
lg.setColorAt(1, light);
@@ -359,8 +366,8 @@ QPixmap NewFormWidget::formPreviewPixmap(QIODevice &file, const QString &working
// bottom/right corner shadow
{
- const QRect rect(margin + image.width() + 1, margin + image.height() + 1, shadow, shadow);
- QRadialGradient g(rect.topLeft(), shadow);
+ const QRect rect(margin + imageSize.width() + 1, margin + imageSize.height() + 1, shadow, shadow);
+ QRadialGradient g(rect.topLeft(), shadow - 1);
g.setColorAt(0, dark);
g.setColorAt(1, light);
p.fillRect(rect, g);
@@ -368,8 +375,8 @@ QPixmap NewFormWidget::formPreviewPixmap(QIODevice &file, const QString &working
// top/right corner
{
- const QRect rect(margin + image.width() + 1, margin, shadow, shadow);
- QRadialGradient g(rect.bottomLeft(), shadow);
+ const QRect rect(margin + imageSize.width() + 1, margin, shadow, shadow);
+ QRadialGradient g(rect.bottomLeft(), shadow - 1);
g.setColorAt(0, dark);
g.setColorAt(1, light);
p.fillRect(rect, g);
@@ -377,8 +384,8 @@ QPixmap NewFormWidget::formPreviewPixmap(QIODevice &file, const QString &working
// bottom/left corner
{
- const QRect rect(margin, margin + image.height() + 1, shadow, shadow);
- QRadialGradient g(rect.topRight(), shadow);
+ const QRect rect(margin, margin + imageSize.height() + 1, shadow, shadow);
+ QRadialGradient g(rect.topRight(), shadow - 1);
g.setColorAt(0, dark);
g.setColorAt(1, light);
p.fillRect(rect, g);
diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp
index 098f9525a..565d55b65 100644
--- a/src/designer/src/lib/shared/qtresourceview.cpp
+++ b/src/designer/src/lib/shared/qtresourceview.cpp
@@ -189,6 +189,7 @@ QtResourceViewPrivate::QtResourceViewPrivate(QDesignerFormEditorInterface *core)
m_ignoreGuiSignals(false),
m_resourceEditingEnabled(true)
{
+ m_toolBar->setIconSize(QSize(22, 22));
}
void QtResourceViewPrivate::restoreSettings()
@@ -598,6 +599,7 @@ QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *pare
d_ptr->m_filterWidget = new QWidget(d_ptr->m_toolBar);
QHBoxLayout *filterLayout = new QHBoxLayout(d_ptr->m_filterWidget);
+ filterLayout->setContentsMargins(0, 0, 0, 0);
QLineEdit *filterLineEdit = new QLineEdit(d_ptr->m_filterWidget);
connect(filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotFilterChanged(QString)));
filterLineEdit->setPlaceholderText(tr("Filter"));
diff --git a/src/linguist/linguist/errorsview.cpp b/src/linguist/linguist/errorsview.cpp
index 28404c608..3f1560d3a 100644
--- a/src/linguist/linguist/errorsview.cpp
+++ b/src/linguist/linguist/errorsview.cpp
@@ -75,7 +75,7 @@ void ErrorsView::addError(int model, const ErrorType type, const QString &arg)
addError(model, tr("Translation does not refer to the same place markers as in the source text."));
break;
case NumerusMarkerMissing:
- addError(model, tr("Translation does not contain the necessary %n place marker."));
+ addError(model, tr("Translation does not contain the necessary %n/%Ln place marker."));
break;
default:
addError(model, tr("Unknown error"));
diff --git a/src/linguist/linguist/mainwindow.cpp b/src/linguist/linguist/mainwindow.cpp
index 6c4ab8d0f..282e2adea 100644
--- a/src/linguist/linguist/mainwindow.cpp
+++ b/src/linguist/linguist/mainwindow.cpp
@@ -2528,7 +2528,8 @@ void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose)
if (m->message().isPlural()) {
for (int i = 0; i < numTranslations; ++i)
if (m_dataModel->model(mi)->countRefNeeds().at(i)
- && !translations[i].contains(QLatin1String("%n"))) {
+ && !(translations[i].contains(QLatin1String("%n"))
+ || translations[i].contains(QLatin1String("%Ln")))) {
if (verbose)
m_errorsView->addError(mi, ErrorsView::NumerusMarkerMissing);
danger = true;
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index 557726514..b9d71d11e 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -172,8 +172,9 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
otool.start("otool", QStringList() << "-L" << binaryPath);
otool.waitForFinished();
- if (otool.exitCode() != 0) {
+ if (otool.exitStatus() != QProcess::NormalExit || otool.exitCode() != 0) {
LogError() << otool.readAllStandardError();
+ return info;
}
static const QRegularExpression regexp(QStringLiteral(
@@ -182,6 +183,11 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
QString output = otool.readAllStandardOutput();
QStringList outputLines = output.split("\n", QString::SkipEmptyParts);
+ if (outputLines.size() < 2) {
+ LogError() << "Could not parse otool output:" << output;
+ return info;
+ }
+
outputLines.removeFirst(); // remove line containing the binary path
if (binaryPath.contains(".framework/") || binaryPath.endsWith(".dylib")) {
const auto match = regexp.match(outputLines.first());
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index c42f1fb31..5b7792d32 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -1034,8 +1034,9 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
*/
void CppCodeParser::processOtherMetaCommands(const Doc& doc, Node *node)
{
- const QSet<QString> metaCommands = doc.metaCommandsUsed();
- QSet<QString>::ConstIterator cmd = metaCommands.constBegin();
+ QStringList metaCommands = doc.metaCommandsUsed().toList();
+ metaCommands.sort();
+ QStringList::ConstIterator cmd = metaCommands.constBegin();
while (cmd != metaCommands.constEnd()) {
ArgList args = doc.metaCommandArgs(*cmd);
ArgList::ConstIterator arg = args.constBegin();
diff --git a/src/qdoc/doc/examples/samples.qdocinc b/src/qdoc/doc/examples/samples.qdocinc
index 0212c5e70..afe634326 100644
--- a/src/qdoc/doc/examples/samples.qdocinc
+++ b/src/qdoc/doc/examples/samples.qdocinc
@@ -39,7 +39,7 @@
The QVector3D class can also be used to represent vertices in 3D space.
We therefore do not need to provide a separate vertex class.
- \b{Note:} By design values in the QVector3D instance are stored as \c float.
+ \note By design values in the QVector3D instance are stored as \c float.
This means that on platforms where the \c qreal arguments to QVector3D
functions are represented by \c double values, it is possible to
lose precision.
diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc
index 282b5fcd1..2b78aef4e 100644
--- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc
+++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc
@@ -954,7 +954,7 @@
formatting. The source code begins on a new line, rendered in the
code.
- \b{Note:} Although most of these commands are for rendering C++
+ \note Although most of these commands are for rendering C++
code, the
\l{07-0-qdoc-commands-includingexternalcode.html#snippet-command}
{\\snippet} and
@@ -1144,7 +1144,7 @@
others. The typical use of the latter is to quote a file chunk by
chunk.
- \b{Note:} Although all these commands can be used for rendering C++
+ \note Although all these commands can be used for rendering C++
code, the
\l{07-0-qdoc-commands-includingexternalcode.html#snippet-command}
{\\snippet} and
@@ -3631,7 +3631,7 @@
/ *!
\if defined(opensourceedition)
- \b{Note:} This edition is for the development of
+ \note This edition is for the development of
\l{Qt Open Source Edition} {Free and Open Source}
software only; see \l{Qt Commercial Editions}.
diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp
index f98962c3e..e9c6fcc73 100644
--- a/src/qdoc/helpprojectwriter.cpp
+++ b/src/qdoc/helpprojectwriter.cpp
@@ -684,7 +684,9 @@ void HelpProjectWriter::generateProject(HelpProject &project)
for (it = project.customFilters.constBegin(); it != project.customFilters.constEnd(); ++it) {
writer.writeStartElement("customFilter");
writer.writeAttribute("name", it.key());
- foreach (const QString &filter, it.value())
+ QStringList sortedAttributes = it.value().toList();
+ sortedAttributes.sort();
+ foreach (const QString &filter, sortedAttributes)
writer.writeTextElement("filterAttribute", filter);
writer.writeEndElement(); // customFilter
}
@@ -693,7 +695,9 @@ void HelpProjectWriter::generateProject(HelpProject &project)
writer.writeStartElement("filterSection");
// Write filterAttribute elements.
- foreach (const QString &filterName, project.filterAttributes)
+ QStringList sortedFilterAttributes = project.filterAttributes.toList();
+ sortedFilterAttributes.sort();
+ foreach (const QString &filterName, sortedFilterAttributes)
writer.writeTextElement("filterAttribute", filterName);
writer.writeStartElement("toc");
@@ -811,7 +815,11 @@ void HelpProjectWriter::generateProject(HelpProject &project)
}
// No contents/nextpage links found, write all nodes unsorted
if (!contentsFound) {
- foreach (const Node *node, subproject.nodes)
+ QList<const Node*> subnodes = subproject.nodes.values();
+
+ std::sort(subnodes.begin(), subnodes.end(), Node::nodeNameLessThan);
+
+ foreach (const Node *node, subnodes)
writeNode(project, writer, node);
}
}
@@ -827,6 +835,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
writer.writeEndElement(); // toc
writer.writeStartElement("keywords");
+ std::sort(project.keywords.begin(), project.keywords.end());
foreach (const QStringList &details, project.keywords) {
writer.writeStartElement("keyword");
writer.writeAttribute("name", details[0]);
@@ -843,7 +852,9 @@ void HelpProjectWriter::generateProject(HelpProject &project)
QSet<QString> files = QSet<QString>::fromList(gen_->outputFileNames());
files.unite(project.files);
files.unite(project.extraFiles);
- foreach (const QString &usedFile, files) {
+ QStringList sortedFiles = files.toList();
+ sortedFiles.sort();
+ foreach (const QString &usedFile, sortedFiles) {
if (!usedFile.isEmpty())
writer.writeTextElement("file", usedFile);
}
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp
index e809f12b3..2b88f007f 100644
--- a/src/qdoc/htmlgenerator.cpp
+++ b/src/qdoc/htmlgenerator.cpp
@@ -2886,6 +2886,8 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
out() << "<div class=\"table\"><table class=\"annotated\">\n";
int row = 0;
NodeList nodes = nmm.values();
+ std::sort(nodes.begin(), nodes.end(), Node::nodeNameLessThan);
+
foreach (const Node* node, nodes) {
if (++row % 2 == 1)
out() << "<tr class=\"odd topAlign\">";
@@ -4599,7 +4601,9 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
if (!tags.isEmpty()) {
writer.writeStartElement("tags");
bool wrote_one = false;
- foreach (const QString &tag, tags) {
+ QStringList sortedTags = tags.toList();
+ sortedTags.sort();
+ foreach (const QString &tag, sortedTags) {
if (wrote_one)
writer.writeCharacters(",");
writer.writeCharacters(tag);
@@ -4902,7 +4906,9 @@ void HtmlGenerator::generateAssociatedPropertyNotes(const FunctionNode* fn)
{
if (fn->hasAssociatedProperties()) {
out() << "<p><b>Note:</b> ";
- foreach (const PropertyNode* pn, fn->associatedProperties()) {
+ PropNodeList propertyNodes = fn->associatedProperties();
+ std::sort(propertyNodes.begin(), propertyNodes.end(), Node::nodeNameLessThan);
+ foreach (const PropertyNode* pn, propertyNodes) {
QString msg;
switch (pn->role(fn)) {
case PropertyNode::Getter:
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index baf2c2870..47c939f8b 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -73,6 +73,63 @@ void Node::initialize()
goals_.insert("namespace", Node::Namespace);
}
+bool Node::nodeNameLessThan(const Node *n1, const Node *n2)
+{
+ if (n1->location().filePath() < n2->location().filePath())
+ return true;
+ else if (n1->location().filePath() > n2->location().filePath())
+ return false;
+
+ if (n1->type() < n2->type())
+ return true;
+ else if (n1->type() > n2->type())
+ return false;
+
+ if (n1->name() < n2->name())
+ return true;
+ else if (n1->name() > n2->name())
+ return false;
+
+ if (n1->access() < n2->access())
+ return true;
+ else if (n1->access() > n2->access())
+ return false;
+
+ if (n1->type() == Node::Function && n2->type() == Node::Function) {
+ const FunctionNode* f1 = static_cast<const FunctionNode*>(n1);
+ const FunctionNode* f2 = static_cast<const FunctionNode*>(n2);
+
+ if (f1->isConst() < f2->isConst())
+ return true;
+ else if (f1->isConst() > f2->isConst())
+ return false;
+
+ if (f1->signature(false) < f2->signature(false))
+ return true;
+ else if (f1->signature(false) > f2->signature(false))
+ return false;
+ }
+
+ if (n1->isDocumentNode() && n2->isDocumentNode()) {
+ const DocumentNode* f1 = static_cast<const DocumentNode*>(n1);
+ const DocumentNode* f2 = static_cast<const DocumentNode*>(n2);
+ if (f1->fullTitle() < f2->fullTitle())
+ return true;
+ else if (f1->fullTitle() > f2->fullTitle())
+ return false;
+ }
+ else if (n1->isCollectionNode() && n2->isCollectionNode()) {
+ const CollectionNode* f1 = static_cast<const CollectionNode*>(n1);
+ const CollectionNode* f2 = static_cast<const CollectionNode*>(n2);
+ if (f1->fullTitle() < f2->fullTitle())
+ return true;
+ else if (f1->fullTitle() > f2->fullTitle())
+ return false;
+ }
+
+ return false;
+}
+
/*!
Increment the number of property groups seen in the current
file, and return the new value.
diff --git a/src/qdoc/node.h b/src/qdoc/node.h
index 026c29d00..4b3549961 100644
--- a/src/qdoc/node.h
+++ b/src/qdoc/node.h
@@ -333,6 +333,14 @@ public:
static void initialize();
static NodeType goal(const QString& t) { return goals_.value(t); }
+/*!
+ Returns \c true if the node \a n1 is less than node \a n2. The
+ comparison is performed by comparing properties of the nodes
+ in order of increasing complexity.
+*/
+ static bool nodeNameLessThan(const Node *first, const Node *second);
+
+
protected:
Node(NodeType type, Aggregate* parent, const QString& name);
void removeRelates();
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp
index 5612c77e6..888d451c7 100644
--- a/src/qdoc/qdocindexfiles.cpp
+++ b/src/qdoc/qdocindexfiles.cpp
@@ -1013,7 +1013,11 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
baseStrings.insert(n->fullName());
}
if (!baseStrings.isEmpty())
- writer.writeAttribute("bases", QStringList(baseStrings.toList()).join(QLatin1Char(',')));
+ {
+ QStringList baseStringsAsList = baseStrings.toList();
+ baseStringsAsList.sort();
+ writer.writeAttribute("bases", baseStringsAsList.join(QLatin1Char(',')));
+ }
if (!node->physicalModuleName().isEmpty())
writer.writeAttribute("module", node->physicalModuleName());
if (!classNode->groupNames().isEmpty())
@@ -1183,13 +1187,12 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
writer.writeAttribute("relates", functionNode->relates()->name());
}
if (functionNode->hasAssociatedProperties()) {
- QString associatedProperties;
+ QStringList associatedProperties;
foreach (PropertyNode* pn, functionNode->associatedProperties()) {
- if (!associatedProperties.isEmpty())
- associatedProperties += QLatin1String(", ");
- associatedProperties += pn->name();
+ associatedProperties << pn->name();
}
- writer.writeAttribute("associated-property", associatedProperties);
+ associatedProperties.sort();
+ writer.writeAttribute("associated-property", associatedProperties.join(","));
}
writer.writeAttribute("type", functionNode->returnType());
if (!brief.isEmpty())
@@ -1383,73 +1386,6 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
}
/*!
- Returns \c true if the node \a n1 is less than node \a n2. The
- comparison is performed by comparing properties of the nodes
- in order of increasing complexity.
-*/
-bool compareNodes(const Node* n1, const Node* n2)
-{
- // Private nodes can occur in any order since they won't normally be
- // written to the index.
- if (n1->access() == Node::Private && n2->access() == Node::Private)
- return false;
-
- if (n1->location().filePath() < n2->location().filePath())
- return true;
- else if (n1->location().filePath() > n2->location().filePath())
- return false;
-
- if (n1->type() < n2->type())
- return true;
- else if (n1->type() > n2->type())
- return false;
-
- if (n1->name() < n2->name())
- return true;
- else if (n1->name() > n2->name())
- return false;
-
- if (n1->access() < n2->access())
- return true;
- else if (n1->access() > n2->access())
- return false;
-
- if (n1->type() == Node::Function && n2->type() == Node::Function) {
- const FunctionNode* f1 = static_cast<const FunctionNode*>(n1);
- const FunctionNode* f2 = static_cast<const FunctionNode*>(n2);
-
- if (f1->isConst() < f2->isConst())
- return true;
- else if (f1->isConst() > f2->isConst())
- return false;
-
- if (f1->signature(false) < f2->signature(false))
- return true;
- else if (f1->signature(false) > f2->signature(false))
- return false;
- }
-
- if (n1->isDocumentNode() && n2->isDocumentNode()) {
- const DocumentNode* f1 = static_cast<const DocumentNode*>(n1);
- const DocumentNode* f2 = static_cast<const DocumentNode*>(n2);
- if (f1->fullTitle() < f2->fullTitle())
- return true;
- else if (f1->fullTitle() > f2->fullTitle())
- return false;
- }
- else if (n1->isCollectionNode() && n2->isCollectionNode()) {
- const CollectionNode* f1 = static_cast<const CollectionNode*>(n1);
- const CollectionNode* f2 = static_cast<const CollectionNode*>(n2);
- if (f1->fullTitle() < f2->fullTitle())
- return true;
- else if (f1->fullTitle() > f2->fullTitle())
- return false;
- }
-
- return false;
-}
-
-/*!
Generate index sections for the child nodes of the given \a node
using the \a writer specified. If \a generateInternalNodes is true,
nodes marked as internal will be included in the index; otherwise,
@@ -1471,7 +1407,7 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer,
const Aggregate* inner = static_cast<const Aggregate*>(node);
NodeList cnodes = inner->childNodes();
- std::sort(cnodes.begin(), cnodes.end(), compareNodes);
+ std::sort(cnodes.begin(), cnodes.end(), Node::nodeNameLessThan);
foreach (Node* child, cnodes) {
generateIndexSections(writer, child, generateInternalNodes);
diff --git a/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp b/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp
index 3b601adbb..da7e03779 100644
--- a/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp
+++ b/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp
@@ -41,6 +41,8 @@ class tst_QHelpGenerator : public QObject
private slots:
void initTestCase();
void generateHelp();
+ // Check that two runs of the generator creates the same file twice
+ void generateTwice();
private:
void checkNamespace();
@@ -192,6 +194,37 @@ void tst_QHelpGenerator::checkMetaData()
if (!m_query->next())
QFAIL("Meta Data Error");
QCOMPARE(m_query->value(0).toString(), QString("Digia Plc and/or its subsidiary(-ies)"));
+
+}
+
+void tst_QHelpGenerator::generateTwice()
+{
+ // defined in profile
+ QString path = QLatin1String(SRCDIR);
+
+ QString inputFile(path + "/data/test.qhp");
+ QHelpProjectData data;
+ if (!data.readData(inputFile))
+ QFAIL("Cannot read qhp file!");
+
+ QHelpGenerator generator1;
+ QHelpGenerator generator2;
+ QString outputFile1 = path + QLatin1String("/data/test1.qch");
+ QString outputFile2 = path + QLatin1String("/data/test2.qch");
+ QCOMPARE(generator1.generate(&data, outputFile1), true);
+ QCOMPARE(generator2.generate(&data, outputFile2), true);
+
+ QFile f1(outputFile1);
+ QFile f2(outputFile2);
+ QVERIFY(f1.open(QIODevice::ReadOnly));
+ QVERIFY(f2.open(QIODevice::ReadOnly));
+
+ QByteArray arr1 = f1.readAll();
+ QByteArray arr2 = f2.readAll();
+
+ QFile::remove(outputFile1);
+ QFile::remove(outputFile2);
+ QCOMPARE(arr1, arr2);
}
QTEST_MAIN(tst_QHelpGenerator)