customMenuFont was null, so objects was an empty array, and
NSDictionary throws an exception when being called with arrays
of different sizes.
Task-number: QTBUG-42728
Change-Id: I8cdab449fd8c1d12b65c46dd5617a7f5e3e96c6e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Change-Id: I7147d326b0f5bb218f4dbc013ed82efb4c1e1440
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Place the rubberband over the tabs instead of where the hidden
subwindows happen to be.
[ChangeLog][QtWidgets][QMdiArea] Fix rubberband position for tabbed mdi windows
Task-number: QTBUG-42612
Change-Id: I41e81ab8b99ab9e0fa533fd4ed1b2a8141d19753
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Prepare for determining the suitable number of touch points
from the device type. For now, 2 points are used as
before, which can be overridden by setting the environment
variable QT_PAN_TOUCHPOINTS. Add member variable
to QPanGesturePrivate which is set on gesture creation and later
used for comparison.
Task-number: QTBUG-40461
Change-Id: I6d9e35ca752375bc6a54435482ca0925195b8142
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This is required so we can take a QVariant and detect that it contains a
Q_GADGET and then use method like QMetaType::metaObject and QMetaProperty::write
with the QVariant::data
Change-Id: I3603692e4e84426e10bf59949e3def3ea4947bec
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
When the QWidgetWindow receives a resize or move event, it should check
with the widget if its crect already has this geometry. if not then send
the resize or move event
Ideally events should be sent whenever the QWidgetWindow receives them.
QTBUG-42383 is created for this problem
Task-number: QTBUG-29937
Task-number: QTBUG-38768
Task-number: QTBUG-30744
Change-Id: I1e9a5d25de29a98885edece927ba14d7a763eb01
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
For some reason lost in time QFrame was missing that method. Of course
that led to duplicated code and to subtle sizing miscalculations.
Task-number: QTBUG-29330
Change-Id: I81163f5def6661e01cb2ecc49c1169449a3e3758
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This test shows a behavior change of setFrameStyle(QFrame::WinPanel)
between 4.4 and 4.5.
Turns out that 4.4 defaulted to "Raised" only via a side effect of the
code, while 4.5 defaults to "Plain" which makes more sense since Plain
is the default anyway. So there is no actual bug to fix (the app code
really meant QFrame::WinPanel|QFrame::Raised anyway), but the unittest
is still good to have for the future.
Done-with: David Faure
Change-Id: Icf16382504b18357256bc601b1e865abac9f2b2a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
For some reasons lost in history, those methods simply ignore
the list of items passed to them, and always return NULL.
Of course, that's totally broken. Fix that by doing the same thing
that the respective (hidden) models did when calling mimeData().
Surprisingly enough, QTreeWidget has a proper implementation.
Task-number: QTBUG-25900
Change-Id: I99ca7b4d4f87f096fd9ff0b0cb4e58282aa9c26e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Instead of sending the event from random places, send it from
QWindowSystemInterface. This allows to send override events on OS X to
menus before doing other key processing and reduces the number of
ShortcutOverride events on all platforms to exactly one per key press
event.
Additional test by Friedemann Kleint.
Task-number: QTBUG-38986
Change-Id: I6981bb776aba586ebc7c3daa5fd7a0d84c25bc3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Removing and adding toplevel items could result in invalid stacking
order (not corresponding to insertion order).
Task-number: QTBUG-19316
Change-Id: Ia8646784a2181cfa936b101e2adaf7e7e73bb83d
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Selection rectangle was incorrectly mapped to scene space when the
view was rotated. It became a rotated rectangle instead of the correct
polygon (rhombus).
Task-number: QTBUG-42008
Change-Id: Ib7b366bec7e1f83109e03c434268ad6897138f30
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The sample lineedit in Qt's own font dialog shouldn't have its font
affected by stylesheets.
Not only does this hampers the ability to preview the font, it actually
overrides the font selection as that one is taken directly from the
widget.
Task-number: QTBUG-41513
Change-Id: I11d0bef8c7bf7bdae4cc08b6b9276d0fc14a75fb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
The updateDelegate() function checks isEditable() which in
turn checks if d->lineEdit != 0, so we need to make the
call after the lineEdit has actually been set/unset, otherwise
the change to the delegate will not come until the next time
you update the delegate.
[ChangeLog][QComboBox] Fixed updating appearance of popup menu
when changing the editable state of the combo box.
Change-Id: Ib32f36cabd53c2c30d6256484a1eae131419960a
Task-number: QTBUG-33537
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Make sure the dock widgets get the available space when the
central widget cannot expand any more.
[ChangeLog][QtWidgets][QMainWindow] Dock widgets will now be resized
properly when the central widget has a fixed size.
Task-number: QTBUG-40410
Change-Id: Id06c07b79aa3102aa41212fa2c621f5fa426fe02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Since layout items can now be hidden, this also makes sure we respect
the QSizePolicy::retainSizeWhenHidden
Task-number: QTBUG-20132
Change-Id: Iab59fc9b61d4ca1bb2208c479a027da6eb0283a9
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Map the positions via QGraphicsScene and the first QGraphicsView
(as is done in existing code). Fall back to the previous code
path when no QGraphicsView exists, which is hit in the tests.
Change-Id: I0754765d05cded6bc1b64045f2513fef8afde337
Task-number: QTBUG-41135
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Without this part of the calendar widget get cut off when put
in a layout and the contentsMargins are non zero.
Task-number: QTBUG-40352
Change-Id: I9ce90476c59c270d92e876a5dc81ea8ce325848c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
QListView::spacing() is the space around the item (layout margin),
so the effective spacing is twice as big.
This differs conceptionally from QTableView, which has a spacing of 1
and a line on top/bottom. Split up QComboBoxPrivateContainer::spacing()
into functions return spacing and top/bottom margins to reflect this.
Task-number: QTBUG-37865
Change-Id: I1ff812e7856e00a53f1119ef3304956cbb7cbfca
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Fix warning:
void QWindow::setTransientParent(QWindow*) ... must be a top level window.
which occurred for example when parenting a QMenu onto a native child
widget.
Task-number: QTBUG-41898
Change-Id: Icc25fb2108bd68b2d9c0e551949b90fc7a82d358
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
ASAN report:
READ of size 8 at 0x606000011990 thread T0
#0 0x505e3b in EnterTestMainDialog::eventFilter(QObject*, QEvent*) tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp:10294
[...]
0x606000011990 is located 48 bytes inside of 56-byte region [0x606000011960,0x606000011998)
freed by thread T0 here:
#0 0x2b8df3551c79 in operator delete(void*) ../../../../gcc/libsanitizer/asan/asan_new_delete.cc:92
#1 0x418ab5 in EnterTestMainDialog::buttonPressed() tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp:10276
previously allocated by thread T0 here:
#0 0x2b8df3551739 in operator new(unsigned long) ../../../../gcc/libsanitizer/asan/asan_new_delete.cc:60
#1 0x4188cf in EnterTestMainDialog::buttonPressed() tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp:10272
EnterTestMainDialog::eventFilter() checks for nullness of 'modal'
before accessing it, but buttonPressed() did not reset 'modal'
to nullptr after deletion.
Change-Id: I65562a29f8264a6996d7d615e06de1d1afb5af53
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
The check for Qt::Key_A to handle selectAll was changed to directly
compare to QKeySequence::SelectAll as this will only match Ctrl. The
former implementation also triggered when e.g. Shift was pressed.
Added a check that selectAll is only called when selection is not
disabled, i.e. selectionMode=NoSelection.
Added a unit test for selectAll().
Task-number: QTBUG-26687
Change-Id: I721e7ab590b55d7d754b3b74ef01756fa5aa1315
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
- Ensure top level widgets are cleaned up.
- Place wizards beside each other for comparison.
- Use classic style on Windows to avoid interference by Vista style.
Change-Id: I223a40ea14eefe65dc2e9e8ddee44b0f0c806e3d
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Apparently, this causes problems with the completer due
to the fact that it matches the root drive "C:\" on Windows.
Task-number: QTBUG-41681
Change-Id: Iaf96675067e22e679371139a1a2fbf011a5edbdc
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
- Streamline code and remove code that has no effect.
- Create temporary directory and files only when it is actually
required (empty start path).
- Remove try/catch as it is not commonly used in Qt autotests.
Its original purpose was apparently to ensure temporary file
cleanup, but that should now work since smart pointers are used
for temporary files and directories.
- Introduce variable for case sensitivity.
Task-number: QTBUG-41681
Change-Id: Ie5f621c30fc461b880292b853e0660b8fba316eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Take PM_FocusFrameVMargin into account.
Task-number: QTBUG-35146
Change-Id: I1499790537ddf9fbb912ab764b7d049ee11af95d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Say you have a document of two blocks of text.
When you select a block of text in the document and then replace this
with a new empty block (by pressing enter) and then subsequently
undo this action, the following three steps are performed as a
chain of undo commands:
1. Remove the empty block at the beginning of the document
2. Insert a new empty block at the beginning of the document
3. Insert the text back into the first block
Since a block is removed and inserted in the same go, both blocks
require a relayout, since the accumulated change spans both blocks.
However, in QPlainTextDocumentLayout we would only look at the max
of either removed chars or added chars. This would match the text
length of the first block at this point, so we would only relayout
that block. However, since we are also removing characters, the
actual accumulated change to the document is larger. We should
relayout any block touched by the sum of the added and removed
character counts.
Missing this, the paint event would later query
block.layout()->lineForTextPosition(0) which would give an invalid
line despite the fact that the block.length() > 0. This caused
a crash in the paint event when the full width selection was
turned on.
Note that the logic here was only recently updated to include the
removed characters at all in the logic, by the SHA1:
2983cb9531.
[ChangeLog][QPlainTextEdit] Fixed a crash when using full width
selections and issuing a complex undo command chain which removes
and inserts an empty block in one go.
Task-number: QTBUG-36415
Change-Id: Iafe8a69e455e0c713a48714f10f0cace69c84f51
Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.
Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Fixes a regression against Qt 4, where Show/Hide events were received
when the minimized state changed.
It is restricted to QWidget so as not to introduce additional events
to QWindow (which already has signal visibilityChanged()) and cause
unexpected side effects in QQuickWindow.
Task-number: QTBUG-41312
Change-Id: Ib165a5daf7a7e5d8231ef8a94b70e8a2a3253057
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
tst_qcolumnview fails on OS X # QTBUG-41341
tst_qaccessibility fails on OS X # QTBUG-41340
tst_qnetworkreply fails on OS X # QTBUG-41320
tst_qfontcombobox fails on OS X # QTBUG-41318
tst_macplist fails on OS X # QTBUG-41314
tst_qgraphicsitem fails on OS X # QTBUG-41342
tst_qmdiarea fails on OS X # QTBUG-41343
tst_qtableview fails on OS X # QTBUG-41344
Change-Id: I2626aa61417336805872a807c4a6065b7e0ddb02
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Do not zoom 1pt on every single wheel-event, but instead scale
the zoom with the size of the angle delta.
Change-Id: Idbe17356c7845ebd0039f655d3e611e71c6f0dd6
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Only step the value in the spin box when we have accumulated one wheel
tick worth of wheel delta.
Also fixes the obsolete contructors of QWheelEvent so they set the non
obsolete properties.
Change-Id: Ic6ea4b37afa8eec85a6ca7bdc0d919bf8fb02608
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
When a window's screen changes it may recreate the platform window.
In that case, update the winId in the widget to keep it in sync.
Task-number: QTBUG-40681
Change-Id: Iec815320214832bb63952de3a5bd1340a04dacd4
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QToolButton::sizeHint() takes into account the presence of a menu.
However, setMenu() doesn't retrigger a size hint recalculation. Hence,
(un)setting a menu on an already sized tool button won't properly
reset the size hint. Since the calculated size hint is cached,
delete the cached value and call updateGeometry to cause a
recalculation.
Task-number: QTBUG-38949
Change-Id: I6e79e5e70e31afdfd129282b3668875eca86f51d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
QSplitter::handleWidth() returns either a style dependent value if
d->handleWidth is negative or the value of d->handleWidth itself.
So to preserve this choice after calling saveState()/restoreState()
we should save and restore the value of d->handleWidth rather than a
result of handleWidth() which is non-negative.
Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
And not a normal pointer. The problem is that in certain scenarios,
if the TLW containing a QSizeGrip changes and the old TLW gets
immediately destroyed, then the mechanism which updates the tracked
TLW is run too late, and ends up accessing a dangling pointer.
Therefore, we need to protect that pointer via a smart pointer.
Task-number: QTBUG-22867
Change-Id: Icfb051132bacde604f660ac7a98bc0a9d1022c68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Add a new PM_TreeViewIndentaion enum value to QStyle and get
the corresponding pixel metric in QTreeView.
[ChangeLog][QtWidgets][QTreeView] Indentation is now style-dependent by default.
[ChangeLog][QtWidgets][QTreeView] Added resetIndentation().
Change-Id: Ifad7987b8f3c6cd32987b89d95390f33043d8f19
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Adam Majer <adamm@zombino.com>
This is useful when writing a generic preview-icon-generator which
should work with different type of views, itemviews and QML views.
A way to be notified of a change of icon size was missing on the itemview side.
[ChangeLog][QtWidgets][QAbstractItemView] Added iconSizeChanged signal.
Change-Id: I19b3049961002ca27d71aefbb6980d1e6f225c79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Widgets and layouts added or inserted to a layout are checked for:
- Not being NULL
- Not being the parent widget of a layout or the layout itself,
respectively
Without this commit, adding a widget to its own layout would result in a
CPU-hogging infinite loop. Now, a warning is written to stderr and the
add or insert function call is ignored.
The checks are implemented as public functions of QLayoutPrivate and
thus accessible in QLayout's descendants to be used in various
"addWidget", "insertWidget", etc functions.
Unlike 'classical' layouts like QGridLayout, QFormLayout does indeed
accept widgets that are NULL. To not break this behavior, any call for
the check functions first tests if the widget or layout, respectively,
to test is NULL or not and calls the check only in the latter case.
Automated tests for QBoxLayout, QGridLayout, and QFormLayout were added.
For an unpatched Qt 5.3, each of those automated tests will freeze as
explained in QTBUG-40609. For a fixed version, warning messages about
invalid parameters to addWidget/addLayout/... calls will be read by
QTest::ignoreMessage, resulting in a passed test.
Change-Id: I1522d5727e643da3f7c025755975aca9f482676d
Task-number: QTBUG-40609
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
When setting a new screen, the code calls QWindow::destroy(), which
recursively destroys all child windows. It then calls create() on the
top-level window, leaving child windows destroyed. This causes crashes
if you have embedded native widgets.
Task-number: QTBUG-40817
Change-Id: Iaace2589f48bbfd5faaf5ff95357ff43b310504a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Timer granularity means that sometimes this won't wait the full timeout before
vanishing the message. Add some extra tolerance so we don't unnecessarily fail
integrations.
Change-Id: I203ac16cda7bd1f0437dd3febc0509c17e86c25a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The QPanGesture recognizer requires single-point touch events. The touch
implementation in Qt 4 would test Qt::WA_TouchPadAcceptSingleTouchEvents
and forward single touch events if set.
Making this work in Qt 5 is a little bit more involved since the platform
plugins don't know about widgets.
Change the Cocoa touch implementation to send single-point touch events
to QWidgetWindow windows only. Make QApplication forward single-point
touch events only if the target widget has the
Qt::WA_TouchPadAcceptSingleTouchEvents attribute set.
Task-number: QTBUG-35893
Change-Id: I68712a5e3efb4ece7a81ca42f49c412e525eeb3a
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Everything else passes, after some pending fixes in QtWayland.
Change-Id: Ibd8efcaab8c5210111854f1a7362434046a62898
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Time taken by this testcase reduced from 7 seconds to 5.1 seconds for me.
Change-Id: I93b1c5fbc7d9d6515c9ce51a64fdd5c2ffbd54c8
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
So when they fail it's easier to figure out why.
Change-Id: I7e76a6e0b8076ede30a6bb9049a031063c569dfc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.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>
Manually included changes from
3a347a4e70
in src/opengl/qgl.cpp.
Conflicts:
src/opengl/qgl_qpa.cpp
src/plugins/platforms/android/androidjnimain.cpp
Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
In some language, mnemonics put after label text within parentheses.
e.g. "&Open" is translated to "開く(&O)" in Japanese.
OS X doesn't use mnemonics and '&' in label text is removed.
Mnemonics in parentheses (and spaces before them) also should be removed.
Change-Id: I88c0a1f60af7e148b3cf24a4e215ce807d62bce3
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
With SHA1 47b3ecf3f4 some tests got
commented out by accident. This re-enables those tests.
Change-Id: If9c7d8a672b66086895a0383fe87d3101fb146fb
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
The "adoption" code is taken from setLabel().
Task-number: QTBUG-40503
Change-Id: Id512b28eb756b4a80e5701e599e2cbdf5346ff62
Reviewed-by: David Faure <david.faure@kdab.com>
Read data into local variables and apply only after a check.
Task-number: QTBUG-40462
Change-Id: Id06060d0d5b0eafc2d303526a86d552ff5747a72
Reviewed-by: David Faure <david.faure@kdab.com>
QOpenGLWidget is now public.
In addition Qt::WA_AlwaysStackOnTop is introduced to support the
special case of semi-transparent QOpenGLWidget or QQuickWidget on
top of regular widgets.
hellogl_es2 becomes the qopenglwidget example. This example performs
painting both via QPainter and native GL commands and has the OpenGL
widget combined with other, normal widgets.
The widget stack receives some changes when it comes to renderToTexture
widgets like QQuickWidget and QOpenGLWidget. Calling update() will now
result in a paint event, which is essential for QOpenGLWidget since we
want it to behave like a regular widget. The dirty region handling is
extended specially for such widgets due to performance reasons.
(an OpenGL content update must not result in any backingstore painting,
and is thus handled as a different kind of dirtiness)
[ChangeLog] Added QOpenGLWidget. This widget serves as a replacement for QGLWidget.
Task-number: QTBUG-36899
Task-number: QTBUG-40086
Change-Id: Ibf7f82fea99b39edfffd2fc088e7e0eadbca25cf
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Use sizes relative to the test widget size; move windows relative
to the top left point of the available screen geometry. Set a window
title on widgets to be able to identify them. The test now
passes on Windows using a 4K monitor.
Task-number: QTBUG-38858
Change-Id: I5df9198e390befeb3ca18796e24180135a084aad
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
It is documented to be, and the LanguageChange event is caught and processed.
However, retranslateStrings() uses QProgressDialog::setCancelButtonText(),
which unconditionally sets useDefaultCancelText=true, blocking any further
changes to the button text by subsequent LanguageChange events.
The fix is to use extracted QProgressDialogPrivate::setCancelButtonText()
which - quite intentionally - doesn't set useDefaultCancelText.
Task-number: QTBUG-40504
Change-Id: I6e701deda10c454cb088c0b0778ac2d6adff574a
Reviewed-by: David Faure <david.faure@kdab.com>
The associated test has unearthed that setBar() fails to make the new bar a child
of the progress dialog. This will be fixed in a separate commit.
Task-number: QTBUG-40502
Change-Id: I2d09ebb07ae6395449a4efe38a638df831eebdd7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Introduce function QMdiSubWindowPrivate::storeFocusWidget()
to store focus widget and call this when de-activating a
sub window. Change restoreFocus() to return a bool and call
it from QMdiSubWindowPrivate::setActive().
Task-number: QTBUG-38378
Change-Id: I18dbe66ce85213ca5b4907b5a09126544415351a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Fix tests widgets leaking widgets and ensure it stays
that way by adding a check to cleanup().
Task-number: QTBUG-38858
Change-Id: I77a81d823c68cf0b4e51c2da55b1c473d6e4170b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
[ChangeLog][QtWidgets][QLineEdit] The signal textEdited() is now
emitted when the user clicks the clear button created by
setClearButtonEnabled() as well.
Task-number: QTBUG-40287
Change-Id: Iacd303ffd1533f27cfa68a6120cdd370e3d31ddc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Otherwise, when interrupting the test half-way (e.g. in gdb),
the user's ~/.config/QtProject.conf would be modified.
Change-Id: Id582c4a3fbf0acbed460126fccf0d39b3a09758a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When a dialog was parented on a native child widget,
its window handle was used as a transient parent.
This confused QPlatformWindow::initialGeometry() among
other things. Use top level window as is in Qt 4.
Task-number: QTBUG-40195
Change-Id: Ic82adc276175f92adde825fb2551274351e41f30
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Prevent the QGroupBox from changing the enabled state of
dialogs parented on it.
Task-number: QTBUG-40132
Change-Id: I91cc6ccf5ade0b3a491020ed947d4aceca62d7b6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Prevent the splitter from adding them to the layout or showing
them.
Task-number: QTBUG-40132
Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
It can happen when the sidebar only has only one item, due to
"My Computer" being missing.
Change-Id: I2b38fef45139f1dfa20d88059e56185c3163a833
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
So that this method is at least called once in the test :)
Change-Id: I3b5fc6b7c464d9e56264c709cfa313d475004207
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Instantiate the timer on the stack to prevent it from
interfering with other tests.
Change-Id: I91ffe23b502fcddaeb6d6d3f89ea3d27b083cdb0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Broke tst_QMenu::statusTip by closing the menu while it should not. (and therefore, a QTimer::singleShot that fires while following test are running is making the test fail)
This reverts commit 50c04d6318.
Change-Id: Ib4ef8190f945b915fe268745cc64d471994c5e2d
Reviewed-by: Richard J. Moore <rich@kde.org>
This patch aims to implement the session management available on OS X.
Currently applicationShouldTerminate is just a go through that closes
everything and ends the application. The new implementation calls
first appCommitData and cancels the termination properly if required.
This means that if a user wishes to logout, Qt applications can now
cancel that like e.g. answering to Safari asking whether it is ok to
close because of a number of opened tab/window.
Task-number: QTBUG-33034
Change-Id: Icedc8590a1c0934d9bc87d3a43d6702a9903bfb8
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Remove old message handler hack as we have a new and better api to
ignore warning messages.
Change-Id: Id967b2672fe3e3638db9977500118a19c2afb730
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This property is used to automatically hide tab bar if it has only one
tab.
Originally-by: Denis Kovalskiy <denimnumber1@gmail.com>
Change-Id: I6967f760010fa55bad6a5986c29abe7ccf625cf8
Reviewed-by: David Faure <david.faure@kdab.com>
Fixed qwidget test cases for platforms that show windows full screen by
default and that don't support WindowMasks. Incorporated QNX/BlackBerry
peculiarities.
Change-Id: I349ecab5cef35c7d9751aa547465f685d620164a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Conflicts:
mkspecs/qnx-x86-qcc/qplatformdefs.h
src/corelib/global/qglobal.h
src/network/socket/qnativesocketengine_winrt.cpp
src/plugins/platforms/android/androidjniaccessibility.cpp
src/plugins/platforms/windows/qwindowswindow.cpp
Manually adjusted:
mkspecs/qnx-armle-v7-qcc/qplatformdefs.h
to include 9ce697f2d5
Thanks goes to Sergio for the qnx mkspecs adjustments.
Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
In "setOpaqueResizeAndMove" this patch makes sure that the content of a subwindow
actually fits into the window, otherwise the resize does not work properly.
The content is dpi dependent and thus the pixel size of it increases with the display
dpi value.
Furthermore when moving the QMdiSubwindow this patch makes sure that we actually grab
the window's header and not one of it's tool buttons (minimize, maximize, close).
Change-Id: I88314994957c5883f57c09c9240a3b83f1ee42ed
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
If the widget exists in the style rules cache before it polishes for the
first time then it should be removed from styleSheetCache too so that the
latest set stylesheet is used for the polishing.
Task-number: QTBUG-39427
Change-Id: Ic1e7988afe530f16ea9996bae56543ed554d6be9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This reverts commit a1c5198387.
The idea of detecting non-spontaneous events by comparing
against the widget's crect has problems when sequences
of programmatic resizes occur. In addition, QWindowSystemInterface's
queueing of events is problematic for this.
Task-number: QTBUG-39611
Task-number: QTBUG-32590
Change-Id: I4674d8d5d5d432d938f7226b5790543335665c1f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
It is NOT always the same as isEnabled().
Added a unittest to prove it.
Change-Id: I7717126835923e8c091249bfcdf81767c44fb5f7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When navigating with the directional keys or tab/backtab, there are
certain situations where the cell that is edited is incorrect.
For example, consider the table below.
'^' represents the starting cell and the direction of navigation.
'c' represents the index that is arrived at as the currentIndex prior to this patch as
reported by view.selectionModel()->currentIndex().
'x' is the cell that should be edited:
+---+---+---+---+
| | | e | |
+---+---+---+---+
| | x | |
+---+ +---+
| | c | |
+---+---+---+---+
| | | ^ | |
+---+---+---+---+
Before this patch, the cell that will actually be edited is c, rather
than x, so after editing the cell and pressing enter, the previous
contents of the cell will still be shown.
With this patch, currentIndex() will be changed after every call to
cursorMove(). Navigation into and out of cells is not affected because
the visualCursor member in the QTableViewPrivate tracks the keyboard
navigation entry point. If after the up navigation into the span, the
user presses up, the cell entered is 'e', not the cell above 'x'.
Task-number: QTBUG-29239
[ChangeLog][QtWidgets][QTableView][QTableWidget] currentIndex() now
reflects the top left cell when in a span.
Change-Id: I3dc3db46ebba340102860fc4ad98fcaf91484983
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
QWidget::resize() or QWidget::move() set the new size/position values
and send events. The spontaneous events generated by the platform
should be ignored in that case.
Task-number: QTBUG-30744
Task-number: QTBUG-38768
Task-number: QTBUG-32590
Change-Id: I9c0ae38842ed76a8a88ca64fdc9bbe106b2766b7
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Store the value of QMessageBoxPrivate::autoAddOkButton
temporarily when automatically adding the "Show Details..."
button.
Task-number: QTBUG-39334
Change-Id: I173c83893548ee83b3d8ea2743f87686c32657e7
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Use QTRY_COMPARE instead of hard-coded timeouts, ensure window is
shown.
Change-Id: I4f23144ee14150c4fba9c6fbd8c4ee2da472cc75
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This fixes an issue where, if characters were removed from several
blocks in a single edit, the document layout would end up being
corrupted since the document layout manager wouldn't re-layout the
proper number of text blocks.
Task-number: QTBUG-30051
Change-Id: Idf3a6f567120e6a5dbebf1f65f685d374219328a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
When syncing between QAction and native NSMenuItems, the ampersands
(mnemonics) were removed twice. This lead to double ampersands being
removed instead of replace with single ones.
Task-number: QTBUG-37933
Change-Id: If1d9cd247b467472647b22b38460b44b03f13d82
Reviewed-by: Liang Qi <liang.qi@digia.com>
QEXPECT_FAIL followed by QTRY_COMPARE considerably slows down
tests due to the check timing out.
Task-number: QTBUG-38890
Change-Id: I7f90f2627fc6ce149d159a6d13355ca1a8181d54
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Use the correct palette and enforce Fusion style to prevent
the Vista style from clobbering the tooltip palette in polish().
Task-number: QTBUG-38183
Change-Id: Id19d548f818d801c4914a343e08207195c343888
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Determine the visual index by looking up the column of the QModelIndex
in the logicalIndices array instead of looping.
Task-number: QTBUG-37813
Change-Id: I5c3c73c67537877b03cdc2c36a52041d99f7f49d
Reviewed-by: David Faure <david.faure@kdab.com>
This test doesn't fail on Mac any more.
This reverts commit 36493a7a41.
Task-number: QTBUG-23685
Change-Id: Ib7c56494b07de9839b3287758fe228f799bc343c
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
On some platforms all windows are by default forced into fullscreen mode when show() is executed.
In QMdiSubWindow we cannot handle the fullscreen state and should ignore it. Otherwise
the window will be forced in "normal" state and ignore any previously
executed geometry changes.
Change-Id: I09ce6507a1eac6a0adb3405ca3f423642d30f801
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Increase window size when verifying that the scrollbar disappears
when using a small font on Windows 8.1
Change-Id: I7d4520bc5882d8ccd59db3f5bff7e9d6d68a4827
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
When stripping the root path from a file name that cannot be found
in the model, use case sensitive comparison depending on
file system.
Task-number: QTBUG-38162
Change-Id: I28e28973fca2da35a5768fdd00cc258b9669a15a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>