Merge master into api_changes
Conflicts: src/corelib/tools/qvector.h tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
This commit is contained in:
commit
95d6f8a4cf
8
configure
vendored
8
configure
vendored
@ -4389,7 +4389,7 @@ fi
|
||||
|
||||
# auto-detect iconv(3) support
|
||||
if [ "$CFG_ICONV" != "no" ]; then
|
||||
if [ "$XPLATFORM_MINGW" = "yes" ] || [ "$PLATFORM_QPA" = "yes" -a "$CFG_ICONV" = "auto" ]; then
|
||||
if [ "$XPLATFORM_MINGW" = "yes" ]; then
|
||||
CFG_ICONV=no
|
||||
elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/iconv" "POSIX iconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
|
||||
CFG_ICONV=yes
|
||||
@ -5722,6 +5722,8 @@ fi
|
||||
if [ "$PLATFORM_MAC" = "yes" ]; then
|
||||
if [ "$CFG_RPATH" = "yes" ]; then
|
||||
QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
|
||||
# set the default rpath to the library installation directory
|
||||
RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
|
||||
fi
|
||||
elif [ -z "`getXQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
|
||||
if [ -n "$RPATH_FLAGS" ]; then
|
||||
@ -6294,8 +6296,8 @@ if [ -n "$CFG_SYSROOT" ]; then
|
||||
echo "}" >> "$QTCONFIG.tmp"
|
||||
echo >> "$QTCONFIG.tmp"
|
||||
fi
|
||||
if [ "$CFG_RPATH" = "yes" ]; then
|
||||
echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
|
||||
if [ -n "$RPATH_FLAGS" ]; then
|
||||
echo "QMAKE_RPATHDIR += $RPATH_FLAGS" >> "$QTCONFIG.tmp"
|
||||
fi
|
||||
if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
|
||||
echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
|
||||
|
28
dist/changes-5.0.0
vendored
28
dist/changes-5.0.0
vendored
@ -347,6 +347,16 @@ QtGui
|
||||
information like capability flags, point-specific flags, velocity,
|
||||
and raw positions.
|
||||
|
||||
* A new set of enabler classes have been added, most importantly QWindow, QScreen,
|
||||
QSurfaceFormat, and QOpenGLContext.
|
||||
|
||||
* Most of the useful QtOpenGL classes have been polished and moved into
|
||||
QtGui. See QOpenGLFramebufferObject, QOpenGLShaderProgram,
|
||||
QOpenGLFunctions, etc.
|
||||
|
||||
* QOpenGLPaintDevice has been added to be able to use QPainter to render into
|
||||
the currently bound context.
|
||||
|
||||
QtWidgets
|
||||
---------
|
||||
* QInputContext removed as well as related getters and setters on QWidget and QApplication.
|
||||
@ -395,6 +405,11 @@ QtNetwork
|
||||
QtOpenGL
|
||||
--------
|
||||
|
||||
* Most of the classes in this module (with the notable exception of QGLWidget)
|
||||
now have equivalents in QtGui, along with the naming change QGL -> QOpenGL.
|
||||
The classes in QtOpenGL that have equivalents in QtGui can now be considered
|
||||
deprecated.
|
||||
|
||||
QtScript
|
||||
--------
|
||||
|
||||
@ -555,10 +570,9 @@ Qt for Windows CE
|
||||
|
||||
- QPointer
|
||||
|
||||
* QPointer itself is now deprecated, and the implementation of QPointer
|
||||
has been changed to use QWeakPointer. The old guard mechanism has been
|
||||
removed. This causes two slight changes in behavior when using
|
||||
QPointer:
|
||||
* The implementation of QPointer has been changed to use QWeakPointer. The
|
||||
old guard mechanism has been removed. This causes a slight change
|
||||
in behavior when using QPointer:
|
||||
|
||||
* When using QPointer on a QWidget (or a subclass of QWidget), previously
|
||||
the QPointer would be cleared by the QWidget destructor. Now, the QPointer
|
||||
@ -566,12 +580,6 @@ Qt for Windows CE
|
||||
cleared). Any QPointers tracking a widget will NOT be cleared before the
|
||||
QWidget destructor destroys the children for the widget being tracked.
|
||||
|
||||
* When constructing a QSharedPointer to take ownership of an object after a
|
||||
QPointer is already tracking the object. Previously, the shared pointer
|
||||
construction would not be affected by the QPointer, but now that QPointer
|
||||
is implemented using QWeakPoiner, constructing the QSharedPointer will
|
||||
cause an abort().
|
||||
|
||||
|
||||
- QVariant
|
||||
|
||||
|
@ -2,4 +2,9 @@ CONFIG += qpa/basicunixfontdatabase
|
||||
contains(QT_CONFIG, fontconfig) {
|
||||
DEFINES += Q_FONTCONFIGDATABASE
|
||||
LIBS += -lfontconfig
|
||||
} else {
|
||||
fonts.path = $$[QT_INSTALL_LIBS]/fonts
|
||||
fonts.files = $$QT_SOURCE_TREE/lib/fonts/*
|
||||
INSTALLS += fonts
|
||||
}
|
||||
|
||||
|
@ -35,9 +35,3 @@ qt_install_headers {
|
||||
INSTALLS += private_headers
|
||||
}
|
||||
|
||||
embedded: equals(TARGET, QtGui) {
|
||||
# install fonts for embedded
|
||||
INSTALLS += fonts
|
||||
fonts.path = $$[QT_INSTALL_LIBS]/fonts
|
||||
fonts.files = $$QT_SOURCE_TREE/lib/fonts/*
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ $(OBJS): qmake_pch.obj
|
||||
$(QTOBJS): qmake_pch.obj
|
||||
|
||||
qmake_pch.obj:
|
||||
$(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP qmake_pch.h
|
||||
$(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP $(QMKSRC)\qmake_pch.h
|
||||
|
||||
{$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj::
|
||||
$(CXX) $(CXXFLAGS) $<
|
||||
|
@ -520,6 +520,9 @@ MetaMakefileGenerator::modesForGenerator(const QString &gen,
|
||||
#ifdef Q_OS_MAC
|
||||
*host_mode = Option::HOST_MACX_MODE;
|
||||
*target_mode = Option::TARG_MACX_MODE;
|
||||
#elif defined(Q_OS_WIN)
|
||||
*host_mode = Option::HOST_WIN_MODE;
|
||||
*target_mode = Option::TARG_UNIX_MODE;
|
||||
#else
|
||||
*host_mode = Option::HOST_UNIX_MODE;
|
||||
*target_mode = Option::TARG_UNIX_MODE;
|
||||
|
@ -56,7 +56,7 @@
|
||||
destroyed while you still hold a reference to it. You can safely
|
||||
test the pointer for validity.
|
||||
|
||||
Note that Qt 5 introduces two slight changes in behavior when using QPointer.
|
||||
Note that Qt 5 introduces a slight change in behavior when using QPointer.
|
||||
|
||||
\list
|
||||
|
||||
@ -66,12 +66,6 @@
|
||||
cleared). Any QPointers tracking a widget will \b NOT be cleared before the
|
||||
QWidget destructor destroys the children for the widget being tracked.
|
||||
|
||||
\li When constructing a QSharedPointer to take ownership of an object after a
|
||||
QPointer is already tracking the object. Previously, the shared pointer
|
||||
construction would not be affected by the QPointer, but now that QPointer
|
||||
is implemented using QWeakPoiner, constructing the QSharedPointer will
|
||||
cause an \c abort().
|
||||
|
||||
\endlist
|
||||
|
||||
Qt also provides QSharedPointer, an implementation of a reference-counted
|
||||
|
@ -181,25 +181,6 @@ QMimeType &QMimeType::operator=(const QMimeType &other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
/*!
|
||||
\fn QMimeType::QMimeType(QMimeType &&other);
|
||||
Constructs this QMimeType object by moving the data of the rvalue reference \a other.
|
||||
*/
|
||||
QMimeType::QMimeType(QMimeType &&other) :
|
||||
d(std::move(other.d))
|
||||
{
|
||||
DBG() << "name():" << name();
|
||||
//DBG() << "aliases():" << aliases();
|
||||
//DBG() << "comment():" << comment();
|
||||
DBG() << "genericIconName():" << genericIconName();
|
||||
DBG() << "iconName():" << iconName();
|
||||
DBG() << "globPatterns():" << globPatterns();
|
||||
DBG() << "suffixes():" << suffixes();
|
||||
DBG() << "preferredSuffix():" << preferredSuffix();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn QMimeType::QMimeType(const QMimeTypePrivate &dd);
|
||||
Assigns the data of the QMimeTypePrivate \a dd to this QMimeType object, and returns a reference to this object.
|
||||
|
@ -59,8 +59,6 @@ public:
|
||||
QMimeType(const QMimeType &other);
|
||||
QMimeType &operator=(const QMimeType &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QMimeType(QMimeType &&other);
|
||||
|
||||
QMimeType &operator=(QMimeType &&other)
|
||||
{
|
||||
qSwap(d, other.d);
|
||||
|
@ -175,8 +175,7 @@ void QFactoryLoader::update()
|
||||
QString iid = library->metaData.value(QLatin1String("IID")).toString();
|
||||
if (iid == QLatin1String(d->iid.constData(), d->iid.size())) {
|
||||
QJsonObject object = library->metaData.value(QLatin1String("MetaData")).toObject();
|
||||
if (!object.isEmpty())
|
||||
metaDataOk = true;
|
||||
metaDataOk = true;
|
||||
|
||||
QJsonArray k = object.value(QLatin1String("Keys")).toArray();
|
||||
for (int i = 0; i < k.size(); ++i) {
|
||||
|
@ -800,6 +800,12 @@ const QStaticByteArrayData<1> QByteArray::shared_empty = { { Q_REFCOUNT_INITIALI
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*! \fn QByteArray::const_iterator QByteArray::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*! \fn QByteArray::const_iterator QByteArray::constBegin() const
|
||||
|
||||
\internal
|
||||
@ -815,6 +821,12 @@ const QStaticByteArrayData<1> QByteArray::shared_empty = { { Q_REFCOUNT_INITIALI
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*! \fn QByteArray::const_iterator QByteArray::cend() const
|
||||
\since 5.0
|
||||
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*! \fn QByteArray::const_iterator QByteArray::constEnd() const
|
||||
|
||||
\internal
|
||||
|
@ -354,9 +354,11 @@ public:
|
||||
typedef const_iterator ConstIterator;
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator constBegin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
const_iterator cend() const;
|
||||
const_iterator constEnd() const;
|
||||
|
||||
// stl compatibility
|
||||
@ -495,12 +497,16 @@ inline QByteArray::iterator QByteArray::begin()
|
||||
{ detach(); return d->data(); }
|
||||
inline QByteArray::const_iterator QByteArray::begin() const
|
||||
{ return d->data(); }
|
||||
inline QByteArray::const_iterator QByteArray::cbegin() const
|
||||
{ return d->data(); }
|
||||
inline QByteArray::const_iterator QByteArray::constBegin() const
|
||||
{ return d->data(); }
|
||||
inline QByteArray::iterator QByteArray::end()
|
||||
{ detach(); return d->data() + d->size; }
|
||||
inline QByteArray::const_iterator QByteArray::end() const
|
||||
{ return d->data() + d->size; }
|
||||
inline QByteArray::const_iterator QByteArray::cend() const
|
||||
{ return d->data() + d->size; }
|
||||
inline QByteArray::const_iterator QByteArray::constEnd() const
|
||||
{ return d->data() + d->size; }
|
||||
inline QByteArray &QByteArray::operator+=(char c)
|
||||
|
@ -1045,6 +1045,15 @@ void QHashData::checkSanity()
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QHash::const_iterator QHash::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
in the hash.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QHash::const_iterator QHash::constBegin() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
@ -1074,6 +1083,15 @@ void QHashData::checkSanity()
|
||||
\sa constBegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QHash::const_iterator QHash::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the hash.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QHash::iterator QHash::erase(iterator pos)
|
||||
|
||||
Removes the (key, value) pair associated with the iterator \a pos
|
||||
@ -1114,7 +1132,7 @@ void QHashData::checkSanity()
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QHash::iterator QHash::constFind(const Key &key) const
|
||||
/*! \fn QHash::const_iterator QHash::constFind(const Key &key) const
|
||||
\since 4.1
|
||||
|
||||
Returns an iterator pointing to the item with the \a key in the
|
||||
|
@ -440,9 +440,11 @@ public:
|
||||
// STL style
|
||||
inline iterator begin() { detach(); return iterator(d->firstNode()); }
|
||||
inline const_iterator begin() const { return const_iterator(d->firstNode()); }
|
||||
inline const_iterator cbegin() const { return const_iterator(d->firstNode()); }
|
||||
inline const_iterator constBegin() const { return const_iterator(d->firstNode()); }
|
||||
inline iterator end() { detach(); return iterator(e); }
|
||||
inline const_iterator end() const { return const_iterator(e); }
|
||||
inline const_iterator cend() const { return const_iterator(e); }
|
||||
inline const_iterator constEnd() const { return const_iterator(e); }
|
||||
iterator erase(iterator it);
|
||||
|
||||
|
@ -330,6 +330,15 @@ const QLinkedListData QLinkedListData::shared_null = {
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QLinkedList::const_iterator QLinkedList::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
in the list.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QLinkedList::const_iterator QLinkedList::constBegin() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
@ -351,6 +360,15 @@ const QLinkedListData QLinkedListData::shared_null = {
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QLinkedList::const_iterator QLinkedList::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the list.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QLinkedList::const_iterator QLinkedList::constEnd() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
|
@ -180,9 +180,11 @@ public:
|
||||
// stl style
|
||||
inline iterator begin() { detach(); return e->n; }
|
||||
inline const_iterator begin() const { return e->n; }
|
||||
inline const_iterator cbegin() const { return e->n; }
|
||||
inline const_iterator constBegin() const { return e->n; }
|
||||
inline iterator end() { detach(); return e; }
|
||||
inline const_iterator end() const { return e; }
|
||||
inline const_iterator cend() const { return e; }
|
||||
inline const_iterator constEnd() const { return e; }
|
||||
iterator insert(iterator before, const T &t);
|
||||
iterator erase(iterator pos);
|
||||
|
@ -919,6 +919,15 @@ void **QListData::erase(void **xi)
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QList::const_iterator QList::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
in the list.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QList::const_iterator QList::constBegin() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
@ -940,6 +949,15 @@ void **QListData::erase(void **xi)
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QList::const_iterator QList::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the list.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QList::const_iterator QList::constEnd() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
|
@ -269,9 +269,11 @@ public:
|
||||
// stl style
|
||||
inline iterator begin() { detach(); return reinterpret_cast<Node *>(p.begin()); }
|
||||
inline const_iterator begin() const { return reinterpret_cast<Node *>(p.begin()); }
|
||||
inline const_iterator cbegin() const { return reinterpret_cast<Node *>(p.begin()); }
|
||||
inline const_iterator constBegin() const { return reinterpret_cast<Node *>(p.begin()); }
|
||||
inline iterator end() { detach(); return reinterpret_cast<Node *>(p.end()); }
|
||||
inline const_iterator end() const { return reinterpret_cast<Node *>(p.end()); }
|
||||
inline const_iterator cend() const { return reinterpret_cast<Node *>(p.end()); }
|
||||
inline const_iterator constEnd() const { return reinterpret_cast<Node *>(p.end()); }
|
||||
iterator insert(iterator before, const T &t);
|
||||
iterator erase(iterator pos);
|
||||
|
@ -682,6 +682,15 @@ void QMapData::dump()
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QMap::const_iterator QMap::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
in the map.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QMap::const_iterator QMap::constBegin() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
@ -703,6 +712,15 @@ void QMapData::dump()
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QMap::const_iterator QMap::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the map.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QMap::const_iterator QMap::constEnd() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
@ -744,7 +762,7 @@ void QMapData::dump()
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QMap::iterator QMap::constFind(const Key &key) const
|
||||
/*! \fn QMap::const_iterator QMap::constFind(const Key &key) const
|
||||
\since 4.1
|
||||
|
||||
Returns an const iterator pointing to the item with key \a key in the
|
||||
|
@ -362,12 +362,14 @@ public:
|
||||
// STL style
|
||||
inline iterator begin() { detach(); return iterator(e->forward[0]); }
|
||||
inline const_iterator begin() const { return const_iterator(e->forward[0]); }
|
||||
inline const_iterator cbegin() const { return const_iterator(e->forward[0]); }
|
||||
inline const_iterator constBegin() const { return const_iterator(e->forward[0]); }
|
||||
inline iterator end() {
|
||||
detach();
|
||||
return iterator(e);
|
||||
}
|
||||
inline const_iterator end() const { return const_iterator(e); }
|
||||
inline const_iterator cend() const { return const_iterator(e); }
|
||||
inline const_iterator constEnd() const { return const_iterator(e); }
|
||||
iterator erase(iterator it);
|
||||
|
||||
|
@ -135,7 +135,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
\snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 2
|
||||
|
||||
The pattern() function returns the pattern that it's currently set for a
|
||||
The pattern() function returns the pattern that is currently set for a
|
||||
QRegularExpression object:
|
||||
|
||||
\snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 3
|
||||
@ -342,9 +342,9 @@ QT_BEGIN_NAMESPACE
|
||||
string; however, the subpattern \c{def} matches the subject string
|
||||
completely, and therefore a complete match is reported.
|
||||
|
||||
In case multiple partial matches are found when matching (but no complete
|
||||
match), then the QRegularExpressionMatch will report the first one that it
|
||||
is found. For instance:
|
||||
If multiple partial matches are found when matching (but no complete
|
||||
match), then the QRegularExpressionMatch object will report the first one
|
||||
that is found. For instance:
|
||||
|
||||
\snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 18
|
||||
|
||||
@ -440,7 +440,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
\section2 Exact matching
|
||||
|
||||
QRegExp::exactMatch in Qt 4 served for two purposes: it exactly matched
|
||||
QRegExp::exactMatch() in Qt 4 served two purposes: it exactly matched
|
||||
a regular expression against a subject string, and it implemented partial
|
||||
matching. In fact, if an exact match was not found, one could still find
|
||||
out how much of the subject string was matched by the regular expression
|
||||
@ -478,9 +478,20 @@ QT_BEGIN_NAMESPACE
|
||||
matching correctly (that is, like Perl does). In particular, patterns that
|
||||
can match 0 characters (like \c{"a*"}) are problematic.
|
||||
|
||||
QRegularExpression::globalMatch implements Perl global match correctly, and
|
||||
QRegularExpression::globalMatch() implements Perl global match correctly, and
|
||||
the returned iterator can be used to examine each result.
|
||||
|
||||
\section2 Unicode properties support
|
||||
|
||||
When using QRegExp, character classes such as \c{\w}, \c{\d}, etc. match
|
||||
characters with the corresponding Unicode property: for instance, \c{\d}
|
||||
matches any character with the Unicode Nd (decimal digit) property.
|
||||
|
||||
Those character classes only match ASCII characters by default when using
|
||||
QRegularExpression: for instance, \c{\d} matches exactly a character in the
|
||||
\c{0-9} ASCII range. It is possible to change this behaviour by using the
|
||||
UseUnicodePropertiesOption pattern option.
|
||||
|
||||
\section2 Wildcard matching
|
||||
|
||||
There is no equivalent of wildcard matching in QRegularExpression.
|
||||
@ -494,11 +505,11 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
\section2 Minimal matching
|
||||
|
||||
QRegExp::setMinimal implemented minimal matching by simply reversing the
|
||||
QRegExp::setMinimal() implemented minimal matching by simply reversing the
|
||||
greediness of the quantifiers (QRegExp did not support lazy quantifiers,
|
||||
like \c{*?}, \c{+?}, etc.). QRegularExpression instead does support greedy,
|
||||
lazy and possessive quantifiers. The InvertedGreedinessOption
|
||||
pattern option can be useful to emulate the effects of QRegExp::setMinimal:
|
||||
pattern option can be useful to emulate the effects of QRegExp::setMinimal():
|
||||
if enabled, it inverts the greediness of quantifiers (greedy ones become
|
||||
lazy and vice versa).
|
||||
|
||||
@ -675,7 +686,7 @@ QT_BEGIN_NAMESPACE
|
||||
equivalent for this option in Perl regular expressions.
|
||||
|
||||
\value UseUnicodePropertiesOption
|
||||
The meaning of the \c{\w}, \c{\d}, etc., character types, as well as
|
||||
The meaning of the \c{\w}, \c{\d}, etc., character classes, as well as
|
||||
the meaning of their counterparts (\c{\W}, \c{\D}, etc.), is changed
|
||||
from matching ASCII charaters only to matching any character with the
|
||||
corresponding Unicode property. For instance, \c{\d} is changed to
|
||||
@ -1004,12 +1015,18 @@ class QPcreJitStackPointer
|
||||
Q_DISABLE_COPY(QPcreJitStackPointer);
|
||||
|
||||
public:
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
QPcreJitStackPointer()
|
||||
{
|
||||
// The default JIT stack size in PCRE is 32K,
|
||||
// we allocate from 32K up to 512K.
|
||||
stack = pcre16_jit_stack_alloc(32*1024, 512*1024);
|
||||
}
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
~QPcreJitStackPointer()
|
||||
{
|
||||
if (stack)
|
||||
@ -1572,8 +1589,8 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const
|
||||
a backslash all characters in \a str, except for the characters in the
|
||||
\c{[A-Z]}, \c{[a-z]} and \c{[0-9]} ranges, as well as the underscore
|
||||
(\c{_}) character. The only difference with Perl is that a literal NUL
|
||||
inside \a str is escaped with the sequence \c{"\\\\0"} (backslash +
|
||||
\c{'0'}), instead of \c{"\\\\\\0"} (backslash + \c{NUL}).
|
||||
inside \a str is escaped with the sequence \c{"\\0"} (backslash +
|
||||
\c{'0'}), instead of \c{"\\\0"} (backslash + \c{NUL}).
|
||||
*/
|
||||
QString QRegularExpression::escape(const QString &str)
|
||||
{
|
||||
|
@ -164,9 +164,11 @@ public:
|
||||
// STL style
|
||||
inline iterator begin() { return q_hash.begin(); }
|
||||
inline const_iterator begin() const { return q_hash.begin(); }
|
||||
inline const_iterator cbegin() const { return q_hash.begin(); }
|
||||
inline const_iterator constBegin() const { return q_hash.constBegin(); }
|
||||
inline iterator end() { return q_hash.end(); }
|
||||
inline const_iterator end() const { return q_hash.end(); }
|
||||
inline const_iterator cend() const { return q_hash.end(); }
|
||||
inline const_iterator constEnd() const { return q_hash.constEnd(); }
|
||||
iterator erase(iterator i)
|
||||
{ return q_hash.erase(reinterpret_cast<typename Hash::iterator &>(i)); }
|
||||
|
@ -343,6 +343,15 @@
|
||||
item in the set.
|
||||
*/
|
||||
|
||||
/*! \fn QSet::const_iterator QSet::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} positioned at the first
|
||||
item in the set.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QSet::const_iterator QSet::constBegin() const
|
||||
|
||||
Returns a const \l{STL-style iterator} positioned at the first
|
||||
@ -367,6 +376,15 @@
|
||||
imaginary item after the last item in the set.
|
||||
*/
|
||||
|
||||
/*! \fn QSet::const_iterator QSet::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the set.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QSet::const_iterator QSet::constEnd() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
|
@ -862,6 +862,15 @@ int QString::grow(int size)
|
||||
\overload begin()
|
||||
*/
|
||||
|
||||
/*! \fn QString::const_iterator QString::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first character
|
||||
in the string.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QString::const_iterator QString::constBegin() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first character
|
||||
@ -883,6 +892,15 @@ int QString::grow(int size)
|
||||
\overload end()
|
||||
*/
|
||||
|
||||
/*! \fn QString::const_iterator QString::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the list.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QString::const_iterator QString::constEnd() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
|
@ -573,9 +573,11 @@ public:
|
||||
typedef const_iterator ConstIterator;
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator constBegin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
const_iterator cend() const;
|
||||
const_iterator constEnd() const;
|
||||
|
||||
// STL compatibility
|
||||
@ -921,12 +923,16 @@ inline QString::iterator QString::begin()
|
||||
{ detach(); return reinterpret_cast<QChar*>(d->data()); }
|
||||
inline QString::const_iterator QString::begin() const
|
||||
{ return reinterpret_cast<const QChar*>(d->data()); }
|
||||
inline QString::const_iterator QString::cbegin() const
|
||||
{ return reinterpret_cast<const QChar*>(d->data()); }
|
||||
inline QString::const_iterator QString::constBegin() const
|
||||
{ return reinterpret_cast<const QChar*>(d->data()); }
|
||||
inline QString::iterator QString::end()
|
||||
{ detach(); return reinterpret_cast<QChar*>(d->data() + d->size); }
|
||||
inline QString::const_iterator QString::end() const
|
||||
{ return reinterpret_cast<const QChar*>(d->data() + d->size); }
|
||||
inline QString::const_iterator QString::cend() const
|
||||
{ return reinterpret_cast<const QChar*>(d->data() + d->size); }
|
||||
inline QString::const_iterator QString::constEnd() const
|
||||
{ return reinterpret_cast<const QChar*>(d->data() + d->size); }
|
||||
inline bool QString::contains(const QString &s, Qt::CaseSensitivity cs) const
|
||||
|
@ -160,9 +160,11 @@ public:
|
||||
|
||||
inline iterator begin() { return ptr; }
|
||||
inline const_iterator begin() const { return ptr; }
|
||||
inline const_iterator cbegin() const { return ptr; }
|
||||
inline const_iterator constBegin() const { return ptr; }
|
||||
inline iterator end() { return ptr + s; }
|
||||
inline const_iterator end() const { return ptr + s; }
|
||||
inline const_iterator cend() const { return ptr + s; }
|
||||
inline const_iterator constEnd() const { return ptr + s; }
|
||||
iterator insert(iterator before, int n, const T &x);
|
||||
inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
|
||||
|
@ -451,6 +451,15 @@
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
in the array.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::constBegin() const
|
||||
\since 4.8
|
||||
|
||||
@ -475,6 +484,15 @@
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the array.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::constEnd() const
|
||||
\since 4.8
|
||||
|
||||
|
@ -688,6 +688,15 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT)
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QVector::const_iterator QVector::cbegin() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
in the vector.
|
||||
|
||||
\sa begin(), cend()
|
||||
*/
|
||||
|
||||
/*! \fn QVector::const_iterator QVector::constBegin() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the first item
|
||||
@ -709,6 +718,15 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT)
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*! \fn QVector::const_iterator QVector::cend() const
|
||||
\since 5.0
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
item after the last item in the vector.
|
||||
|
||||
\sa cbegin(), end()
|
||||
*/
|
||||
|
||||
/*! \fn QVector::const_iterator QVector::constEnd() const
|
||||
|
||||
Returns a const \l{STL-style iterator} pointing to the imaginary
|
||||
|
@ -248,9 +248,11 @@ public:
|
||||
#endif
|
||||
inline iterator begin() { detach(); return d->begin(); }
|
||||
inline const_iterator begin() const { return d->begin(); }
|
||||
inline const_iterator cbegin() const { return d->begin(); }
|
||||
inline const_iterator constBegin() const { return d->begin(); }
|
||||
inline iterator end() { detach(); return d->end(); }
|
||||
inline const_iterator end() const { return d->end(); }
|
||||
inline const_iterator cend() const { return d->end(); }
|
||||
inline const_iterator constEnd() const { return d->end(); }
|
||||
iterator insert(iterator before, int n, const T &x);
|
||||
inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
|
||||
|
@ -58,7 +58,6 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
class QDBusUnixFileDescriptorPrivate;
|
||||
template<> QExplicitlySharedDataPointer<QDBusUnixFileDescriptorPrivate>::~QExplicitlySharedDataPointer();
|
||||
|
||||
class Q_DBUS_EXPORT QDBusUnixFileDescriptor
|
||||
{
|
||||
@ -80,8 +79,6 @@ public:
|
||||
static bool isSupported();
|
||||
|
||||
#if defined(Q_COMPILER_RVALUE_REFS)
|
||||
QDBusUnixFileDescriptor(QDBusUnixFileDescriptor &&other) : d(static_cast<Data &&>(other.d))
|
||||
{ }
|
||||
inline QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other)
|
||||
{ d.swap(other.d); return *this; }
|
||||
#endif
|
||||
|
@ -430,6 +430,7 @@ private:
|
||||
|
||||
class Q_GUI_EXPORT QAccessibleEvent
|
||||
{
|
||||
Q_DISABLE_COPY(QAccessibleEvent)
|
||||
public:
|
||||
inline QAccessibleEvent(QAccessible::Event typ, QObject *obj, int chld = -1)
|
||||
: m_type(typ), m_object(obj), m_child(chld)
|
||||
@ -446,7 +447,8 @@ public:
|
||||
|
||||
QAccessibleInterface *accessibleInterface() const;
|
||||
|
||||
private:
|
||||
protected:
|
||||
|
||||
QAccessible::Event m_type;
|
||||
QObject *m_object;
|
||||
int m_child;
|
||||
@ -463,7 +465,7 @@ public:
|
||||
return m_changedStates;
|
||||
}
|
||||
|
||||
private:
|
||||
protected:
|
||||
QAccessible::State m_changedStates;
|
||||
};
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "qwindowsysteminterface_qpa.h"
|
||||
#include "qwindowsysteminterface_qpa_p.h"
|
||||
#include "private/qguiapplication_p.h"
|
||||
#include "private/qevent_p.h"
|
||||
#include "private/qtouchdevice_p.h"
|
||||
#include <QAbstractEventDispatcher>
|
||||
#include <QPlatformDrag>
|
||||
@ -147,6 +148,39 @@ void QWindowSystemInterface::handleMouseEvent(QWindow *tlw, ulong timestamp, con
|
||||
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
|
||||
}
|
||||
|
||||
bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
|
||||
const QString & text, bool autorep, ushort count)
|
||||
{
|
||||
unsigned long timestamp = QWindowSystemInterfacePrivate::eventTime.elapsed();
|
||||
return tryHandleSynchronousShortcutEvent(w, timestamp, k, mods, text, autorep, count);
|
||||
}
|
||||
|
||||
bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
|
||||
const QString & text, bool autorep, ushort count)
|
||||
{
|
||||
QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count);
|
||||
qevent.setTimestamp(timestamp);
|
||||
return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent);
|
||||
}
|
||||
|
||||
bool QWindowSystemInterface::tryHandleSynchronousExtendedShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
|
||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
||||
const QString &text, bool autorep, ushort count)
|
||||
{
|
||||
unsigned long timestamp = QWindowSystemInterfacePrivate::eventTime.elapsed();
|
||||
return tryHandleSynchronousExtendedShortcutEvent(w, timestamp, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count);
|
||||
}
|
||||
|
||||
bool QWindowSystemInterface::tryHandleSynchronousExtendedShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
|
||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
||||
const QString &text, bool autorep, ushort count)
|
||||
{
|
||||
QKeyEventEx qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count, nativeScanCode, nativeVirtualKey, nativeModifiers);
|
||||
qevent.setTimestamp(timestamp);
|
||||
return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent);
|
||||
}
|
||||
|
||||
|
||||
void QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) {
|
||||
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
|
||||
handleKeyEvent(w, time, t, k, mods, text, autorep, count);
|
||||
|
@ -69,6 +69,18 @@ public:
|
||||
static void handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier);
|
||||
static void handleMouseEvent(QWindow *w, ulong timestamp, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier);
|
||||
|
||||
static bool tryHandleSynchronousShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
|
||||
const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||
static bool tryHandleSynchronousShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
|
||||
const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||
|
||||
static bool tryHandleSynchronousExtendedShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
|
||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
||||
const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||
static bool tryHandleSynchronousExtendedShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
|
||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
||||
const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||
|
||||
static void handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||
static void handleKeyEvent(QWindow *w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||
|
||||
|
@ -1564,7 +1564,9 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag
|
||||
(flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face);
|
||||
for (int i = 0; i < glyphs->numGlyphs; i++) {
|
||||
Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0;
|
||||
if (g) {
|
||||
// Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph
|
||||
GlyphFormat acceptableFormat = (defaultFormat != Format_None) ? defaultFormat : Format_Mono;
|
||||
if (g && g->format == acceptableFormat) {
|
||||
glyphs->advances_x[i] = design ? QFixed::fromFixed(g->linearAdvance) : QFixed(g->advance);
|
||||
} else {
|
||||
if (!face)
|
||||
|
@ -354,7 +354,7 @@ static void cleanupCocoaApplicationDelegate()
|
||||
- (void)qtDispatcherToQAction:(id)sender
|
||||
{
|
||||
Q_UNUSED(sender);
|
||||
//[[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender];
|
||||
[qtMenuLoader qtDispatcherToQAction:sender];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -64,6 +64,10 @@ QMimeData *QCocoaClipboard::mimeData(QClipboard::Mode mode)
|
||||
void QCocoaClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
|
||||
{
|
||||
if (QMacPasteboard *pasteBoard = pasteboardForMode(mode)) {
|
||||
if (data == 0) {
|
||||
pasteBoard->clear();
|
||||
}
|
||||
|
||||
pasteBoard->sync();
|
||||
pasteBoard->setMimeData(data);
|
||||
emitChanged(mode);
|
||||
|
@ -570,42 +570,47 @@ static QTouchDevice *touchDevice = 0;
|
||||
return qtMods;
|
||||
}
|
||||
|
||||
- (void)handleKeyEvent:(NSEvent *)theEvent eventType:(int)eventType
|
||||
- (void)handleKeyEvent:(NSEvent *)nsevent eventType:(int)eventType
|
||||
{
|
||||
NSTimeInterval timestamp = [theEvent timestamp];
|
||||
ulong qt_timestamp = timestamp * 1000;
|
||||
QString characters = QString::fromUtf8([[theEvent characters] UTF8String]);
|
||||
Qt::KeyboardModifiers modifiers = [self convertKeyModifiers : [theEvent modifierFlags]];
|
||||
QChar ch([[theEvent charactersIgnoringModifiers] characterAtIndex:0]);
|
||||
int keyCode = [self convertKeyCode : ch];
|
||||
ulong timestamp = [nsevent timestamp] * 1000;
|
||||
Qt::KeyboardModifiers modifiers = [self convertKeyModifiers:[nsevent modifierFlags]];
|
||||
NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers];
|
||||
QChar ch([charactersIgnoringModifiers characterAtIndex:0]);
|
||||
int keyCode = [self convertKeyCode:ch];
|
||||
|
||||
QWindowSystemInterface::handleKeyEvent(m_window, qt_timestamp, QEvent::Type(eventType), keyCode, modifiers, characters);
|
||||
}
|
||||
QString text;
|
||||
if (eventType == QEvent::KeyPress) {
|
||||
// ignore text for the U+F700-U+F8FF range. This is used by Cocoa when
|
||||
// delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.)
|
||||
if ([charactersIgnoringModifiers length] == 1 && (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff))
|
||||
text = QString::fromUtf8([[nsevent characters] UTF8String]);
|
||||
|
||||
- (void)keyDown:(NSEvent *)theEvent
|
||||
{
|
||||
QObject *fo = QGuiApplication::focusObject();
|
||||
m_keyEventsAccepted = false;
|
||||
if (fo) {
|
||||
QInputMethodQueryEvent queryEvent(Qt::ImHints);
|
||||
if (QCoreApplication::sendEvent(fo, &queryEvent)) {
|
||||
Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(queryEvent.value(Qt::ImHints).toUInt());
|
||||
if (!(hints & Qt::ImhDigitsOnly || hints & Qt::ImhFormattedNumbersOnly || hints & Qt::ImhHiddenText)) {
|
||||
[self interpretKeyEvents:[NSArray arrayWithObject: theEvent]];
|
||||
if (!m_keyEventsAccepted && m_composingText.isEmpty())
|
||||
m_keyEventsAccepted = QWindowSystemInterface::tryHandleSynchronousShortcutEvent(m_window, timestamp, keyCode, modifiers, text);
|
||||
|
||||
QObject *fo = QGuiApplication::focusObject();
|
||||
if (!m_keyEventsAccepted && fo) {
|
||||
QInputMethodQueryEvent queryEvent(Qt::ImHints);
|
||||
if (QCoreApplication::sendEvent(fo, &queryEvent)) {
|
||||
Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(queryEvent.value(Qt::ImHints).toUInt());
|
||||
if (!(hints & Qt::ImhDigitsOnly || hints & Qt::ImhFormattedNumbersOnly || hints & Qt::ImhHiddenText))
|
||||
[self interpretKeyEvents:[NSArray arrayWithObject:nsevent]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_keyEventsAccepted && m_composingText.isEmpty()) {
|
||||
[self handleKeyEvent : theEvent eventType :int(QEvent::KeyPress)];
|
||||
}
|
||||
if (!m_keyEventsAccepted && m_composingText.isEmpty())
|
||||
QWindowSystemInterface::handleKeyEvent(m_window, timestamp, QEvent::Type(eventType), keyCode, modifiers, text);
|
||||
}
|
||||
|
||||
- (void)keyUp:(NSEvent *)theEvent
|
||||
- (void)keyDown:(NSEvent *)nsevent
|
||||
{
|
||||
if (!m_keyEventsAccepted && m_composingText.isEmpty()) {
|
||||
[self handleKeyEvent : theEvent eventType :int(QEvent::KeyRelease)];
|
||||
}
|
||||
m_keyEventsAccepted = false;
|
||||
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)];
|
||||
}
|
||||
|
||||
- (void)keyUp:(NSEvent *)nsevent
|
||||
{
|
||||
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyRelease)];
|
||||
}
|
||||
|
||||
- (void) doCommandBySelector:(SEL)aSelector
|
||||
|
@ -98,18 +98,18 @@ public:
|
||||
}
|
||||
static void clearEvents() { eventList().clear(); }
|
||||
static EventList events() { return eventList(); }
|
||||
static bool verifyEvent(const QAccessibleEvent& ev)
|
||||
static bool verifyEvent(QAccessibleEvent *ev)
|
||||
{
|
||||
if (eventList().isEmpty())
|
||||
return false;
|
||||
QAccessibleEvent *first = eventList().takeFirst();
|
||||
bool res = *first == ev;
|
||||
bool res = *first == *ev;
|
||||
delete first;
|
||||
return res;
|
||||
}
|
||||
static bool containsEvent(const QAccessibleEvent &event) {
|
||||
static bool containsEvent(QAccessibleEvent *event) {
|
||||
Q_FOREACH (QAccessibleEvent *ev, eventList()) {
|
||||
if (*ev == event)
|
||||
if (*ev == *event)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -862,7 +862,7 @@ QT_BEGIN_NAMESPACE
|
||||
/*! \fn bool QTest::qWaitForWindowShown(QWidget *window)
|
||||
\since 4.6
|
||||
|
||||
Waits until the \a window is shown in the screen. This is mainly useful for
|
||||
Waits until the \a window is shown on the screen. This is mainly useful for
|
||||
asynchronous systems like X11, where a window will be mapped to screen some
|
||||
time after being asked to show itself on the screen. Returns true.
|
||||
|
||||
@ -870,6 +870,37 @@ QT_BEGIN_NAMESPACE
|
||||
\snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 24
|
||||
*/
|
||||
|
||||
/*! \fn bool QTest::qWaitForWindowShown(QWindow *window, int timeout)
|
||||
\since 5.0
|
||||
|
||||
Waits for \a timeout milliseconds or until the \a window is shown on the screen.
|
||||
This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some
|
||||
time after being asked to show itself on the screen.
|
||||
|
||||
Returns true if \c window is show in \a timout milliseconds, otherwise returns false.
|
||||
|
||||
\sa QTest::qWaitForWindowActive(), QTest::qWaitForWindowExposed()
|
||||
*/
|
||||
|
||||
/*! \fn bool QTest::qWaitForWindowActive(QWindow *window, int timeout)
|
||||
\since 5.0
|
||||
|
||||
Waits for \a timeout milliseconds or until the \a window is active.
|
||||
|
||||
Returns true if \c window is active in \a timout milliseconds, otherwise returns false.
|
||||
|
||||
\sa QTest::qWaitForWindowActive(), QTest::qWaitForWindowShown(), QWindow::isActive()
|
||||
*/
|
||||
|
||||
/*! \fn bool QTest::qWaitForWindowExposed(QWindow *window, int timeout)
|
||||
\since 5.0
|
||||
|
||||
Waits for \a timeout milliseconds or until the \a window is exposed.
|
||||
Returns true if \c window is exposed in \a timout milliseconds, otherwise returns false.
|
||||
|
||||
\sa QTest::qWaitForWindowShown(), QTest::qWaitForWindowExposed(), QWindow::isExposed()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QTest::QTouchEventSequence
|
||||
\inmodule QtTest
|
||||
|
@ -76,19 +76,39 @@ namespace QTest
|
||||
return true;
|
||||
}
|
||||
|
||||
inline static bool qWaitForWindowShown(QWindow *window)
|
||||
inline static bool qWaitForWindowActive(QWindow *window, int timeout = 1000)
|
||||
{
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
while (!window->isExposed()) {
|
||||
int remaining = int(timer.elapsed()) - 1000;
|
||||
while (!window->isActive()) {
|
||||
int remaining = timeout - int(timer.elapsed());
|
||||
if (remaining <= 0)
|
||||
break;
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
||||
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
|
||||
QTest::qSleep(10);
|
||||
}
|
||||
return true;
|
||||
return window->isActive();
|
||||
}
|
||||
|
||||
inline static bool qWaitForWindowExposed(QWindow *window, int timeout = 1000)
|
||||
{
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
while (!window->isExposed()) {
|
||||
int remaining = timeout - int(timer.elapsed());
|
||||
if (remaining <= 0)
|
||||
break;
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
||||
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
|
||||
QTest::qSleep(10);
|
||||
}
|
||||
return window->isExposed();
|
||||
}
|
||||
|
||||
inline static bool qWaitForWindowShown(QWindow *window, int timeout = 1000)
|
||||
{
|
||||
return qWaitForWindowActive(window, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5900,9 +5900,15 @@ void DitaXmlGenerator::writeDitaMap(const Tree *tree)
|
||||
writeEndTag(); // </topicmeta>
|
||||
|
||||
writeStartTag(DT_topicref);
|
||||
xmlWriter().writeAttribute("navtitle",project);
|
||||
if (rootPageNode)
|
||||
if (rootPageNode) {
|
||||
if (!rootPageNode->title().isEmpty())
|
||||
xmlWriter().writeAttribute("navtitle",rootPageNode->title());
|
||||
else
|
||||
xmlWriter().writeAttribute("navtitle",project);
|
||||
xmlWriter().writeAttribute("href",fileName(rootPageNode));
|
||||
}
|
||||
else
|
||||
xmlWriter().writeAttribute("navtitle",project);
|
||||
|
||||
writeTopicrefs(pageTypeMaps[Node::OverviewPage], "overviews");
|
||||
writeTopicrefs(pageTypeMaps[Node::HowToPage], "howtos");
|
||||
|
@ -376,15 +376,16 @@ QIcon QFileIconProviderPrivate::getMacIcon(const QFileInfo &fi) const
|
||||
qt_mac_constructQIconFromIconRef(iconRef, 0, &retIcon);
|
||||
ReleaseIconRef(iconRef);
|
||||
|
||||
pixmap = retIcon.pixmap(16);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("16"), pixmap);
|
||||
pixmap = retIcon.pixmap(32);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("32"), pixmap);
|
||||
pixmap = retIcon.pixmap(64);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("64"), pixmap);
|
||||
pixmap = retIcon.pixmap(128);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("128"), pixmap);
|
||||
|
||||
if (fi.isFile() && !fi.isExecutable() && !fi.isSymLink()) {
|
||||
pixmap = retIcon.pixmap(16);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("16"), pixmap);
|
||||
pixmap = retIcon.pixmap(32);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("32"), pixmap);
|
||||
pixmap = retIcon.pixmap(64);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("64"), pixmap);
|
||||
pixmap = retIcon.pixmap(128);
|
||||
QPixmapCache::insert(keyBase + QLatin1String("128"), pixmap);
|
||||
}
|
||||
return retIcon;
|
||||
}
|
||||
#endif
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <qevent.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qmenu.h>
|
||||
#include <qmenubar.h>
|
||||
#include <qapplication.h>
|
||||
#include <private/qapplication_p.h>
|
||||
#include <private/qshortcutmap_p.h>
|
||||
@ -114,7 +115,7 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
|
||||
static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidget *active_window)
|
||||
{
|
||||
bool visible = w->isVisible();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
|
||||
visible = true;
|
||||
#endif
|
||||
@ -177,7 +178,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
|
||||
static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsWidget *w, QWidget *active_window)
|
||||
{
|
||||
bool visible = w->isVisible();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
|
||||
visible = true;
|
||||
#endif
|
||||
|
@ -660,20 +660,28 @@ FOR_EACH_CORE_METATYPE(RETURN_CREATE_COPY_FUNCTION)
|
||||
void tst_QMetaType::sizeOf_data()
|
||||
{
|
||||
QTest::addColumn<QMetaType::Type>("type");
|
||||
QTest::addColumn<int>("size");
|
||||
QTest::addColumn<size_t>("size");
|
||||
|
||||
QTest::newRow("QMetaType::UnknownType") << QMetaType::UnknownType << 0;
|
||||
QTest::newRow("QMetaType::UnknownType") << QMetaType::UnknownType << size_t(0);
|
||||
#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \
|
||||
QTest::newRow(#RealType) << QMetaType::MetaTypeName << int(QTypeInfo<RealType>::sizeOf);
|
||||
QTest::newRow(#RealType) << QMetaType::MetaTypeName << size_t(QTypeInfo<RealType>::sizeOf);
|
||||
FOR_EACH_CORE_METATYPE(ADD_METATYPE_TEST_ROW)
|
||||
#undef ADD_METATYPE_TEST_ROW
|
||||
|
||||
QTest::newRow("Whity<double>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<double> >()) << sizeof(Whity<double>);
|
||||
QTest::newRow("Whity<int>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<int> >()) << sizeof(Whity<int>);
|
||||
QTest::newRow("Testspace::Foo") << static_cast<QMetaType::Type>(::qMetaTypeId<TestSpace::Foo>()) << sizeof(TestSpace::Foo);
|
||||
|
||||
QTest::newRow("-1") << QMetaType::Type(-1) << size_t(0);
|
||||
QTest::newRow("-124125534") << QMetaType::Type(-124125534) << size_t(0);
|
||||
QTest::newRow("124125534") << QMetaType::Type(124125534) << size_t(0);
|
||||
}
|
||||
|
||||
void tst_QMetaType::sizeOf()
|
||||
{
|
||||
QFETCH(QMetaType::Type, type);
|
||||
QFETCH(int, size);
|
||||
QCOMPARE(QMetaType::sizeOf(type), size);
|
||||
QFETCH(size_t, size);
|
||||
QCOMPARE(size_t(QMetaType::sizeOf(type)), size);
|
||||
}
|
||||
|
||||
void tst_QMetaType::sizeOfStaticLess_data()
|
||||
@ -684,8 +692,8 @@ void tst_QMetaType::sizeOfStaticLess_data()
|
||||
void tst_QMetaType::sizeOfStaticLess()
|
||||
{
|
||||
QFETCH(QMetaType::Type, type);
|
||||
QFETCH(int, size);
|
||||
QCOMPARE(QMetaType(type).sizeOf(), size);
|
||||
QFETCH(size_t, size);
|
||||
QCOMPARE(size_t(QMetaType(type).sizeOf()), size);
|
||||
}
|
||||
|
||||
struct CustomMovable {};
|
||||
|
@ -285,6 +285,8 @@ void tst_QMap::beginEnd()
|
||||
QVERIFY( map.constBegin() == map.constEnd() );
|
||||
map.insert( "0", "a" );
|
||||
map.insert( "1", "b" );
|
||||
QVERIFY( map.constBegin() == map.cbegin() );
|
||||
QVERIFY( map.constEnd() == map.cend() );
|
||||
|
||||
// make a copy. const function shouldn't detach
|
||||
StringMap map2 = map;
|
||||
|
@ -393,9 +393,9 @@ void tst_QSet::begin()
|
||||
|
||||
{
|
||||
QSet<int>::const_iterator i = set1.constBegin();
|
||||
QSet<int>::const_iterator j = set1.constBegin();
|
||||
QSet<int>::const_iterator j = set1.cbegin();
|
||||
QSet<int>::const_iterator k = set2.constBegin();
|
||||
QSet<int>::const_iterator ell = set2.constBegin();
|
||||
QSet<int>::const_iterator ell = set2.cbegin();
|
||||
|
||||
QVERIFY(i == j);
|
||||
QVERIFY(k == ell);
|
||||
@ -407,9 +407,9 @@ void tst_QSet::begin()
|
||||
|
||||
{
|
||||
QSet<int>::const_iterator i = set1.constBegin();
|
||||
QSet<int>::const_iterator j = set1.constBegin();
|
||||
QSet<int>::const_iterator j = set1.cbegin();
|
||||
QSet<int>::const_iterator k = set2.constBegin();
|
||||
QSet<int>::const_iterator ell = set2.constBegin();
|
||||
QSet<int>::const_iterator ell = set2.cbegin();
|
||||
|
||||
QVERIFY(i == j);
|
||||
QVERIFY(k == ell);
|
||||
@ -421,9 +421,9 @@ void tst_QSet::begin()
|
||||
|
||||
{
|
||||
QSet<int>::const_iterator i = set1.constBegin();
|
||||
QSet<int>::const_iterator j = set1.constBegin();
|
||||
QSet<int>::const_iterator j = set1.cbegin();
|
||||
QSet<int>::const_iterator k = set2.constBegin();
|
||||
QSet<int>::const_iterator ell = set2.constBegin();
|
||||
QSet<int>::const_iterator ell = set2.cbegin();
|
||||
|
||||
QVERIFY(i == j);
|
||||
QVERIFY(k == ell);
|
||||
@ -439,9 +439,9 @@ void tst_QSet::end()
|
||||
|
||||
{
|
||||
QSet<int>::const_iterator i = set1.constEnd();
|
||||
QSet<int>::const_iterator j = set1.constEnd();
|
||||
QSet<int>::const_iterator j = set1.cend();
|
||||
QSet<int>::const_iterator k = set2.constEnd();
|
||||
QSet<int>::const_iterator ell = set2.constEnd();
|
||||
QSet<int>::const_iterator ell = set2.cend();
|
||||
|
||||
QVERIFY(i == j);
|
||||
QVERIFY(k == ell);
|
||||
@ -456,9 +456,9 @@ void tst_QSet::end()
|
||||
|
||||
{
|
||||
QSet<int>::const_iterator i = set1.constEnd();
|
||||
QSet<int>::const_iterator j = set1.constEnd();
|
||||
QSet<int>::const_iterator j = set1.cend();
|
||||
QSet<int>::const_iterator k = set2.constEnd();
|
||||
QSet<int>::const_iterator ell = set2.constEnd();
|
||||
QSet<int>::const_iterator ell = set2.cend();
|
||||
|
||||
QVERIFY(i == j);
|
||||
QVERIFY(k == ell);
|
||||
@ -473,9 +473,9 @@ void tst_QSet::end()
|
||||
|
||||
{
|
||||
QSet<int>::const_iterator i = set1.constEnd();
|
||||
QSet<int>::const_iterator j = set1.constEnd();
|
||||
QSet<int>::const_iterator j = set1.cend();
|
||||
QSet<int>::const_iterator k = set2.constEnd();
|
||||
QSet<int>::const_iterator ell = set2.constEnd();
|
||||
QSet<int>::const_iterator ell = set2.cend();
|
||||
|
||||
QVERIFY(i == j);
|
||||
QVERIFY(k == ell);
|
||||
|
@ -4,8 +4,6 @@ TARGET = tst_qpainter
|
||||
QT += widgets widgets-private printsupport testlib
|
||||
|
||||
SOURCES += tst_qpainter.cpp
|
||||
mac*:CONFIG+=insignificant_test
|
||||
win32:CONFIG += insignificant_test # QTBUG-24188
|
||||
|
||||
TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \
|
||||
task217400.png
|
||||
|
@ -550,6 +550,10 @@ void tst_Collections::list()
|
||||
QList<QString>::const_iterator cit = list.constBegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
|
||||
cit = list.cbegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
}
|
||||
|
||||
{
|
||||
@ -967,6 +971,10 @@ void tst_Collections::linkedList()
|
||||
QLinkedList<QString>::const_iterator cit = list.constBegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
|
||||
cit = list.cbegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
}
|
||||
|
||||
{
|
||||
@ -1607,6 +1615,10 @@ void tst_Collections::hash()
|
||||
QHash<int, QString>::const_iterator cit = hash.constBegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
|
||||
cit = hash.cbegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
}
|
||||
|
||||
{
|
||||
@ -1924,6 +1936,10 @@ void tst_Collections::map()
|
||||
QMap<int, QString>::const_iterator cit = map.constBegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
|
||||
cit = map.cbegin();
|
||||
QVERIFY((*cit).toLower() == "xello");
|
||||
QVERIFY(cit->toUpper() == "XELLO");
|
||||
}
|
||||
|
||||
{
|
||||
@ -2902,7 +2918,7 @@ void tst_Collections::linkedlist_stl()
|
||||
QCOMPARE(int(stdList.size()), elements.size());
|
||||
|
||||
std::list<QString>::const_iterator it = stdList.begin();
|
||||
QLinkedList<QString>::const_iterator it2 = list.constBegin();
|
||||
QLinkedList<QString>::const_iterator it2 = list.cbegin();
|
||||
for (uint j = 0; j < stdList.size(); ++j, ++it, ++it2)
|
||||
QCOMPARE(*it, *it2);
|
||||
|
||||
@ -3001,9 +3017,11 @@ void instantiateContainer()
|
||||
#ifndef QT_NO_STL
|
||||
typename ContainerType::const_iterator constIt;
|
||||
constIt = constContainer.begin();
|
||||
constIt = container.cbegin();
|
||||
container.constBegin();
|
||||
|
||||
constIt = constContainer.end();
|
||||
constIt = constContainer.cend();
|
||||
container.constEnd();
|
||||
Q_UNUSED(constIt)
|
||||
#endif
|
||||
|
@ -369,18 +369,22 @@ void tst_QAccessibility::eventTest()
|
||||
button->setObjectName(QString("Olaf"));
|
||||
|
||||
button->show();
|
||||
QVERIFY_EVENT(QAccessibleEvent(QAccessible::ObjectShow, button, -1));
|
||||
QAccessibleEvent showEvent(QAccessible::ObjectShow, button, -1);
|
||||
QVERIFY_EVENT(&showEvent);
|
||||
button->setFocus(Qt::MouseFocusReason);
|
||||
QTestAccessibility::clearEvents();
|
||||
QTest::mouseClick(button, Qt::LeftButton, 0);
|
||||
|
||||
button->setAccessibleName("Olaf the second");
|
||||
QVERIFY_EVENT(QAccessibleEvent(QAccessible::NameChanged, button));
|
||||
QAccessibleEvent nameEvent(QAccessible::NameChanged, button);
|
||||
QVERIFY_EVENT(&nameEvent);
|
||||
button->setAccessibleDescription("This is a button labeled Olaf");
|
||||
QVERIFY_EVENT(QAccessibleEvent(QAccessible::DescriptionChanged, button));
|
||||
QAccessibleEvent descEvent(QAccessible::DescriptionChanged, button);
|
||||
QVERIFY_EVENT(&descEvent);
|
||||
|
||||
button->hide();
|
||||
QVERIFY_EVENT(QAccessibleEvent(QAccessible::ObjectHide, button));
|
||||
QAccessibleEvent hideEvent(QAccessible::ObjectHide, button);
|
||||
QVERIFY_EVENT(&hideEvent);
|
||||
|
||||
delete button;
|
||||
}
|
||||
@ -684,16 +688,20 @@ void tst_QAccessibility::hideShowTest()
|
||||
window->show();
|
||||
QVERIFY(!state(window).invisible);
|
||||
QVERIFY(!state(child).invisible);
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectShow, window)));
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectShow, child)));
|
||||
QAccessibleEvent show(QAccessible::ObjectShow, window);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&show));
|
||||
QAccessibleEvent showChild(QAccessible::ObjectShow, child);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&showChild));
|
||||
QTestAccessibility::clearEvents();
|
||||
|
||||
// hide() and veryfy that both window and child are invisible and get ObjectHide events.
|
||||
window->hide();
|
||||
QVERIFY(state(window).invisible);
|
||||
QVERIFY(state(child).invisible);
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectHide, window)));
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectHide, child)));
|
||||
QAccessibleEvent hide(QAccessible::ObjectHide, window);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&hide));
|
||||
QAccessibleEvent hideChild(QAccessible::ObjectHide, child);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&hideChild));
|
||||
QTestAccessibility::clearEvents();
|
||||
|
||||
delete window;
|
||||
@ -774,7 +782,8 @@ void tst_QAccessibility::mainWindowTest()
|
||||
QLatin1String name = QLatin1String("I am the main window");
|
||||
mw->setWindowTitle(name);
|
||||
QTest::qWaitForWindowShown(mw);
|
||||
QVERIFY_EVENT(QAccessibleEvent(QAccessible::ObjectShow, mw));
|
||||
QAccessibleEvent show(QAccessible::ObjectShow, mw);
|
||||
QVERIFY_EVENT(&show);
|
||||
|
||||
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(mw);
|
||||
QCOMPARE(interface->text(QAccessible::Name), name);
|
||||
@ -934,9 +943,10 @@ void tst_QAccessibility::buttonTest()
|
||||
QVERIFY(checkBox.isChecked());
|
||||
QAccessible::State st;
|
||||
st.checked = true;
|
||||
QVERIFY_EVENT(QAccessibleStateChangeEvent(st, &checkBox));
|
||||
QAccessibleStateChangeEvent ev(st, &checkBox);
|
||||
QVERIFY_EVENT(&ev);
|
||||
checkBox.setChecked(false);
|
||||
QVERIFY_EVENT(QAccessibleStateChangeEvent(st, &checkBox));
|
||||
QVERIFY_EVENT(&ev);
|
||||
delete interface;
|
||||
}
|
||||
|
||||
@ -954,7 +964,8 @@ void tst_QAccessibility::buttonTest()
|
||||
QVERIFY(radio.isChecked());
|
||||
QAccessible::State st;
|
||||
st.checked = true;
|
||||
QVERIFY_EVENT(QAccessibleStateChangeEvent(st, &radio));
|
||||
QAccessibleStateChangeEvent ev(st, &radio);
|
||||
QVERIFY_EVENT(&ev);
|
||||
delete interface;
|
||||
}
|
||||
|
||||
@ -1017,12 +1028,14 @@ void tst_QAccessibility::scrollBarTest()
|
||||
scrollBar->resize(200, 50);
|
||||
scrollBar->show();
|
||||
QVERIFY(!scrollBarInterface->state().invisible);
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectShow, scrollBar)));
|
||||
QAccessibleEvent show(QAccessible::ObjectShow, scrollBar);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&show));
|
||||
QTestAccessibility::clearEvents();
|
||||
|
||||
scrollBar->hide();
|
||||
QVERIFY(scrollBarInterface->state().invisible);
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectHide, scrollBar)));
|
||||
QAccessibleEvent hide(QAccessible::ObjectHide, scrollBar);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&hide));
|
||||
QTestAccessibility::clearEvents();
|
||||
|
||||
// Test that the left/right subcontrols are set to unavailable when the scrollBar is at the minimum/maximum.
|
||||
@ -1463,7 +1476,7 @@ void tst_QAccessibility::spinBoxTest()
|
||||
QTest::keyPress(spinBox, Qt::Key_Up);
|
||||
QTest::qWait(200);
|
||||
QAccessibleEvent expectedEvent(QAccessible::ValueChanged, spinBox);
|
||||
QVERIFY(QTestAccessibility::containsEvent(expectedEvent));
|
||||
QVERIFY(QTestAccessibility::containsEvent(&expectedEvent));
|
||||
delete spinBox;
|
||||
QTestAccessibility::clearEvents();
|
||||
}
|
||||
@ -1733,7 +1746,8 @@ void tst_QAccessibility::lineEditTest()
|
||||
le->setFocus(Qt::TabFocusReason);
|
||||
QTestAccessibility::clearEvents();
|
||||
le2->setFocus(Qt::TabFocusReason);
|
||||
QTRY_VERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Focus, le2)));
|
||||
QAccessibleEvent ev(QAccessible::Focus, le2);
|
||||
QTRY_VERIFY(QTestAccessibility::containsEvent(&ev));
|
||||
|
||||
le->setText(QLatin1String("500"));
|
||||
le->setValidator(new QIntValidator());
|
||||
@ -1753,7 +1767,8 @@ void tst_QAccessibility::lineEditTest()
|
||||
le3->deselect();
|
||||
le3->setCursorPosition(3);
|
||||
QCOMPARE(textIface->cursorPosition(), 3);
|
||||
QTRY_VERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::TextCaretMoved, le3)));
|
||||
QAccessibleEvent caretEvent(QAccessible::TextCaretMoved, le3);
|
||||
QTRY_VERIFY(QTestAccessibility::containsEvent(&caretEvent));
|
||||
QCOMPARE(textIface->selectionCount(), 0);
|
||||
QTestAccessibility::clearEvents();
|
||||
|
||||
@ -2124,11 +2139,15 @@ void tst_QAccessibility::listTest()
|
||||
|
||||
// Check for events
|
||||
QTest::mouseClick(listView->viewport(), Qt::LeftButton, 0, listView->visualItemRect(listView->item(1)).center());
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Selection, listView, 2)));
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Focus, listView, 2)));
|
||||
QAccessibleEvent selectList2(QAccessible::Selection, listView, 2);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&selectList2));
|
||||
QAccessibleEvent focusList2(QAccessible::Focus, listView, 2);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&focusList2));
|
||||
QTest::mouseClick(listView->viewport(), Qt::LeftButton, 0, listView->visualItemRect(listView->item(2)).center());
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Selection, listView, 3)));
|
||||
QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Focus, listView, 3)));
|
||||
QAccessibleEvent selectList3(QAccessible::Selection, listView, 3);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&selectList3));
|
||||
QAccessibleEvent focusList3(QAccessible::Focus, listView, 3);
|
||||
QVERIFY(QTestAccessibility::containsEvent(&focusList3));
|
||||
|
||||
listView->addItem("Munich");
|
||||
QCOMPARE(iface->childCount(), 4);
|
||||
|
@ -129,7 +129,9 @@ void tst_QTextCodec::fromUnicode_data() const
|
||||
void tst_QTextCodec::fromUnicode() const
|
||||
{
|
||||
QFETCH(QTextCodec*, codec);
|
||||
QFile file(SRCDIR "utf-8.txt");
|
||||
QString testFile = QFINDTESTDATA("utf-8.txt");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file utf-8.txt!");
|
||||
QFile file(testFile);
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
qFatal("Cannot open input file");
|
||||
return;
|
||||
@ -156,7 +158,9 @@ void tst_QTextCodec::toUnicode_data() const
|
||||
void tst_QTextCodec::toUnicode() const
|
||||
{
|
||||
QFETCH(QTextCodec*, codec);
|
||||
QFile file(SRCDIR "utf-8.txt");
|
||||
QString testFile = QFINDTESTDATA("utf-8.txt");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file utf-8.txt!");
|
||||
QFile file(testFile);
|
||||
QVERIFY(file.open(QFile::ReadOnly));
|
||||
QByteArray data = file.readAll();
|
||||
const char *d = data.constData();
|
||||
|
@ -2,9 +2,5 @@ TARGET = tst_bench_qtextcodec
|
||||
QT = core testlib
|
||||
SOURCES += main.cpp
|
||||
|
||||
wince*:{
|
||||
DEFINES += SRCDIR=\\\"\\\"
|
||||
} else {
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
TESTDATA = utf-8.txt
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
TEMPLATE = app
|
||||
TARGET = bench_qdir_10000
|
||||
TARGET = tst_bench_qdir_10000
|
||||
|
||||
SOURCES += bench_qdir_10000.cpp
|
||||
|
||||
|
@ -3,3 +3,5 @@ QT = core testlib
|
||||
CONFIG -= app_bundle
|
||||
|
||||
SOURCES += tst_bench_qtbinaryjson.cpp
|
||||
|
||||
TESTDATA = numbers.json test.json
|
||||
|
66
tests/benchmarks/corelib/json/test.json
Normal file
66
tests/benchmarks/corelib/json/test.json
Normal file
File diff suppressed because one or more lines are too long
@ -87,7 +87,9 @@ void BenchmarkQtBinaryJson::cleanup()
|
||||
|
||||
void BenchmarkQtBinaryJson::parseNumbers()
|
||||
{
|
||||
QFile file(QLatin1String("numbers.json"));
|
||||
QString testFile = QFINDTESTDATA("numbers.json");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file numbers.json!");
|
||||
QFile file(testFile);
|
||||
file.open(QFile::ReadOnly);
|
||||
QByteArray testJson = file.readAll();
|
||||
|
||||
@ -99,7 +101,9 @@ void BenchmarkQtBinaryJson::parseNumbers()
|
||||
|
||||
void BenchmarkQtBinaryJson::parseJson()
|
||||
{
|
||||
QFile file(QLatin1String("../../../auto/corelib/json/test.json"));
|
||||
QString testFile = QFINDTESTDATA("test.json");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
|
||||
QFile file(testFile);
|
||||
file.open(QFile::ReadOnly);
|
||||
QByteArray testJson = file.readAll();
|
||||
|
||||
@ -111,7 +115,9 @@ void BenchmarkQtBinaryJson::parseJson()
|
||||
|
||||
void BenchmarkQtBinaryJson::parseJsonToVariant()
|
||||
{
|
||||
QFile file(QLatin1String("../../../auto/corelib/json/test.json"));
|
||||
QString testFile = QFINDTESTDATA("test.json");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
|
||||
QFile file(testFile);
|
||||
file.open(QFile::ReadOnly);
|
||||
QByteArray testJson = file.readAll();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
QT = core testlib
|
||||
TEMPLATE = app
|
||||
TARGET = tst_qmetatype
|
||||
TARGET = tst_bench_qmetatype
|
||||
|
||||
SOURCES += tst_qmetatype.cpp
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
TARGET = tst_qalgorithms
|
||||
TARGET = tst_bench_qalgorithms
|
||||
QT = core testlib
|
||||
SOURCES = tst_qalgorithms.cpp
|
||||
|
@ -1,4 +1,4 @@
|
||||
TARGET = tst_qlist
|
||||
TARGET = tst_bench_qlist
|
||||
QT = core testlib
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
@ -1408,7 +1408,9 @@ void tst_QString::ucstrncmp() const
|
||||
|
||||
void tst_QString::fromUtf8() const
|
||||
{
|
||||
QFile file(SRCDIR "utf-8.txt");
|
||||
QString testFile = QFINDTESTDATA("utf-8.txt");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file utf-8.txt!");
|
||||
QFile file(testFile);
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
qFatal("Cannot open input file");
|
||||
return;
|
||||
|
@ -3,11 +3,7 @@ QT -= gui
|
||||
QT += core-private testlib
|
||||
SOURCES += main.cpp data.cpp fromlatin1.cpp fromutf8.cpp
|
||||
|
||||
wince*:{
|
||||
DEFINES += SRCDIR=\\\"\\\"
|
||||
} else {
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
TESTDATA = utf-8.txt
|
||||
|
||||
sse4:QMAKE_CXXFLAGS += -msse4
|
||||
else:ssse3:QMAKE_FLAGS += -mssse3
|
||||
|
@ -1,4 +1,4 @@
|
||||
TARGET = tst_vector
|
||||
TARGET = tst_bench_vector
|
||||
QT = core testlib
|
||||
INCLUDEPATH += .
|
||||
SOURCES += main.cpp outofline.cpp
|
||||
|
@ -1,7 +1,7 @@
|
||||
QT += widgets testlib
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = bench_qheaderview
|
||||
TARGET = tst_bench_qheaderview
|
||||
|
||||
SOURCES += qheaderviewbench.cpp
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
QT += widgets testlib
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = tst_qtbench
|
||||
TARGET = tst_bench_qtbench
|
||||
|
||||
SOURCES += tst_qtbench.cpp
|
||||
|
||||
|
@ -129,7 +129,9 @@ void tst_QText::shaping_data()
|
||||
QTest::newRow("lorem") << m_lorem;
|
||||
QTest::newRow("short") << QString::fromLatin1("Lorem ipsum dolor sit amet");
|
||||
|
||||
QFile file(QString::fromLatin1(SRCDIR) + QLatin1String("/bidi.txt"));
|
||||
QString testFile = QFINDTESTDATA("bidi.txt");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file bidi.txt!");
|
||||
QFile file(testFile);
|
||||
QVERIFY(file.open(QFile::ReadOnly));
|
||||
QByteArray data = file.readAll();
|
||||
QVERIFY(data.count() > 1000);
|
||||
|
@ -6,4 +6,4 @@ TARGET = tst_bench_QText
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
TESTDATA = bidi.txt
|
||||
|
@ -59,7 +59,9 @@ void tst_jpeg::jpegDecodingQtWebkitStyle()
|
||||
{
|
||||
// QtWebkit currently calls size() to get the image size for layouting purposes.
|
||||
// Then when it is in the viewport (we assume that here) it actually gets decoded.
|
||||
QFile inputJpeg(SRCDIR "n900.jpeg");
|
||||
QString testFile = QFINDTESTDATA("n900.jpeg");
|
||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file n900.jpeg!");
|
||||
QFile inputJpeg(testFile);
|
||||
QVERIFY(inputJpeg.exists());
|
||||
inputJpeg.open(QIODevice::ReadOnly);
|
||||
QByteArray imageData = inputJpeg.readAll();
|
||||
|
@ -3,10 +3,6 @@ TARGET = jpeg
|
||||
QT += testlib
|
||||
CONFIG += release
|
||||
|
||||
wince*: {
|
||||
DEFINES += SRCDIR=\\\"\\\"
|
||||
} else {
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
|
||||
SOURCES += jpeg.cpp
|
||||
|
||||
TESTDATA = n900.jpeg
|
||||
|
@ -264,6 +264,8 @@ Configure::Configure(int& argc, char** argv)
|
||||
|
||||
dictionary[ "PCRE" ] = "auto";
|
||||
|
||||
dictionary[ "ICU" ] = "auto";
|
||||
|
||||
dictionary[ "GIF" ] = "auto";
|
||||
dictionary[ "JPEG" ] = "auto";
|
||||
dictionary[ "PNG" ] = "auto";
|
||||
@ -504,6 +506,12 @@ void Configure::parseCmdLine()
|
||||
dictionary[ "PCRE" ] = "system";
|
||||
}
|
||||
|
||||
else if (configCmdLine.at(i) == "-icu") {
|
||||
dictionary[ "ICU" ] = "yes";
|
||||
} else if (configCmdLine.at(i) == "-no-icu") {
|
||||
dictionary[ "ICU" ] = "no";
|
||||
}
|
||||
|
||||
// Image formats --------------------------------------------
|
||||
else if (configCmdLine.at(i) == "-no-gif")
|
||||
dictionary[ "GIF" ] = "no";
|
||||
@ -1468,7 +1476,7 @@ bool Configure::displayHelp()
|
||||
"[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n"
|
||||
"[-no-script] [-script] [-no-scripttools] [-scripttools]\n"
|
||||
"[-no-webkit] [-webkit] [-webkit-debug]\n"
|
||||
"[-no-directwrite] [-directwrite] [-qpa] [-no-widgets] \n\n", 0, 7);
|
||||
"[-no-directwrite] [-directwrite] [-qpa] [-no-widgets] [-icu]\n\n", 0, 7);
|
||||
|
||||
desc("Installation options:\n\n");
|
||||
|
||||
@ -1565,6 +1573,9 @@ bool Configure::displayHelp()
|
||||
desc("PCRE", "qt", "-qt-pcre", "Use the PCRE library bundled with Qt.");
|
||||
desc("PCRE", "qt", "-system-pcre", "Use the PCRE library from the operating system.\nSee http://pcre.org/\n");
|
||||
|
||||
desc("ICU", "yes", "-icu", "Use the ICU library.");
|
||||
desc("ICU", "no", "-no-icu", "Do not use the ICU library.\nSee http://site.icu-project.org/\n");
|
||||
|
||||
desc("GIF", "no", "-no-gif", "Do not compile GIF reading support.");
|
||||
|
||||
desc("LIBPNG", "no", "-no-libpng", "Do not compile PNG support.");
|
||||
@ -1811,6 +1822,9 @@ bool Configure::checkAvailability(const QString &part)
|
||||
else if (part == "PCRE")
|
||||
available = findFile("pcre.h");
|
||||
|
||||
else if (part == "ICU")
|
||||
available = findFile("unicode/utypes.h") && findFile("unicode/ucol.h") && findFile("unicode/ustring.h") && findFile("icuin.lib");
|
||||
|
||||
else if (part == "LIBJPEG")
|
||||
available = findFile("jpeglib.h");
|
||||
else if (part == "LIBPNG")
|
||||
@ -1924,6 +1938,10 @@ void Configure::autoDetection()
|
||||
if (dictionary["PCRE"] == "auto")
|
||||
dictionary["PCRE"] = checkAvailability("PCRE") ? defaultTo("PCRE") : "qt";
|
||||
|
||||
// ICU detection
|
||||
if (dictionary["ICU"] == "auto")
|
||||
dictionary["ICU"] = checkAvailability("ICU") ? "yes" : "no";
|
||||
|
||||
// Image format detection
|
||||
if (dictionary["GIF"] == "auto")
|
||||
dictionary["GIF"] = defaultTo("GIF");
|
||||
@ -2118,6 +2136,10 @@ void Configure::generateOutputVars()
|
||||
if (dictionary[ "PCRE" ] == "qt")
|
||||
qmakeConfig += "pcre";
|
||||
|
||||
// ICU ---------------------------------------------------------
|
||||
if (dictionary[ "ICU" ] == "yes")
|
||||
qtConfig += "icu";
|
||||
|
||||
// Image formates -----------------------------------------------
|
||||
if (dictionary[ "GIF" ] == "no")
|
||||
qtConfig += "no-gif";
|
||||
@ -3060,6 +3082,8 @@ void Configure::displayConfig()
|
||||
cout << " JPEG support............" << dictionary[ "JPEG" ] << endl;
|
||||
cout << " PNG support............." << dictionary[ "PNG" ] << endl;
|
||||
cout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl << endl;
|
||||
cout << " PCRE support............" << dictionary[ "PCRE" ] << endl;
|
||||
cout << " ICU support............." << dictionary[ "ICU" ] << endl;
|
||||
|
||||
cout << "Styles:" << endl;
|
||||
cout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user