Source

Target

Commits (21)
Showing with 408 additions and 328 deletions
load(qt_build_config)
CONFIG += qt_example_installs
MODULE_VERSION = 5.7.0
......@@ -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.
......
......@@ -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.
-------------------------------------------------------------------------
......
......@@ -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.
......
......@@ -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));
......
No preview for this file type
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
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 = " "
TEMPLATE = aux
QMAKE_DOCS = $$PWD/assistant.qdocconf
......@@ -58,301 +58,6 @@
\endlist
*/
/*!
\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
......
/****************************************************************************
**
** 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
*/
......@@ -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
......
......@@ -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. */
......
......@@ -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);
......
......@@ -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"));
......
......@@ -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);
......
......@@ -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"));
......
......@@ -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"));
......
......@@ -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;
......
......@@ -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());
......