This is an automated change performing the following replacements:
join\("(.)"\) -> join('\1')
join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1'))
join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))
Change-Id: Ia30048e0c40967dc86a4e4ad26ac02ab67519096
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.
This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.
The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.
The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.
This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.
This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.
This needs to be applied in conjunction with
https://codereview.qt-project.org/#change,33548
Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
The test shows spurious failures in editingFinished() on some Mac
platforms (QTest::qWaitForWindowActive(testFocusWidget)).
This is apparently caused by the widget testFocusWidget (member
variable) interfering with the other tests widgets.
As it is used in one test only, instantiate it on the stack there.
Change-Id: I688cd21a2668d072660658302cf59197abe0b4d8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
This reverts commit 6b5bbc531b.
Autograbbing mouse shouldn't be done in crossplatform code, as
X11 does this automatically. Windows needs platform specific
solution.
Task-number: QTBUG-26962
Task-number: QTBUG-27039
Task-number: QTBUG-23699
Change-Id: I911df92c4a34deb50b729f50681497046657948b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
When 2 (February) is entered as the month for (e.g.) 31/Jan/2000 (which
is following the format: "dd/MMM/yyyy"), the day is corrected to 29 but
displayed as its numerical value instead of its short (or long) name.
Task-number: QTBUG-27036 QTBUG-19091
Change-Id: I558ee13b224707d22b26c2ec2c045f96118bd5a1
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
When a QDateEdit has its display format set to "yyyy/MM/dd", its day
set to 31 and its month set to 2, it will display 291 as the day until
the cursor is moved or the focus changed. This is because
QDateTimeParser::parse calls sectionSize() for the day section, which
will sometimes return an incorrect size. There are also other display
formats affected by this bug (e.g. long day names).
For example, (in the context of sectionSize()) when text is
"2000/01/31" and displayText() is "2000/2/31", there is a difference
between displayText() and text - text is the previous value and
displayText() is the new value. The size difference is always due to
leading zeroes.
This patch makes QDateTimeParser keep track of the quantity of zeroes
added to each section and then factors this value into the result of
sectionSize() if there is a size difference between text and
displayText().
Task-number: QTBUG-26847
Change-Id: I3823cc41167ec920f742cb6a20d39fc5f433c915
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
QStyle::standardIconImplementation() & layoutSpacingImplementation()
are removed, and standardIcon() & layoutSpacing() made pure virtual.
Change-Id: If8ab6cfef0b639b7973be22dd630ba3e6f39a225
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
When calculating the maximum height / width which a QGraphicsView can display,
make sure we only take the scrollbars' dimensions into account if their policy
is set to Qt::ScrollBarAsNeeded:
- if the policy is set to Qt::ScrollBarAlwaysOff, the scrollbar will not be
displayed at all
- if the policy is set to Qt::ScrollBarAlwaysOn, the scrollbar's dimensions
have already been substracted from the available space by
QAbstractScrollArea::maximumViewportSize()
Task-number: QTBUG-14711
Change-Id: If5d24b41dbe7b089abca2bf61ccbd370d4de79a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Try to find a target widget that accepts drops; ignore the event
if none can be found. Split the handleDrag*() functions
to reduce indentation.
Add an autotest.
Task-number: QTBUG-22987
Change-Id: I516ac5f0c002caaf83c52ac16f821246e565230f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
If you had a QTreeView with expandable items, if you tried to expand and while
the animation was still running you'd try to collpase the node,
the display would be completely broken: the items below that items would
not be visible any more except for a fraction of a second when expanding
or collapsing it again.
The problem is in the fact that when starting an animation the QTreeView
stores the state before animating. And it does that even if an animation
is already running. So the stateBeforeAnimation becomes AnimatingState and
when the animation finishes, AnimatingState is the state that is restored
breaking the painting.
Unit test is included.
Change-Id: I015212c1ed8962e6df705655099a5660f195caf3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
The Qt::KeypadModifier modifier is internally masked away from all
shortcuts. So it is not possible to set a keypad only shortcut.
Changed the implementation so that first a full keysequence match is
searched. Then if no match is found the same sequence is tried
without the keypad modifer.
Added a autotest for this also to cover the basic use cases relating
to this.
Task-number: QTBUG-20191
Change-Id: Ibe7740c705fd0ab1eece4809b9a0b48882172933
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
QTextEdit showing long lines using lots of text format (for example
with a syntax highlighter) used to expose a quadratic behaviour which
make it impossible to edit files with long lines.
It was fiexed in the few previous commit
Task-number: QTBUG-8389
Change-Id: Ib7203497a7699a85ae1dfb70fe65d5fb36884b58
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Introduced during Qt5 development and renamed to QInputMethod.
Change-Id: If6744648dc98b779e65c449ae32626db574181df
Reviewed-by: Joona Petrell <joona.petrell@gmail.com>
Task-number: QTBUG-26540
Change-Id: I1c365aeb013f5ddedd0589aa4c4844be759a3882
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
They used to always return indexes in column 0.
Change-Id: I2cf4239e0a975b37548de00a1deb916fcd88b4c7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Commit 7808ec79 changes QApplication to synthesize
mouse events from (unhandled) touch events.
On Mac OS X this creates a conflict for two-finger
scroll swipes, which generates both touch events and
mouse wheel events: scrolling in QTextEdit will also
select the text.
Add a SynthesizeMouseFromTouchEvents platform style
hint that enables the event synthesising. Set to true
by default and false in Cocoa.
Change-Id: I1ffa5a141476aa38b81ce92a87eff676c7ec2276
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Size constraints set on a widget before the creation of
the QWidgetWindow were lost (for example, Qt Creator's
preference page).
Task-number: QTBUG-26745
Change-Id: I7c2f5aed9c8817795603e5ad3c24418d66627bab
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: hjk <qthjk@ovi.com>
Task-number: QTBUG-21804
Change-Id: I475166f3f60b1278089baa255ace4e18baeb568e
Reviewed-by: Jani Honkonen <jani.honkonen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
When a stylesheet was set on a parent widget then in some cases it would
not get applied to all the child widgets. This was because the order of
the children list may have been modified while it was being set on
children. By making a copy of the list we prevent this from being a
problem.
Task-number: QTBUG-26321
Change-Id: Iea6bf72c69a0c39746f7ef5e7893dda5a93ed7e5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
The listitem width was calculated incorrectly because spacing was
not considered. This fixes the second part of the reported bug where
spacing is set. Added some tests to catch the issue relating to the
reported bug.
Also added a test to check spacing in general.
Task-number: QTBUG-21804
Change-Id: Icc6326bce914264d882a60a9fc0ebe7d2a08dbf6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
If the selected item is scrolled with keyboard keys the selected item
will go outside the visible area. The scrolling did not take hidden
items into account when calculating the amount to be scrolled.
Task-number: QTBUG-21804
Change-Id: I63da0248cec43be464898f9dc8167e739f00ccd0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This allows us to remove the odd hacks to get the static metaobject
for the QWidget* metatype.
The QWidget* is still an automatic metatype thanks to the QObject
partial template specialization. It is registered as a metatype
at runtime automatically in qwidgetsvariant.cpp.
Change-Id: Ie01b69eadf2cbe87af1a86c3284550f60dcf9e94
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This is necessary whenever QPersistentModelIndexes are changed. Omitting
it means that views are not able to react to the change, such as QTreeView
clearing its (manually held) QModelIndex cache, and the QItemSelectionModel
clearing the item from its storage.
It is necessary to change a QSortFilterProxyModel test which assumed setItem
does not have any such effect. That test is ported to setData instead.
Task-number: QTBUG-18539
Change-Id: Id7a602f18b9773ba4d11019418de886860d26d3e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
The bug is that the connection to emit that signal can be made
obsolete if the connection is made too early and the model is replaced.
In the bug report, the connection is made by calling view() early (thereby
causing the creation of a view and a QItemSelectionModel which operates on
the built-in QItemSelectionModel, and then connecting to that
QItemSelectionModel), and then when QComboBox::setModel() is called later
the built-in view creates a new QItemSelectionModel for it. The bug was
that that new QItemSelectionModel is not connected to. This patch fixes that
bug.
Task-number: QTBUG-4454
Change-Id: Ibbdb8731f16ab071008b4a19dc2cc7ae03cebc84
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
There are some security issues with undo/redo. User should not be
able to get the erased password back in any situation. Therefore
redo must be disabled completely and undo is limited only for erasing
previously entered text.
Task-number: QTBUG-14226
Change-Id: I2b38aca84adbad1c14db76b56ad6303d56b35b4d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Task-number: QTBUG-26687
Change-Id: Iaa0197efe64c61505e22e4a63a1f5c012af0bc78
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
GCC 4.8 warns:
src/testlib/qtestmouse.h:219:67: warning: ‘popupMenu’ may be used uninitialized in this function [-Wmaybe-uninitialized]
{ mouseEvent(MouseClick, widget, button, stateKey, pos, delay); }
tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp:862:12: note: ‘popupMenu’ was declared here
Change-Id: I19cfd1790fbd948e97bf740d4412ccf3bb98a330
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This test is doing a brute-force mapping. Coupled with changes to
QCOMPARE last year, this now allocates and deallocates a lot of memory
per iteration. On my Sandybridge, it takes two minutes to run:
111136.781153 task-clock # 0.999 CPUs utilized
371,692,633,238 cycles # 3.344 GHz
182,641,818,708 stalled-cycles-frontend # 49.14% frontend cycles idle
57,951,552,830 stalled-cycles-backend # 15.59% backend cycles idle
477,216,332,971 instructions # 1.28 insns per cycle
# 0.38 stalled cycles per insn
86,959,637,669 branches # 782.456 M/sec
309,185,237 branch-misses # 0.36% of all branches
111.264868818 seconds time elapsed
Changing the iteration step from 1 to 5 reduces the runtime to about 5
seconds.
Change-Id: I9cad6f85f535f472319da7cd6c4aa28e12ddf1b7
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This test has recently timed out in CI, but appeared to be making
progress. Give it more time to complete.
Change-Id: Ied0fb7aad35ed6d5889dd585a7545687617e5e19
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Task-number: QTBUG-26793
Change-Id: Ic19cb6581cd5838d26713998e152772a5d12da4f
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
SRCDIR was not defined for WinCE but it should no longer be used.
Fixed test case to use QFINDTESTDATA instead.
Change-Id: I07cbf7d42790d33e2d205d1682ec10e7577a92bd
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
This is consistent with QAbstractButton, QCalendarWidget,
QDialogButtonBox and QGroupBox (ie, all other widgets with
a clicked signal)
Task-number: QTBUG-26105
Change-Id: Ieafe988b5c03216796b69a7cd70ac1a03fc12b0a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The argument has been obsoleted and not documented since 2007. Get rid
of it now before Qt 5.0
Task-number: QTBUG-25089
Change-Id: I91a5508a5e1606f5b5c289501295c67be4abe6a0
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Add new qt_handleXXX functions that forward to the QWindowSystemInterface
functions, and use those in the testlib inline functions. Remove use of
struct QWindowSystemInterface::TouchPoint from the testlib header files
(requiring some slight increase in ugliness in the two tests that use
that struct).
Also remove the qmake hack that adds private headers to all tests
Change-Id: Iec23537e55a44802f6e9cd463f7a0f82007c5250
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.
Task-number: QTBUG-25053
Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QWindow::setWindowState is not supposed to set the window active.
The method requestActivateWindow() should be used for that.
When switching from and to fullscreen mode we're always passing
SWP_NOACTIVATE to SetWindowPos to not change the activation state
of the window. This is inverse to the old behaviour, which did not
have an effect.
Change-Id: I339337935cdad76b3ef252202e92177f37543038
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
QApplication::setActiveWindow doesn't activate the native window but
marks the widget as active inside Qt.
We need to use QWidget::activateWindow instead. See docs.
Also moved the activation call further down because on Windows a
minimized window cannot be activated using the activation-by-focus
fake we're currently using.
Change-Id: I752f6ada1f463931fa9cfb3c35f42dbec0207bfa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Previously synchronous window system events were
implemented by bypassing the queue and processing
the event immediately. This is not ideal since the
event order is not preserved - there might be "happened
before" events waiting in the queue.
Add QWindowSystemInterface::flushWindowSystemEvents
and change all handleSynchronous* to 1) queue the
event 2) call flushWindowSystemEvents.
flushWindowSystemEvents is almost identical to the
already existing sendWindowSystemEvents with the
exception that it does not call QApp::sendPostedEvents.
Move the common implementation to a new private function.
Task-number: QTBUG-20778
Change-Id: Ie98a83875bc0a14e335e36bed0dd9e0ed4a1dea0
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
The test has a member QWidget *topLevel which it recreates
and shows in init() without waiting for it to be exposed
although it is not used in every test case. This apparently
interferes with some tests that create separate top levels.
Do not show in init(), delete the topLevel.
Add wait to the cases where the topLevel is shown.
Change-Id: Ib428020b36dc82991d41e68478fd583bdfb004c7
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Use QTRY_VERIFY for the mappped attribute check.
Change-Id: I3cbde9122405bf7067f3702193e80636edc8c5c6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
- Introduce smart pointers to delete widgets and resources
to ensure tests are not affected by left-over widgets
also in case of failure.
- Replace deprecated QTest::qWaitForWindowShown() by
QTest::qWaitForWindowExposed() and use QVERIFY,
remove some hard-coded timeouts.
- Set some titles and object names.
- Add verbose debug output of event lists in tests
childEvents.
- Set minimum sizes on widgets to avoid Windows warnings.
- Stabilize GDIWidget, trigger on first event only.
Change-Id: I64119a2e7113e4a9f0156d00c72ce0935d03bb81
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>