Merge branch 'master' of ssh://codereview.qt-project.org/qt/qtbase into newdocs
Change-Id: I7e6cee190a341901dfbf8effb54ebccb91bf7a17
This commit is contained in:
commit
c808dd2745
7
.gitignore
vendored
7
.gitignore
vendored
@ -261,13 +261,6 @@ d_exc_*.stk
|
||||
# Generated by abldfast.bat from devtools.
|
||||
.abldsteps.*
|
||||
|
||||
# Carbide project files
|
||||
# ---------------------
|
||||
.project
|
||||
.cproject
|
||||
.make.cache
|
||||
*.d
|
||||
|
||||
qtc-debugging-helper
|
||||
qtc-qmldump
|
||||
qtc-qmldbg
|
||||
|
40
configure
vendored
40
configure
vendored
@ -785,6 +785,7 @@ CFG_JAVASCRIPTCORE_JIT=auto
|
||||
CFG_PKGCONFIG=auto
|
||||
CFG_STACK_PROTECTOR_STRONG=auto
|
||||
CFG_SLOG2=auto
|
||||
CFG_SYSTEM_PROXIES=no
|
||||
|
||||
# Target architecture
|
||||
CFG_ARCH=
|
||||
@ -1003,6 +1004,14 @@ while [ "$#" -gt 0 ]; do
|
||||
VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
|
||||
VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
|
||||
;;
|
||||
-system-proxies)
|
||||
VAR=system-proxies
|
||||
VAL=yes
|
||||
;;
|
||||
-no-system-proxies)
|
||||
VAR=system-proxies
|
||||
VAL=no
|
||||
;;
|
||||
#Qt Builtin/System style options
|
||||
-no-*|-system-*|-qt-*)
|
||||
VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
|
||||
@ -1890,7 +1899,7 @@ while [ "$#" -gt 0 ]; do
|
||||
fi
|
||||
;;
|
||||
javascript-jit)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_JAVASCRIPTCORE_JIT="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
@ -2090,6 +2099,13 @@ while [ "$#" -gt 0 ]; do
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
system-proxies)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_SYSTEM_PROXIES="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
UNKNOWN_OPT=yes
|
||||
;;
|
||||
@ -2227,7 +2243,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then
|
||||
mkdir -p "$outpath/mkspecs"
|
||||
rm -rf "$outpath"/mkspecs/*
|
||||
ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
|
||||
rm -f "$outpath/mkspecs/default"
|
||||
|
||||
ShadowMkspecs()
|
||||
{
|
||||
@ -3291,6 +3306,9 @@ Additional options:
|
||||
OpenGL ES 2, or regular desktop OpenGL.
|
||||
Use es2 for <api> to override auto-detection.
|
||||
|
||||
* -no-system-proxies .. Do not use system network proxies by default.
|
||||
-system-proxies ..... Use system network proxies by default.
|
||||
|
||||
$GBN -no-glib ........... Do not compile Glib support.
|
||||
$GBY -glib .............. Compile Glib support.
|
||||
EOF
|
||||
@ -3508,6 +3526,9 @@ esac
|
||||
#-------------------------------------------------------------------------------
|
||||
[ -d "$outpath/src/corelib/global" ] || mkdir -p "$outpath/src/corelib/global"
|
||||
|
||||
shortxspec=`echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"`
|
||||
shortspec=`echo $QMAKESPEC | sed "s,^${relpath}/mkspecs/,,"`
|
||||
|
||||
cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
|
||||
/* License Info */
|
||||
static const char qt_configure_licensee_str [256 + 12] = "qt_lcnsuser=$Licensee";
|
||||
@ -3534,6 +3555,8 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = {
|
||||
"qt_hpfxpath=$QT_HOST_PREFIX",
|
||||
"qt_hbinpath=$QT_HOST_BINS",
|
||||
"qt_hdatpath=$QT_HOST_DATA",
|
||||
"qt_targspec=$shortxspec",
|
||||
"qt_hostspec=$shortspec",
|
||||
#endif
|
||||
};
|
||||
static const char qt_configure_settings_path_str[256 + 12] = "qt_stngpath=$QT_INSTALL_SETTINGS";
|
||||
@ -3597,10 +3620,6 @@ setBootstrapVariable()
|
||||
if true; then ###[ '!' -f "$outpath/bin/qmake" ];
|
||||
echo "Creating qmake. Please wait..."
|
||||
|
||||
#mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
|
||||
rm -rf mkspecs/default mkspecs/default-host
|
||||
ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
|
||||
ln -s `echo $QMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default-host
|
||||
mkdir -p "$outpath/qmake" || exit
|
||||
# fix makefiles
|
||||
for mkfile in GNUmakefile Makefile; do
|
||||
@ -5211,7 +5230,7 @@ if [ "$CFG_ALSA" = "auto" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
|
||||
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
|
||||
if [ "$CFG_ARCH" = "arm" ]; then
|
||||
compileTest unix/javascriptcore-jit "javascriptcore-jit"
|
||||
if [ $? != "0" ]; then
|
||||
@ -5454,6 +5473,7 @@ fi
|
||||
[ "$CFG_MAC_HARFBUZZ" = "yes" ] && QT_CONFIG="$QT_CONFIG harfbuzz"
|
||||
[ "$CFG_XCB" = "yes" ] && QT_CONFIG="$QT_CONFIG xcb"
|
||||
[ "$CFG_XINPUT2" = "yes" ] && QT_CONFIG="$QT_CONFIG xinput2"
|
||||
[ "$CFG_SYSTEM_PROXIES" = "yes" ] && QT_CONFIG="$QT_CONFIG system-proxies"
|
||||
|
||||
[ '!' -z "$DEFINES" ] && QMakeVar add DEFINES "$DEFINES"
|
||||
[ '!' -z "$L_FLAGS" ] && QMakeVar add LIBS "$L_FLAGS"
|
||||
@ -6054,7 +6074,7 @@ fi
|
||||
#-------------------------------------------------------------------------------
|
||||
QTMODULE="$outpath/mkspecs/qmodule.pri"
|
||||
|
||||
echo "CONFIG += $QMAKE_CONFIG create_prl link_prl prepare_docs" >> "$QTMODULE.tmp"
|
||||
echo "CONFIG += $QMAKE_CONFIG create_prl link_prl prepare_docs fix_output_dirs no_private_qt_headers_warning QTDIR_build" >> "$QTMODULE.tmp"
|
||||
echo "QT_BUILD_PARTS += $CFG_BUILD_PARTS" >> "$QTMODULE.tmp"
|
||||
|
||||
if [ -n "$QT_CFLAGS_PSQL" ]; then
|
||||
@ -6119,9 +6139,6 @@ cat >>"$CACHEFILE.tmp" <<EOF
|
||||
#paths
|
||||
QT_SOURCE_TREE = \$\$quote($relpath)
|
||||
QT_BUILD_TREE = \$\$quote($outpath)
|
||||
|
||||
CONFIG += fix_output_dirs no_private_qt_headers_warning QTDIR_build
|
||||
|
||||
EOF
|
||||
|
||||
# replace .qmake.cache if it differs from the newly created temp file
|
||||
@ -6235,6 +6252,7 @@ echo "libudev support ........ $CFG_LIBUDEV"
|
||||
if [ "$XPLATFORM_QNX" = "yes" ]; then
|
||||
echo "SLOG2 support .......... $CFG_SLOG2"
|
||||
fi
|
||||
echo "Use system proxies ..... $CFG_SYSTEM_PROXIES"
|
||||
|
||||
if [ "$CFG_OPENGL" = "desktop" ]; then
|
||||
echo "OpenGL support ......... yes (Desktop OpenGL)"
|
||||
|
18
dist/changes-5.0.0
vendored
18
dist/changes-5.0.0
vendored
@ -481,6 +481,15 @@ QtCore
|
||||
- StartWord/EndWord enum values has been logically replaced with StartOfItem/EndOfItem ones
|
||||
to mention they are not about the word boundaries only.
|
||||
|
||||
* Softkeys API was removed. The following functions and enums were removed:
|
||||
- QAction::setSoftKeyRole()
|
||||
- QAction::softKeyRole()
|
||||
- QAction::SoftKeyRole
|
||||
- Qt::WA_MergeSoftkeys
|
||||
- Qt::WA_MergeSoftkeysRecursively
|
||||
- Qt::WindowSoftkeysVisibleHint
|
||||
- Qt::WindowSoftkeysRespondHint
|
||||
|
||||
QtGui
|
||||
-----
|
||||
* Accessibility has been refactored. The hierachy of accessible objects is implemented via
|
||||
@ -550,7 +559,7 @@ QtWidgets
|
||||
the proper Qt API: due to the version bump, QStyle will try to use the additional
|
||||
QStyleOption members, which are left default-initialized.
|
||||
|
||||
* QHeaderView - The following functions have been obsoleted.
|
||||
* QHeaderView has been refactored and the following functions have been obsoleted:
|
||||
|
||||
* void setMovable(bool movable) - use void setSectionsMovable(bool movable) instead.
|
||||
|
||||
@ -566,6 +575,8 @@ QtWidgets
|
||||
* ResizeMode resizeMode(int logicalindex) const -
|
||||
use sectionResizeMode(int logicalindex) instead.
|
||||
|
||||
* setSortIndicator will no longer emit sortIndicatorChanged when the sort indicator is unchanged.
|
||||
|
||||
* QDateEdit and QTimeEdit have re-gained a USER property. These were originally removed
|
||||
before Qt 4.7.0, and are re-added for 5.0. This means that the userProperty for
|
||||
those classes are now QDate and QTime respectively, not QDateTime as they have been
|
||||
@ -586,6 +597,11 @@ QtWidgets
|
||||
returned from permissions() or data(FilePermissions), even if in read-only mode
|
||||
(QFileSystemModel::isReadOnly()).
|
||||
|
||||
* [QTBUG-158 QTBUG-428 QTBUG-26501] QComboBox::currentText improvements
|
||||
Restored currentText as USER property.
|
||||
New setter setCurrentText(), marked as WRITE method, usable by QItemDelegate and QDataWidgetMapper.
|
||||
New signal currentTextChanged() marked as NOTIFY method.
|
||||
|
||||
QtNetwork
|
||||
---------
|
||||
* QHostAddress::isLoopback() API added. Returns true if the address is
|
||||
|
@ -1,5 +1,5 @@
|
||||
#! [0]
|
||||
CONFIG += uitools
|
||||
QT += uitools
|
||||
HEADERS = textfinder.h
|
||||
RESOURCES = textfinder.qrc
|
||||
SOURCES = textfinder.cpp main.cpp
|
||||
|
@ -1,50 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "softkeys.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
MainWindow mw;
|
||||
mw.showMaximized();
|
||||
return app.exec();
|
||||
}
|
@ -1,188 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "softkeys.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
central = new QWidget(this);
|
||||
central->setContextMenuPolicy(Qt::NoContextMenu); // explicitly forbid usage of context menu so actions item is not shown menu
|
||||
setCentralWidget(central);
|
||||
|
||||
// Create text editor and set softkeys to it
|
||||
textEditor= new QTextEdit(tr("Navigate in UI to see context sensitive softkeys in action"), this);
|
||||
QAction* clear = new QAction(tr("Clear"), this);
|
||||
clear->setSoftKeyRole(QAction::NegativeSoftKey);
|
||||
|
||||
textEditor->addAction(clear);
|
||||
|
||||
ok = new QAction(tr("Ok"), this);
|
||||
ok->setSoftKeyRole(QAction::PositiveSoftKey);
|
||||
connect(ok, SIGNAL(triggered()), this, SLOT(okPressed()));
|
||||
|
||||
cancel = new QAction(tr("Cancel"), this);
|
||||
cancel->setSoftKeyRole(QAction::NegativeSoftKey);
|
||||
connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed()));
|
||||
|
||||
infoLabel = new QLabel(tr(""), this);
|
||||
infoLabel->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
toggleButton = new QPushButton(tr("Custom"), this);
|
||||
toggleButton->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
toggleButton->setCheckable(true);
|
||||
|
||||
modeButton = new QPushButton(tr("Loop SK window type"), this);
|
||||
modeButton->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
modeLabel = new QLabel(tr("Normal maximized"), this);
|
||||
modeLabel->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
pushButton = new QPushButton(tr("File Dialog"), this);
|
||||
pushButton->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
QComboBox* comboBox = new QComboBox(this);
|
||||
comboBox->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
comboBox->insertItems(0, QStringList()
|
||||
<< QApplication::translate("MainWindow", "Selection1", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "Selection2", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "Selection3", 0, QApplication::UnicodeUTF8)
|
||||
);
|
||||
|
||||
layout = new QGridLayout;
|
||||
layout->addWidget(textEditor, 0, 0, 1, 2);
|
||||
layout->addWidget(infoLabel, 1, 0, 1, 2);
|
||||
layout->addWidget(toggleButton, 2, 0);
|
||||
layout->addWidget(pushButton, 2, 1);
|
||||
layout->addWidget(comboBox, 3, 0, 1, 2);
|
||||
layout->addWidget(modeButton, 4, 0, 1, 2);
|
||||
layout->addWidget(modeLabel, 5, 0, 1, 2);
|
||||
central->setLayout(layout);
|
||||
|
||||
fileMenu = menuBar()->addMenu(tr("&File"));
|
||||
exit = new QAction(tr("&Exit"), this);
|
||||
fileMenu->addAction(exit);
|
||||
|
||||
connect(clear, SIGNAL(triggered()), this, SLOT(clearTextEditor()));
|
||||
connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog()));
|
||||
connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication()));
|
||||
connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys()));
|
||||
connect(modeButton, SIGNAL(clicked()), this, SLOT(setMode()));
|
||||
pushButton->setFocus();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void MainWindow::clearTextEditor()
|
||||
{
|
||||
textEditor->setText(tr(""));
|
||||
}
|
||||
|
||||
void MainWindow::openDialog()
|
||||
{
|
||||
QFileDialog::getOpenFileName(this);
|
||||
}
|
||||
|
||||
void MainWindow::addSoftKeys()
|
||||
{
|
||||
addAction(ok);
|
||||
addAction(cancel);
|
||||
}
|
||||
|
||||
void MainWindow::setCustomSoftKeys()
|
||||
{
|
||||
if (toggleButton->isChecked()) {
|
||||
infoLabel->setText(tr("Custom softkeys set"));
|
||||
addSoftKeys();
|
||||
}
|
||||
else {
|
||||
infoLabel->setText(tr("Custom softkeys removed"));
|
||||
removeAction(ok);
|
||||
removeAction(cancel);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setMode()
|
||||
{
|
||||
if(isMaximized()) {
|
||||
showFullScreen();
|
||||
modeLabel->setText(tr("Normal Fullscreen"));
|
||||
} else {
|
||||
Qt::WindowFlags flags = windowFlags();
|
||||
if(flags & Qt::WindowSoftkeysRespondHint) {
|
||||
flags |= Qt::WindowSoftkeysVisibleHint;
|
||||
flags &= ~Qt::WindowSoftkeysRespondHint;
|
||||
setWindowFlags(flags); // Hides visible window
|
||||
showFullScreen();
|
||||
modeLabel->setText(tr("Fullscreen with softkeys"));
|
||||
} else if(flags & Qt::WindowSoftkeysVisibleHint) {
|
||||
flags &= ~Qt::WindowSoftkeysVisibleHint;
|
||||
flags &= ~Qt::WindowSoftkeysRespondHint;
|
||||
setWindowFlags(flags); // Hides visible window
|
||||
showMaximized();
|
||||
modeLabel->setText(tr("Normal Maximized"));
|
||||
} else {
|
||||
flags &= ~Qt::WindowSoftkeysVisibleHint;
|
||||
flags |= Qt::WindowSoftkeysRespondHint;
|
||||
setWindowFlags(flags); // Hides visible window
|
||||
showFullScreen();
|
||||
modeLabel->setText(tr("Fullscreen with SK respond"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::exitApplication()
|
||||
{
|
||||
qApp->exit();
|
||||
}
|
||||
|
||||
void MainWindow::okPressed()
|
||||
{
|
||||
infoLabel->setText(tr("OK pressed"));
|
||||
}
|
||||
|
||||
void MainWindow::cancelPressed()
|
||||
{
|
||||
infoLabel->setText(tr("Cancel pressed"));
|
||||
}
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Name=Soft Keys
|
||||
Exec=/opt/usr/bin/softkeys
|
||||
Icon=softkeys
|
||||
X-Window-Icon=
|
||||
X-HildonDesk-ShowInToolbar=true
|
||||
X-Osso-Type=application/x-executable
|
@ -1,88 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef SOFTKEYS_H
|
||||
#define SOFTKEYS_H
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
private slots:
|
||||
void clearTextEditor();
|
||||
void openDialog();
|
||||
void addSoftKeys();
|
||||
void exitApplication();
|
||||
void okPressed();
|
||||
void cancelPressed();
|
||||
void setCustomSoftKeys();
|
||||
void setMode();
|
||||
public:
|
||||
MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
private:
|
||||
QGridLayout *layout;
|
||||
QWidget *central;
|
||||
QTextEdit *textEditor;
|
||||
QLabel *infoLabel;
|
||||
QPushButton *toggleButton;
|
||||
QPushButton *pushButton;
|
||||
QPushButton *modeButton;
|
||||
QLabel *modeLabel;
|
||||
QMenu *fileMenu;
|
||||
QAction *addSoftKeysAct;
|
||||
QAction *exit;
|
||||
QAction *ok;
|
||||
QAction *cancel;
|
||||
};
|
||||
|
||||
//! [0]
|
||||
class SoftKey : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SoftKey(QWidget *parent = 0);
|
||||
};
|
||||
//! [0]
|
||||
|
||||
#endif
|
@ -1,13 +0,0 @@
|
||||
HEADERS = softkeys.h
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
softkeys.cpp
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/softkeys
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS softkeys.pro
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/softkeys
|
||||
INSTALLS += target sources
|
||||
|
||||
QT += widgets
|
||||
|
@ -56,17 +56,6 @@ Dialog::Dialog(QWidget *parent, bool smallScreen)
|
||||
layout->addWidget(lineEdit);
|
||||
setLayout(layout);
|
||||
|
||||
#ifdef QT_SOFTKEYS_ENABLED
|
||||
QAction *exitAction = new QAction(tr("Exit"), this);
|
||||
exitAction->setSoftKeyRole(QAction::NegativeSoftKey);
|
||||
connect (exitAction, SIGNAL(triggered()),this, SLOT(close()));
|
||||
addAction (exitAction);
|
||||
|
||||
Qt::WindowFlags flags = windowFlags();
|
||||
flags |= Qt::WindowSoftkeysVisibleHint;
|
||||
setWindowFlags(flags);
|
||||
#endif
|
||||
|
||||
connect(lineEdit, SIGNAL(textChanged(QString)),
|
||||
wigglyWidget, SLOT(setText(QString)));
|
||||
if (!smallScreen){
|
||||
|
@ -60,7 +60,7 @@ static|staticlib:CMAKE_STATIC_TYPE = true
|
||||
|
||||
contains(QT_CONFIG, reduce_relocations):CMAKE_ADD_FPIE_FLAGS = "true"
|
||||
|
||||
CMAKE_MKSPEC = $$relative_path($$QMAKESPEC, $$[QT_HOST_DATA/get]/mkspecs)
|
||||
CMAKE_MKSPEC = $$[QMAKE_XSPEC]
|
||||
|
||||
macx {
|
||||
!isEmpty(CMAKE_STATIC_TYPE) {
|
||||
|
@ -1,20 +1,6 @@
|
||||
load(exclusive_builds)
|
||||
CONFIG = lex yacc warn_on debug exceptions depend_includepath $$CONFIG
|
||||
|
||||
!build_pass:exists($$_PRO_FILE_PWD_/sync.profile) {
|
||||
!exists($$[QT_HOST_DATA]/.qmake.cache) {
|
||||
!isEmpty(_QMAKE_SUPER_CACHE_) {
|
||||
# When doing a -prefix build of top-level qt5/qt.pro, we need to announce
|
||||
# this repo's module pris' location to the other repos.
|
||||
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$OUT_PWD
|
||||
modpath = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
|
||||
!contains(QMAKEMODULES, $$modpath): \
|
||||
cache(QMAKEMODULES, add super, modpath)
|
||||
unset(modpath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Populate the installdir which will be passed to qdoc in the default_post.prf
|
||||
# This allows a project to remove the installdir if need be, to trigger building online docs,
|
||||
# which Qt Creator does.
|
||||
|
2
mkspecs/features/qml1_module.prf
Normal file
2
mkspecs/features/qml1_module.prf
Normal file
@ -0,0 +1,2 @@
|
||||
CONFIG += qml1_target
|
||||
load(qml_module)
|
2
mkspecs/features/qml1_plugin.prf
Normal file
2
mkspecs/features/qml1_plugin.prf
Normal file
@ -0,0 +1,2 @@
|
||||
CONFIG += qml1_target
|
||||
load(qml_plugin)
|
@ -9,6 +9,11 @@ for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_)
|
||||
# Only for Qt Creator's project view
|
||||
OTHER_FILES += $$fq_qml_files
|
||||
|
||||
qml1_target: \
|
||||
instbase = $$[QT_INSTALL_IMPORTS]/QtDeclarative
|
||||
else: \
|
||||
instbase = $$[QT_INSTALL_IMPORTS]
|
||||
|
||||
exists($$[QT_HOST_PREFIX]/.qmake.cache) {
|
||||
# These bizarre rules copy the files to the qtbase build directory
|
||||
|
||||
@ -17,7 +22,7 @@ exists($$[QT_HOST_PREFIX]/.qmake.cache) {
|
||||
}
|
||||
|
||||
qmlfiles2build.input = fq_qml_files
|
||||
qmlfiles2build.output = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/${QMAKE_FUNC_FILE_IN_qmlModStripSrcDir}
|
||||
qmlfiles2build.output = $$instbase/$$TARGETPATH/${QMAKE_FUNC_FILE_IN_qmlModStripSrcDir}
|
||||
!contains(TEMPLATE, vc.*): qmlfiles2build.variable_out = PRE_TARGETDEPS
|
||||
qmlfiles2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||
qmlfiles2build.name = COPY ${QMAKE_FILE_IN}
|
||||
@ -29,5 +34,5 @@ exists($$[QT_HOST_PREFIX]/.qmake.cache) {
|
||||
# Install rules
|
||||
qmldir.base = $$_PRO_FILE_PWD_
|
||||
qmldir.files = $$fq_qml_files
|
||||
qmldir.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
|
||||
qmldir.path = $$instbase/$$TARGETPATH
|
||||
INSTALLS += qmldir
|
||||
|
@ -24,7 +24,12 @@ exists($$QMLTYPEFILE): QML_FILES += $$QMLTYPEFILE
|
||||
|
||||
# Install rules
|
||||
|
||||
target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
|
||||
qml1_target: \
|
||||
instbase = $$[QT_INSTALL_IMPORTS]/QtDeclarative
|
||||
else: \
|
||||
instbase = $$[QT_INSTALL_IMPORTS]
|
||||
|
||||
target.path = $$instbase/$$TARGETPATH
|
||||
INSTALLS += target
|
||||
|
||||
# Some final setup
|
||||
@ -42,13 +47,31 @@ load(qt_targets)
|
||||
# directory. Then review and commit the changes made to plugins.qmltypes.
|
||||
#
|
||||
!cross_compile {
|
||||
isEmpty(IMPORT_VERSION): IMPORT_VERSION = $$eval(QT.$${CXX_MODULE}.MAJOR_VERSION).$$eval(QT.$${CXX_MODULE}.MINOR_VERSION)
|
||||
build_pass|!debug_and_release {
|
||||
isEmpty(IMPORT_VERSION): IMPORT_VERSION = $$eval(QT.$${CXX_MODULE}.MAJOR_VERSION).$$eval(QT.$${CXX_MODULE}.MINOR_VERSION)
|
||||
|
||||
load(resolve_target)
|
||||
qtPrepareTool(QMLPLUGINDUMP, qmlplugindump)
|
||||
qmltypes.target = qmltypes
|
||||
qmltypes.commands = $$QMLPLUGINDUMP $$replace(TARGETPATH, /, .) $$IMPORT_VERSION $$QMAKE_RESOLVED_TARGET > $$QMLTYPEFILE
|
||||
qmltypes.depends = $$QMAKE_RESOLVED_TARGET
|
||||
load(resolve_target)
|
||||
qml1_target: \
|
||||
qmlplugindump = qml1plugindump
|
||||
else: \
|
||||
qmlplugindump = qmlplugindump
|
||||
qtPrepareTool(QMLPLUGINDUMP, $$qmlplugindump)
|
||||
importpath.value =
|
||||
for(qmod, QMAKEMODULES) {
|
||||
qmod = $$section(qmod, /, 0, -3)/imports
|
||||
qml1_target: qmod = $$qmod/QtDeclarative
|
||||
exists($$qmod): importpath.value += $$shell_path($$qmod)
|
||||
}
|
||||
importpath.name = QML_IMPORT_PATH
|
||||
importpath.value = $$unique(importpath.value)
|
||||
qtAddToolEnv(QMLPLUGINDUMP, importpath)
|
||||
TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )
|
||||
qmltypes.target = qmltypes
|
||||
qmltypes.commands = $$QMLPLUGINDUMP $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE
|
||||
qmltypes.depends = $$QMAKE_RESOLVED_TARGET
|
||||
} else {
|
||||
qmltypes.CONFIG += recursive
|
||||
}
|
||||
QMAKE_EXTRA_TARGETS += qmltypes
|
||||
}
|
||||
|
||||
|
@ -38,60 +38,15 @@ plugin { #Qt plugins
|
||||
QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
|
||||
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
|
||||
for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
|
||||
qplugin_style =
|
||||
!qt_debug:!qt_release {
|
||||
CONFIG(debug, debug|release):qplugin_style = debug
|
||||
else:qplugin_style = release
|
||||
} else:CONFIG(qt_debug, qt_debug|qt_release) {
|
||||
qplugin_style = debug
|
||||
} else {
|
||||
qplugin_style = release
|
||||
}
|
||||
|
||||
# Check if the plugin is known to Qt. We can use this to determine
|
||||
# the plugin path. Unknown plugins must rely on the default link path.
|
||||
ACCESSIBLEPLUGINS = qtaccessiblewidgets qtaccessiblecompatwidgets
|
||||
BEARERPLUGINS = qgenericbearer qnativewifibearer
|
||||
CODECPLUGINS = qcncodecs qjpcodecs qkrcodecs qtwcodecs
|
||||
DECORATIONPLUGINS = qdecorationdefault qdecorationstyled qdecorationwindows
|
||||
GFXDRIVERPLUGINS = qscreenvfb qgfxtransformed qgfxshadowfb qgfxpvregl qscreenlinuxfb qeglnullws qdirectfbscreen qahiscreen
|
||||
GRAPHICSSYSTEMPLUGINS = qmeegographicssystem qglgraphicssystem qvggraphicssystem qshivavggraphicssystem
|
||||
IMAGEPLUGINS = qgif qico qjpeg qsvg
|
||||
INPUTPLUGINS = qimsw-multi
|
||||
KBDDRIVERPLUGINS = qlinuxinputkbddriver
|
||||
MOUSEDRIVERPLUGINS = qtslibmousehandler qpcmousedriver qlinuxtpmousedriver
|
||||
SQLPLUGINS = qsqldb2 qsqloci qsqltds qsqlodbc qsqlpsql qsqlibase qsqlmysql qsqlite2 qsqlite
|
||||
PHONONPLUGINS = phonon_waveout phonon_ds9 phonon_gstreamer phonon_qt7 phonon_mmf
|
||||
|
||||
ALLQTPLUGINS = $$ACCESSIBLEPLUGINS $$BEARERPLUGINS $$CODECPLUGINS $$DECORATIONPLUGINS $$GFXDRIVERPLUGINS $$GRAPHICSSYSTEMPLUGINS $$IMAGEPLUGINS $$INPUTPLUGINS $$KBDDRIVERPLUGINS $$MOUSEDRIVERPLUGINS $$SQLPLUGINS $$PHONONPLUGINS
|
||||
|
||||
QT_PLUGINPATH =
|
||||
contains(ALLQTPLUGINS, $$QTPLUG) {
|
||||
# Determine the plugin path
|
||||
contains(ACCESSIBLEPLUGINS, $$QTPLUG): QT_PLUGINPATH = accessible
|
||||
contains(BEARERPLUGINS, $$QTPLUG): QT_PLUGINPATH = bearer
|
||||
contains(CODECPLUGINS, $$QTPLUG): QT_PLUGINPATH = codecs
|
||||
contains(DECORATIONPLUGINS, $$QTPLUG): QT_PLUGINPATH = decorations
|
||||
contains(GFXDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = gfxdrivers
|
||||
contains(GRAPHICSSYSTEMPLUGINS, $$QTPLUG): QT_PLUGINPATH = graphicssystems
|
||||
contains(IMAGEPLUGINS, $$QTPLUG): QT_PLUGINPATH = imageformats
|
||||
contains(INPUTPLUGINS, $$QTPLUG): QT_PLUGINPATH = inputmethods
|
||||
contains(KBDDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = kbddrivers
|
||||
contains(MOUSEDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = mousedrivers
|
||||
contains(SQLPLUGINS, $$QTPLUG): QT_PLUGINPATH = sqldrivers
|
||||
contains(PHONONPLUGINS, $$QTPLUG): QT_PLUGINPATH = phonon_backend
|
||||
}
|
||||
QT_PLUGINPATH = $$eval(QT_PLUGIN.$${QTPLUG}.TYPE)
|
||||
|
||||
# Generate the plugin linker line
|
||||
target_qt:isEqual(TARGET, QTPLUG) {
|
||||
warning($$TARGET cannot have a QTPLUGIN of $$QTPLUG)
|
||||
} else {
|
||||
QT_LINKAGE = -l$${QTPLUG}
|
||||
win32 {
|
||||
CONFIG(debug, debug|release):QT_LINKAGE = -l$${QTPLUG}d
|
||||
} else:mac {
|
||||
isEqual(qplugin_style, debug):QT_LINKAGE = -l$${QTPLUG}_debug
|
||||
}
|
||||
QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
|
||||
}
|
||||
|
||||
# Only link against plugin in static builds
|
||||
@ -149,6 +104,3 @@ wince*:static:gui {
|
||||
}
|
||||
|
||||
!isEmpty(QT_NAMESPACE):DEFINES *= QT_NAMESPACE=$$QT_NAMESPACE
|
||||
mac {
|
||||
!isEmpty(QT_NAMESPACE_MAC_CRC):DEFINES *= QT_NAMESPACE_MAC_CRC=$$QT_NAMESPACE_MAC_CRC
|
||||
}
|
||||
|
@ -9,6 +9,16 @@
|
||||
debug(1, "Not loading qmodule.pri twice")
|
||||
}
|
||||
|
||||
!build_pass:!isEmpty(_QMAKE_SUPER_CACHE_):!exists($$[QT_HOST_DATA]/.qmake.cache) {
|
||||
# When doing a -prefix build of top-level qt5/qt.pro, we need to announce
|
||||
# this repo's module pris' location to the other repos.
|
||||
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$shadowed($$dirname(_QMAKE_CONF_))
|
||||
modpath = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
|
||||
!contains(QMAKEMODULES, $$modpath): \
|
||||
cache(QMAKEMODULES, add super, modpath)
|
||||
unset(modpath)
|
||||
}
|
||||
|
||||
mac {
|
||||
!isEmpty(QMAKE_RPATHDIR){
|
||||
CONFIG += absolute_library_soname
|
||||
|
14
mkspecs/features/qt_build_paths.prf
Normal file
14
mkspecs/features/qt_build_paths.prf
Normal file
@ -0,0 +1,14 @@
|
||||
# Find the module's source root dir.
|
||||
isEmpty(_QMAKE_CONF_): error("Project has no top-level .qmake.conf file.")
|
||||
MODULE_PROFILE_DIR = $$dirname(_QMAKE_CONF_)
|
||||
isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR
|
||||
isEmpty(MODULE_BASE_OUTDIR): MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR)
|
||||
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
|
||||
|
||||
QTDIR = $$[QT_HOST_PREFIX]
|
||||
exists($$QTDIR/.qmake.cache) {
|
||||
# Permit modules to enforce being built outside QTDIR ...
|
||||
!force_independent: MODULE_BASE_OUTDIR = $$QTDIR
|
||||
# ... though this sort of breaks the idea.
|
||||
MODULE_QMAKE_OUTDIR = $$QTDIR
|
||||
}
|
@ -192,13 +192,16 @@ defineTest(qtAddToolEnv) {
|
||||
equals(QMAKE_DIR_SEP, /) {
|
||||
contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
|
||||
else: infix =
|
||||
$$1 = "$$name=$$join(value, :)$$infix $$eval($$1)"
|
||||
val = "$$name=$$join(value, :)$$infix"
|
||||
} else {
|
||||
# Escape closing parens when expanding the variable, otherwise cmd confuses itself.
|
||||
contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)%
|
||||
else: infix =
|
||||
$$1 = "(set $$name=$$join(value, ;)$$infix) & $$eval($$1)"
|
||||
val = "(set $$name=$$join(value, ;)$$infix) &"
|
||||
}
|
||||
contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g
|
||||
else: val ~= s,\\\$,\$\$,g
|
||||
$$1 = "$$val $$eval($$1)"
|
||||
}
|
||||
}
|
||||
export($$1)
|
||||
@ -207,29 +210,33 @@ defineTest(qtAddToolEnv) {
|
||||
defineTest(qtAddTargetEnv) {
|
||||
deps = $$resolve_depends(QT, "QT.")
|
||||
!isEmpty(deps) {
|
||||
plugin_paths =
|
||||
for(dep, deps) {
|
||||
deppath += $$shell_path($$eval(QT.$${dep}.libs))
|
||||
for(rpath, QT.$${dep}.rpath_link): \
|
||||
deppath += $$shell_path($$rpath)
|
||||
plugin_paths += $$eval(QT.$${dep}.plugin_path) $$eval(QT.$${dep}.plugins)
|
||||
}
|
||||
equals(QMAKE_HOST.os, Windows): \
|
||||
equals(QMAKE_HOST.os, Windows) {
|
||||
deppath.name = PATH
|
||||
else:contains(QMAKE_HOST.os, Linux|FreeBSD): \
|
||||
} else:contains(QMAKE_HOST.os, Linux|FreeBSD) {
|
||||
deppath.name = LD_LIBRARY_PATH
|
||||
else:equals(QMAKE_HOST.os, Darwin): \
|
||||
deppath.name = DYLD_LIBRARY_PATH
|
||||
else: \
|
||||
} else:equals(QMAKE_HOST.os, Darwin) {
|
||||
contains(QT_CONFIG, qt_framework): \
|
||||
deppath.name = DYLD_FRAMEWORK_PATH
|
||||
else: \
|
||||
deppath.name = DYLD_LIBRARY_PATH
|
||||
} else {
|
||||
error("Operating system not supported.")
|
||||
}
|
||||
deppath.value = $$unique(deppath)
|
||||
deppath.CONFIG = prepend
|
||||
pluginpath.name = QT_PLUGIN_PATH
|
||||
|
||||
pluginpath.value =
|
||||
plugin_paths = $$unique(plugin_paths)
|
||||
for(ppath, plugin_paths): \
|
||||
exists($$ppath): \
|
||||
pluginpath.value += $$shell_path($$ppath)
|
||||
for(qmod, QMAKEMODULES) {
|
||||
qmod = $$section(qmod, /, 0, -3)/plugins
|
||||
exists($$qmod): pluginpath.value += $$shell_path($$qmod)
|
||||
}
|
||||
pluginpath.name = QT_PLUGIN_PATH
|
||||
|
||||
QT_TOOL_ENV += deppath pluginpath
|
||||
}
|
||||
qtAddToolEnv($$1, $$QT_TOOL_ENV)
|
||||
|
@ -32,19 +32,7 @@ else: \
|
||||
MODULE_DEFINE = QT_$${ucmodule}_LIB
|
||||
MODULE_DEFINES = $$MODULE_DEFINE $$MODULE_DEFINES
|
||||
|
||||
# Find the module's source root dir.
|
||||
MODULE_PROFILE_DIR = $$_PRO_FILE_PWD_
|
||||
for(ever) {
|
||||
exists($$MODULE_PROFILE_DIR/sync.profile):break()
|
||||
nmpri = $$dirname(MODULE_PROFILE_DIR)
|
||||
equals(nmpri, $$MODULE_PROFILE_DIR):error("No sync.profile found. This does not look like a Qt module source tree.")
|
||||
MODULE_PROFILE_DIR = $$nmpri
|
||||
unset(nmpri)
|
||||
}
|
||||
|
||||
isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR
|
||||
isEmpty(MODULE_BASE_OUTDIR): MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR)
|
||||
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
|
||||
load(qt_build_paths)
|
||||
|
||||
# This check will be removed soon. Weird indentation to avoid reindenting the code later.
|
||||
!isEmpty(MODULE_PRI) {
|
||||
@ -53,7 +41,7 @@ isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
|
||||
exists($$MODULE_PRI)|error("Specified module pri file $$MODULE_PRI does not exist.")
|
||||
} else {
|
||||
|
||||
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_$${MODULE}.pri
|
||||
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri
|
||||
|
||||
!build_pass {
|
||||
|
||||
@ -104,10 +92,7 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_$${MODULE}.pri
|
||||
|
||||
load(qt_module_fwdpri)
|
||||
|
||||
MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes)
|
||||
MODULE_PRIVATE_INCLUDES = $$eval(QT.$${MODULE}.private_includes)
|
||||
INCLUDEPATH *= $$MODULE_INCLUDES
|
||||
INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES
|
||||
INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}.private_includes)
|
||||
|
||||
load(qt_module_headers)
|
||||
|
||||
@ -123,14 +108,8 @@ CONFIG -= fix_output_dirs
|
||||
!isEmpty(QMAKE_DOCS) {
|
||||
doc_subdir = doc
|
||||
|
||||
QTDIR = $$[QT_HOST_PREFIX]
|
||||
!force_independent:exists($$QTDIR/.qmake.cache): \
|
||||
mod_component_base = $$QTDIR
|
||||
else: \
|
||||
mod_component_base = $$MODULE_BASE_OUTDIR
|
||||
|
||||
unset(QMAKE_DOCS_INDEX)
|
||||
QMAKE_DOCS_OUTPUTDIR = $$mod_component_base/$$doc_subdir/qt$${MODULE}
|
||||
QMAKE_DOCS_OUTPUTDIR = $$MODULE_BASE_OUTDIR/$$doc_subdir/qt$${MODULE}
|
||||
for(qmod, QMAKEMODULES): \
|
||||
QMAKE_DOCS_INDEX += $$section(qmod, /, 0, -3)/$$doc_subdir
|
||||
|
||||
|
@ -1,19 +1,10 @@
|
||||
!build_pass {
|
||||
|
||||
QTDIR = $$[QT_HOST_PREFIX]
|
||||
exists($$QTDIR/.qmake.cache) {
|
||||
mod_component_base = $$QTDIR
|
||||
mod_qmake_base = $$QTDIR
|
||||
} else {
|
||||
mod_component_base = $$MODULE_BASE_OUTDIR
|
||||
mod_qmake_base = $$MODULE_QMAKE_OUTDIR
|
||||
}
|
||||
# Permit modules to enforce being built outside QTDIR.
|
||||
force_independent: mod_component_base = $$MODULE_BASE_OUTDIR
|
||||
load(qt_build_paths)
|
||||
|
||||
isEmpty(MODULE_INSTALL_LIBS): MODULE_INSTALL_LIBS = $$[QT_INSTALL_LIBS/raw]
|
||||
|
||||
MODULE_FWD_PRI = $$mod_qmake_base/mkspecs/modules/qt_$${MODULE}.pri
|
||||
MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri
|
||||
|
||||
# -rpath-link is used by the linker to find depedencies of dynamic
|
||||
# libraries which were NOT specified on the command line.
|
||||
@ -32,11 +23,9 @@
|
||||
privqt = $$replace(QT_PRIVATE, -private$, )
|
||||
privdep = $$resolve_depends(privqt, "QT.")
|
||||
rpaths =
|
||||
pluginpath =
|
||||
alldep = $$pubdep $$privdep
|
||||
for(dep, alldep) { # Inherit link-rpaths from all our dependencies
|
||||
rpaths += $$eval(QT.$${dep}.rpath_link) $$eval(QT.$${dep}.rpath_link_private)
|
||||
pluginpath += $$eval(QT.$${dep}.plugin_path) $$eval(QT.$${dep}.plugins)
|
||||
}
|
||||
privdep -= $$pubdep
|
||||
for(dep, privdep): \ # Add our private dependencies' lib paths as new link-rpaths
|
||||
@ -58,20 +47,18 @@
|
||||
} else {
|
||||
module_rpathlink_priv =
|
||||
}
|
||||
pluginpath = $$unique(pluginpath)
|
||||
|
||||
# Create a forwarding module .pri file
|
||||
MODULE_FWD_PRI_CONT = \
|
||||
"QT_MODULE_BASE = $$MODULE_BASE_DIR" \
|
||||
"QT_MODULE_BIN_BASE = $$mod_component_base/bin" \
|
||||
"QT_MODULE_INCLUDE_BASE = $$mod_component_base/include" \
|
||||
"QT_MODULE_IMPORT_BASE = $$mod_component_base/imports" \
|
||||
"QT_MODULE_LIB_BASE = $$mod_component_base/lib" \
|
||||
"QT_MODULE_PLUGIN_BASE = $$mod_component_base/plugins" \
|
||||
"QT_MODULE_BIN_BASE = $$MODULE_BASE_OUTDIR/bin" \
|
||||
"QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_OUTDIR/include" \
|
||||
"QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \
|
||||
"QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \
|
||||
"QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \
|
||||
$$module_rpathlink \
|
||||
$$module_rpathlink_priv \
|
||||
"QT.$${MODULE}.rpath = $$MODULE_INSTALL_LIBS" \
|
||||
"QT.$${MODULE}.plugin_path = $$val_escape(pluginpath)" \
|
||||
"include($$MODULE_PRI)"
|
||||
write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
|
||||
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
|
||||
|
@ -1,20 +1,16 @@
|
||||
QTDIR = $$[QT_HOST_PREFIX]
|
||||
!force_independent:exists($$QTDIR/.qmake.cache): \
|
||||
mod_component_base = $$QTDIR
|
||||
else: \
|
||||
mod_component_base = $$MODULE_BASE_OUTDIR
|
||||
load(qt_build_paths)
|
||||
|
||||
!build_pass {
|
||||
qtPrepareTool(QMAKE_SYNCQT, syncqt)
|
||||
contains(QT_CONFIG, private_tests): \ # -developer-build
|
||||
QMAKE_SYNCQT += -check-includes
|
||||
QMAKE_SYNCQT += -module $$TARGET -mkspecsdir $$[QT_HOST_DATA/get]/mkspecs -outdir $$mod_component_base $$MODULE_BASE_DIR
|
||||
QMAKE_SYNCQT += -module $$TARGET -mkspecsdir $$[QT_HOST_DATA/get]/mkspecs -outdir $$MODULE_BASE_OUTDIR $$MODULE_BASE_DIR
|
||||
!silent: message($$QMAKE_SYNCQT)
|
||||
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
|
||||
}
|
||||
|
||||
#load up the headers info
|
||||
include($$mod_component_base/include/$$TARGET/headers.pri, "", true)
|
||||
include($$MODULE_BASE_OUTDIR/include/$$TARGET/headers.pri, "", true)
|
||||
|
||||
lctarget = $$lower($$TARGET)
|
||||
uctarget = $$upper($$TARGET)
|
||||
@ -55,7 +51,7 @@ count(MODULE_VERSION_HEADER, 1) {
|
||||
}
|
||||
|
||||
# Create a module master header
|
||||
MODULE_MASTER_HEADER = $$mod_component_base/include/$$TARGET/$$TARGET
|
||||
MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$TARGET/$$TARGET
|
||||
!build_pass {
|
||||
MODULE_MASTER_HEADER_CONT = \
|
||||
"/* This file was generated by qmake with the info from $${_PRO_FILE_}. */" \
|
||||
|
@ -1,12 +1,17 @@
|
||||
TEMPLATE = lib
|
||||
isEmpty(VERSION):VERSION = $$QT_VERSION
|
||||
CONFIG += qt plugin
|
||||
load(qt_build_paths)
|
||||
|
||||
if(win32|mac):!macx-xcode {
|
||||
isEmpty(PLUGIN_TYPE): error("PLUGIN_TYPE (plugins/ subdirectory) needs to be defined.")
|
||||
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin
|
||||
DESTDIR = $$MODULE_BASE_OUTDIR/plugins/$$PLUGIN_TYPE
|
||||
|
||||
tool_plugin {
|
||||
!build_pass:contains(QT_CONFIG, build_all): CONFIG += release
|
||||
} else:if(win32|mac):!macx-xcode {
|
||||
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all):CONFIG += build_all
|
||||
}
|
||||
TARGET = $$qtLibraryTarget($$TARGET)
|
||||
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
|
||||
contains(QT_CONFIG, separate_debug_info):CONFIG += separate_debug_info
|
||||
contains(QT_CONFIG, separate_debug_info_nocopy):CONFIG += separate_debug_info_nocopy
|
||||
@ -15,6 +20,25 @@ contains(QT_CONFIG, c++11):CONFIG += c++11
|
||||
contains(QT_CONFIG, static):CONFIG += static
|
||||
else:CONFIG += shared
|
||||
|
||||
!build_pass:static {
|
||||
isEmpty(MODULE): MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
|
||||
|
||||
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_plugin_$${MODULE}.pri
|
||||
|
||||
MODULE_PRI_CONT = \
|
||||
"QT_PLUGIN.$${MODULE}.TYPE = $$PLUGIN_TYPE"
|
||||
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
|
||||
|
||||
pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
|
||||
pritarget.files = $$MODULE_PRI
|
||||
INSTALLS += pritarget
|
||||
}
|
||||
|
||||
target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
|
||||
INSTALLS += target
|
||||
|
||||
TARGET = $$qtLibraryTarget($$TARGET)
|
||||
|
||||
load(qt_targets)
|
||||
|
||||
wince*:LIBS += $$QMAKE_LIBS_GUI
|
||||
|
@ -1,5 +1,8 @@
|
||||
TEMPLATE = app
|
||||
|
||||
load(qt_build_paths)
|
||||
DESTDIR = $$MODULE_BASE_OUTDIR/bin
|
||||
|
||||
CONFIG += qt warn_on console
|
||||
isEmpty(QMAKE_INFO_PLIST): CONFIG -= app_bundle
|
||||
|
||||
@ -16,26 +19,13 @@ INSTALLS += target
|
||||
|
||||
MODULE_DEPENDS = $$replace(QT, -private$, )
|
||||
|
||||
# Find the module's source root dir.
|
||||
MODULE_PROFILE_DIR = $$_PRO_FILE_PWD_
|
||||
for(ever) {
|
||||
exists($$MODULE_PROFILE_DIR/sync.profile):break()
|
||||
nmpri = $$dirname(MODULE_PROFILE_DIR)
|
||||
equals(nmpri, $$MODULE_PROFILE_DIR): \
|
||||
error("No sync.profile found. This does not look like a Qt module source tree.")
|
||||
MODULE_PROFILE_DIR = $$nmpri
|
||||
unset(nmpri)
|
||||
}
|
||||
|
||||
isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR
|
||||
MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR)
|
||||
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
|
||||
load(qt_build_paths)
|
||||
|
||||
load(resolve_target)
|
||||
cmd = $$shell_path($$QMAKE_RESOLVED_TARGET)
|
||||
qtAddTargetEnv(cmd)
|
||||
|
||||
TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_$${MODULE}.pri
|
||||
TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri
|
||||
|
||||
TOOL_PRI_CONT = "QT_TOOL.$${MODULE}.command = $$val_escape(cmd)"
|
||||
write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.")
|
||||
|
@ -1127,20 +1127,23 @@ bool QMakeEvaluator::loadSpecInternal()
|
||||
evalError(fL1S("Could not read qmake configuration file %1.").arg(spec));
|
||||
return false;
|
||||
}
|
||||
#ifdef Q_OS_UNIX
|
||||
#ifndef QT_BUILD_QMAKE
|
||||
// Legacy support for Qt4 default specs
|
||||
# ifdef Q_OS_UNIX
|
||||
if (m_qmakespec.endsWith(QLatin1String("/default-host"))
|
||||
|| m_qmakespec.endsWith(QLatin1String("/default"))) {
|
||||
QString rspec = QFileInfo(m_qmakespec).readLink();
|
||||
if (!rspec.isEmpty())
|
||||
m_qmakespec = QDir::cleanPath(QDir(m_qmakespec).absoluteFilePath(rspec));
|
||||
}
|
||||
#else
|
||||
# else
|
||||
// We can't resolve symlinks as they do on Unix, so configure.exe puts
|
||||
// the source of the qmake.conf at the end of the default/qmake.conf in
|
||||
// the QMAKESPEC_ORIGINAL variable.
|
||||
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
|
||||
if (!orig_spec.isEmpty())
|
||||
m_qmakespec = orig_spec.toQString();
|
||||
# endif
|
||||
#endif
|
||||
valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespec);
|
||||
m_qmakespecName = IoUtils::fileName(m_qmakespec).toString();
|
||||
@ -1188,7 +1191,12 @@ bool QMakeEvaluator::loadSpec()
|
||||
|
||||
updateMkspecPaths();
|
||||
if (qmakespec.isEmpty())
|
||||
qmakespec = m_hostBuild ? QLatin1String("default-host") : QLatin1String("default");
|
||||
qmakespec = propertyValue(ProKey(m_hostBuild ? "QMAKE_SPEC" : "QMAKE_XSPEC")).toQString();
|
||||
#ifndef QT_BUILD_QMAKE
|
||||
// Legacy support for Qt4 qmake in Qt Creator, etc.
|
||||
if (qmakespec.isEmpty())
|
||||
qmakespec = QLatin1String("default-host") : QLatin1String("default");
|
||||
#endif
|
||||
if (IoUtils::isRelativePath(qmakespec)) {
|
||||
foreach (const QString &root, m_mkspecPaths) {
|
||||
QString mkspec = root + QLatin1Char('/') + qmakespec;
|
||||
|
@ -71,6 +71,8 @@ static const struct {
|
||||
{ "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true },
|
||||
{ "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
|
||||
{ "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
|
||||
{ "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true },
|
||||
{ "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true },
|
||||
};
|
||||
|
||||
QMakeProperty::QMakeProperty() : settings(0)
|
||||
|
10
qtbase.pro
10
qtbase.pro
@ -87,16 +87,6 @@ mkspecs.files = \
|
||||
$$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri $$OUT_PWD/mkspecs/qdevice.pri \
|
||||
$$files($$PWD/mkspecs/*) # $$OUT_PWD contains only symlinks under Unix
|
||||
mkspecs.files -= $$PWD/mkspecs/modules
|
||||
!equals(OUT_PWD, $$PWD) {
|
||||
# When shadow building, the default mkspecs only exist in the build tree.
|
||||
mkspecs.files += $$OUT_PWD/mkspecs/default-host $$OUT_PWD/mkspecs/default
|
||||
}
|
||||
!equals(QMAKE_HOST.os, Linux):!equals(QMAKE_HOST.os, Windows) {
|
||||
# MacOS' (and maybe other Unixes') cp command is too daft to honor -f when copying symlinks.
|
||||
mkspecs_pre.commands = rm -f $$[QT_HOST_DATA]/mkspecs/default-host $$[QT_HOST_DATA]/mkspecs/default
|
||||
QMAKE_EXTRA_TARGETS += mkspecs_pre
|
||||
mkspecs.depends += mkspecs_pre
|
||||
}
|
||||
INSTALLS += mkspecs
|
||||
|
||||
global_docs.files = $$PWD/doc/global
|
||||
|
@ -13,7 +13,7 @@ isEmpty(ANGLE_DIR) {
|
||||
}
|
||||
|
||||
win32 {
|
||||
GNUTOOLS_DIR=$$[QT_HOST_DATA]/../gnuwin32/bin
|
||||
GNUTOOLS_DIR=$$PWD/../../../../gnuwin32/bin
|
||||
exists($$GNUTOOLS_DIR/gperf.exe) {
|
||||
GNUTOOLS = "(set $$escape_expand(\\\")PATH=$$replace(GNUTOOLS_DIR, [/\\\\], $${QMAKE_DIR_SEP});%PATH%$$escape_expand(\\\"))"
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = libGLESv2
|
||||
DEPENDPATH += . shaders
|
||||
CONFIG += simd
|
||||
|
||||
include(../common/common.pri)
|
||||
|
||||
@ -60,10 +61,11 @@ SOURCES += \
|
||||
$$ANGLE_DIR/src/libGLESv2/ResourceManager.cpp \
|
||||
$$ANGLE_DIR/src/libGLESv2/Shader.cpp \
|
||||
$$ANGLE_DIR/src/libGLESv2/Texture.cpp \
|
||||
$$ANGLE_DIR/src/libGLESv2/TextureSSE2.cpp \
|
||||
$$ANGLE_DIR/src/libGLESv2/utilities.cpp \
|
||||
$$ANGLE_DIR/src/libGLESv2/VertexDataManager.cpp
|
||||
|
||||
SSE2_SOURCES += $$ANGLE_DIR/src/libGLESv2/TextureSSE2.cpp
|
||||
|
||||
float_converter.target = float_converter
|
||||
float_converter.commands = python $$ANGLE_DIR/src/libGLESv2/Float16ToFloat32.py \
|
||||
> $$ANGLE_DIR/src/libGLESv2/Float16ToFloat32.cpp
|
||||
|
@ -59,3 +59,83 @@ macro(expect_fail _dir)
|
||||
--build-options "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" ${BUILD_OPTIONS_LIST}
|
||||
)
|
||||
endmacro()
|
||||
|
||||
function(test_module_includes)
|
||||
|
||||
set(all_args ${ARGN})
|
||||
set(packages_string "")
|
||||
set(libraries_string "")
|
||||
|
||||
foreach(_package ${Qt5_MODULE_TEST_DEPENDS})
|
||||
set(packages_string
|
||||
"
|
||||
${packages_string}
|
||||
find_package(Qt5${_package} REQUIRED)
|
||||
"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
while(all_args)
|
||||
list(GET all_args 0 qtmodule)
|
||||
list(REMOVE_AT all_args 0 1)
|
||||
set(packages_string
|
||||
"${packages_string}
|
||||
find_package(Qt5${qtmodule} REQUIRED)
|
||||
include_directories(\${Qt5${qtmodule}_INCLUDE_DIRS})
|
||||
add_definitions(\${Qt5${qtmodule}_DEFINITIONS})\n"
|
||||
)
|
||||
set(libraries_string "${libraries_string} Qt5::${qtmodule}")
|
||||
endwhile()
|
||||
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/module_includes/CMakeLists.txt"
|
||||
"
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(module_includes)
|
||||
|
||||
${packages_string}
|
||||
|
||||
set(CMAKE_CXX_FLAGS \"\${CMAKE_CXX_FLAGS} \${Qt5Core_EXECUTABLE_COMPILE_FLAGS}\")
|
||||
|
||||
add_executable(module_includes_exe \"\${CMAKE_CURRENT_SOURCE_DIR}/main.cpp\")
|
||||
target_link_libraries(module_includes_exe ${libraries_string})\n"
|
||||
)
|
||||
|
||||
set(all_args ${ARGN})
|
||||
set(includes_string "")
|
||||
set(instances_string "")
|
||||
while(all_args)
|
||||
list(GET all_args 0 qtmodule)
|
||||
list(GET all_args 1 qtinclude)
|
||||
list(REMOVE_AT all_args 0 1)
|
||||
set(includes_string
|
||||
"${includes_string}
|
||||
#include <${qtinclude}>
|
||||
#include <Qt${qtmodule}/${qtinclude}>
|
||||
#include <Qt${qtmodule}>
|
||||
#include <Qt${qtmodule}/Qt${qtmodule}>"
|
||||
)
|
||||
set(instances_string
|
||||
"${instances_string}
|
||||
${qtinclude} local${qtinclude};
|
||||
")
|
||||
endwhile()
|
||||
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/module_includes/main.cpp"
|
||||
"
|
||||
|
||||
${includes_string}
|
||||
|
||||
int main(int, char **) { ${instances_string} return 0; }\n"
|
||||
)
|
||||
|
||||
add_test(module_includes ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/module_includes/"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/module_includes/build"
|
||||
--build-config "${CMAKE_BUILD_TYPE}"
|
||||
--build-generator ${CMAKE_GENERATOR}
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
||||
--build-project module_includes
|
||||
--build-options "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" ${BUILD_OPTIONS_LIST}
|
||||
)
|
||||
endfunction()
|
||||
|
@ -31,10 +31,10 @@
|
||||
\ingroup groups
|
||||
\brief Codec support in Qt.
|
||||
|
||||
These codecs provide facilities for conversion between Unicode and
|
||||
specific text encodings.
|
||||
These \l{Qt Core} codecs classes provide facilities for conversion between
|
||||
Unicode and specific text encodings.
|
||||
|
||||
\generatelist{related}
|
||||
\annotatedlist codecs
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -38,17 +38,28 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
#include <QRegularExpressionMatchIterator>
|
||||
|
||||
int main() {
|
||||
|
||||
{
|
||||
//! [0]
|
||||
QRegularExpression re("a pattern");
|
||||
//! [0]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [1]
|
||||
QRegularExpression re;
|
||||
re.setPattern("another pattern");
|
||||
//! [1]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [2]
|
||||
// matches two digits followed by a space and a word
|
||||
QRegularExpression re("\\d\\d \\w+");
|
||||
@ -56,27 +67,31 @@ QRegularExpression re("\\d\\d \\w+");
|
||||
// matches a backslash
|
||||
QRegularExpression re2("\\\\");
|
||||
//! [2]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [3]
|
||||
QRegularExpression re("a third pattern");
|
||||
QString pattern = re.pattern(); // pattern == "a third pattern"
|
||||
//! [3]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [4]
|
||||
// matches "Qt rocks", but also "QT rocks", "QT ROCKS", "qT rOcKs", etc.
|
||||
QRegularExpression re("Qt rocks", QRegularExpression::CaseInsensitiveOption);
|
||||
//! [4]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [5]
|
||||
QRegularExpression re("^\\d+$");
|
||||
re.setPatternOptions(QRegularExpression::MultilineOption);
|
||||
// re matches any line in the subject string that contains only digits (but at least one)
|
||||
//! [5]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [6]
|
||||
QRegularExpression re = QRegularExpression("^two.*words$", QRegularExpression::MultilineOption
|
||||
| QRegularExpression::DotMatchesEverythingOption);
|
||||
@ -84,16 +99,18 @@ QRegularExpression re = QRegularExpression("^two.*words$", QRegularExpression::M
|
||||
QRegularExpression::PatternOptions options = re.patternOptions();
|
||||
// options == QRegularExpression::MultilineOption | QRegularExpression::DotMatchesEverythingOption
|
||||
//! [6]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [7]
|
||||
// match two digits followed by a space and a word
|
||||
QRegularExpression re("\\d\\d \\w+");
|
||||
QRegularExpressionMatch match = re.match("abc123 def");
|
||||
bool hasMatch = match.hasMatch(); // true
|
||||
//! [7]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [8]
|
||||
QRegularExpression re("\\d\\d \\w+");
|
||||
QRegularExpressionMatch match = re.match("abc123 def");
|
||||
@ -102,8 +119,9 @@ if (match.hasMatch()) {
|
||||
// ...
|
||||
}
|
||||
//! [8]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [9]
|
||||
QRegularExpression re("\\d\\d \\w+");
|
||||
QRegularExpressionMatch match = re.match("12 abc 45 def", 1);
|
||||
@ -112,31 +130,34 @@ if (match.hasMatch()) {
|
||||
// ...
|
||||
}
|
||||
//! [9]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [10]
|
||||
QRegularExpression re("^(\\d\\d)/(\\d\\d)/(\\d\\d\\d\\d)$");
|
||||
QRegularExpressionMatch match = re.match("08/12/1985");
|
||||
if (match.hasMatch()) {
|
||||
QString day = re.captured(1); // day == "08"
|
||||
QString month = re.captured(2); // month == "12"
|
||||
QString year = re.captured(3); // year == "1985"
|
||||
QString day = match.captured(1); // day == "08"
|
||||
QString month = match.captured(2); // month == "12"
|
||||
QString year = match.captured(3); // year == "1985"
|
||||
// ...
|
||||
}
|
||||
//! [10]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [11]
|
||||
QRegularExpression re("abc(\\d+)def");
|
||||
QRegularExpressionMatch match = re.match("XYZabc123defXYZ");
|
||||
if (match.hasMatch()) {
|
||||
int startOffset = re.capturedStart(1); // startOffset == 6
|
||||
int endOffset = re.capturedEnd(1); // endOffset == 9
|
||||
int startOffset = match.capturedStart(1); // startOffset == 6
|
||||
int endOffset = match.capturedEnd(1); // endOffset == 9
|
||||
// ...
|
||||
}
|
||||
//! [11]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [12]
|
||||
QRegularExpression re("^(?<date>\\d\\d)/(?<month>\\d\\d)/(?<year>\\d\\d\\d\\d)$");
|
||||
QRegularExpressionMatch match = re.match("08/12/1985");
|
||||
@ -146,14 +167,14 @@ if (match.hasMatch()) {
|
||||
QString year = match.captured("year"); // year == 1985
|
||||
}
|
||||
//! [12]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [13]
|
||||
QRegularExpression re("(\\w+)");
|
||||
QRegularExpressionMatchIterator i = re.globalMatch("the quick fox");
|
||||
//! [13]
|
||||
|
||||
|
||||
//! [14]
|
||||
QStringList words;
|
||||
while (i.hasNext()) {
|
||||
@ -163,72 +184,86 @@ while (i.hasNext()) {
|
||||
}
|
||||
// words contains "the", "quick", "fox"
|
||||
//! [14]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [15]
|
||||
QString pattern("^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d\\d?, \\d\\d\\d\\d$");
|
||||
QRegularExpression re(pattern);
|
||||
|
||||
QString input("Jan 21,");
|
||||
QRegularExpressionMatch match = re.match(input, 0, QRegularExpressionMatch::PartialPreferCompleteMatch);
|
||||
QRegularExpressionMatch match = re.match(input, 0, QRegularExpression::PartialPreferCompleteMatch);
|
||||
bool hasMatch = match.hasMatch(); // false
|
||||
bool hasPartialMatch = match.hasPartialMatch(); // true
|
||||
//! [15]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
QString pattern("^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d\\d?, \\d\\d\\d\\d$");
|
||||
QRegularExpression re(pattern);
|
||||
//! [16]
|
||||
QString input("Dec 8, 1985");
|
||||
QRegularExpressionMatch match = re.match(input, 0, QRegularExpressionMatch::PartialPreferCompleteMatch);
|
||||
QRegularExpressionMatch match = re.match(input, 0, QRegularExpression::PartialPreferCompleteMatch);
|
||||
bool hasMatch = match.hasMatch(); // true
|
||||
bool hasPartialMatch = match.hasPartialMatch(); // false
|
||||
//! [16]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [17]
|
||||
QRegularExpression re("abc\\w+X|def");
|
||||
QRegularExpressionMatch match = re.match("abcdef", 0, QRegularExpressionMatch::PartialPreferCompleteMatch);
|
||||
QRegularExpressionMatch match = re.match("abcdef", 0, QRegularExpression::PartialPreferCompleteMatch);
|
||||
bool hasMatch = match.hasMatch(); // true
|
||||
bool hasPartialMatch = match.hasPartialMatch(); // false
|
||||
QString captured = match.captured(0); // captured == "def"
|
||||
//! [17]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [18]
|
||||
QRegularExpression re("abc\\w+X|defY");
|
||||
QRegularExpressionMatch match = re.match("abcdef", 0, QRegularExpressionMatch::PartialPreferCompleteMatch);
|
||||
QRegularExpressionMatch match = re.match("abcdef", 0, QRegularExpression::PartialPreferCompleteMatch);
|
||||
bool hasMatch = match.hasMatch(); // false
|
||||
bool hasPartialMatch = match.hasPartialMatch(); // true
|
||||
QString captured = match.captured(0); // captured == "abcdef"
|
||||
//! [18]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [19]
|
||||
QRegularExpression re("abc|ab");
|
||||
QRegularExpressionMatch match = re.match("ab", 0, QRegularExpressionMatch::PartialPreferFirstMatch);
|
||||
QRegularExpressionMatch match = re.match("ab", 0, QRegularExpression::PartialPreferFirstMatch);
|
||||
bool hasMatch = match.hasMatch(); // false
|
||||
bool hasPartialMatch = match.hasPartialMatch(); // true
|
||||
//! [19]
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
//! [20]
|
||||
QRegularExpression re("abc(def)?");
|
||||
QRegularExpressionMatch match = re.match("abc", 0, QRegularExpressionMatch::PartialPreferFirstMatch);
|
||||
QRegularExpressionMatch match = re.match("abc", 0, QRegularExpression::PartialPreferFirstMatch);
|
||||
bool hasMatch = match.hasMatch(); // false
|
||||
bool hasPartialMatch = match.hasPartialMatch(); // true
|
||||
//! [20]
|
||||
}
|
||||
|
||||
{
|
||||
//! [21]
|
||||
QRegularExpression re("(abc)*");
|
||||
QRegularExpressionMatch match = re.match("abc", 0, QRegularExpressionMatch::PartialPreferFirstMatch);
|
||||
QRegularExpressionMatch match = re.match("abc", 0, QRegularExpression::PartialPreferFirstMatch);
|
||||
bool hasMatch = match.hasMatch(); // false
|
||||
bool hasPartialMatch = match.hasPartialMatch(); // true
|
||||
//! [21]
|
||||
}
|
||||
|
||||
{
|
||||
//! [22]
|
||||
QRegularExpression invalidRe("(unmatched|parenthesis");
|
||||
bool isValid = invalidRe.isValid(); // false
|
||||
//! [22]
|
||||
}
|
||||
|
||||
{
|
||||
//! [23]
|
||||
QRegularExpression invalidRe("(unmatched|parenthesis");
|
||||
if (!invalidRe.isValid()) {
|
||||
@ -237,44 +272,62 @@ if (!invalidRe.isValid()) {
|
||||
// ...
|
||||
}
|
||||
//! [23]
|
||||
}
|
||||
|
||||
{
|
||||
//! [24]
|
||||
QRegularExpression re("^this pattern must match exactly$");
|
||||
//! [24]
|
||||
}
|
||||
|
||||
{
|
||||
//! [25]
|
||||
QString p("a .*|pattern");
|
||||
QRegularExpression re("\\A(?:" + p + ")\\z"); // re matches exactly the pattern string p
|
||||
//! [25]
|
||||
}
|
||||
|
||||
{
|
||||
//! [26]
|
||||
QString escaped = QRegularExpression::escape("a(x) = f(x) + g(x)");
|
||||
// escaped == "a\\(x\\)\\ \\=\\ f\\(x\\)\\ \\+\\ g\\(x\\)"
|
||||
//! [26]
|
||||
}
|
||||
|
||||
{
|
||||
QString name;
|
||||
QString nickname;
|
||||
//! [27]
|
||||
QString pattern = "(" + QRegularExpression::escape(name) +
|
||||
"|" + QRegularExpression::escape(nickname) + ")";
|
||||
QRegularExpression re(pattern);
|
||||
//! [27]
|
||||
}
|
||||
|
||||
{
|
||||
QString string;
|
||||
QRegularExpression re;
|
||||
//! [28]
|
||||
QRegularExpressionMatch match = re.match(...);
|
||||
QRegularExpressionMatch match = re.match(string);
|
||||
for (int i = 0; i <= match.lastCapturedIndex(); ++i) {
|
||||
QString captured = match.captured(i);
|
||||
// ...
|
||||
}
|
||||
//! [28]
|
||||
}
|
||||
|
||||
{
|
||||
//! [29]
|
||||
QRegularExpression("(\\d\\d) (?<name>\\w+)");
|
||||
QRegularExpression re("(\\d\\d) (?<name>\\w+)");
|
||||
QRegularExpressionMatch match = re.match("23 Jordan");
|
||||
if (match.hasMatch()) {
|
||||
QString number = match.captured(1); // first == "23"
|
||||
QString name = match.captured("name"); // name == "Jordan"
|
||||
}
|
||||
//! [29]
|
||||
}
|
||||
|
||||
{
|
||||
//! [30]
|
||||
// extracts the words
|
||||
QRegularExpression re("(\\w+)");
|
||||
@ -285,5 +338,6 @@ while (i.hasNext()) {
|
||||
// ...
|
||||
}
|
||||
//! [30]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
//! [2]
|
||||
QStringList arguments;
|
||||
arguments << "-style" << "motif";
|
||||
arguments << "-style" << "fusion";
|
||||
|
||||
QProcess *myProcess = new QProcess(parent);
|
||||
myProcess->start(program, arguments);
|
||||
|
@ -28,6 +28,11 @@
|
||||
/*!
|
||||
\group animation
|
||||
\title Animation Framework
|
||||
|
||||
This page lists classes belonging to \l{Qt Core}'s
|
||||
\l{The Animation Framework}{animation framework}.
|
||||
|
||||
\annotatedlist animation
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -102,7 +107,7 @@
|
||||
the framework, please look up their class descriptions.
|
||||
|
||||
\section1 Classes in the Animation Framework
|
||||
|
||||
|
||||
These classes provide a framework for creating both simple and complex
|
||||
animations.
|
||||
|
||||
@ -361,4 +366,3 @@
|
||||
framework for animations, see the states example (it lives in the
|
||||
\c{examples/animation/states} directory).
|
||||
*/
|
||||
|
||||
|
@ -25,22 +25,6 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\group tools
|
||||
\title Non-GUI Classes
|
||||
\ingroup groups
|
||||
|
||||
\brief Collection classes such as list, queue, stack and string, along
|
||||
with other classes that can be used without needing QApplication.
|
||||
|
||||
The non-GUI classes are general-purpose collection and string classes
|
||||
that may be used independently of the GUI classes.
|
||||
|
||||
In particular, these classes do not depend on QApplication at all,
|
||||
and so can be used in non-GUI programs.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page containers.html
|
||||
\title Container Classes
|
||||
@ -394,13 +378,13 @@
|
||||
QMapIterator, which is somewhat different because it iterates on
|
||||
(key, value) pairs.
|
||||
|
||||
Like QListIterator, QMapIterator provides
|
||||
\l{QMapIterator::toFront()}{toFront()},
|
||||
\l{QMapIterator::toBack()}{toBack()},
|
||||
\l{QMapIterator::hasNext()}{hasNext()},
|
||||
\l{QMapIterator::next()}{next()},
|
||||
\l{QMapIterator::peekNext()}{peekNext()},
|
||||
\l{QMapIterator::hasPrevious()}{hasPrevious()},
|
||||
Like QListIterator, QMapIterator provides
|
||||
\l{QMapIterator::toFront()}{toFront()},
|
||||
\l{QMapIterator::toBack()}{toBack()},
|
||||
\l{QMapIterator::hasNext()}{hasNext()},
|
||||
\l{QMapIterator::next()}{next()},
|
||||
\l{QMapIterator::peekNext()}{peekNext()},
|
||||
\l{QMapIterator::hasPrevious()}{hasPrevious()},
|
||||
\l{QMapIterator::previous()}{previous()}, and
|
||||
\l{QMapIterator::peekPrevious()}{peekPrevious()}. The key and
|
||||
value components are extracted by calling key() and value() on
|
||||
|
@ -33,7 +33,7 @@
|
||||
The \l QDataStream allows you to serialize some of the Qt data types.
|
||||
The table below lists the data types that QDataStream can serialize
|
||||
and how they are represented. The format described below is
|
||||
\l{QDataStream::setVersion()}{version 12}.
|
||||
\l{QDataStream::setVersion()}{version 13}.
|
||||
|
||||
It is always best to cast integers to a Qt integer type, such as
|
||||
qint16 or quint32, when reading and writing. This ensures that
|
||||
@ -129,7 +129,7 @@
|
||||
\li \list
|
||||
\li Date (QDate)
|
||||
\li Time (QTime)
|
||||
\li 0 for Qt::LocalTime, 1 for Qt::UTC (quint8)
|
||||
\li The \l{Qt::TimeSpec}{time spec} (quint8)
|
||||
\endlist
|
||||
\row \li QEasingCurve
|
||||
\li \list
|
||||
|
@ -32,10 +32,11 @@
|
||||
|
||||
\brief Classes used to create and handle events.
|
||||
|
||||
These classes are used to create and handle events.
|
||||
These \l{Qt Core} classes are used to create and handle events.
|
||||
|
||||
For more information see the \link object.html Object model\endlink
|
||||
and \link signalsandslots.html Signals and Slots\endlink.
|
||||
For more information see the \l{The Event System}{Event System} page.
|
||||
|
||||
\annotatedlist events
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -31,6 +31,12 @@
|
||||
/*!
|
||||
\group shared
|
||||
\title Implicitly Shared Classes
|
||||
|
||||
These \l{Qt Core} classes provides a safe and efficient way of sharing and
|
||||
manipulating data by \l{Implicit Sharing}{implicitly sharing} data.
|
||||
|
||||
\annotatedlist shared
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -33,7 +33,9 @@
|
||||
\brief Classes providing file input and output along with directory and
|
||||
network handling.
|
||||
|
||||
These classes are used to handle input and output to and from external
|
||||
devices, processes, files etc. as well as manipulating files and directories.
|
||||
*/
|
||||
These \l{Qt Core} classes are used to handle input and output to and from
|
||||
external devices, processes, files etc. as well as manipulating files and
|
||||
directories.
|
||||
|
||||
\annotatedlist io
|
||||
*/
|
||||
|
@ -108,5 +108,6 @@
|
||||
|
||||
\annotatedlist json
|
||||
|
||||
All JSON classes are value based, implicitly shared classes.
|
||||
All JSON classes are value based,
|
||||
\l{Implicit Sharing}{implicitly shared classes}.
|
||||
*/
|
||||
|
@ -32,12 +32,14 @@
|
||||
|
||||
\brief Plugin related classes.
|
||||
|
||||
These classes deal with shared libraries, (e.g. .so and DLL files),
|
||||
and with Qt plugins.
|
||||
These \l{Qt Core} classes deal with shared libraries, (e.g. .so and DLL
|
||||
files), and with Qt plugins.
|
||||
|
||||
See the \link plugins-howto.html plugins documentation\endlink.
|
||||
See the \l{How to Create Qt Plugins} page for more information..
|
||||
|
||||
See also the \l{ActiveQt framework} for Windows.
|
||||
|
||||
\annotatedlist plugins
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
119
src/corelib/doc/src/qtcore-index.qdoc
Normal file
119
src/corelib/doc/src/qtcore-index.qdoc
Normal file
@ -0,0 +1,119 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** 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 Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/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$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\page qtcore-index.html
|
||||
\title Qt Core
|
||||
|
||||
\brief The Qt Core module is part of Qt's essential modules.
|
||||
|
||||
\section1 Getting Started
|
||||
All other Qt modules rely on this module. To include the
|
||||
definitions of the module's classes, use the following directive:
|
||||
|
||||
\snippet code/doc_src_qtcore.cpp 0
|
||||
|
||||
\section1 Core Functionalities
|
||||
|
||||
Qt adds these features to C++:
|
||||
|
||||
\list
|
||||
\li a very powerful mechanism for seamless object communication called
|
||||
signals and slots
|
||||
\li queryable and designable object properties
|
||||
\li hierarchical and queryable object trees that organize
|
||||
\li object ownership in a natural way with guarded pointers (QPointer)
|
||||
\li a dynamic cast that works across library boundaries
|
||||
\endlist
|
||||
|
||||
The following pages provide more information about Qt's core features:
|
||||
\list
|
||||
\li \l{The Meta-Object System}
|
||||
\li \l{The Property System}
|
||||
\li \l{Object Model}
|
||||
\li \l{Object Trees & Ownership}
|
||||
\li \l{Signals & Slots}
|
||||
\endlist
|
||||
|
||||
\section1 Threading and Concurrent Programming
|
||||
|
||||
Qt provides thread support in the form of platform-independent \l{Threading
|
||||
Classes}{threading classes}, a thread-safe way of posting events, and
|
||||
signal-slot connections across threads. Multithreaded programming is also a
|
||||
useful paradigm for performing time-consuming operations without freezing
|
||||
the user interface of an application.
|
||||
|
||||
The \l{Thread Support in Qt} page contains information on implementing
|
||||
threads in applications. Additional concurrent classes are provided by the
|
||||
\l{Qt Concurrent} module.
|
||||
|
||||
\section1 Input/Output, Resources, and Containers
|
||||
|
||||
Qt provides a resource system for organizing application files and assets,
|
||||
a set of containers, and classes for receiving input and printing output.
|
||||
\list
|
||||
\li \l{Container Classes}
|
||||
\li \l{Serializing Qt Data Types}
|
||||
\li \l{Implicit Sharing}
|
||||
\endlist
|
||||
|
||||
In addition, Qt Core provides a platform-independent mechanism for storing
|
||||
binary files in the application's executable.
|
||||
|
||||
\list
|
||||
\li \l{The Qt Resource System}
|
||||
\endlist
|
||||
|
||||
\section1 Additional Frameworks
|
||||
Qt Core also provides some of Qt's key frameworks.
|
||||
|
||||
\list
|
||||
\li \l{The Animation Framework}
|
||||
\li \l{JSON Support in Qt}
|
||||
\li \l{The State Machine Framework}
|
||||
\li \l{How to Create Qt Plugins}
|
||||
\li \l{The Event System}
|
||||
\endlist
|
||||
|
||||
\section1 Related Information
|
||||
\section1 Reference
|
||||
These are links to the API reference materials.
|
||||
\list
|
||||
\li \l{Qt Core C++ Classes}{C++ classes}
|
||||
\list
|
||||
\li \l{Animation Framework}{Animation Classes}
|
||||
\li \l{Threading Classes}
|
||||
\li \l{Container Classes}
|
||||
\li \l{Plugin Classes}
|
||||
\li \l{Implicitly Shared Classes}
|
||||
\li \l{State Machine Classes}
|
||||
\li \l{Input/Output and Networking}{Input/Output Classes}
|
||||
\li \l{Event Classes}
|
||||
\endlist
|
||||
\endlist
|
||||
|
||||
*/
|
@ -27,16 +27,13 @@
|
||||
|
||||
/*!
|
||||
\module QtCore
|
||||
\title QtCore Module
|
||||
\title Qt Core C++ Classes
|
||||
\ingroup modules
|
||||
|
||||
\keyword QtCore
|
||||
|
||||
\brief The QtCore module contains core non-GUI functionality.
|
||||
\brief Provides core non-GUI functionality.
|
||||
|
||||
All other Qt modules rely on this module. To include the
|
||||
definitions of the module's classes, use the following directive:
|
||||
|
||||
\snippet code/doc_src_qtcore.cpp 0
|
||||
*/
|
||||
|
||||
|
@ -28,6 +28,11 @@
|
||||
/*!
|
||||
\group statemachine
|
||||
\title State Machine Classes
|
||||
|
||||
These \l{Qt Core} classes are part of the \l{The State Machine Framework}{
|
||||
State Machine Framework}.
|
||||
|
||||
\annotatedlist statemachine
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -69,7 +74,7 @@
|
||||
\section1 Classes in the State Machine Framework
|
||||
|
||||
These classes are provided by qt for creating event-driven state machines.
|
||||
|
||||
|
||||
\annotatedlist statemachine
|
||||
|
||||
\section1 A Simple State Machine
|
||||
|
@ -28,6 +28,10 @@
|
||||
/*!
|
||||
\group thread
|
||||
\title Threading Classes
|
||||
|
||||
These \l{Qt Core} classes provide threading support to applications.
|
||||
The \l{Thread Support in Qt} page covers how to use these classes.
|
||||
\annotatedlist thread
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -111,13 +115,13 @@
|
||||
/*!
|
||||
\page threads-starting.html
|
||||
\title Starting Threads with QThread
|
||||
|
||||
|
||||
\contentspage Thread Support in Qt
|
||||
\nextpage Synchronizing Threads
|
||||
|
||||
A QThread instance represents a thread and provides the means to
|
||||
\l{QThread::start()}{start()} a thread, which will then execute the
|
||||
reimplementation of QThread::run(). The \c run() implementation is for a
|
||||
reimplementation of QThread::run(). The \c run() implementation is for a
|
||||
thread what the \c main() entry point is for the application. All code
|
||||
executed in a call stack that starts in the \c run() function is executed
|
||||
by the new thread, and the thread finishes when the function returns.
|
||||
@ -141,12 +145,12 @@
|
||||
Then, create an instance of the thread object and call
|
||||
QThread::start(). Note that you must create the QApplication (or
|
||||
QCoreApplication) object before you can create a QThread.
|
||||
|
||||
The function will return immediately and the
|
||||
|
||||
The function will return immediately and the
|
||||
main thread will continue. The code that appears in the
|
||||
\l{QThread::run()}{run()} reimplementation will then be executed
|
||||
in a separate thread.
|
||||
|
||||
|
||||
Creating threads is explained in more detail in the QThread
|
||||
documentation.
|
||||
|
||||
@ -160,7 +164,7 @@
|
||||
/*!
|
||||
\page threads-synchronizing.html
|
||||
\title Synchronizing Threads
|
||||
|
||||
|
||||
\previouspage Starting Threads with QThread
|
||||
\contentspage Thread Support in Qt
|
||||
\nextpage Reentrancy and Thread-Safety
|
||||
@ -227,7 +231,7 @@
|
||||
|
||||
\list
|
||||
\li A \e thread-safe function can be called simultaneously from
|
||||
multiple threads, even when the invocations use shared data,
|
||||
multiple threads, even when the invocations use shared data,
|
||||
because all references to the shared data are serialized.
|
||||
\li A \e reentrant function can also be called simultaneously from
|
||||
multiple threads, but only if each invocation uses its own data.
|
||||
@ -577,8 +581,8 @@
|
||||
|
||||
\endlist
|
||||
|
||||
Qt Concurrent supports several STL-compatible container and iterator types,
|
||||
but works best with Qt containers that have random-access iterators, such as
|
||||
Qt Concurrent supports several STL-compatible container and iterator types,
|
||||
but works best with Qt containers that have random-access iterators, such as
|
||||
QList or QVector. The map and filter functions accept both containers and begin/end iterators.
|
||||
|
||||
STL Iterator support overview:
|
||||
@ -609,14 +613,14 @@
|
||||
\li QList, QVector, std::vector
|
||||
\li Supported and Recommended
|
||||
\endtable
|
||||
|
||||
|
||||
Random access iterators can be faster in cases where Qt Concurrent is iterating
|
||||
over a large number of lightweight items, since they allow skipping to any point
|
||||
in the container. In addition, using random access iterators allows Qt Concurrent
|
||||
to provide progress information trough QFuture::progressValue() and QFutureWatcher::
|
||||
progressValueChanged().
|
||||
|
||||
The non in-place modifying functions such as mapped() and filtered() makes a
|
||||
The non in-place modifying functions such as mapped() and filtered() makes a
|
||||
copy of the container when called. If you are using STL containers this copy operation
|
||||
might take some time, in this case we recommend specifying the begin and end iterators
|
||||
for the container instead.
|
||||
@ -643,7 +647,7 @@
|
||||
|
||||
QPainter can be used in a thread to paint onto QImage, QPrinter, and
|
||||
QPicture paint devices. Painting onto QPixmaps and QWidgets is \e not
|
||||
supported. On Mac OS X the automatic progress dialog will not be
|
||||
supported. On Mac OS X the automatic progress dialog will not be
|
||||
displayed if you are printing from outside the GUI thread.
|
||||
|
||||
Any number of threads can paint at any given time, however only
|
||||
|
@ -326,11 +326,6 @@
|
||||
#define QT_NO_SOCKS5
|
||||
#endif
|
||||
|
||||
// QSoftKeyManager
|
||||
#if !defined(QT_NO_SOFTKEYMANAGER) && (defined(QT_NO_ACTION))
|
||||
#define QT_NO_SOFTKEYMANAGER
|
||||
#endif
|
||||
|
||||
// QSplitter
|
||||
#if !defined(QT_NO_SPLITTER) && (defined(QT_NO_RUBBERBAND))
|
||||
#define QT_NO_SPLITTER
|
||||
|
@ -63,13 +63,6 @@ Requires:
|
||||
Name: QAction
|
||||
SeeAlso: ???
|
||||
|
||||
Feature: SOFTKEYMANAGER
|
||||
Description: Supports softkeys.
|
||||
Section: Gui
|
||||
Requires: ACTION
|
||||
Name: QSoftKeyManager
|
||||
SeeAlso: ???
|
||||
|
||||
Feature: CURSOR
|
||||
Description: Supports mouse cursors.
|
||||
Section: Kernel
|
||||
|
@ -276,6 +276,8 @@ static const struct {
|
||||
{ "HostPrefix", "" },
|
||||
{ "HostBinaries", "bin" },
|
||||
{ "HostData", "." },
|
||||
{ "TargetSpec", "" },
|
||||
{ "HostSpec", "" },
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -378,6 +380,12 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
|
||||
#endif // QT_NO_SETTINGS
|
||||
}
|
||||
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
// The specs need to be returned verbatim.
|
||||
if (loc == TargetSpecPath || loc == HostSpecPath)
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
if (!ret.isEmpty() && QDir::isRelativePath(ret)) {
|
||||
QString baseDir;
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
|
@ -81,7 +81,9 @@ public:
|
||||
HostPrefixPath,
|
||||
HostBinariesPath,
|
||||
HostDataPath,
|
||||
LastHostPath = HostDataPath,
|
||||
TargetSpecPath,
|
||||
HostSpecPath,
|
||||
LastHostPath = HostSpecPath,
|
||||
#endif
|
||||
SettingsPath = 100
|
||||
};
|
||||
|
@ -311,8 +311,6 @@ public:
|
||||
BypassGraphicsProxyWidget = 0x20000000,
|
||||
WindowOkButtonHint = 0x00080000,
|
||||
WindowCancelButtonHint = 0x00100000,
|
||||
WindowSoftkeysVisibleHint = 0x40000000,
|
||||
WindowSoftkeysRespondHint = 0x80000000,
|
||||
NoDropShadowWindowHint = 0x40000000
|
||||
};
|
||||
|
||||
@ -470,9 +468,6 @@ public:
|
||||
WA_WState_AcceptedTouchBeginEvent = 122,
|
||||
WA_TouchPadAcceptSingleTouchEvents = 123,
|
||||
|
||||
WA_MergeSoftkeys = 124,
|
||||
WA_MergeSoftkeysRecursively = 125,
|
||||
|
||||
WA_X11DoNotAcceptFocus = 126,
|
||||
WA_MacNoShadow = 127,
|
||||
|
||||
|
@ -1160,17 +1160,6 @@
|
||||
\value WA_TouchPadAcceptSingleTouchEvents Allows touchpad single
|
||||
touch events to be sent to the widget.
|
||||
|
||||
\value WA_MergeSoftkeys Allows widget to merge softkeys with parent widget,
|
||||
i.e. widget can set only one softkeys and request softkey implementation
|
||||
to take rest of the softkeys from the parent. Note parents are traversed until
|
||||
WA_MergeSoftkeys is not set. See also Qt::WA_MergeSoftkeysRecursively
|
||||
This attribute currently has effect only on Symbian platforms
|
||||
|
||||
\value WA_MergeSoftkeysRecursively Allows widget to merge softkeys recursively
|
||||
with all parents. If this attribute is set, the widget parents are traversed until
|
||||
window boundary (widget without parent or dialog) is found.
|
||||
This attribute currently has effect only on Symbian platforms
|
||||
|
||||
\value WA_X11DoNotAcceptFocus Asks the window manager to not give focus
|
||||
to this top level window. This attribute has no effect on non-X11
|
||||
platforms.
|
||||
@ -2031,14 +2020,6 @@
|
||||
\value WindowCancelButtonHint Adds a Cancel button to the window decoration of a dialog.
|
||||
Only supported for Windows CE.
|
||||
|
||||
\value WindowSoftkeysVisibleHint Makes softkeys visible when widget is fullscreen.
|
||||
Only supported for Symbian.
|
||||
|
||||
\value WindowSoftkeysRespondHint Makes softkeys to receive key events even
|
||||
when invisible. With this hint the softkey actions are triggered
|
||||
even the softkeys are invisible i.e. the window is displayed with
|
||||
\c showFullscreen(). Only supported for Symbian.
|
||||
|
||||
\value WindowTransparentForInput Informs the window system that this window
|
||||
is used only for output (displaying something) and does not take input.
|
||||
Therefore input events should pass through as if it wasn't there.
|
||||
|
@ -46,17 +46,17 @@
|
||||
// Borland's windows.h does not set these correctly, resulting in
|
||||
// unusable WinSDK standard dialogs
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x400
|
||||
# define WINVER 0x0501
|
||||
#endif
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x400
|
||||
# define _WIN32_WINNT 0x0501
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(Q_CC_MINGW)
|
||||
// mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x500
|
||||
# define WINVER 0x501
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -65,6 +65,13 @@
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
#if defined(_WIN32_IE) && _WIN32_IE < 0x0501
|
||||
# undef _WIN32_IE
|
||||
#endif
|
||||
#if !defined(_WIN32_IE)
|
||||
# define _WIN32_IE 0x0501
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#include <ceconfig.h>
|
||||
#endif
|
||||
|
@ -118,15 +118,13 @@ win32 {
|
||||
} else {
|
||||
SOURCES += io/qstandardpaths_unix.cpp
|
||||
}
|
||||
} else:standardpathsjson {
|
||||
SOURCES += io/qstandardpaths_json.cpp
|
||||
} else:blackberry {
|
||||
SOURCES += io/qstandardpaths_blackberry.cpp
|
||||
} else {
|
||||
SOURCES += io/qstandardpaths_unix.cpp
|
||||
}
|
||||
|
||||
linux-* {
|
||||
linux-*|if(qnx:contains(QT_CONFIG, inotify)) {
|
||||
SOURCES += io/qfilesystemwatcher_inotify.cpp
|
||||
HEADERS += io/qfilesystemwatcher_inotify_p.h
|
||||
}
|
||||
|
@ -300,6 +300,13 @@ void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry)
|
||||
const struct dirent_extra_stat * const extra_stat =
|
||||
reinterpret_cast<struct dirent_extra_stat *>(extra);
|
||||
|
||||
// Remember whether this was a link or not, this saves an lstat() call later.
|
||||
if (extra->d_type == _DTYPE_LSTAT) {
|
||||
knownFlagsMask |= QFileSystemMetaData::LinkType;
|
||||
if (S_ISLNK(extra_stat->d_stat.st_mode))
|
||||
entryFlags |= QFileSystemMetaData::LinkType;
|
||||
}
|
||||
|
||||
// For symlinks, the extra type _DTYPE_LSTAT doesn't work for filling out the meta data,
|
||||
// as we need the stat() information there, not the lstat() information.
|
||||
// In this case, don't use the extra information.
|
||||
|
@ -51,11 +51,14 @@
|
||||
#include <qset.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#if defined(Q_OS_LINUX) || (defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY))
|
||||
#define USE_INOTIFY
|
||||
#endif
|
||||
|
||||
#include "qfilesystemwatcher_polling_p.h"
|
||||
#if defined(Q_OS_WIN)
|
||||
# include "qfilesystemwatcher_win_p.h"
|
||||
#elif defined(Q_OS_LINUX)
|
||||
#elif defined(USE_INOTIFY)
|
||||
# include "qfilesystemwatcher_inotify_p.h"
|
||||
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
|
||||
# include "qfilesystemwatcher_kqueue_p.h"
|
||||
@ -67,7 +70,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(QObject
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
return new QWindowsFileSystemWatcherEngine(parent);
|
||||
#elif defined(Q_OS_LINUX)
|
||||
#elif defined(USE_INOTIFY)
|
||||
// there is a chance that inotify may fail on Linux pre-2.6.13 (August
|
||||
// 2005), so we can't just new inotify directly.
|
||||
return QInotifyFileSystemWatcherEngine::create(parent);
|
||||
|
@ -52,12 +52,20 @@
|
||||
#include <qsocketnotifier.h>
|
||||
#include <qvarlengtharray.h>
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if defined(QT_NO_INOTIFY)
|
||||
|
||||
#if defined(Q_OS_QNX)
|
||||
// These files should only be compiled on QNX if the inotify headers are found
|
||||
#error "Should not get here."
|
||||
#endif
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#if defined(__i386__)
|
||||
|
@ -458,8 +458,8 @@ void QProcessPrivate::Channel::clear()
|
||||
are supplied as individual strings in a QStringList.
|
||||
|
||||
For example, the following code snippet runs the analog clock
|
||||
example in the Motif style on X11 platforms by passing strings
|
||||
containing "-style" and "motif" as two items in the list of
|
||||
example in the Fusion style on X11 platforms by passing strings
|
||||
containing "-style" and "fusion" as two items in the list of
|
||||
arguments:
|
||||
|
||||
\snippet qprocess/qprocess-simpleexecution.cpp 0
|
||||
|
@ -272,7 +272,7 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
|
||||
searchPaths.reserve(rawPaths.size());
|
||||
foreach (const QString &rawPath, rawPaths) {
|
||||
QString cleanPath = QDir::cleanPath(rawPath);
|
||||
if (cleanPath.size() > 1 && cleanPath.endsWith('/'))
|
||||
if (cleanPath.size() > 1 && cleanPath.endsWith(QLatin1Char('/')))
|
||||
cleanPath.truncate(cleanPath.size() - 1);
|
||||
searchPaths.push_back(cleanPath);
|
||||
}
|
||||
|
@ -1,258 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** 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 Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#include "qstandardpaths.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QJsonArray>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QAtomicPointer>
|
||||
#include <QCoreApplication>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatchIterator>
|
||||
#include <QRegularExpressionMatch>
|
||||
|
||||
#ifndef QT_NO_STANDARDPATHS
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QStandardPathsPrivate {
|
||||
public:
|
||||
QStandardPathsPrivate() : object(0){}
|
||||
~QStandardPathsPrivate() { delete object.load(); }
|
||||
QAtomicPointer<QJsonObject> object;
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(QStandardPathsPrivate, configCache);
|
||||
|
||||
/*!
|
||||
\internal
|
||||
Substitute environment variables in the form ${name}
|
||||
|
||||
The JSON QStandardPaths implementation can be configured on a per user
|
||||
(or per application) basis through the use of environment variables,
|
||||
which are evaluated each time a location is queried. This function
|
||||
performs that evaluation on \a value. No substitution is performed
|
||||
for undefined variables.
|
||||
|
||||
This slightly underselects according to the 2009-09-20 version of
|
||||
the GNU setenv(3) manual page: It disallows '}' within the variable
|
||||
name. ${var}} will look for a variable named "var", not "var}".
|
||||
*/
|
||||
static QString substituteEnvVars(const QJsonValue & value)
|
||||
{
|
||||
QString str = value.toString();
|
||||
if (str.isEmpty() || !str.contains(QLatin1String("${")))
|
||||
return str;
|
||||
|
||||
// optimize for a common case
|
||||
str.replace(QLatin1String("${HOME}"), QDir::homePath());
|
||||
|
||||
// Do ${} format environment variable substitution if necessary
|
||||
// repeat this test because ${HOME} might expand to the empty string
|
||||
if (!str.isEmpty() && str.contains(QLatin1String("${"))) {
|
||||
QRegularExpression varRegExp(QLatin1String("\\$\\{([^\\}=]*)\\}"));
|
||||
QRegularExpressionMatchIterator matchIterator =
|
||||
varRegExp.globalMatch(str);
|
||||
while (matchIterator.hasNext()) {
|
||||
QRegularExpressionMatch match = matchIterator.next();
|
||||
QByteArray envValue =
|
||||
qgetenv(match.captured(1).toLatin1().data());
|
||||
if (!envValue.isNull()) {
|
||||
QString replacement =
|
||||
QFile::decodeName(envValue);
|
||||
str.replace(match.captured(0), replacement);
|
||||
}
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
static void appendOrganizationAndApp(QString &path)
|
||||
{
|
||||
const QString org = QCoreApplication::organizationName();
|
||||
if (!org.isEmpty())
|
||||
path += QLatin1Char('/') + org;
|
||||
const QString appName = QCoreApplication::applicationName();
|
||||
if (!appName.isEmpty())
|
||||
path += QLatin1Char('/') + appName;
|
||||
}
|
||||
|
||||
QString QStandardPaths::writableLocation(StandardLocation type)
|
||||
{
|
||||
QStringList locations = QStandardPaths::standardLocations(type);
|
||||
if (locations.isEmpty())
|
||||
return QString();
|
||||
return locations.first();
|
||||
}
|
||||
|
||||
QStringList QStandardPaths::standardLocations(StandardLocation type)
|
||||
{
|
||||
switch (type) {
|
||||
case HomeLocation:
|
||||
return QStringList(QDir::homePath()); // set $HOME
|
||||
case TempLocation:
|
||||
return QStringList(QDir::tempPath()); // set $TMPDIR
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (isTestModeEnabled()) {
|
||||
const QString qttestDir = QDir::homePath() + QLatin1String("/.qttest");
|
||||
QString path;
|
||||
switch (type) {
|
||||
case GenericDataLocation:
|
||||
case DataLocation:
|
||||
path = qttestDir + QLatin1String("/share");
|
||||
if (type == DataLocation)
|
||||
appendOrganizationAndApp(path);
|
||||
return QStringList(path);
|
||||
case GenericCacheLocation:
|
||||
case CacheLocation:
|
||||
path = qttestDir + QLatin1String("/cache");
|
||||
if (type == CacheLocation)
|
||||
appendOrganizationAndApp(path);
|
||||
return QStringList(path);
|
||||
case ConfigLocation:
|
||||
return QStringList(qttestDir + QLatin1String("/config"));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QJsonObject * localConfigObject = configCache()->object.loadAcquire();
|
||||
if (localConfigObject == 0) {
|
||||
QString configHome = QFile::decodeName(qgetenv("PATH_CONFIG_HOME"));
|
||||
if (configHome.isEmpty())
|
||||
configHome = QLatin1String("/etc/user-dirs.json");
|
||||
QFile file(configHome);
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
QJsonDocument configDoc = QJsonDocument::fromJson(file.readAll());
|
||||
if (configDoc.isNull())
|
||||
return QStringList();
|
||||
|
||||
QJsonObject myConfigObject = configDoc.object();
|
||||
localConfigObject = new QJsonObject(myConfigObject);
|
||||
if (!configCache()->object.testAndSetRelease(0, localConfigObject)) {
|
||||
delete localConfigObject;
|
||||
localConfigObject = configCache()->object.loadAcquire();
|
||||
}
|
||||
} else {
|
||||
return QStringList();
|
||||
}
|
||||
}
|
||||
|
||||
QLatin1String key("");
|
||||
|
||||
switch (type) {
|
||||
case DocumentsLocation:
|
||||
key = QLatin1String("DOCUMENTS");
|
||||
break;
|
||||
case PicturesLocation:
|
||||
key = QLatin1String("PICTURES");
|
||||
break;
|
||||
case MusicLocation:
|
||||
key = QLatin1String("MUSIC");
|
||||
break;
|
||||
case MoviesLocation:
|
||||
key = QLatin1String("VIDEOS");
|
||||
break;
|
||||
case DownloadLocation:
|
||||
key = QLatin1String("DOWNLOAD");
|
||||
break;
|
||||
case ApplicationsLocation:
|
||||
key = QLatin1String("APPLICATIONS");
|
||||
break;
|
||||
case CacheLocation:
|
||||
key = QLatin1String("CACHE");
|
||||
break;
|
||||
case GenericCacheLocation:
|
||||
key = QLatin1String("GENERIC_CACHE");
|
||||
break;
|
||||
case DataLocation:
|
||||
key = QLatin1String("DATA");
|
||||
break;
|
||||
case GenericDataLocation:
|
||||
key = QLatin1String("GENERIC_DATA");
|
||||
break;
|
||||
case ConfigLocation:
|
||||
key = QLatin1String("CONFIG");
|
||||
break;
|
||||
case RuntimeLocation:
|
||||
key = QLatin1String("RUNTIME");
|
||||
break;
|
||||
case DesktopLocation:
|
||||
key = QLatin1String("DESKTOP");
|
||||
break;
|
||||
case FontsLocation:
|
||||
key = QLatin1String("FONTS");
|
||||
break;
|
||||
|
||||
default:
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QJsonObject::const_iterator iter = localConfigObject->constFind(key);
|
||||
if (iter == localConfigObject->constEnd())
|
||||
return QStringList();
|
||||
|
||||
switch (iter.value().type()) {
|
||||
case QJsonValue::Array: {
|
||||
QStringList resultList;
|
||||
foreach (const QJsonValue &item, iter.value().toArray())
|
||||
resultList.append(substituteEnvVars(item));
|
||||
return resultList;
|
||||
}
|
||||
case QJsonValue::String:
|
||||
return QStringList(substituteEnvVars(iter.value()));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_STANDARDPATHS
|
@ -213,7 +213,8 @@ void QWindowsPipeReader::startAsyncRead()
|
||||
// We get notified by the QWinOverlappedIoNotifier - even in the synchronous case.
|
||||
return;
|
||||
} else {
|
||||
switch (GetLastError()) {
|
||||
const DWORD dwError = GetLastError();
|
||||
switch (dwError) {
|
||||
case ERROR_IO_PENDING:
|
||||
// This is not an error. We're getting notified, when data arrives.
|
||||
return;
|
||||
@ -223,16 +224,19 @@ void QWindowsPipeReader::startAsyncRead()
|
||||
// didn't fit into the pipe's system buffer.
|
||||
// We're getting notified by the QWinOverlappedIoNotifier.
|
||||
break;
|
||||
case ERROR_BROKEN_PIPE:
|
||||
case ERROR_PIPE_NOT_CONNECTED:
|
||||
{
|
||||
// It may happen, that the other side closes the connection directly
|
||||
// after writing data. Then we must set the appropriate socket state.
|
||||
readSequenceStarted = false;
|
||||
pipeBroken = true;
|
||||
emit pipeClosed();
|
||||
return;
|
||||
}
|
||||
default:
|
||||
emit winError(GetLastError(), QLatin1String("QWindowsPipeReader::startAsyncRead"));
|
||||
readSequenceStarted = false;
|
||||
emit winError(dwError, QLatin1String("QWindowsPipeReader::startAsyncRead"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
void itemsAboutToBeMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation);
|
||||
void itemsMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
|
||||
bool allowMove(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
|
||||
|
||||
|
||||
inline QModelIndex createIndex(int row, int column, void *data = 0) const {
|
||||
return q_func()->createIndex(row, column, data);
|
||||
}
|
||||
|
@ -577,8 +577,12 @@ void QCoreApplication::flush()
|
||||
\a argc must be greater than zero and \a argv must contain at least
|
||||
one valid character string.
|
||||
*/
|
||||
QCoreApplication::QCoreApplication(int &argc, char **argv, int _internal)
|
||||
: QObject(*new QCoreApplicationPrivate(argc, argv, _internal))
|
||||
QCoreApplication::QCoreApplication(int &argc, char **argv
|
||||
#ifndef Q_QDOC
|
||||
, int _internal
|
||||
#endif
|
||||
)
|
||||
: QObject(*new QCoreApplicationPrivate(argc, argv, _internal))
|
||||
{
|
||||
init();
|
||||
QCoreApplicationPrivate::eventDispatcher->startingUp();
|
||||
@ -698,7 +702,17 @@ bool QCoreApplication::testAttribute(Qt::ApplicationAttribute attribute)
|
||||
return QCoreApplicationPrivate::testAttribute(attribute);
|
||||
}
|
||||
|
||||
/*!/
|
||||
|
||||
/*!
|
||||
\property QCoreApplication::quitLockEnabled
|
||||
|
||||
Returns true if the use of the QEventLoopLocker feature can cause the
|
||||
application to quit, otherwise returns false.
|
||||
|
||||
\sa QEventLoopLocker
|
||||
*/
|
||||
|
||||
/*!
|
||||
Returns true if the use of the QEventLoopLocker feature can cause the
|
||||
application to quit, otherwise returns false.
|
||||
|
||||
@ -2220,7 +2234,7 @@ void QCoreApplication::installNativeEventFilter(QAbstractNativeEventFilter *filt
|
||||
}
|
||||
|
||||
/*!
|
||||
Removes an event filter object \a obj from this object. The
|
||||
Removes an event \a filterObject from this object. The
|
||||
request is ignored if such an event filter has not been installed.
|
||||
|
||||
All event filters for this object are automatically removed when
|
||||
@ -2232,12 +2246,12 @@ void QCoreApplication::installNativeEventFilter(QAbstractNativeEventFilter *filt
|
||||
\sa installNativeEventFilter()
|
||||
\since 5.0
|
||||
*/
|
||||
void QCoreApplication::removeNativeEventFilter(QAbstractNativeEventFilter *filterObj)
|
||||
void QCoreApplication::removeNativeEventFilter(QAbstractNativeEventFilter *filterObject)
|
||||
{
|
||||
QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance();
|
||||
if (!filterObj || !eventDispatcher)
|
||||
if (!filterObject || !eventDispatcher)
|
||||
return;
|
||||
eventDispatcher->removeNativeEventFilter(filterObj);
|
||||
eventDispatcher->removeNativeEventFilter(filterObject);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -85,7 +85,11 @@ public:
|
||||
GuiServer // # deprecated
|
||||
};
|
||||
|
||||
QCoreApplication(int &argc, char **argv, int = ApplicationFlags);
|
||||
QCoreApplication(int &argc, char **argv
|
||||
#ifndef Q_QDOC
|
||||
, int = ApplicationFlags
|
||||
#endif
|
||||
);
|
||||
|
||||
~QCoreApplication();
|
||||
|
||||
|
@ -270,7 +270,6 @@ QT_BEGIN_NAMESPACE
|
||||
\omitvalue MacGLClearDrawable
|
||||
\omitvalue NetworkReplyUpdated
|
||||
\omitvalue FutureCallOut
|
||||
\omitvalue UpdateSoftKeys
|
||||
\omitvalue NativeGesture
|
||||
*/
|
||||
|
||||
|
@ -256,8 +256,6 @@ public:
|
||||
RequestSoftwareInputPanel = 199,
|
||||
CloseSoftwareInputPanel = 200,
|
||||
|
||||
UpdateSoftKeys = 201, // Internal for compressing soft key updates
|
||||
|
||||
WinIdChange = 203,
|
||||
#ifndef QT_NO_GESTURES
|
||||
Gesture = 198,
|
||||
|
@ -67,7 +67,7 @@ struct bpsIOHandlerData {
|
||||
fd_set *exceptfds;
|
||||
};
|
||||
|
||||
static int bpsIOReadyDomain = -1;
|
||||
static int bpsUnblockDomain = -1;
|
||||
|
||||
static int bpsIOHandler(int fd, int io_events, void *data)
|
||||
{
|
||||
@ -103,13 +103,13 @@ static int bpsIOHandler(int fd, int io_events, void *data)
|
||||
qEventDispatcherDebug << "Sending bpsIOReadyDomain event";
|
||||
// create IO ready event
|
||||
bps_event_t *event;
|
||||
int result = bps_event_create(&event, bpsIOReadyDomain, 0, NULL, NULL);
|
||||
int result = bps_event_create(&event, bpsUnblockDomain, 0, NULL, NULL);
|
||||
if (result != BPS_SUCCESS) {
|
||||
qWarning("QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberry: bps_event_create() failed");
|
||||
return BPS_FAILURE;
|
||||
}
|
||||
|
||||
// post IO ready event to our thread
|
||||
// post unblock event to our thread
|
||||
result = bps_push_event(event);
|
||||
if (result != BPS_SUCCESS) {
|
||||
qWarning("QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberry: bps_push_event() failed");
|
||||
@ -129,31 +129,33 @@ QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberryPrivate()
|
||||
if (result != BPS_SUCCESS)
|
||||
qFatal("QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberry: bps_initialize() failed");
|
||||
|
||||
// get domain for IO ready events - ignoring race condition here for now
|
||||
if (bpsIOReadyDomain == -1) {
|
||||
bpsIOReadyDomain = bps_register_domain();
|
||||
if (bpsIOReadyDomain == -1)
|
||||
bps_channel = bps_channel_get_active();
|
||||
|
||||
// get domain for IO ready and wake up events - ignoring race condition here for now
|
||||
if (bpsUnblockDomain == -1) {
|
||||
bpsUnblockDomain = bps_register_domain();
|
||||
if (bpsUnblockDomain == -1)
|
||||
qWarning("QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberry: bps_register_domain() failed");
|
||||
}
|
||||
|
||||
// Register thread_pipe[0] with bps
|
||||
int io_events = BPS_IO_INPUT;
|
||||
result = bps_add_fd(thread_pipe[0], io_events, &bpsIOHandler, ioData.data());
|
||||
if (result != BPS_SUCCESS)
|
||||
qWarning() << Q_FUNC_INFO << "bps_add_fd() failed";
|
||||
}
|
||||
|
||||
QEventDispatcherBlackberryPrivate::~QEventDispatcherBlackberryPrivate()
|
||||
{
|
||||
// Unregister thread_pipe[0] from bps
|
||||
const int result = bps_remove_fd(thread_pipe[0]);
|
||||
if (result != BPS_SUCCESS)
|
||||
qWarning() << Q_FUNC_INFO << "bps_remove_fd() failed";
|
||||
|
||||
// we're done using BPS
|
||||
bps_shutdown();
|
||||
}
|
||||
|
||||
int QEventDispatcherBlackberryPrivate::initThreadWakeUp()
|
||||
{
|
||||
return -1; // no fd's used
|
||||
}
|
||||
|
||||
int QEventDispatcherBlackberryPrivate::processThreadWakeUp(int nsel)
|
||||
{
|
||||
Q_UNUSED(nsel);
|
||||
return wakeUps.fetchAndStoreRelaxed(0);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
QEventDispatcherBlackberry::QEventDispatcherBlackberry(QObject *parent)
|
||||
@ -317,7 +319,7 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
|
||||
if (!event) // In case of !event, we break out of the loop to let Qt process the timers
|
||||
break; // (since timeout has expired) and socket notifiers that are now ready.
|
||||
|
||||
if (bps_event_get_domain(event) == bpsIOReadyDomain) {
|
||||
if (bps_event_get_domain(event) == bpsUnblockDomain) {
|
||||
timeoutTotal = 0; // in order to immediately drain the event queue of native events
|
||||
event = 0; // (especially touch move events) we don't break out here
|
||||
}
|
||||
@ -339,6 +341,21 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
|
||||
return d->ioData->count;
|
||||
}
|
||||
|
||||
void QEventDispatcherBlackberry::wakeUp()
|
||||
{
|
||||
Q_D(QEventDispatcherBlackberry);
|
||||
if (d->wakeUps.testAndSetAcquire(0, 1)) {
|
||||
bps_event_t *event;
|
||||
if (bps_event_create(&event, bpsUnblockDomain, 0, 0, 0) == BPS_SUCCESS) {
|
||||
if (bps_channel_push_event(d->bps_channel, event) == BPS_SUCCESS)
|
||||
return;
|
||||
else
|
||||
bps_event_destroy(event);
|
||||
}
|
||||
qWarning("QEventDispatcherBlackberryPrivate::wakeUp failed");
|
||||
}
|
||||
}
|
||||
|
||||
int QEventDispatcherBlackberry::ioEvents(int fd)
|
||||
{
|
||||
int io_events = 0;
|
||||
|
@ -71,6 +71,8 @@ public:
|
||||
void registerSocketNotifier(QSocketNotifier *notifier);
|
||||
void unregisterSocketNotifier(QSocketNotifier *notifier);
|
||||
|
||||
void wakeUp();
|
||||
|
||||
protected:
|
||||
QEventDispatcherBlackberry(QEventDispatcherBlackberryPrivate &dd, QObject *parent = 0);
|
||||
|
||||
@ -89,6 +91,10 @@ public:
|
||||
QEventDispatcherBlackberryPrivate();
|
||||
~QEventDispatcherBlackberryPrivate();
|
||||
|
||||
int initThreadWakeUp();
|
||||
int processThreadWakeUp(int nsel);
|
||||
|
||||
int bps_channel;
|
||||
QScopedPointer<bpsIOHandlerData> ioData;
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,7 @@ QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
|
||||
bool pipefail = false;
|
||||
|
||||
// initialize the common parts of the event loop
|
||||
#if defined(Q_OS_NACL)
|
||||
#if defined(Q_OS_NACL) || defined (Q_OS_BLACKBERRY)
|
||||
// do nothing.
|
||||
#elif defined(Q_OS_INTEGRITY)
|
||||
// INTEGRITY doesn't like a "select" on pipes, so use socketpair instead
|
||||
@ -157,7 +157,7 @@ QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
|
||||
|
||||
QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate()
|
||||
{
|
||||
#if defined(Q_OS_NACL)
|
||||
#if defined(Q_OS_NACL) || defined (Q_OS_BLACKBERRY)
|
||||
// do nothing.
|
||||
#elif defined(Q_OS_VXWORKS)
|
||||
close(thread_pipe[0]);
|
||||
@ -211,8 +211,8 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
|
||||
FD_ZERO(&sn_vec[2].select_fds);
|
||||
}
|
||||
|
||||
FD_SET(thread_pipe[0], &sn_vec[0].select_fds);
|
||||
highest = qMax(highest, thread_pipe[0]);
|
||||
int wakeUpFd = initThreadWakeUp();
|
||||
highest = qMax(highest, wakeUpFd);
|
||||
|
||||
nsel = q->select(highest + 1,
|
||||
&sn_vec[0].select_fds,
|
||||
@ -271,25 +271,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
|
||||
}
|
||||
}
|
||||
|
||||
// some other thread woke us up... consume the data on the thread pipe so that
|
||||
// select doesn't immediately return next time
|
||||
int nevents = 0;
|
||||
if (nsel > 0 && FD_ISSET(thread_pipe[0], &sn_vec[0].select_fds)) {
|
||||
#if defined(Q_OS_VXWORKS)
|
||||
char c[16];
|
||||
::read(thread_pipe[0], c, sizeof(c));
|
||||
::ioctl(thread_pipe[0], FIOFLUSH, 0);
|
||||
#else
|
||||
char c[16];
|
||||
while (::read(thread_pipe[0], c, sizeof(c)) > 0)
|
||||
;
|
||||
#endif
|
||||
if (!wakeUps.testAndSetRelease(1, 0)) {
|
||||
// hopefully, this is dead code
|
||||
qWarning("QEventDispatcherUNIX: internal error, wakeUps.testAndSetRelease(1, 0) failed!");
|
||||
}
|
||||
++nevents;
|
||||
}
|
||||
int nevents = processThreadWakeUp(nsel);
|
||||
|
||||
// activate socket notifiers
|
||||
if (! (flags & QEventLoop::ExcludeSocketNotifiers) && nsel > 0 && sn_highest >= 0) {
|
||||
@ -307,6 +289,35 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
|
||||
return (nevents + q->activateSocketNotifiers());
|
||||
}
|
||||
|
||||
int QEventDispatcherUNIXPrivate::initThreadWakeUp()
|
||||
{
|
||||
FD_SET(thread_pipe[0], &sn_vec[0].select_fds);
|
||||
return thread_pipe[0];
|
||||
}
|
||||
|
||||
int QEventDispatcherUNIXPrivate::processThreadWakeUp(int nsel)
|
||||
{
|
||||
if (nsel > 0 && FD_ISSET(thread_pipe[0], &sn_vec[0].select_fds)) {
|
||||
// some other thread woke us up... consume the data on the thread pipe so that
|
||||
// select doesn't immediately return next time
|
||||
#if defined(Q_OS_VXWORKS)
|
||||
char c[16];
|
||||
::read(thread_pipe[0], c, sizeof(c));
|
||||
::ioctl(thread_pipe[0], FIOFLUSH, 0);
|
||||
#else
|
||||
char c[16];
|
||||
while (::read(thread_pipe[0], c, sizeof(c)) > 0)
|
||||
;
|
||||
#endif
|
||||
if (!wakeUps.testAndSetRelease(1, 0)) {
|
||||
// hopefully, this is dead code
|
||||
qWarning("QEventDispatcherUNIX: internal error, wakeUps.testAndSetRelease(1, 0) failed!");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QEventDispatcherUNIX::QEventDispatcherUNIX(QObject *parent)
|
||||
: QAbstractEventDispatcher(*new QEventDispatcherUNIXPrivate, parent)
|
||||
{ }
|
||||
|
@ -144,6 +144,8 @@ public:
|
||||
~QEventDispatcherUNIXPrivate();
|
||||
|
||||
int doSelect(QEventLoop::ProcessEventsFlags flags, timeval *timeout);
|
||||
virtual int initThreadWakeUp();
|
||||
virtual int processThreadWakeUp(int nsel);
|
||||
|
||||
bool mainThread;
|
||||
int thread_pipe[2];
|
||||
|
@ -192,10 +192,58 @@ inline qreal qPow(qreal x, qreal y)
|
||||
return pow(x, y);
|
||||
}
|
||||
|
||||
#ifndef M_E
|
||||
#define M_E (2.7182818284590452354)
|
||||
#endif
|
||||
|
||||
#ifndef M_LOG2E
|
||||
#define M_LOG2E (1.4426950408889634074)
|
||||
#endif
|
||||
|
||||
#ifndef M_LOG10E
|
||||
#define M_LOG10E (0.43429448190325182765)
|
||||
#endif
|
||||
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 (0.69314718055994530942)
|
||||
#endif
|
||||
|
||||
#ifndef M_LN10
|
||||
#define M_LN10 (2.30258509299404568402)
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI (3.14159265358979323846)
|
||||
#endif
|
||||
|
||||
#ifndef M_PI_2
|
||||
#define M_PI_2 (1.57079632679489661923)
|
||||
#endif
|
||||
|
||||
#ifndef M_PI_4
|
||||
#define M_PI_4 (0.78539816339744830962)
|
||||
#endif
|
||||
|
||||
#ifndef M_1_PI
|
||||
#define M_1_PI (0.31830988618379067154)
|
||||
#endif
|
||||
|
||||
#ifndef M_2_PI
|
||||
#define M_2_PI (0.63661977236758134308)
|
||||
#endif
|
||||
|
||||
#ifndef M_2_SQRTPI
|
||||
#define M_2_SQRTPI (1.12837916709551257390)
|
||||
#endif
|
||||
|
||||
#ifndef M_SQRT2
|
||||
#define M_SQRT2 (1.41421356237309504880)
|
||||
#endif
|
||||
|
||||
#ifndef M_SQRT1_2
|
||||
#define M_SQRT1_2 (0.70710678118654752440)
|
||||
#endif
|
||||
|
||||
inline qreal qFastSin(qreal x)
|
||||
{
|
||||
int si = int(x * (0.5 * QT_SINE_TABLE_SIZE / M_PI)); // Would be more accurate with qRound, but slower.
|
||||
|
@ -192,13 +192,10 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty
|
||||
case QVariant::ByteArray:
|
||||
case QVariant::Color:
|
||||
return data.toByteArray();
|
||||
break;
|
||||
case QVariant::String:
|
||||
return data.toString().toUtf8();
|
||||
break;
|
||||
case QVariant::Url:
|
||||
return data.toUrl().toEncoded();
|
||||
break;
|
||||
case QVariant::List: {
|
||||
// has to be list of URLs
|
||||
QByteArray result;
|
||||
|
@ -419,6 +419,16 @@ bool QFutureInterfaceBase::referenceCountIsOne() const
|
||||
return d->refCount.load() == 1;
|
||||
}
|
||||
|
||||
bool QFutureInterfaceBase::refT() const
|
||||
{
|
||||
return d->refCount.refT();
|
||||
}
|
||||
|
||||
bool QFutureInterfaceBase::derefT() const
|
||||
{
|
||||
return d->refCount.derefT();
|
||||
}
|
||||
|
||||
QFutureInterfaceBasePrivate::QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState)
|
||||
: refCount(1), m_progressValue(0), m_progressMinimum(0), m_progressMaximum(0),
|
||||
state(initialState), pendingResults(0),
|
||||
|
@ -130,6 +130,8 @@ public:
|
||||
|
||||
protected:
|
||||
bool referenceCountIsOne() const;
|
||||
bool refT() const;
|
||||
bool derefT() const;
|
||||
public:
|
||||
|
||||
#ifndef QFUTURE_TEST
|
||||
@ -148,13 +150,17 @@ class QFutureInterface : public QFutureInterfaceBase
|
||||
public:
|
||||
QFutureInterface(State initialState = NoState)
|
||||
: QFutureInterfaceBase(initialState)
|
||||
{ }
|
||||
{
|
||||
refT();
|
||||
}
|
||||
QFutureInterface(const QFutureInterface &other)
|
||||
: QFutureInterfaceBase(other)
|
||||
{ }
|
||||
{
|
||||
refT();
|
||||
}
|
||||
~QFutureInterface()
|
||||
{
|
||||
if (referenceCountIsOne())
|
||||
if (!derefT())
|
||||
resultStore().clear();
|
||||
}
|
||||
|
||||
@ -163,7 +169,8 @@ public:
|
||||
|
||||
QFutureInterface &operator=(const QFutureInterface &other)
|
||||
{
|
||||
if (referenceCountIsOne())
|
||||
other.refT();
|
||||
if (!derefT())
|
||||
resultStore().clear();
|
||||
QFutureInterfaceBase::operator=(other);
|
||||
return *this;
|
||||
|
@ -129,7 +129,31 @@ class QFutureInterfaceBasePrivate
|
||||
public:
|
||||
QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState);
|
||||
|
||||
QAtomicInt refCount;
|
||||
// When the last QFuture<T> reference is removed, we need to make
|
||||
// sure that data stored in the ResultStore is cleaned out.
|
||||
// Since QFutureInterfaceBasePrivate can be shared between QFuture<T>
|
||||
// and QFuture<void> objects, we use a separate ref. counter
|
||||
// to keep track of QFuture<T> objects.
|
||||
class RefCount
|
||||
{
|
||||
public:
|
||||
inline RefCount(int r = 0, int rt = 0)
|
||||
: m_refCount(r), m_refCountT(rt) {}
|
||||
// Default ref counter for QFIBP
|
||||
inline bool ref() { return m_refCount.ref(); }
|
||||
inline bool deref() { return m_refCount.deref(); }
|
||||
inline int load() const { return m_refCount.load(); }
|
||||
// Ref counter for type T
|
||||
inline bool refT() { return m_refCountT.ref(); }
|
||||
inline bool derefT() { return m_refCountT.deref(); }
|
||||
inline int loadT() const { return m_refCountT.load(); }
|
||||
|
||||
private:
|
||||
QAtomicInt m_refCount;
|
||||
QAtomicInt m_refCountT;
|
||||
};
|
||||
|
||||
RefCount refCount;
|
||||
mutable QMutex m_mutex;
|
||||
QWaitCondition waitCondition;
|
||||
QList<QFutureCallOutInterface *> outputConnections;
|
||||
|
@ -93,47 +93,67 @@ static inline QDate fixedDate(int y, int m, int d)
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline qint64 julianDayFromDate(qint64 year, int month, int day)
|
||||
static inline qint64 floordiv(qint64 a, qint64 b)
|
||||
{
|
||||
// Gregorian calendar
|
||||
// Algorithm from Henry F. Fliegel and Thomas C. Van Flandern
|
||||
return (a - (a < 0 ? b-1 : 0)) / b;
|
||||
}
|
||||
|
||||
static inline qint64 floordiv(qint64 a, int b)
|
||||
{
|
||||
return (a - (a < 0 ? b-1 : 0)) / b;
|
||||
}
|
||||
|
||||
static inline int floordiv(int a, int b)
|
||||
{
|
||||
return (a - (a < 0 ? b-1 : 0)) / b;
|
||||
}
|
||||
|
||||
static inline qint64 julianDayFromDate(int year, int month, int day)
|
||||
{
|
||||
// Adjust for no year 0
|
||||
if (year < 0)
|
||||
++year;
|
||||
|
||||
return (1461 * (year + 4800 + (month - 14) / 12)) / 4
|
||||
+ (367 * (month - 2 - 12 * ((month - 14) / 12))) / 12
|
||||
- (3 * ((year + 4900 + (month - 14) / 12) / 100)) / 4
|
||||
+ day - 32075;
|
||||
/*
|
||||
* Math from The Calendar FAQ at http://www.tondering.dk/claus/cal/julperiod.php
|
||||
* This formula is correct for all julian days, when using mathematical integer
|
||||
* division (round to negative infinity), not c++11 integer division (round to zero)
|
||||
*/
|
||||
int a = floordiv(14 - month, 12);
|
||||
qint64 y = (qint64)year + 4800 - a;
|
||||
int m = month + 12 * a - 3;
|
||||
return day + floordiv(153 * m + 2, 5) + 365 * y + floordiv(y, 4) - floordiv(y, 100) + floordiv(y, 400) - 32045;
|
||||
}
|
||||
|
||||
static void getDateFromJulianDay(qint64 julianDay, int *year, int *month, int *day)
|
||||
static void getDateFromJulianDay(qint64 julianDay, int *yearp, int *monthp, int *dayp)
|
||||
{
|
||||
int y, m, d;
|
||||
/*
|
||||
* Math from The Calendar FAQ at http://www.tondering.dk/claus/cal/julperiod.php
|
||||
* This formula is correct for all julian days, when using mathematical integer
|
||||
* division (round to negative infinity), not c++11 integer division (round to zero)
|
||||
*/
|
||||
qint64 a = julianDay + 32044;
|
||||
qint64 b = floordiv(4 * a + 3, 146097);
|
||||
int c = a - floordiv(146097 * b, 4);
|
||||
|
||||
// Gregorian calendar
|
||||
// This algorithm is from Henry F. Fliegel and Thomas C. Van Flandern
|
||||
qint64 ell, n, i, j; //TODO These will need to be bigger to prevent overflow!!!
|
||||
ell = julianDay + 68569;
|
||||
n = (4 * ell) / 146097;
|
||||
ell = ell - (146097 * n + 3) / 4;
|
||||
i = (4000 * (ell + 1)) / 1461001;
|
||||
ell = ell - (1461 * i) / 4 + 31;
|
||||
j = (80 * ell) / 2447;
|
||||
d = ell - (2447 * j) / 80;
|
||||
ell = j / 11;
|
||||
m = j + 2 - (12 * ell);
|
||||
y = 100 * (n - 49) + i + ell;
|
||||
int d = floordiv(4 * c + 3, 1461);
|
||||
int e = c - floordiv(1461 * d, 4);
|
||||
int m = floordiv(5 * e + 2, 153);
|
||||
|
||||
if (y<= 0)
|
||||
--y;
|
||||
int day = e - floordiv(153 * m + 2, 5) + 1;
|
||||
int month = m + 3 - 12 * floordiv(m, 10);
|
||||
int year = 100 * b + d - 4800 + floordiv(m, 10);
|
||||
|
||||
if (year)
|
||||
*year = y;
|
||||
if (month)
|
||||
*month = m;
|
||||
if (day)
|
||||
*day = d;
|
||||
// Adjust for no year 0
|
||||
if (year <= 0)
|
||||
--year ;
|
||||
|
||||
if (yearp)
|
||||
*yearp = year;
|
||||
if (monthp)
|
||||
*monthp = month;
|
||||
if (dayp)
|
||||
*dayp = day;
|
||||
}
|
||||
|
||||
|
||||
@ -225,14 +245,8 @@ static QString fmtDateTime(const QString& f, const QTime* dt = 0, const QDate* d
|
||||
QDate::toJulianDay() and can be set using QDate::fromJulianDay().
|
||||
|
||||
The range of dates able to be stored by QDate as a Julian Day number is
|
||||
limited for convenience from std::numeric_limits<qint64>::min() / 2 to
|
||||
std::numeric_limits<qint64>::max() / 2, which on most platforms means
|
||||
from around 2.5 quadrillion BCE to around 2.5 quadrillion CE, effectively
|
||||
covering the full range of astronomical time. The range of Julian Days
|
||||
able to be accurately converted to and from valid YMD form Dates is
|
||||
restricted to 1 January 4800 BCE to 31 December 1400000 CE due to
|
||||
shortcomings in the available conversion formulas. Conversions outside this
|
||||
range are not guaranteed to be correct. This may change in the future.
|
||||
for technical reasons limited to between -784350574879 and 784354017364,
|
||||
which means from before 2 billion BCE to after 2 billion CE.
|
||||
|
||||
\sa QTime, QDateTime, QDateEdit, QDateTimeEdit, QCalendarWidget
|
||||
*/
|
||||
@ -859,9 +873,6 @@ QString QDate::toString(const QString& format) const
|
||||
If the specified date is invalid, the QDate object is set to be
|
||||
invalid.
|
||||
|
||||
Note that any date before 4800 BCE or after about 1.4 million CE
|
||||
may not be accurately stored.
|
||||
|
||||
\sa isValid()
|
||||
*/
|
||||
bool QDate::setDate(int year, int month, int day)
|
||||
@ -882,9 +893,6 @@ bool QDate::setDate(int year, int month, int day)
|
||||
|
||||
Returns 0 if the date is invalid.
|
||||
|
||||
Note that any date before 4800 BCE or after about 1.4 million CE
|
||||
may not be accurately stored.
|
||||
|
||||
\sa year(), month(), day(), isValid()
|
||||
*/
|
||||
void QDate::getDate(int *year, int *month, int *day)
|
||||
@ -2100,14 +2108,8 @@ int QTime::elapsed() const
|
||||
QDate::toJulianDay() and can be set using QDate::fromJulianDay().
|
||||
|
||||
The range of dates able to be stored by QDate as a Julian Day number is
|
||||
limited for convenience from std::numeric_limits<qint64>::min() / 2 to
|
||||
std::numeric_limits<qint64>::max() / 2, which on most platforms means
|
||||
from around 2.5 quadrillion BCE to around 2.5 quadrillion CE, effectively
|
||||
covering the full range of astronomical time. The range of Julian Days
|
||||
able to be accurately converted to and from valid YMD form Dates is
|
||||
restricted to 1 January 4800 BCE to 31 December 1400000 CE due to
|
||||
shortcomings in the available conversion formulas. Conversions outside this
|
||||
range are not guaranteed to be correct. This may change in the future.
|
||||
for technical reasons limited to between -784350574879 and 784354017364,
|
||||
which means from before 2 billion BCE to after 2 billion CE.
|
||||
|
||||
\section2
|
||||
Use of System Timezone
|
||||
@ -2418,7 +2420,7 @@ void QDateTime::setMSecsSinceEpoch(qint64 msecs)
|
||||
|
||||
QDateTimePrivate::Spec oldSpec = d->spec;
|
||||
|
||||
int ddays = msecs / MSECS_PER_DAY;
|
||||
qint64 ddays = msecs / MSECS_PER_DAY;
|
||||
msecs %= MSECS_PER_DAY;
|
||||
if (msecs < 0) {
|
||||
// negative
|
||||
@ -3391,10 +3393,11 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f)
|
||||
int year;
|
||||
QStringList timeParts = parts.at(3).split(QLatin1Char(':'));
|
||||
if ((timeParts.count() == 3) || (timeParts.count() == 2)) {
|
||||
// Year is after time, e.g. "Sun Dec 1 13:02:00 1974"
|
||||
year = parts.at(4).toInt(&ok);
|
||||
if (!ok)
|
||||
return QDateTime();
|
||||
} else {
|
||||
} else { // Year is before time, e.g. "Sun Dec 1 1974 13:02:00"
|
||||
timeParts = parts.at(4).split(QLatin1Char(':'));
|
||||
if ((timeParts.count() != 3) && (timeParts.count() != 2))
|
||||
return QDateTime();
|
||||
@ -3743,7 +3746,8 @@ static bool hasUnquotedAP(const QString &f)
|
||||
for (int i=0; i<max; ++i) {
|
||||
if (f.at(i) == quote) {
|
||||
inquote = !inquote;
|
||||
} else if (!inquote && f.at(i).toUpper() == QLatin1Char('A')) {
|
||||
} else if (!inquote && f.at(i).toUpper() == QLatin1Char('A')
|
||||
&& i + 1 < max && f.at(i + 1).toUpper() == QLatin1Char('P')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -121,8 +121,8 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
|
||||
|
||||
private:
|
||||
static inline qint64 nullJd() { return std::numeric_limits<qint64>::min(); }
|
||||
static inline qint64 minJd() { return std::numeric_limits<qint64>::min() / 2; }
|
||||
static inline qint64 maxJd() { return (std::numeric_limits<qint64>::max()) / 2; }
|
||||
static inline qint64 minJd() { return Q_INT64_C(-784350574879); }
|
||||
static inline qint64 maxJd() { return Q_INT64_C( 784354017364); }
|
||||
|
||||
qint64 jd;
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
const QMapDataBase QMapDataBase::shared_null = { Q_REFCOUNT_INITIALIZE_STATIC, 0, { 0, 0, 0 } };
|
||||
const QMapDataBase QMapDataBase::shared_null = { Q_REFCOUNT_INITIALIZE_STATIC, 0, { 0, 0, 0 }, 0 };
|
||||
|
||||
const QMapNodeBase *QMapNodeBase::nextNode() const
|
||||
{
|
||||
@ -177,6 +177,12 @@ void QMapDataBase::freeNodeAndRebalance(QMapNodeBase *z)
|
||||
QMapNodeBase *x_parent;
|
||||
if (y->left == 0) {
|
||||
x = y->right;
|
||||
if (y == mostLeftNode) {
|
||||
if (x)
|
||||
mostLeftNode = x; // It cannot have (left) children due the red black invariant.
|
||||
else
|
||||
mostLeftNode = y->parent();
|
||||
}
|
||||
} else {
|
||||
if (y->right == 0) {
|
||||
x = y->left;
|
||||
@ -290,6 +296,13 @@ void QMapDataBase::freeNodeAndRebalance(QMapNodeBase *z)
|
||||
--size;
|
||||
}
|
||||
|
||||
void QMapDataBase::recalcMostLeftNode()
|
||||
{
|
||||
mostLeftNode = &header;
|
||||
while (mostLeftNode->left)
|
||||
mostLeftNode = mostLeftNode->left;
|
||||
}
|
||||
|
||||
static inline int qMapAlignmentThreshold()
|
||||
{
|
||||
// malloc on 32-bit platforms should return pointers that are 8-byte
|
||||
@ -324,6 +337,8 @@ QMapNodeBase *QMapDataBase::createNode(int alloc, int alignment, QMapNodeBase *p
|
||||
if (parent) {
|
||||
if (left) {
|
||||
parent->left = node;
|
||||
if (parent == mostLeftNode)
|
||||
mostLeftNode = node;
|
||||
} else {
|
||||
parent->right = node;
|
||||
}
|
||||
@ -352,6 +367,7 @@ QMapDataBase *QMapDataBase::createData()
|
||||
d->header.p = 0;
|
||||
d->header.left = 0;
|
||||
d->header.right = 0;
|
||||
d->mostLeftNode = &(d->header);
|
||||
|
||||
return d;
|
||||
}
|
||||
|
@ -173,11 +173,13 @@ struct Q_CORE_EXPORT QMapDataBase
|
||||
QtPrivate::RefCount ref;
|
||||
int size;
|
||||
QMapNodeBase header;
|
||||
QMapNodeBase *mostLeftNode;
|
||||
|
||||
void rotateLeft(QMapNodeBase *x);
|
||||
void rotateRight(QMapNodeBase *x);
|
||||
void rebalance(QMapNodeBase *x);
|
||||
void freeNodeAndRebalance(QMapNodeBase *z);
|
||||
void recalcMostLeftNode();
|
||||
|
||||
QMapNodeBase *createNode(int size, int alignment, QMapNodeBase *parent, bool left);
|
||||
void freeTree(QMapNodeBase *root, int alignment);
|
||||
@ -197,8 +199,8 @@ struct QMapData : public QMapDataBase
|
||||
|
||||
const Node *end() const { return static_cast<const Node *>(&header); }
|
||||
Node *end() { return static_cast<Node *>(&header); }
|
||||
const Node *begin() const { if (root()) return root()->minimumNode(); return end(); }
|
||||
Node *begin() { if (root()) return root()->minimumNode(); return end(); }
|
||||
const Node *begin() const { if (root()) return static_cast<const Node*>(mostLeftNode); return end(); }
|
||||
Node *begin() { if (root()) return static_cast<Node*>(mostLeftNode); return end(); }
|
||||
|
||||
void deleteNode(Node *z);
|
||||
Node *findNode(const Key &akey) const;
|
||||
@ -555,6 +557,7 @@ inline QMap<Key, T>::QMap(const QMap<Key, T> &other)
|
||||
if (other.d->header.left) {
|
||||
d->header.left = static_cast<Node *>(other.d->header.left)->copy(d);
|
||||
d->header.left->setParent(&d->header);
|
||||
d->recalcMostLeftNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -780,6 +783,7 @@ Q_OUTOFLINE_TEMPLATE void QMap<Key, T>::detach_helper()
|
||||
if (!d->ref.deref())
|
||||
d->destroy();
|
||||
d = x;
|
||||
d->recalcMostLeftNode();
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
@ -935,7 +939,7 @@ Q_OUTOFLINE_TEMPLATE QMap<Key, T>::QMap(const std::map<Key, T> &other)
|
||||
typename std::map<Key,T>::const_iterator it = other.end();
|
||||
while (it != other.begin()) {
|
||||
--it;
|
||||
insert((*it).first, (*it).second);
|
||||
d->createNode((*it).first, (*it).second, d->begin(), true); // insert on most left node.
|
||||
}
|
||||
}
|
||||
|
||||
@ -946,7 +950,7 @@ Q_OUTOFLINE_TEMPLATE std::map<Key, T> QMap<Key, T>::toStdMap() const
|
||||
const_iterator it = end();
|
||||
while (it != begin()) {
|
||||
--it;
|
||||
map.insert(std::pair<Key, T>(it.key(), it.value()));
|
||||
map.insert(map.begin(), std::pair<Key, T>(it.key(), it.value()));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
@ -1324,14 +1324,11 @@ Q_CORE_EXPORT QString qt_regexp_toCanonical(const QString &pattern, QRegExp::Pat
|
||||
#ifndef QT_NO_REGEXP_WILDCARD
|
||||
case QRegExp::Wildcard:
|
||||
return wc2rx(pattern, false);
|
||||
break;
|
||||
case QRegExp::WildcardUnix:
|
||||
return wc2rx(pattern, true);
|
||||
break;
|
||||
#endif
|
||||
case QRegExp::FixedString:
|
||||
return QRegExp::escape(pattern);
|
||||
break;
|
||||
case QRegExp::W3CXmlSchema11:
|
||||
default:
|
||||
return pattern;
|
||||
|
@ -252,7 +252,7 @@ void QVector<T>::defaultConstruct(T *from, T *to)
|
||||
new (from++) T();
|
||||
}
|
||||
} else {
|
||||
::memset(from, 0, (to - from) * sizeof(T));
|
||||
::memset(static_cast<void *>(from), 0, (to - from) * sizeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ void QVector<T>::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom)
|
||||
while (srcFrom != srcTo)
|
||||
new (dstFrom++) T(*srcFrom++);
|
||||
} else {
|
||||
::memcpy(dstFrom, srcFrom, (srcTo - srcFrom) * sizeof(T));
|
||||
::memcpy(static_cast<void *>(dstFrom), static_cast<const void *>(srcFrom), (srcTo - srcFrom) * sizeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
|
||||
new (dst++) T(*srcBegin++);
|
||||
}
|
||||
} else {
|
||||
::memcpy(static_cast<void *>(dst), srcBegin, (srcEnd - srcBegin) * sizeof(T));
|
||||
::memcpy(static_cast<void *>(dst), static_cast<void *>(srcBegin), (srcEnd - srcBegin) * sizeof(T));
|
||||
dst += srcEnd - srcBegin;
|
||||
|
||||
// destruct unused / not moved data
|
||||
|
@ -300,7 +300,6 @@ QVariant QDBusDemarshaller::toVariantInternal()
|
||||
|
||||
// I hope you never dereference this pointer!
|
||||
return QVariant::fromValue<void *>(ptr);
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,6 @@
|
||||
|
||||
#include "qaccessible.h"
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
||||
#include "qaccessibleplugin.h"
|
||||
#include "qaccessibleobject.h"
|
||||
#include "qaccessiblebridge.h"
|
||||
@ -1265,4 +1263,3 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
@ -58,8 +58,6 @@ QT_BEGIN_HEADER
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
||||
class QAccessibleInterface;
|
||||
class QAccessibleEvent;
|
||||
class QWindow;
|
||||
@ -678,8 +676,6 @@ inline void QAccessible::updateAccessibility(QObject *object, int child, Event r
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // QT_NO_ACCESSIBILITY
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
@ -4915,43 +4915,33 @@ int QImage::metric(PaintDeviceMetric metric) const
|
||||
switch (metric) {
|
||||
case PdmWidth:
|
||||
return d->width;
|
||||
break;
|
||||
|
||||
case PdmHeight:
|
||||
return d->height;
|
||||
break;
|
||||
|
||||
case PdmWidthMM:
|
||||
return qRound(d->width * 1000 / d->dpmx);
|
||||
break;
|
||||
|
||||
case PdmHeightMM:
|
||||
return qRound(d->height * 1000 / d->dpmy);
|
||||
break;
|
||||
|
||||
case PdmNumColors:
|
||||
return d->colortable.size();
|
||||
break;
|
||||
|
||||
case PdmDepth:
|
||||
return d->depth;
|
||||
break;
|
||||
|
||||
case PdmDpiX:
|
||||
return qRound(d->dpmx * 0.0254);
|
||||
break;
|
||||
|
||||
case PdmDpiY:
|
||||
return qRound(d->dpmy * 0.0254);
|
||||
break;
|
||||
|
||||
case PdmPhysicalDpiX:
|
||||
return qRound(d->dpmx * 0.0254);
|
||||
break;
|
||||
|
||||
case PdmPhysicalDpiY:
|
||||
return qRound(d->dpmy * 0.0254);
|
||||
break;
|
||||
|
||||
default:
|
||||
qWarning("QImage::metric(): Unhandled metric type %d", metric);
|
||||
|
@ -849,13 +849,6 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, vo
|
||||
png_set_gAMA(png_ptr, info_ptr, 1.0/gamma);
|
||||
}
|
||||
|
||||
png_color_8 sig_bit;
|
||||
sig_bit.red = 8;
|
||||
sig_bit.green = 8;
|
||||
sig_bit.blue = 8;
|
||||
sig_bit.alpha = image.hasAlphaChannel() ? 8 : 0;
|
||||
png_set_sBIT(png_ptr, info_ptr, &sig_bit);
|
||||
|
||||
if (image.format() == QImage::Format_MonoLSB)
|
||||
png_set_packswap(png_ptr);
|
||||
|
||||
|
@ -2935,7 +2935,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
|
||||
return data;
|
||||
QByteArray encoded;
|
||||
QDataStream stream(&encoded, QIODevice::WriteOnly);
|
||||
|
||||
|
||||
QSet<QStandardItem*> itemsSet;
|
||||
QStack<QStandardItem*> stack;
|
||||
itemsSet.reserve(indexes.count());
|
||||
@ -2945,7 +2945,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
|
||||
itemsSet << item;
|
||||
stack.push(item);
|
||||
}
|
||||
|
||||
|
||||
//remove duplicates childrens
|
||||
{
|
||||
QSet<QStandardItem *> seen;
|
||||
@ -2954,7 +2954,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
|
||||
if (seen.contains(itm))
|
||||
continue;
|
||||
seen.insert(itm);
|
||||
|
||||
|
||||
const QVector<QStandardItem*> &childList = itm->d_func()->children;
|
||||
for (int i = 0; i < childList.count(); ++i) {
|
||||
QStandardItem *chi = childList.at(i);
|
||||
@ -2968,17 +2968,17 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stack.reserve(itemsSet.count());
|
||||
foreach (QStandardItem *item, itemsSet) {
|
||||
stack.push(item);
|
||||
}
|
||||
|
||||
|
||||
//stream everything recursively
|
||||
while (!stack.isEmpty()) {
|
||||
QStandardItem *item = stack.pop();
|
||||
if(itemsSet.contains(item)) { //if the item is selection 'top-level', strem its position
|
||||
stream << item->row() << item->column();
|
||||
stream << item->row() << item->column();
|
||||
}
|
||||
if(item) {
|
||||
stream << *item << item->columnCount() << item->d_ptr->children.count();
|
||||
@ -2996,7 +2996,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
|
||||
|
||||
/* \internal
|
||||
Used by QStandardItemModel::dropMimeData
|
||||
stream out an item and his children
|
||||
stream out an item and his children
|
||||
*/
|
||||
void QStandardItemModelPrivate::decodeDataRecursive(QDataStream &stream, QStandardItem *item)
|
||||
{
|
||||
@ -3004,9 +3004,9 @@ void QStandardItemModelPrivate::decodeDataRecursive(QDataStream &stream, QStanda
|
||||
stream >> *item;
|
||||
stream >> colCount >> childCount;
|
||||
item->setColumnCount(colCount);
|
||||
|
||||
|
||||
int childPos = childCount;
|
||||
|
||||
|
||||
while(childPos > 0) {
|
||||
childPos--;
|
||||
QStandardItem *child = createItem();
|
||||
|
@ -105,6 +105,7 @@ QPointF QGuiApplicationPrivate::lastCursorPosition(0.0, 0.0);
|
||||
|
||||
bool QGuiApplicationPrivate::tabletState = false;
|
||||
QWindow *QGuiApplicationPrivate::tabletPressTarget = 0;
|
||||
QWindow *QGuiApplicationPrivate::currentMouseWindow = 0;
|
||||
|
||||
QPlatformIntegration *QGuiApplicationPrivate::platform_integration = 0;
|
||||
QPlatformTheme *QGuiApplicationPrivate::platform_theme = 0;
|
||||
@ -455,7 +456,19 @@ void QGuiApplicationPrivate::showModalWindow(QWindow *modal)
|
||||
{
|
||||
self->modalWindowList.prepend(modal);
|
||||
|
||||
QEvent e(QEvent::WindowBlocked);
|
||||
// Send leave for currently entered window if it should be blocked
|
||||
if (currentMouseWindow && (currentMouseWindow->windowType() & Qt::Popup) != Qt::Popup) {
|
||||
bool shouldBeBlocked = self->isWindowBlocked(currentMouseWindow);
|
||||
if (shouldBeBlocked) {
|
||||
// Remove the new window from modalWindowList temporarily so leave can go through
|
||||
self->modalWindowList.removeFirst();
|
||||
QEvent e(QEvent::Leave);
|
||||
QGuiApplication::sendEvent(currentMouseWindow, &e);
|
||||
currentMouseWindow = 0;
|
||||
self->modalWindowList.prepend(modal);
|
||||
}
|
||||
}
|
||||
|
||||
QWindowList windows = QGuiApplication::topLevelWindows();
|
||||
for (int i = 0; i < windows.count(); ++i) {
|
||||
QWindow *window = windows.at(i);
|
||||
@ -470,7 +483,6 @@ void QGuiApplicationPrivate::hideModalWindow(QWindow *window)
|
||||
{
|
||||
self->modalWindowList.removeAll(window);
|
||||
|
||||
QEvent e(QEvent::WindowUnblocked);
|
||||
QWindowList windows = QGuiApplication::topLevelWindows();
|
||||
for (int i = 0; i < windows.count(); ++i) {
|
||||
QWindow *window = windows.at(i);
|
||||
@ -1410,6 +1422,8 @@ void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::En
|
||||
return;
|
||||
}
|
||||
|
||||
currentMouseWindow = e->enter;
|
||||
|
||||
QEvent event(QEvent::Enter);
|
||||
QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event);
|
||||
}
|
||||
@ -1423,6 +1437,8 @@ void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Le
|
||||
return;
|
||||
}
|
||||
|
||||
currentMouseWindow = 0;
|
||||
|
||||
QEvent event(QEvent::Leave);
|
||||
QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event);
|
||||
}
|
||||
|
@ -189,6 +189,7 @@ public:
|
||||
static QPointF lastCursorPosition;
|
||||
static bool tabletState;
|
||||
static QWindow *tabletPressTarget;
|
||||
static QWindow *currentMouseWindow;
|
||||
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
static QClipboard *qt_clipboard;
|
||||
|
@ -195,6 +195,10 @@ QPlatformServices *QPlatformIntegration::services() const
|
||||
\value BufferQueueingOpenGL The OpenGL implementation on the platform will queue
|
||||
up buffers when swapBuffers() is called and block only when its buffer pipeline
|
||||
is full, rather than block immediately.
|
||||
|
||||
\value MultipleWindows The platform supports multiple QWindows, i.e. does some kind
|
||||
of compositing either client or server side. Some platforms might only support a
|
||||
single fullscreen window.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -83,11 +83,12 @@ class Q_GUI_EXPORT QPlatformIntegration
|
||||
public:
|
||||
enum Capability {
|
||||
ThreadedPixmaps = 1,
|
||||
OpenGL = 2,
|
||||
ThreadedOpenGL = 3,
|
||||
SharedGraphicsCache = 4,
|
||||
BufferQueueingOpenGL = 5,
|
||||
WindowMasks = 6
|
||||
OpenGL,
|
||||
ThreadedOpenGL,
|
||||
SharedGraphicsCache,
|
||||
BufferQueueingOpenGL,
|
||||
WindowMasks,
|
||||
MultipleWindows
|
||||
};
|
||||
|
||||
virtual ~QPlatformIntegration() { }
|
||||
|
@ -102,6 +102,7 @@ public:
|
||||
|
||||
virtual void setText(const QString &text) = 0;
|
||||
virtual void setEnabled(bool enabled) = 0;
|
||||
virtual void setVisible(bool visible) = 0;
|
||||
|
||||
virtual QPlatformMenuItem *menuItemAt(int position) const = 0;
|
||||
virtual QPlatformMenuItem *menuItemForTag(quintptr tag) const = 0;
|
||||
|
@ -214,6 +214,8 @@ QWindow::~QWindow()
|
||||
{
|
||||
if (QGuiApplicationPrivate::focus_window == this)
|
||||
QGuiApplicationPrivate::focus_window = 0;
|
||||
if (QGuiApplicationPrivate::currentMouseWindow == this)
|
||||
QGuiApplicationPrivate::currentMouseWindow = 0;
|
||||
QGuiApplicationPrivate::window_list.removeAll(this);
|
||||
destroy();
|
||||
}
|
||||
@ -939,9 +941,24 @@ void QWindow::setMinimumSize(const QSize &size)
|
||||
QSize adjustedSize = QSize(qBound(0, size.width(), QWINDOWSIZE_MAX), qBound(0, size.height(), QWINDOWSIZE_MAX));
|
||||
if (d->minimumSize == adjustedSize)
|
||||
return;
|
||||
QSize oldSize = d->minimumSize;
|
||||
d->minimumSize = adjustedSize;
|
||||
if (d->platformWindow && isTopLevel())
|
||||
d->platformWindow->propagateSizeHints();
|
||||
if (d->minimumSize.width() != oldSize.width())
|
||||
emit minimumWidthChanged(d->minimumSize.width());
|
||||
if (d->minimumSize.height() != oldSize.height())
|
||||
emit minimumHeightChanged(d->minimumSize.height());
|
||||
}
|
||||
|
||||
void QWindow::setMinimumWidth(int w)
|
||||
{
|
||||
setMinimumSize(QSize(w, minimumHeight()));
|
||||
}
|
||||
|
||||
void QWindow::setMinimumHeight(int h)
|
||||
{
|
||||
setMinimumSize(QSize(minimumWidth(), h));
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -957,9 +974,24 @@ void QWindow::setMaximumSize(const QSize &size)
|
||||
QSize adjustedSize = QSize(qBound(0, size.width(), QWINDOWSIZE_MAX), qBound(0, size.height(), QWINDOWSIZE_MAX));
|
||||
if (d->maximumSize == adjustedSize)
|
||||
return;
|
||||
QSize oldSize = d->maximumSize;
|
||||
d->maximumSize = adjustedSize;
|
||||
if (d->platformWindow && isTopLevel())
|
||||
d->platformWindow->propagateSizeHints();
|
||||
if (d->maximumSize.width() != oldSize.width())
|
||||
emit maximumWidthChanged(d->maximumSize.width());
|
||||
if (d->maximumSize.height() != oldSize.height())
|
||||
emit maximumHeightChanged(d->maximumSize.height());
|
||||
}
|
||||
|
||||
void QWindow::setMaximumWidth(int w)
|
||||
{
|
||||
setMaximumSize(QSize(w, maximumHeight()));
|
||||
}
|
||||
|
||||
void QWindow::setMaximumHeight(int h)
|
||||
{
|
||||
setMaximumSize(QSize(maximumWidth(), h));
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -1057,6 +1089,26 @@ void QWindow::setGeometry(const QRect &rect)
|
||||
\brief the height of the window's geometry
|
||||
*/
|
||||
|
||||
/*!
|
||||
\property QWindow::minimumWidth
|
||||
\brief the minimum width of the window's geometry
|
||||
*/
|
||||
|
||||
/*!
|
||||
\property QWindow::minimumHeight
|
||||
\brief the minimum height of the window's geometry
|
||||
*/
|
||||
|
||||
/*!
|
||||
\property QWindow::maximumWidth
|
||||
\brief the maximum width of the window's geometry
|
||||
*/
|
||||
|
||||
/*!
|
||||
\property QWindow::maximumHeight
|
||||
\brief the maximum height of the window's geometry
|
||||
*/
|
||||
|
||||
/*!
|
||||
Returns the geometry of the window, excluding its window frame.
|
||||
|
||||
@ -1445,6 +1497,8 @@ bool QWindow::close()
|
||||
|
||||
if (QGuiApplicationPrivate::focus_window == this)
|
||||
QGuiApplicationPrivate::focus_window = 0;
|
||||
if (QGuiApplicationPrivate::currentMouseWindow == this)
|
||||
QGuiApplicationPrivate::currentMouseWindow = 0;
|
||||
|
||||
QGuiApplicationPrivate::window_list.removeAll(this);
|
||||
destroy();
|
||||
|
@ -104,6 +104,10 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
|
||||
Q_PROPERTY(QPoint pos READ pos WRITE setPos)
|
||||
Q_PROPERTY(QSize size READ size WRITE resize)
|
||||
Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)
|
||||
Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged)
|
||||
Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged)
|
||||
Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged)
|
||||
Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged)
|
||||
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
|
||||
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
|
||||
#ifndef QT_NO_CURSOR
|
||||
@ -170,6 +174,11 @@ public:
|
||||
|
||||
bool isExposed() const;
|
||||
|
||||
int minimumWidth() const { return minimumSize().width(); }
|
||||
int minimumHeight() const { return minimumSize().height(); }
|
||||
int maximumWidth() const { return maximumSize().width(); }
|
||||
int maximumHeight() const { return maximumSize().height(); }
|
||||
|
||||
QSize minimumSize() const;
|
||||
QSize maximumSize() const;
|
||||
QSize baseSize() const;
|
||||
@ -273,6 +282,11 @@ public Q_SLOTS:
|
||||
setGeometry(QRect(x(), y(), width(), arg));
|
||||
}
|
||||
|
||||
void setMinimumWidth(int w);
|
||||
void setMinimumHeight(int h);
|
||||
void setMaximumWidth(int w);
|
||||
void setMaximumHeight(int h);
|
||||
|
||||
Q_SIGNALS:
|
||||
void screenChanged(QScreen *screen);
|
||||
void windowModalityChanged(Qt::WindowModality windowModality);
|
||||
@ -283,6 +297,11 @@ Q_SIGNALS:
|
||||
void widthChanged(int arg);
|
||||
void heightChanged(int arg);
|
||||
|
||||
void minimumWidthChanged(int arg);
|
||||
void minimumHeightChanged(int arg);
|
||||
void maximumWidthChanged(int arg);
|
||||
void maximumHeightChanged(int arg);
|
||||
|
||||
void visibleChanged(bool arg);
|
||||
void contentOrientationChanged(Qt::ScreenOrientation orientation);
|
||||
|
||||
|
@ -80,6 +80,7 @@ public:
|
||||
, positionPolicy(WindowFrameExclusive)
|
||||
, contentOrientation(Qt::PrimaryOrientation)
|
||||
, windowOrientation(Qt::PrimaryOrientation)
|
||||
, minimumSize(0, 0)
|
||||
, maximumSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX)
|
||||
, modality(Qt::NonModal)
|
||||
, blockedByModalWindow(false)
|
||||
|
@ -349,7 +349,6 @@ bool QOpenGLFramebufferObjectPrivate::checkFramebufferStatus(QOpenGLContext *ctx
|
||||
case GL_NO_ERROR:
|
||||
case GL_FRAMEBUFFER_COMPLETE:
|
||||
return true;
|
||||
break;
|
||||
case GL_FRAMEBUFFER_UNSUPPORTED:
|
||||
qDebug("QOpenGLFramebufferObject: Unsupported framebuffer format.");
|
||||
break;
|
||||
|
@ -7498,8 +7498,11 @@ start_lengthVariant:
|
||||
|
||||
l.setLineWidth(lineWidth);
|
||||
height += leading;
|
||||
|
||||
// Make sure lines are positioned on whole pixels
|
||||
height = qCeil(height);
|
||||
l.setPosition(QPointF(0., height));
|
||||
height += l.height();
|
||||
height += textLayout.engine()->lines[l.lineNumber()].height().toReal();
|
||||
width = qMax(width, l.naturalTextWidth());
|
||||
if (!dontclip && !brect && height >= r.height())
|
||||
break;
|
||||
|
@ -1630,7 +1630,6 @@ QPainterPath QPathClipper::clip(Operation operation)
|
||||
result.addRect(subjectBounds);
|
||||
return result;
|
||||
}
|
||||
break;
|
||||
case BoolAnd:
|
||||
return clipPath;
|
||||
case BoolOr:
|
||||
|
@ -1370,7 +1370,9 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len,
|
||||
bool surrogate = (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate());
|
||||
uint ucs4 = surrogate ? QChar::surrogateToUcs4(str[i], str[i+1]) : str[i].unicode();
|
||||
if (glyphs->glyphs[glyph_pos] == 0 && str[i].category() != QChar::Separator_Line) {
|
||||
QGlyphLayoutInstance tmp = glyphs->instance(glyph_pos);
|
||||
QGlyphLayoutInstance tmp;
|
||||
if (!(flags & GlyphIndicesOnly))
|
||||
tmp = glyphs->instance(glyph_pos);
|
||||
for (int x=1; x < engines.size(); ++x) {
|
||||
if (engines.at(x) == 0 && !shouldLoadFontEngineForCharacter(x, ucs4))
|
||||
continue;
|
||||
@ -1400,9 +1402,8 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len,
|
||||
}
|
||||
|
||||
// ensure we use metrics from the 1st font when we use the fallback image.
|
||||
if (!glyphs->glyphs[glyph_pos]) {
|
||||
if (!(flags & GlyphIndicesOnly) && !glyphs->glyphs[glyph_pos])
|
||||
glyphs->setInstance(glyph_pos, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
if (surrogate)
|
||||
|
@ -119,18 +119,14 @@ void QSyntaxHighlighterPrivate::applyFormatChanges()
|
||||
formatsChanged = true;
|
||||
}
|
||||
|
||||
QTextCharFormat emptyFormat;
|
||||
|
||||
QTextLayout::FormatRange r;
|
||||
r.start = -1;
|
||||
|
||||
int i = 0;
|
||||
while (i < formatChanges.count()) {
|
||||
QTextLayout::FormatRange r;
|
||||
|
||||
while (i < formatChanges.count() && formatChanges.at(i) == emptyFormat)
|
||||
while (i < formatChanges.count() && formatChanges.at(i) == r.format)
|
||||
++i;
|
||||
|
||||
if (i >= formatChanges.count())
|
||||
if (i == formatChanges.count())
|
||||
break;
|
||||
|
||||
r.start = i;
|
||||
@ -139,9 +135,7 @@ void QSyntaxHighlighterPrivate::applyFormatChanges()
|
||||
while (i < formatChanges.count() && formatChanges.at(i) == r.format)
|
||||
++i;
|
||||
|
||||
if (i >= formatChanges.count())
|
||||
break;
|
||||
|
||||
Q_ASSERT(i <= formatChanges.count());
|
||||
r.length = i - r.start;
|
||||
|
||||
if (preeditAreaLength != 0) {
|
||||
@ -151,21 +145,6 @@ void QSyntaxHighlighterPrivate::applyFormatChanges()
|
||||
r.length += preeditAreaLength;
|
||||
}
|
||||
|
||||
ranges << r;
|
||||
formatsChanged = true;
|
||||
r.start = -1;
|
||||
}
|
||||
|
||||
if (r.start != -1) {
|
||||
r.length = formatChanges.count() - r.start;
|
||||
|
||||
if (preeditAreaLength != 0) {
|
||||
if (r.start >= preeditAreaStart)
|
||||
r.start += preeditAreaLength;
|
||||
else if (r.start + r.length >= preeditAreaStart)
|
||||
r.length += preeditAreaLength;
|
||||
}
|
||||
|
||||
ranges << r;
|
||||
formatsChanged = true;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user