Avoids default-constructing two QPersistentModelIndex
instances just to copy-assign to them.
Change-Id: I0f3e04e3d202f58905f74df44d37dba27911a927
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QTextDocument::find has a behavior that is different from the typical
QRegExp/QRegularExpression behavior where finding a given expression is
always constrained by the paragraph (block), regardless of newline
characters in the expression.
Task-number: QTBUG-21785
Change-Id: Ia6a061c6feb5a19e6b8caa3d8009da5ca31ec422
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Add QTRY_VERIFY2_WITH_TIMEOUT() similar to QTRY_VERIFY_WITH_TIMEOUT()
except that QTRY_VERIFY2() is used below the loop and QTRY_VERIFY2()
based on it.
Add tests to cmptest.
[ChangeLog][QtTest] Added macros QTRY_VERIFY2_WITH_TIMEOUT(), QTRY_VERIFY2()
making it possible to output a message after the timeout has expired.
Change-Id: I587e24f3aeb73542dbf3ccb936a16f2e0806555f
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Add a helper class for resolving debug symbols by dynamically
loading dbghelp.dll and try to obtain a symbol at the exception
location and a stack trace by using CaptureStackBackTrace().
The output looks like:
A crash occurred in d:\dev\projects\crashingtest_5d\debug\tst_crashingtesttest.exe.
Exception address: 0x0000000052E2853A
Exception code : 0xc0000005
Nearby symbol : QString::length
Stack:
# 1: windowsFaultHandler() - 0x00007FFE080CACD0
...
# 8: QString::length() - 0x0000000052E28530
[ChangeLog][QtTest] A stack trace will be output on standard error
if a test crashes.
Task-number: QTBUG-47370
Change-Id: I7217e02ec7dc0c96132fe84d1a175d0bed9c5aaf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
These macros are not defined unless a desktop or standalone SDK is
installed.
Change-Id: I4c600ddca5944cc5fde310e4fbe0866a7250d36b
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
On Ubuntu 14.04.1 LTS, a file /etc/profile.d/appmenu-qt5.sh appeared,
exporting QT_QPA_PLATFORMTHEME=appmenu-qt5 (application menu theme plugin).
This caused QGenericUnixTheme::createUnixTheme() to return an
instance of QGenericUnixTheme by theme name instead of the appropriate
QKdeTheme, QGnomeTheme.
Fix this by always appending the generic theme name to the list
of available themes and returning it only if the name matches.
Qt 5 applications will now appear correctly themed on Ubuntu,
including theme icons.
Change-Id: I68fcd80a620b74e2af73e938253dba9933816336
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
... like all other assignment operators.
Removes the last user of internalCopy(). Removed.
Change-Id: I15f2cb3b7b26988dd3bc2f4475bc316480476993
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This will automatically add DirectWrite support if the required
headers are found. The note about platform support from the help
screen has also been removed, since Windows XP is not officially
supported. Applications that need to run on XP can still build
with -no-directwrite.
Also changed the configure test to be a proper compile test, since
cross-compiled builds for Windows CE may break otherwise.
Change-Id: I7fc7bfb25f2f86ced8a4d4c78a69527de0273707
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
SDKs generated from VS2013 use a different folder for
build settings than those generated from VS2012.
Check both folders, before rejecting a potential
SDK.
Change-Id: I5bee5cc3771352adaab07d39ebbc350618f6c573
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
QCOMPARE did not print "Actual" and "Expected" values for quint8
and qint8 variables when they where not equal. QTest::toString<T>()
lacked specializations for signed and unsigned char types, that are
actually distinct types from char.
Change-Id: Iae789885c474c56441da45065992d7ccf1bc9f5c
Task-number: QTBUG-45238
Reviewed-by: Jason McDonald <macadder1@gmail.com>
- Introduce Qt 5 signals & slot syntax and remove the QSignalMapper
used to map the triggered() signals of the per-MDI-child actions
of the window menu to the activation slot by a functor to demonstrate
the flexibility of the new connection syntax (the functor can
in turn be replaced by a lambda expression once we have C++ 11).
- Merge MainWindow::createMenus()/createQToolBars()
into MainWindow::createActions(), removing the need
to store the actions as member variables.
Use QMenu::addAction() for brevity.
- Use QIcon::fromTheme() to obtain system icons and use
resource icons as fallback.
- Rewrite settings code to use
QWidget::saveGeometry(), Widget::restoreGeometry() since
saving size and position does not work well with multiple
screens. Query the available size when determining
the initial size instead of using hard-coded values
for High-DPI screens.
- Fix minor issues in code, use multi-argument version
of QString::arg(), QDir::toNativeSeparators() to
present file paths to the user and static method invocation.
Change-Id: I3d5078ddbe3cb4eba65e188430ba3580cecb2c79
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
yacc.prf was mostly working, so this commit simply makes it slightly
better by using the -p and -b options that POSIX requires and avoid
having a common intermediate file.
Change-Id: Ib306f8f647014b399b87ffff13f1e8e74ad4db1d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Most people's yacc are actually a symlink to bison. On Windows, where
symlinks don't usually exist, we can use bison -y.
This was tested with MSYS Bison.
Change-Id: I913745d48af30f9ef7b846b6438500261dd6022d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
[ChangeLog][QtCore][QProcess] Fixed a bug that caused QProcess to launch
a child process on Unix even if the directory specified with
setWorkingDirectory did not exist.
Task-number: QTBUG-47271
Change-Id: Ib306f8f647014b399b87ffff13f195158b0e52f5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
We force a recreation of the library paths with added information on
construction of QCoreApplication. This way we can find plugins in
the application directory which only becomes known when
QCoreApplication is created. When the user changes the library path
we create a new list of the manually modified library paths and
recalculate it from the delta of original vs. modified paths when
QCoreApplication is created.
The upsides of this approach vs. keeping an explicit delta are:
* We don't need to introduce a separate data structure to hold
the added/removed status for delta items or the information that
the whole list got replaced.
* The lists never get larger than the the real library paths. An
explicit delta would have to record all modifications.
* I don't think the delta replay algorithm we would have to do
anyway could be made much more compact than the one this change
introduces.
Of course, if the user actually changes anything, the list is
duplicated. Considering that this is a rarely used function and
that we would have to save some extra information anyway, I think
we can live with this.
Task-number: QTBUG-38598
Change-Id: I3bfbbd1be62dd5804dcc7ac808b053428a4e3149
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds an OpenSSL-based implementation of the QSslKeyPrivate encrypt
and decrypt method. This puts both the OpenSSL-based and non-OpenSSL
backends (WinRT for now) on par.
Change-Id: I18a75ee5f1c223601e51ebf0933f4430e7c5c29b
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
- Introduce Qt 5 signals & slot syntax.
- Use QIcon::fromTheme() to obtain system icons and use
resource icons as fallback.
- Fix minor issues in code, use multi-argument version
of QString::arg(), QDir::toNativeSeparators() to
present file paths to the user, static method
invocations.
- Use QMimeDatabase for file dialog.
Change-Id: Ib7f947aaaa0c8034f0853b1c740ebf195821dae0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The clearing of 'children' is already performed by the
'children' destructor, and the presence of the user-defined
QDirNode destructor inhibits the move special member functions
for QDirNode.
Change-Id: Ie8025e7a2c4b1a8c0b691deda0e49b517f8a6ed5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Also solves a warning printed:
configure: 4200: shift: can't shift that many
Change-Id: Ib306f8f647014b399b87ffff13f295e2cdb7f8d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Every bit combination is a valid object, so the
correct type classification is primitive, not
just movable.
This is BC, because it just changes whether
the default ctor and dtor are run or not,
and these types don't care.
Change-Id: Ifbfa83128778744f15a086a65c8be1ce01a58820
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
The compiler-generated move operations are ok.
Change-Id: Ida994b52e3ee6ce75afd50133e61488b94464eee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These types are larger than a void*, so holding them in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking them movable, and holding in a QVector instead.
Change-Id: I74b2ce327d6aee60e2cc3463ce09453a4305bba7
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is low-hanging fruit, for two reasons:
1. The implementation is dead-simple (unlike, say, in QList).
2. It's completely transparent to the QVector user (unlike,
say, emplace_back, which can only be used inside an ifdef).
Change-Id: Iaf750100cf61ced77aa452f0e4e3c4ec36b29639
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It doesn't save any space, is not required for ABI compat
(because it's private API), generates more code to extract
the field, and triggers a bug in older GCCs when synthesizing
a move constructor for this type:
src/gui/image/qiconloader_p.h:64:8: error: invalid conversion from 'unsigned char:4' to 'QIconDirInfo::Type' [-fpermissive]
src/corelib/tools/qvector.h:641:13: note: synthesized method 'QIconDirInfo& QIconDirInfo::operator=(QIconDirInfo&&)' first required here
Change-Id: I61e886566b67c7a18a318a3d026dc762600f8ab4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... except if the function is a ctor, callers pass rvalues,
and the type has a fast move ctor. In that case, keep passing
by-value and qMove() into place.
Change-Id: I2c0be7d4436327834ddee0531c51c5af352ac74c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Makes for much more readable callers, and, d/t NRVO, isn't less efficient
than the old code, either. Transparently enables moves when QVector should
get them, at some point, too.
Change-Id: I77327cf665272b80277deaaa6dd2ee9c00806464
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
FileInfo is larger than a void*, so holding them in a QList is needlessly
inefficient. Worse, the code could come to depend on the fragile property
of (inefficient) QLists that references to elements therein never are
invalidated.
Change-Id: I772177c5ac544a5fecce2368f628148308ef260f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- don't define special member functions if the compiler-generated
ones are just fine (inhibits move semantics)
- implement all remaining methods inline
- unexport
- remove unused (and, to add insult to injury, never init'ed)
d-pointer. This is private API. No need for a d-pointer,
much less an unused one.
Change-Id: I6979cb5103a361c0313c252d3bf7073a3c47addd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
They do the right thing (except move special member functions
on MSVC, but that's MSVC's problem).
Change-Id: I699e1be83c0568821f8c6b84394a2713bb22e8e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtCore] All generic containers (with the exception of
QVarLengthArray, but including QSharedPointer) destroy the
previous state as part of a move-assignment now. Previously, they
would dump it into the right-hand-side object. Note that this is
only true for the generic containers. Other implicitly-shared
types, as well as the non-generic containers QString, QByteArray,
etc. still just swap the contents with the right-hand-side object
when move-assigned into, and, for performance reasons, this will
not change in the forseeable future.
Change-Id: I1f1c684e85400b77bd2e7fba65bde2dce6c1bdde
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Requires adding member-swap and (at least in my copy) move operations.
Change-Id: I1b638a81e4a41f467e69e352806524039e7b9f27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These all invoke the QFlags<>(Zero *) ctor, which is designed to
accept a 0, but no other int. But in doing so, it requires passing
a nullptr literal, and 0 is not a nullptr literal accepted under
-Wzero-as-null-pointer-constant or similar warnings.
Fix by using the QFlags::QFlags() ctor instead.
Task-number: QTBUG-45291
Change-Id: I73f9c9f4de11eeb1ba04ace6c7121d17510ea29f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is in preparation of adding -Wzero-as-null-pointer-constant (or similar)
to the headers check.
Task-number: QTBUG-45291
Change-Id: I6f591a42a8e8ea471d27666eb1cbc77b572b3e0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is in preparation of adding -Wzero-as-null-pointer-constant (or similar)
to the headers check.
Task-number: QTBUG-45291
Change-Id: I72ab40b21a9499b53a639564fa45884de17b6c98
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is in preparation of adding -Wzero-as-null-pointer-constant (or similar)
to the headers check.
Task-number: QTBUG-45291
Change-Id: I9a05d375d2d9d3ed56079ad024c89a08a290619b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>