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>
The fallback code for unhandled event types in QWidgetWindow::event
directly called event() on the underlying QWidget (i.e. m_widget->event(e)).
The problem with that approach is that it does not activate any
event filters that can have been installed on the top level widget.
Instead, let's use sendEvent to forward the event to the widget.
An extra modification becomes necessary:
the events received when creating/showing/etc. a widget change,
hence the corresponding test needs to be tuned. On the other hand,
apparently this fixes a long time XFAIL in that test.
Task-number: QTBUG-42281
Task-number: QTBUG-26424
Change-Id: I237bbbc301e3e9e10f071589629c71343a600ef9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
If the \a to widget was already part of a layout it would be removed from
the layout. This happened because the function that was supposed to
perform this removal was called after we had done the replacement.
QLayout::addChildWidget() should therefore be called first. This is also
documented in QLayout::addChildWidget()
Change-Id: Ie718935a14ebad81827fad962920e930263c05b8
Task-number: QTBUG-37724
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Fix the behavior of the clipboard implementation
to pass the unit test.
Change-Id: Ia8d5428eebf17a626565e8f4a4d895a67f35b20b
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
When listing group nodes, for example, with \annotatedlist command,
QDoc created a link with the plain name (the string that was passed
to \group command as parameter) as the link text.
This change makes QDoc use the group \title, if one exists.
Change-Id: I30b7f9eefc60c12f67b1e579bbc4c5cebe84474b
Task-number: QTBUG-45420
Reviewed-by: Martin Smith <martin.smith@digia.com>
Add a dedicated operator=(std::initializer_list) that
first resizes the QCLA, and then replaces the elements
one by one.
This should be usually faster than creating a temporary
QCLA and then copying it, except for the case where the
new array does not fit into the allocated stack - but this
is IMO nothing to optimize for.
Task-number: QTBUG-45041
Change-Id: I147d6d01186b1ca3c635b2c8365d8f6e638ce6fe
GPush-Base: 08de3113051e1289f0de0651ec5647c9ee6feb27
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Most of the CPU time was spending in fetching pixel values instead of
calculating the bilinear sample. The access to vectors unions turns
out to be very slow, and should be avoided. This patch removes the
uses of vector,int array union in the bilinear sampling for SSE2.
Change-Id: Ie765a80963c4899db59a583ea9a59d15e05f2b13
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QOpenGLContext::defaultFramebufferObject() knows nothing about QOpenGLWidget
and QQuickWidget. The problem is that this function (and others that rely on it)
is expected to give the widget's backing FBO in paintGL() and friends.
To overcome this, we have to provide a way for such widgets that indicate what is
the expected "default fbo".
Task-number: QTBUG-43269
Change-Id: I43f439f8609382b9f7004707ab0ef9f091952b4f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Many people complain about this unexpected behavior. We
may consider introducing a style hint later for those
few people that may want it.
Change-Id: Ifab663b4b5c3a78a3544ab4408cf34f672df8c05
Task-number: QTBUG-8428
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Allows catching exceptions without quitting the application.
The behavior change should be unnoticeable since we can't
activate the menu item from within the Qt application.
Tested that the keyboard modifiers are still set when we get
to the action signal handler.
Change-Id: I43d0c377834450344bd3a3678e07b6631ba0b768
Task-number: QTBUG-15197
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Applications built using the regular makefile generator also need to
link to XCTest, as the library is referenced from qxctestlogger.mm
Change-Id: Iedbb5c6a2811fd904d75abc20f4e39440e44e748
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Previously we would take ownership of all threads when attempting to
attach it to the VM, regardless if it was already attached or not, to
avoid expensive re-attachments in our own code. The downside of this
approach is that we might hijack threads the user wants to control
themselves, and the later detach the thread while it still in use, e.g.,
after the QApplication instance is destroyed.
This change does not add any infrastructure to enable more advanced
management of attached threads, so threads might still be hijacked if
the user make a call directly or indirectly through the QJNI API's on
a thread that's not attached.
Task-number: QTBUG-45110
Change-Id: I30f7faa2d8c2c35151e2ac8875ebf839bcd6c7c6
Reviewed-by: Sergey Galin <s.galin@2gis.ru>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Input method events contain attributes, etc. and cannot
be compressed.
Change-Id: Ib9a2a80f1efec53f9d843684f8227e1f2e245853
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
They are apparently a relic of some old bitmap header that
did not contain them (superseded by BITMAPV5HEADER).
Task-number: QTBUG-45265
Change-Id: I993dda7d409f7963c9fabd42b0fac5f5586c6248
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Returning dbg.space() breaks formatting on streams that already
have nospace() set.
Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e
Reviewed-by: David Faure <david.faure@kdab.com>
before fallingback to uploading a bitmap cursor
Task-number: QTBUG-30016
Change-Id: I53eeda6bb5f6cab66e3bc10a2e5382ce55cc1bab
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Introduce a slow path for 24 and 32 bit BGR. We don't care about
performance here but it has to show the correct colors.
Task-number: QTBUG-42776
Change-Id: Ic73e8ca3950b2b956f06643165dcfac51e7540f3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>