Before commit f1e9076809, mousePressEvent
called the virtual method setSelection(const QRect&, SelectionFlags)
with the 1x1 rectangle which contains only the clicked QPoint, unless
the SelectionFlag "Current" was set because Shift was pressed during
the mouse press.
Since that commit, the behavior has been changed such that the
rectangle is the one that is spanned by the center of the clicked item
and the clicked pixel. In theory, the result should be the same (i.e.,
only the clicked item should be selected), but
* the code path in QListView::setSelection for 1x1 QRects is more
efficient, and
* using a larger QRect can cause problems with custom views, see the
comments in QTBUG-18009
This commit ensures that the 1x1 QRect is used again, unless the
SelectionFlag "Current" is used.
Change-Id: I70dd70c083c20a3af6cd6095aa89a489756b505f
Task-number: QTBUG-18009
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The slot is invoked from QObject::destroyed(), which is emitted
from ~QObject. By that time the object is no longer a QShortcut,
so the static_cast it invalid.
Found by UBSan:
tst_qshortcut.cpp:1210:53: runtime error: downcast of address 0x6020000289d0 which does not point to an object of type 'QShortcut'
0x6020000289d0: note: object is of type 'QObject'
10 00 80 17 c0 ce 63 df 93 2b 00 00 b0 02 00 00 d0 60 00 00 02 00 00 00 ff ff ff 04 04 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
#0 0x42b3bb in tst_QShortcut::shortcutDestroyed(QObject*) tst_qshortcut.cpp:1210
#1 0x446cc9 in tst_QShortcut::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) .moc/tst_qshortcut.moc:186
#2 0x2b93dba52c86 in QMetaObject::activate(QObject*, int, int, void**) qobject.cpp:3787
#3 0x2b93dba55400 in QObject::destroyed(QObject*) .moc/moc_qobject.cpp:213
#4 0x2b93dba8d80d in QObject::~QObject() qobject.cpp:967
#5 0x2b93c6b6e032 in QShortcut::~QShortcut() qshortcut.cpp:476
#6 0x2b93c6b6e370 in QShortcut::~QShortcut() qshortcut.cpp:481
#7 0x42a5de in void qDeleteAll<QList<QShortcut*>::const_iterator>(QList<QShortcut*>::const_iterator, QList<QShortcut*>::const_iterator) qalgorithms.h:317
#8 0x42a5de in void qDeleteAll<QList<QShortcut*> >(QList<QShortcut*> const&) qalgorithms.h:325
#9 0x42a5de in tst_QShortcut::clearAllShortcuts() tst_qshortcut.cpp:1136
Fix by replacing QVector::replaceAll() with the erase-remove idiom,
which does not require the cast, because it can perform mixed-type
lookups.
Change-Id: I4251c1895fa4398023f489dbfd7108d90c1a6c94
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
To keep the change minimal, keep 'sw' as a pointer variable,
but back it by a stack-allocated QStackedWidget instead of a
heap-allocated one that's never deleted.
Change-Id: I9e2a8c07979b861eb7e7040c144d8e75c90d0bc9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Turn the list of newRow() calls into a for loop over a constexpr
data structure.
Fixes the GCC note:
tst_qgraphicsview_2.cpp:47:13: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
and speeds up compilation of the file from 13s to 2.5s on my
machine.
Task-number: QTBUG-38890
Change-Id: I4f0b3565c7df64b286d1d32eb3f3d6bf4df92609
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
In tst_QCompleter, two completers were leaked because they
had no parent and setCompleter() calls don't reparent.
Fixed by giving them parents.
In tst_QUndo*, fix lots of leaked QActions by storing them
in a QScopedPointer. There were some half-hearted attempts
to clean them up with manual deletes, but I ported these to
scoped pointers, too, to make the code more robust in the
face of failures.
This fixes the remaining errors in GCC 6.1 Linux ASan runs of
tests/auto/widgets/util.
Change-Id: Icc5248cc9cf4514540915924df1c4d9e09c071fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The usual:
- delete styles
Either by using QScopedPointer.
This fixes the remaining errors in GCC 6.1 Linux ASan runs of
tests/auto/widgets/styles.
Change-Id: Ifba59085c057d474bf964cbb93010c408d773a61
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
GCC warned:
tst_qabstractslider.cpp:858:89: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Qt::Orientation orientation = *reinterpret_cast<Qt::Orientation*>(&sliderOrientation);
^
tst_qabstractslider.cpp:867:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
orientation = *reinterpret_cast<Qt::Orientation*>(&wheelOrientation);
^
The solution, of course, would be to use a static_cast here, but
why go via int in the first place? Qt::Orientation can perfectly
well be used in QFETCH, as proven by tst_qmainwindow, among other
things.
Change-Id: I97916a50405e16d114837bc52580ce6666d74b17
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Restore Qt::AA_DontUseNativeDialogs that is disabled in the beginning
of the test function.
Change-Id: I4ff8eab4ecc458c478337824e66b5a59fbdd7c65
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
We need to delete the style returned from QStyleFactory::create()
ourselves, so put them into a QScopedPointer.
The alternative would have been to create this once, as a member
of tst_QWidget, but this is the minimal approach that ensures
behavior just as the old code, but without the leak.
Change-Id: I527f1031c57be6f05942f4acc057e7dae1af2571
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Found by UBSan:
tst_qapplication.cpp:1754:48: runtime error: member access within address 0x7ffda11f2220 which does not point to an object of type 'SpontaneousEvent'
0x7ffda11f2220: note: object is of type 'QMouseEvent'
The code attempted to model the layout of a QEvent with another class
that allows public access to the memory location that (hopefully)
corresponds to QEvent::spont, gaining access by casting a QEvent
object to that specifically-crafted class.
Fix by the using the existing QSpontaneKeyEvent::setSpontaneous()
call, which, despite its name, works for all QEvent subclasses, and
which has already been fixed to not invoke UB (in bc087db).
Change-Id: I7db8b8a8a823f7d61ab17375142d19dc3874fea5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QDateTimeEdit ignores the time-spec of its date-time value, using its
own time-spec instead; mostly, this works because it first conforms
the value to its own time-spec. However, during construction, before
doing this, it set up its display data, which could leave it with a
different time (rather than a different representation of the given
time) than it was asked to use.
Moved the updateTimeSpec() calls to immediately after setting value in
QDateTimeEditPrivate::init() to ensure correct handling. Added test.
Task-number: QTBUG-54781
Change-Id: I3b07c10997abb858fc0b40558bff96e3fdabbd83
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
In setMinAndMaxSize(), QLayout::removeItem() doesn't actually delete
the removed item. We have to do that ourselves (RAII not necessary,
since the spacer is owned by the layout until we remove it).
In distributeMultiCell(), allocate the QStyle subclass on the stack so
the compiler cleans it up properly on all exit paths (was:
unconditional leak).
Change-Id: I24f8f11af2bfc5abf78f9aab0139dcfe0187402b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
In sizeConstraints(), QLayout::takeAt(), as the name suggests, doesn't
actually delete the item. We have to do that ourselves.
Likewise, in replaceWidget(), QLayout::replaceWidget() also doesn't
delete the affected item, but returns it. That's spectacularly bad API
design, but the leak is easy to fix: just delete the return value.
Change-Id: I8dcbc59898949eabce766cda2c0edae2e1f2799e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The default should be false, meaning the application will prefer to
use a native menubar if the platform supports it. The application
author can set it to true if he wants to always use a Qt-rendered
menubar instead; or, he can call QMenuBar::setNativeMenuBar().
Qt and its plugins should not override the author's wishes.
Instead, if the platform plugin cannot create a native menubar
for whatever reason, createPlatformMenuBar() will return null,
and QMenuBar will fall back to using a Qt menubar instead.
The application can check the result via QMenuBar::isNativeMenuBar().
QMdiArea when maximized inside a QMainWindow with an empty title
does not replace the main window's title if we are using native menus.
This behavior turned out to be the same on Unity as it is on macOS,
so the autotest needed adjustment to expect that behavior whenever
the menubar is native, not only on certain platforms.
tst_QMenuBar::allowActiveAndDisabled() tests a standalone QMenuBar.
In f92f78094 it was disabled on macOS, but on Ubuntu it passes as
long as we force it to be a non-native menubar, so it should pass
that way on macOS too. Removed unused variable RESET to fix warning.
Task-number: QTBUG-54793
Change-Id: I716e40da709f96331cbbf25213bd7bc153e4dbe2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Found by UBSan:
tst_qgraphicsitem.cpp:5066:29: runtime error: downcast of address 0x2afcb006c7f0 which does not point to an object of type 'GeometryChanger'
0x2afcb006c7f0: note: object is of type 'QGraphicsRectItem'
00 00 00 00 d8 64 ca 98 fc 2a 00 00 40 a9 0b b0 fc 2a 00 00 75 65 29 00 00 00 00 00 35 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QGraphicsRectItem'
#0 0x4c5f1c in tst_QGraphicsItem::prepareGeometryChange() tst_qgraphicsitem.cpp:5066
Fix by actually instantiating a GeometryChanger, which incidentally is
the pattern used by paint() a few lines below, too.
While at it, allocate the item on the stack (as is done in paint())
and create a local QRectF variable to avoid repeating the same magic
numbers over and over again.
Change-Id: If5a3d56511000a17703d78d7dd1f0ea072b8bc11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5971b88e is not needed in new configure.
This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with
apple SDK", 2c9d15d7, because it breaks iOS build with new
configure system.
Conflicts:
mkspecs/features/default_pre.prf
mkspecs/features/mac/toolchain.prf
mkspecs/features/toolchain.prf
src/dbus/qdbusconnection.cpp
src/plugins/sqldrivers/mysql/qsql_mysql.cpp
src/sql/drivers/mysql/qsql_mysql.cpp
src/widgets/widgets/qmenubar.cpp
src/widgets/widgets/qmenubar_p.h
tools/configure/configureapp.cpp
tools/configure/environment.cpp
tools/configure/environment.h
Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
If the sloppy menu popups - send the leave event to the last active
menu (except Cocoa), because only currect active menu gets enter/leave
events (currently Cocoa is an exception).
Check that the menu really has a mouse before hiding the sloppy menu -
don't rely on enter events.
This patch removes some unnecessary synthetic mouse enter/leave events
from QMenu which causes event duplications with different mouse cursor
position.
Refactor sloppy menu timer handling - start or restart timers on mouse
move events. Enter/leave events are not reliable.
Fixes:
- better enter/leave events handling for native widget actions,
- reduce duplicated enter/leave events for menu actions,
- better handle torn off sloppy menus.
Partially reverts: 0ed68f3f58
Amends: 57ecd5aeeb
Task-number: QTBUG-53068
Change-Id: I7ad56ac1619db124915d373fab82d0512d44c90e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Child widgets should get the show/hide event when the TLW changes its
state, because child widgets are also visible or invisible. This
restores the Qt4 behavior (fixes the Qt4->Qt5 regression).
Restoring/minimizing the TLW now sends the spontaneous show/hide event.
Show events are now handled also in the expose event handler in the
QWidgetWindow class, because the show event must occur before the
expose event to avoid possible flicker e.g. the OpenGL content. This
can happen e.g. on XCB platform. If the "WindowStateChange" event occur
before the expose event (e.g. Windows platform) then the code in expose
event handler will be ignored to prevent event duplications.
Added autotest.
Task-number: QTBUG-50589
Change-Id: Ie9a9329b1f29bff876de28d5948d0d5fb6bc1f05
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
widgetlessNativeDialog() is the only test function that creates
a native file dialog instance. GTK+ versions prior 3.15.5 have
a nasty bug (https://bugzilla.gnome.org/show_bug.cgi?id=725164)
in GtkFileChooserWidget, which makes it leak its folder change
callback, causing a crash "at some point later". Running the
native test last is enough to avoid spinning the event loop after
the test, and that way circumvent the crash (QTBUG-55276).
The crash has been fixed in GTK+ 3.15.5, but the RHEL 7.2 CI has
GTK+ 3.14.13 installed.
Change-Id: I867755969a4458693bd12f848d052adf77a2086e
Task-number: QTBUG-55276
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
cf53aa21bf and 3aaa5d6b32
were reverted because of reconstruction in 5.7.
defineTest(qtConfTest_checkCompiler) in configure.pri is smart
enough to cover the case in a9474d1260.
DirectWrite: Fix advances being scaled to 0
Since 131eee5cd, the stretch of a font can be 0, meaning
"whatever the font provides". In combination with ec7fee96,
this would cause advances in the DirectWrite engine to be scaled to
0, causing the QRawFont test to fail.
Conflicts:
configure
mkspecs/features/uikit/device_destinations.sh
mkspecs/features/uikit/xcodebuild.mk
src/corelib/global/qglobal.cpp
src/corelib/global/qnamespace.qdoc
src/plugins/platforms/cocoa/qcocoamenuitem.h
src/plugins/platforms/windows/qwindowsservices.cpp
src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
src/widgets/kernel/qapplication.cpp
tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
Prevent QAbstractSpinBoxPrivate::interpret() from bailing out
in focus changes after text has been entered.
Task-number: QTBUG-55249
Change-Id: I250b3c50f7db5de2e9356038df20f18ee059df11
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Use the new qtConfig macro in all pro/pri files.
This required adding some feature entries, and adding
{private,public}Feature to every referenced already existing entry.
Change-Id: I164214dad1154df6ad84e86d99ed14994ef97cf4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The test is blacklisted already for Ubuntu 14.04, and needs to be
blacklisted for Ubuntu 16.04 too.
Task-number: QTBUG-46116
Change-Id: Ic321a4fd13e00c653e6c387d8a159832173b2eb3
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
These auto tests were trying to not create native dialogs, but setting
the QFileDialog::DontUseNativeDialog option is too late to control the
creation of the platform helper. It is already created at construction
time, unless Qt::AA_DontUseNativeDialogs is set.
Task-number: QTBUG-55276
Task-number: QTBUG-55281
Change-Id: Icf474e97059ac03a5fa01bd3a17f07203da5770a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The only difference between the sample widget sets was:
- widgets << new QLabel("TESTING TESTING");
+ widgets << new QLabel("<b>TESTING TESTING</b>");
I chose the latter, because it's the more complex example
and neither the hoverColors nor focusColors tests suggest
the boldness of the text matters.
Part of port away from Q_FOREACH.
Change-Id: I9a928de4e781b96ad00a8c9515977c35ebfa6c24
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
one of the effects of CONFIG+=x11 is LIBS+=$$QMAKE_LIBS_X11, so it's
positively pointless for project files to do the same.
Change-Id: I4085acd6254401897b34e131c2cb57f1f76a3638
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QStyle was created but never removed
Change-Id: I55011377afd475af28e4ce2cf657e435dd37c96a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Otherwise we can fail to stretch the last section when adding new
sections.
Task-number: QTBUG-52446
Change-Id: I7eb5267ac500bf4246e57c3e3a43268bb65ef1f7
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Conflicts:
configure
5.7 now supports clang on android; but dev re-worked configure
src/gui/kernel/qevent.h
One side renamed a parameter of a constructor; the other added an
alternate constructor on the next line. Applied the rename to both
for consistency.
tests/auto/tools/moc/tst_moc.cpp
Each side added a new test at the end.
.qmake.conf
Ignored 5.7's change to MODULE_VERSION.
configure.json
No conflict noticed by git; but changes in 5.7 were needed for the
re-worked configure to accommodate 5.7's stricter handling of C++11.
Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
As reported by UBSan:
tst_qtreeview.cpp:2187:36: runtime error: downcast of address 0x7ffc15749f20 which does not point to an object of type 'PublicView'
0x7ffc15749f20: note: object is of type 'QTreeView'
Fix by making the test a friend of QTreeView (and, for
Clang, of QAbstractItemView) instead.
Change-Id: I5b748696ab441a91058f4d45a18bd5ed75a6e560
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
As reported by UBSan:
tst_qabstractitemview.cpp:336:23: runtime error: member call on address 0x7ffe6fe96e10 which does not point to an object of type 'TestView'
0x7ffe6fe96e10: note: object is of type 'QListView'
tst_qabstractitemview.cpp:337:5: runtime error: member call on address 0x7ffe6fe96e10 which does not point to an object of type 'TestView'
0x7ffe6fe96e10: note: object is of type 'QListView'
tst_qabstractitemview.cpp:338:23: runtime error: member call on address 0x7ffe6fe96e10 which does not point to an object of type 'TestView'
0x7ffe6fe96e10: note: object is of type 'QListView'
[etc ...]
Fix by making the test a friend of QAbstractItemView instead.
Change-Id: I1a08977042296eb34e9dbdb5c0595662dbd2e5ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
As reported by UBSan:
tst_qtreeview.cpp:663:5: runtime error: load of value 4294967295, which is not a valid value for type 'DragDropMode'
Instead of abusing -1 to indicate to not set the dragDropMode,
use a separate boolean field in tha data.
Change-Id: I13e7539c858f3b2462d57d660062ef3cb7aec61b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Extract the common part from QItemDelegate and QStyledItemDelegate
which uses QLocale to convert a value for Qt::DisplayRole to a string.
Use this code to get the text for tooltips and "What's this?".
[ChangeLog][QtWidgets][QAbstractItemDelegate] Show localized detailed
tooltips and "What's this?" texts.
Task-number: QTBUG-16469
Change-Id: I8618763d45b8cfddafc2f263d658ba256be60a15
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Conflicts:
qmake/library/qmakebuiltins.cpp
qmake/library/qmakeevaluator.cpp
qmake/library/qmakeevaluator.h
qmake/project.h
QMakeEvaluator:
* evaluateConditional(): one side changed return type, the other
changed a parameter type.
* split_value_list(): one side changed a parameter adjacent to where ...
* expandVariableReferences(): ... the other killed one overload and
changed the survivor
src/corelib/io/qlockfile_unix.cpp
One side changed a #if condition, the other moved NETBSD's part of
what it controlled.
src/corelib/tools/qdatetime.cpp
One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the
other moved it from the private class to the public one, in the midst
of the "short date-time" optimization, which confused diff entirely.
One side changed a QStringLiteral to QLatin1String, the other rewrote
adjoining code.
src/network/kernel/qauthenticator.cpp
Both rewrote a line, equivalently; kept the dev version.
src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
One side changed #if-ery that the other removed.
tools/configure/configureapp.cpp
One side added a check to -target parsing; the other killed -target.
tests/auto/testlib/selftests/expected_cmptest.lightxml
tests/auto/testlib/selftests/expected_cmptest.teamcity
tests/auto/testlib/selftests/expected_cmptest.txt
tests/auto/testlib/selftests/expected_cmptest.xml
tests/auto/testlib/selftests/expected_cmptest.xunitxml
Regenerated using generate_expected_output.py
I note that quite a few other expected_* come out changed, now.
There was no git-conflict in
src/widgets/kernel/qformlayout.cpp
but it didn't compile; one side removed some unused methods; the other
found uses for one of them. Put FixedColumnMatrix<>::removeRow(int)
back for its new user.
Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
Conflicts:
qmake/library/qmakeevaluator.cpp
One side changed the iterator to use ranged-for, the other changed its
body; they only conflicted because the latter had to add braces around
the body, intruding on the for-line. Trivial resolution.
Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
When setting a QFileSystemModel as model, the completion role
is set to QFileSystemModel::FileNameRole. This needs to be reset
to the default Qt::EditRole when setting another model.
Task-number: QTBUG-54642
Change-Id: Ie78d5d417e008ad05a2f995bdbc218b3ad1bc49c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
QLineEdit::setText() emits QLineEdit::textChanged(), which is
connected to QComboBox::editTextChanged(). When a user slot
connected to editTextChanged() sets QComboBox::editable to
false, the line edit will be deleted in setEditable() and
when control returns to QComboBoxPrivate::setCurrentIndex(),
the formerly non-null 'lineEdit' has changed to nullptr,
leading to a nullptr dereference when attempting to set the
completionPrefix on lineEdit->completer().
Fix by re-checking 'lineEdit' after returning from the
QLineEdit::setText() call.
Add a test.
Task-number: QTBUG-54191
Change-Id: I94154796cfde73fb490f8471c48b9d6f62825a92
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Modern SSD drives no longer have short file names enabled, causing
the test to fail.
Task-number: QTBUG-29403
Change-Id: I2e9866d8f8a6ed3df9d2dc6630b8cfa47ade0728
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It tested whether a paint event was received when calling QWidget::repaint()
right after QWidget::show() without waiting for the window to be exposed.
This caused a QEvent::UpdateRequest to be sent, which ended up in
QWidgetBackingStore::sync() which returns after checking
QWidgetBackingStore::discardSyncRequest(), since Qt::WA_Mapped is not set
on the non-exposed widget.
The test passed on Windows since it contains one call to
QCoreApplication::processEvents() which causes the the initial WM_PAINT
message to be processed in QWindowsWindow::handleWmPaint() which calls
QWindowSystemInterface::flushWindowSystemEvents() and causes Qt::WA_Mapped
to be set. This seems counter to the intention of the test.
Remove the test since it won't pass anymore in Qt 5 unless Qt::WA_Mapped is set.
Task-number: QTBUG-26424
Task-number: QTBUG-38327
Task-number: QTBUG-39842
Change-Id: Iede026d52825dcf1f2e9014a316d26d260309214
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Now that the minimum deployment target (and thus SDK) is 10.9 for OS X
and 7.0 for iOS, all code paths affecting platform versions lower than
the aforementioned are removed.
Change-Id: Id985c7259c4ac069319d88f2c29c9559ae9e8641
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
It fails randomly on Windows, possibly due to timing issues.
Change-Id: I0ef74f203455eb4ea8aeee4c8fc9bf1fbf6fb8ff
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The test selectWordsFromStringsContainingSeparators() duplicated
in boths tests caused tab and Nbsp characters to be output to the
log, which upsets editors.
Use an array of ushort instead of a wasteful QStringList and
output the hex codes for the unprintable characters.
Change-Id: I08724268f376b4c0da492b4109570e44f7d4a3fb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Whenever a regular QWidget contains a child render-to-texture widget
(like a QOpenGLWidget) that is opaque (attribute
Qt::WA_OpaquePaintEvent is set) and completely covers the parent
geometry, the child widget would not be shown.
This happens because QWidgetBackingStore::doSync contains a check to
see if an opaque child completely covers its parent, in which case it
does not draw the parent, and only draws the child.
This is an issue if the widget is actually a texture-based one, because
for it to be seen on screen, the parent widget has to be redrawn with a
proper blending mask, so that the rtt widget gets properly composed
into the place where the mask is.
The fix consists in keeping the parent widget being marked dirty, in case
it has an opaque texture-based child that completely covers it. This will
force a redraw of the parent widget with a proper blending mask.
Change-Id: If1feec04b86bff2c49158b8d72f175cec252dea1
Task-number: QTBUG-52123
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Blacklisting maskedUpdate() to get QtWayland in the CI
Task-number: QTBUG-51399
Change-Id: Iabe8db88c7e0b6138cbbf6acab0964d85fdd2c36
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
There is nothing guaranteeing there will be a paint request after
resizeViewportFramebuffer() is called. However we must not be left
with a framebuffer with uninitialized content. So trigger an update.
Include also a half-hearted autotest. QOpenGLWidget (or QGLWidget)
viewports have not been autotested at all. Try to verify that it
is functional at least, even if we cannot check the actual output.
Change-Id: I34d78fe32e94c39dad919216b5a4f4bb2aea3cc2
Task-number: QTBUG-52419
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
The test was half-ported from Qt 4 and #ifdefed out depending
on WINVER. When it became active, it failed since it queries the window
handle too early in the process.
Move the code sending the message into showEvent() to ensure a window
handle exists and parent the listview properly to prevent a leaking
toplevel.
Change-Id: I74aa9ddfd0e88dd31e9258400fc3e473b6e0d92e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This has been fixed in 5.6.1 but we can afford the extra test
to guard against regressions.
The setup for this test is two menus, one parent of the other.
The submenu is tearable. We open the parent menu, open its
submenu and then move the mouse cursor straight over the
submenu's tear-off area. The submenu should stay open even
after a short delay.
Change-Id: Ia8ad326d78dde31b6dd91b0ebacf0db1898715d4
Task-number: QTBUG-53068
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This patch reduces paint events by removing code which sets native
widgets dirty in QWidgetWindow::handleExposeEvent. Native widgets are
also marked dirty in QWidgetPrivate::drawWidget, so it is enough for
proper painting.
This restores Qt4 behavior when one resize means one repaint for native
widgets. Without this patch the native widget is marked as dirty on
every expose event, so one repaint is from syncBackingStore and second
(or more) is from marking the widget dirty explicitly.
This patch improves performance of native widgets and it also reduces
locks when paint event is v-synced, e.g. on OpenGL swap buffers or on
any other technology like VDPAU, VA-API, etc.
Added autotest for checking number of paint events for native widgets.
Task-number: QTBUG-50796
Change-Id: I4e1649069e2e73d15b038fd1834d0551915252ee
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QMenuBar now receives a parent changed event for each of its parent,
grand-parent, ... This fixes a crash caused by an invalid QWidget
pointer and makes sure the keyboard shortcuts events are relayed to the
menu bar in all parenting/re-parenting cases by installing an event
filter on each parent
Task-number: QTBUG-53205
Change-Id: I419e6cbc52e28a67fb08a848a7161b4cb8ae4ae5
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Pass -xplatform macx-tvos-clang to configure to build.
Builds device and simulator by default.
Added ‘uikit’ platform with the common setup.
Also added QT_PLATFORM_UIKIT define (undocumented).
qmake config defines tvos (but not ios).
tvOS is 64bits only (QT_ARCH is arm64) and requires bitcode to be
embedded in the binary. A new ‘bitcode’ configuration was added.
For ReleaseDevice builds (which get archived and push to the store),
bitcode is actually embedded (-fembed-bitcode passed to clang). For all
other configurations, only using bitcode markers to keep file size
down (-fembed-bitcode-marker).
Build disables Widgets in qtbase, and qtscript (unsupported,
would require fixes to JavaScriptCore source code).
Qpa same as on iOS but disables device orientation, status bar, clipboard,
menus, dialogs which are not supported on tvOS.
Change-Id: I645804fd933be0befddeeb43095a74d2c178b2ba
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Replace the pointer member test widge by a widget
instiantiated on the stack where needed.
Remove empty functions.
Change-Id: Ie2da1d88bb23e56e85a2c57cc28220d74c63fae1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Use one simple widget of a suitable size per-test instead, removing
the need to reset palettes and fonts and to hide and re-show the
widget.
Task-number: QTBUG-38858
Change-Id: I3096af91ba68e419ad7383e59bcc5838c2363e32
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Introduce a function going up the widget hierarchy determining a QTransform
for mapping the coordinates applying the transformations of any QGraphicsView
instances found. In mapFromGlobal(), use the inverse of it. This fixes the
case of widget hierarchies embedded into QGraphicsView with transformations.
Increase fuzz in the tests due to float rounding errors.
Task-number: QTBUG-41135
Task-number: QTBUG-50030
Task-number: QTBUG-50136
Task-number: QTBUG-52507
Change-Id: I507e0bccd546250fe9c2d1b74ef38657d61490b4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The QFontDialog test will currently fail for some PCF bitmap fonts
because the list of smooth sizes it uses to populate its size list
contains unsupported sizes. We work around this by adding
QEXPECT_FAIL when we detect that the failure is going to happen.
Task-number: QTBUG-46056
Task-number: QTBUG-53299
Change-Id: Ia665cca220f3622405d1a2336e8d587545cccbc6
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Create parent nodes with the corresponding paths, not with
the absolute path of the child node. Otherwise we will get
incorrect QFileInfo at least in the following case:
QFileSystemModel model;
model.setRootPath("/usr/bin");
QModelIndex idx = model.setRootPath("/usr");
qDebug() << model.fileInfo(idx).absoluteFilePath();
Without the fix it prints "/usr/bin".
It's a regression triggered by 61cefb2f7a
(De-inline QFileSystemModel::fileInfo() and implement it efficiently).
Change-Id: I3b4e5f5b256711e27ad50824eaa8492dbc096808
Task-number: QTBUG-51586
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The test passes on OS X now.
Task-number: QTBUG-8941
Change-Id: I7b57dc30ede7c1ed0bcb8bacb458ea56f222d987
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Sheets are no longer transparent on newer OS X
versions.
Change-Id: Iaaed5aea9c9b130a5d991acd36717b76c3927cfb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
The Qt 5 unified toolbar implementation does not move
the toolbar to the “non-client” area. This test is
no longer relevant.
Change-Id: Ia32de2260f8ef400a0dc5acf3e5e3ff59083657a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
On some X11 window managers, 2 events are received when
hiding/reshowing and activating the window, which became
apparent after 91f536dd71.
Change-Id: I66fdc4f69d87ac898b18d5dfddc957617bb8f916
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
The old code sometimes made incorrect selections when rows or columns were
hidden or moved. It used logical top left and bottom right indexes to create a
selection rectangle. However on moved or hidden cells a wrong rectangle was
made. This fix calculates a simple rectangle without hidden cells and makes use
of the row/column select functionality provided by the selection model, to make
the right selection.
[ChangeLog][QtWidgets][QTableView] Fixed a selection bug when rows or columns were hidden (QTBUG-50171)
Task-number: QTBUG-50171
Change-Id: Id186012af26da7b2051ff5eb1c13e6b7494cca77
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
This patch QSKIPs all tests that:
- take to much time sitting in some QTRY_VERIFY or similar before failing
- result in 'not in fullscreen mode' warning (with PASS) - thus completely flaky.
- Where previously determined to not apply to OS X using QT_OS_MAC
The intent is to make the test run-time more reasonable,
both when running the test locally and on the CI system.
Reduce the BLACKLIST - to avoid a 'double elimination' the tests that are skipped now,
should not be BLACKLISTed so that we fix them for good.
Task-number: QTBUG-52974
Change-Id: I34dc2010d0debc6b5b99f2375a6da902b7a17b29
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Q_OS_DARWIN is the general replacement for Q_OS_MAC,
but most/all of the MAC sections in this test are
OS X specific.
Change-Id: Ic54af9d3dce1e1952a57e15b74acdedf2af60c79
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Fix regression in a7b0cb467c which caused
it to be hard to start scrolling at the ends of a scroll-view if using
fine grained scrolling events.
Change-Id: I55f3210150b993281545c3ad5a7356d892fa30b5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>