... by moving them in QTestPrivate namespace (qtesthelpers_p.h). This
header file is a convenient staging area for helper APIs, eventually
some could be moved to public QTest API.
This header file utilizes the same pattern as other qtestlib header
files - wrapping functions with QT_${LIBNAME}_LIB to automatically
enable certain APIs based on what is in the projects dependencies,
e.g. QT += widgets.
Change-Id: Ic0266429939c1f3788912ad8b84fc6e0d5edd68b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The qWaitFor functions themselves can not trigger a test failure, as that
will not result in the test function exiting early, so every single call
to qWaitFor needs to be wrapped in a QVERIFY.
Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remaining uses of Q_NULLPTR are in:
src/corelib/global/qcompilerdetection.h
(definition and documentation of Q_NULLPTR)
tests/manual/qcursor/qcursorhighdpi/main.cpp
(a test executable compilable both under Qt4 and Qt5)
Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Subtract the viewport margins from the contentsRect in
QCommonListViewBase::updateHorizontal/VerticalScrollBar(). This
affects list views in icon mode and list mode / ScrollPerPixel.
Task-number: QTBUG-61383
Change-Id: I6f2f7951ac9344ac21cef1eba061780d130e2467
Reviewed-by: David Faure <david.faure@kdab.com>
This reverts commit a4c25c0205.
The API is too limited in scope, and a good name is hard to find, as
evidenced in the API review discussion preceding Qt 5.9 beta.
This API will hopefully return as something like setItemAlignment().
[ChangeLog][QtWidgets][QListView] EDIT: REMOVE: Added expandingListItems property.
Conflicts:
tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
Change-Id: I397acd8a7a6c716e2d3c96eee45a276eb6d4f9dd
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
The size of flowPositions is larger by one than the number
of rows in the model so the last correct row number is
flowPositions.count()-2, not flowPositions.count()-1.
Change-Id: Idf8bbd155151d553947d5d299dd01ffaff0c95fa
Task-number: QTBUG-47694
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: David Faure <david.faure@kdab.com>
This property allows to change the default behavior in
which list items occupy the entire width of the column.
Setting it to false will reduce their widths to the
minimum values, thus allowing to have intermediate free
space. Then the user will be able to begin selections
by mouse from this space.
[ChangeLog][QtWidgets][QListView] Added expandingListItems property.
Change-Id: I6bd1b147fd0335324310a165104c36f6b0d6ac9f
Task-number: QTBUG-56606
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.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>
Remove Windows CE-specific files, #ifdef sections for Q_OS_WINCE and wince
.pro file clauses in library, examples and tests.
Task-number: QTBUG-51673
Change-Id: I102745aaca9d9737f2108fe7618111743d5ae980
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This also reverts commit 018e670a26.
The change was introduced in 5.6. After the refactoring, 14960f52,
in 5.7 branch and a merge, it is not needed any more.
Conflicts:
.qmake.conf
src/corelib/io/qstandardpaths_mac.mm
src/corelib/tools/qsharedpointer_impl.h
tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
On OS X, the default scrolling mode of item views should be
per pixel instead of per item. We enforce this through a new
style hint. On all other platforms, the behavior remains the
same.
It's still possible to override the style hint by using the
regular scroll mode setters. Any subsequent style change will
result in a no-op once the setters have been called and until
the properties are reset.
Some auto-tests had to be update to to take the new behavior
into account.
[ChangeLog][QtWidgets][Styles] Added SH_ItemView_ScrollMode
style hint.
[ChangeLog][QtWidgets][Item Views] Item views scroll per pixel
on OS X now.
[ChangeLog][QtWidgets][Item Views] QAbstractItemView::verticalScrollMode
and QAbstractItemView::horizontalScrollMode are now resettable.
Change-Id: I3f923275c99aa4389323b52fc1c5455fe71f8d73
Task-number: QTBUG-50102
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Move some code (like registrations of meta types) from init() to
initTestCase() in the process.
Change-Id: I57db5156647cfadab554fbed853b2e68b2815f3b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
The documentation says that we scroll one pixel, but changing the
behavior in 934f062203 to do that
was not well received.
People were relying on the undocumented behavior - and the new behavior
was considered to be a regression. (Nobody called setSingleStep since
Qt in many cases provide a reasonable singleStep - which implied that their
programs scrolled with 1 pixel which was quite slow). Furthermore getting
the old behavior (auto set of single step) was nearly impossible.
However the revert (done in 0e69230d02)
gets us back to QScrollbar::setSingleStep not working in pixel scroll mode
(even without it being documented - but we should also have a working API
rather than documenting that it is not working)
The previous approach was directly prevented Qt from changing
single step (on e.g resize) at all. This patch only prevents Qt from
changing when a user explicitly has called the function
QScrollBar::setSingleStep (in pixel scroll mode).
That is we expect that calls to setSingleStep means that the user actually
wants to set the singleStep and doesn't want Qt to control that value.
Furthermore it is possible to switch back to the automatically adjusted
singlestep with QScrollBar::setSingleStep(-1).
[ChangeLog][QtWidgets][QAbstractItemView] QTBUG-7232 - In ItemViews
when scrollMode is set to scrollPerPixel, it is now possible to
change the single step. Qt will automatically adjust the single step
until setSingleStep is called. When setSingleStep is called it will
however respect the set and stop doing automatic changes of the value.
Calling setSingleStep(-1) will switch mode back to automatic adjust.
Task-number: QTBUG-7232
Change-Id: Ibfe0caa9751d3bcc11bfc6e0654a3d1ac35ac8ae
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
In a QPair, the member names {first, second} have no semantic
value. A simple struct, while not as featureful as QPair, can
be given meaningful member names, {rect, index}, in this case.
Change-Id: If1e289ecee82a1cb020ac3a854efd2ec1096493b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The platform is no longer supported or actively maintained, and is
in the way for improvements to the Unix event dispatcher and QProcess
implementations.
Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Use QByteArray/QString addition instead in loops and for
test row names.
Change-Id: Ia067cd966bf13506e6ca19925eae3158da027b83
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Use character literals where applicable.
Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Calculation was working as long as one didn't use per pixel scrolling.
Task-number: QTBUG-48579
Change-Id: Ie02e28b008c5c81ed45d7dd17fed96148c23b598
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0) by
Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and
add casts where necessary. The values will then be logged
should a test fail.
Change-Id: Ie29640451dddeb58342038a8cd5fac152cce39e5
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
The test showed failures on OS X:
FAIL! : tst_QListView::batchedMode() Compared values are not the same
Actual (ba.size()): 2
Expected (3) : 3
Loc: [tst_qlistview.cpp(848)]
Use QTRY_COMPARE() to count the number of visible indexes with
a helper function instead of using hard-coded timeouts. Item 3
appears with a little delay on OS X.
Change-Id: I2fb2ff5ebdf9dbe85bdc79401375ad6f47b7b12b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
They didn't show up in the "old" CI runs because they usually pass the second
time they are executed - which the testrunner does. The new CI doesn't do that
anymore, instead we now mark those tests explicitly and will track their record
of passing and failing in the new metrics database.
Change-Id: Id34dd6f792f38995b07b6fec88f833df64de2f8b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Don't hit the scrollbar with the mouse click
Change-Id: Ie82d8c5c058df9a482e7d5de2fe40681572f19ad
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Convert vertical wheel events to horizontal for two cases of
the items layout when vertical scrolling is impossible:
1) TopToBottom flow with wrapping
2) LeftToRight flow without wrapping
Do it only for pure vertical events to avoid a mess for such
devices as touchpads or Apple Mouse.
[ChangeLog][QtWidgets][Important Behavior Changes] Allow
horizontal scrolling with a vertical mouse wheel for QListView.
Task-number: QTBUG-37007
Change-Id: Ie2525153fa7b443d27ca08cc5f5d4d7ecdb8c183
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When both scroll bar's policies are set to ScrollBarAsNeeded, make sure
the scroll bars are shown if needed and not show if not. Even the corner
case, where one scroll bar's visibility depends on the other, is handled
properly.
Task-number: QTBUG-45470
Change-Id: I11d6ccf7c0b51644a5ce2d5c3fc59e2e4812755d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
This takes the total runtime of tst_qlistview for me from ~47 seconds to ~10
seconds.
Change-Id: Ie6fe95fe0852c2de37e99c2ad02230de78e0995e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
- Remove irrelevant test subdirs via .pro files
- Follow WinCE codepaths where applicable
- Replace unsupported Win32 APIs with WinRT equivalents
This does not aim to fix any failures in the tests themselves; it only
makes them compile.
Change-Id: Ia82bc0cc402891f8f6238d4c261ee9152b51be80
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Because fonts are bigger on BlackBerry than those assumed when the test was
written, explicitly adjust the font size on this platform.
Change-Id: I6a23c28c2d32edf744dd5de09ea0a97fd5f9b6d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Some test cases rely on the fact that show() is not fullscreen, which may not
be true for some platforms. Explicitly make use of showNormal() to avoid
full-screen show on these platforms.
Change-Id: Ie62fe21bf0f466c561a27cffda99d0201b4a45af
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>