qdoc was creating the scripts and used-in-examples subdirectories
whether or not there were any scripts or images used in examples.
Now qdoc creates these subdirectories only if there is something
to put in them.
Change-Id: Ied0e1b38ee28973313c68754c821b34edfd5f505
Task-number: QTBUG-44655
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
This has no influence on text size, but by executing similar functions
temporally close to each other, we should make better use of the i-cache.
It's also more readable.
Change-Id: Ia211e562d798d4f16f3fd17f87f1e2cad2e0359d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
...to avoid checking the same conditions a second time.
Saves 32B in text size on my machine, too.
Change-Id: I0368408b9f5feb02e811dc15ade79d9796031896
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
...by using the predicate from nextPending() in the two
showMessage() functions, too, which thus become identical,
when substituting type -> QString().
Also saves around 250B in text size.
Change-Id: Ibf5d081dbec3438b7b1be4e240879e26d0455d6b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QQueue is-a QList, so it inherits the trait that types larger than
a void* cause a heap-allocation when inserted, which is horribly
inefficient.
Use a std::queue instead, which, by default, is backed by std::deque.
Requires rewriting the API calls, since QQueue uses non-standard
function names.
Text and data size increase negligibly (23 and 8 bytes, respectively),
even though we're instantiating a completely new type (std::deque)
instead of QList<QPair<QString, QString>>, which is probably still
used, despite the inefficiency.
Change-Id: I9bb04a2ec32bb1b9fa2eb83780f0aaa26e872d49
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The port from split() to splitRef() speeds up typical section()
calls (where the separator is included) by ca. 1/3.
The complete truth includes that section() calls where the
separator is not found seem to have gotten twice slower.
But that's a corner-case.
Change-Id: I7e957cb65fccfd095ac522d523aef3464425e4e4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This is mostly straight-forward, but some things are worth noting:
1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.
The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.
2. The decomposition() functions, returning a QString, can throw (bad_alloc).
Consequently, they're not marked nothrow. they're the only ones.
Change-Id: Iae50283aaa2d0596a265b7e2652c9fb04cedc706
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This hopefully prevents buggy compilers from choking on the definitions
outside the class as inconsistent, even though they are consistent.
Also helps developers, as the rather lengthy attribute lists for
C++11 functions does not need to be repeated.
This is in preparation of plastering the QChar API with Q_DECL_NOTHROW.
I had to keep operator== and operator< outside the class because
Clang on OS X 10 didn't find it when called with types implicitly
convertible to QChar.
Change-Id: I8bd634bc756d1bf5d208d7a2ce7e7ded73c4ce56
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
std::vector has them, too.
[ChangeLog][QtCore][QVarLengthArray] Added relational operators <, <=, >, >= if the element
type supports operator<.
Change-Id: I69e16d361fd4738a56b292ebfa78316d28871eda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
std::vector has them, too.
[ChangeLog][QtCore][QList] Added relational operators <, <=, >, >= if the element
type supports operator<.
Change-Id: Id2bd905e92c0365ad9f439d49908045c8df309c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Currently, socket options setting is hardcoded in QTcpServer::listen()
function after the engine initialization and before a binding to the
address. This disallows a socket tuning in further QTcpServer inheritance.
Add a private virtual configureCreatedSocket() method that gives an
ability to set the socket options before listening.
Change-Id: Ice9b477e64f21daee96c0ec6d27a8408f9e1aa93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTabBar uses a palette brush on a child QWidget. But if that
widget get styled, it sets the palette on it overwriting the
existing palette.
Make sure that no stylesheet is applied to it.
[ChangeLog][QtWidgets][QTabBar] Fixed moving tab when a
stylesheet is applied.
Task-number: QTBUG-45173
Task-number: QTBUG-15128
Change-Id: I07aee0f369fa715d852556620c8e74bcffd836da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Instead of creating lots of temporary QString objects, use QStringRefs.
Together with the two other (micro) optimizations before, this speeds
up section() by up to 2x (section_regex(IPv6)).
No test has become slower.
Change-Id: I514667004f82ddc1518fe3ee699ec5fbf96bb82f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
QString::append(QStringRef) exists, and so should prepend().
QString::append(const QChar *,int) exists, and so should prepend().
[ChangeLog][QtCore][QString] Added prepend(QStringRef) and prepent(const QChar *, int) overloads.
Change-Id: I3eca41045f7c481be473507e23e92690f3ed7ba3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
... using the framework developed for testing QString::append.
Change-Id: I29011eba6438bf9b3daad354cbec4b8e2b98ed81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is tedious to test all the overloads of QString::insert,
so get the help of the compiler to do it. The framework
was originally developed for testing append.
This change showed that the insert(int, QStringRef),
insert(int, const char*) and insert(int, QByteArray)
overloads were missing. They will be added in a separate
commit.
Change-Id: I609b8a05203f8a1ea12827d1798313ace5b719f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is tedious to test all the overloads of QString::prepend,
so get the help of the compiler to do it. The framework
was originally developed for testing append.
This change showed that prepend(QStringRef) and
prepend(const QChar*, int) overloads were missing. They will
be added in a separate commit.
Change-Id: Ic3d6ad011bedc6ee7d5024094d7c3529b1b9d669
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is tedious to test all the overloads of QString::append(),
so get the help of the compiler to do it. The framework
developed for this will be used in subsequent commits for
prepend and insert, too.
Change-Id: I89df581b6d037a5af80b34dd6b5d37ac7484c774
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unearthed an off-by-one error in a QByteArray::fromRawData() call in
tst_qtextdocumentfragment. Fixed by porting to QStringLiteral.
[ChangeLog][Important Behavior Changes] All conversions from QByteArray
to QString now preserve embedded NULs. This is done in order to provide a
faster conversion from QByteArray to QString that does not involve a call to
strlen. If you need the old behavior, convert from QByteArray::constData()
instead. If you are porting from Qt 4, we suggest to make your source compile
with QT_NO_CAST_FROM_BYTEARRAY before porting to Qt 5.
Change-Id: Ibca40f503920fee6f3a5f0d74a04b38b8849796f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Currently, calling these functions with a null QByteArray will return
a non-null QString because QByteArray::data() never returns nullptr.
This behavior leads to inconsistencies between QString::append overloads,
in particular the QByteArray vs. all others (null + null test always
returns a null QString, except for the QByteArray overload before this
change).
It also is inconsistent with the const char* overloads of these methods,
which explicitly preserve nullness (as verified by test cases).
Fixed by an explicit check for nullness and return of null QString.
Alternative would have been to check for nullness and pass nullptr
instead of ba.data() to the _helper() functions, which do the correct
thing in that case. But since we'd have the check anyway and with the
chosen strategy we can avoid a call to a non-inline method, I opted
against that.
[ChangeLog][QtCore][QString] fromLatin1(), fromAscii(), fromUtf8() and
fromLocal8Bit() now return a null QString when called with a null
QByteArray.
Change-Id: I5f2c0bad27fb73c7d535085af0271823bf6ed1da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
std::vector has them, too.
[ChangeLog][QtCore][QVector] Added relational operators <, <=, >, >= if the element
type supports operator<.
Change-Id: I0bcb22dfcc43cb0362f17b4e06154ce18646580a
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Currently only the QRegExp based regexp tool is available to help build
regular expression. This patch aims to add the equivalent that use the
new QRegularExpression class.
Change-Id: Ie5f711640b32a6d10ce44d2c7795062c1aacce3f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Make use of the Linux implementation for Hurd as well, as the mntent API
is available there too (including getmntent_r, specific to GNU libc).
Since PATH_MAX is not available on Hurd, and the current bufferSize is
a lot more larger than it is needed, restrict bufferSize to 1024 bytes,
which should be enough to cover 3 paths in mtab and it is usually used
also in other projects.
Change-Id: Ied43be2ab1eb95b48eb9f55a92064e7549efaefd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Constructing the QProxyStle object with a null QStyle
pointer causes the QProxyStyle to use the default native
style.
Change-Id: If624ed7a805aef839ca8a51242d12b2f6d777e83
Task-number: QTBUG-42231
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
This is just so the Q_COMPILER_xxx macros get defined properly.
Change-Id: Iee8cbc07c4434ce9b560ffff13d066aa0a8671cc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Move to qdbusutil_p.h the string constants that are used often and in
multiple places; use QStringLiteral in qdbusintegrator.cpp for the
strings that are used often.
Change-Id: I8e1325b9ba015bda91bf01c42175d8032ea32f62
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Commit 748abf9347 changed the message, but
the CI either did not run the QtDBus tests when integrating or it
ignored the results.
Task-number: QTBUG-45317
Change-Id: Iee8cbc07c4434ce9b560ffff13d058f21b73ac05
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
The ActivationReason provides the type of click. If the icon has a
D-Bus menu, then QStatusNotifierItemAdaptor::ContextMenu will not be
called: the tray is responsible for opening the context menu. But
an application can alternatively do something different with a
right-click by not providing a menu, and instead handling the
QSystemTrayIcon::activated signal with the Context reason.
Simplified the code by emitting the signal directly in
QStatusNotifierItemAdaptor.
Task-number: QTBUG-44929
Change-Id: Ia062a9a2fd99554418d58a1ff6ecd4e862035198
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This was incomplete functionality in
38abd65377
Task-number: QTBUG-44929
Change-Id: I7120a3de011c5df57ef5a9fbdfe056eee42d572b
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
It was printing the following error:
arguments to dbus_validate_bus_name() were incorrect, assertion "name !=
NULL" failed in file dbus-syntax.c line 248.
This is normally a bug in some application using the D-Bus library.
Change-Id: Iee8cbc07c4434ce9b560ffff13d0586189ba3a79
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
In this case GetLayout will be called with the D-Bus menu ID of the
menu item which contains the submenu.
Task-number: QTBUG-45191
Change-Id: Ia8108272910eac10f040db5865ec4e070da80edb
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
User code should build with -Werror=zero-as-null-pointer-constant
Task-number: QTBUG-45291
Change-Id: Iee8cbc07c4434ce9b560ffff13d0031979b4c2fe
Reviewed-by: Matthew Woehlke <mw_triad@users.sourceforge.net>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Two new function families have been added: qFindFirstSetBit() and
qFindLastSetBit() for a variety of integer sizes. Fast implementations
are included for most platforms.
[ChangeLog][QtCore][QtAlgorithms] Added qFindFirstSetBit() and
qFindLastSetBit().
Change-Id: I89d9d1637ea26070aee5a60be95be1b51bfc84dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If an app has only Qt::Tool window(s) at start,
menu is not updated, since Qt::Tool is also
a Qt::Popup (included) and we have a special logic for
Qt::Popup in QCocoaMenuBar::updateMenuBarImmediately.
Using QCocoaApplicationDelegate (ivar 'inLaunch') we
can avoid this problem.
Change-Id: Ie1c4ef241cd19fa0af93c54de2b36e6e932cb77c
Task-number: QTBUG-32539
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>