Commit Graph

1046 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
fd05f26d80 tst_qdatawidgetmapper: stop using module-wide includes
Change-Id: Ia0e170e2185a46685cb1c130a16b8a9d379b6e02
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-14 21:01:59 +01:00
Giuseppe D'Angelo
a8723871ee QFrame: add an autotest for visual appearance
Change-Id: I97c24902c9f8dfabd9ececbae868d42ea262653b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-11-11 10:33:25 +01:00
Giuseppe D'Angelo
29c4913b02 QFrame: introduce initStyleOption (and use it)
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>
2014-11-04 15:31:09 +01:00
David Faure
7afc6d6277 QFrame: add unit test
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>
2014-11-04 15:31:04 +01:00
Giuseppe D'Angelo
ee17adebd2 Implement QTableWidget/QListWidget::mimeData()
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>
2014-10-31 14:06:25 +01:00
Frederik Gladhorn
d7ca800a87 Clean up ShortcutOverride handling
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>
2014-10-30 11:40:18 +01:00
Frederik Gladhorn
2eb26c1709 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/gui/text/qfontdatabase.cpp

Change-Id: I6ac1f55faa22b8e7b591386fb67f0333d0ea443d
2014-10-27 13:00:36 +01:00
aavit
6841dd6ecc QGraphicsScene: stabilize stacking order of toplevel items
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>
2014-10-24 22:02:18 +02:00
aavit
9911550fa7 Fix rubberband selection in rotated GraphicsView
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>
2014-10-24 21:59:47 +02:00
Pierre Rossi
929509ea03 QStyleSheetStyle: Don't interfere with QFontDialog
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>
2014-10-24 16:59:26 +02:00
Eskil Abrahamsen Blomfeldt
c4430ed023 Correctly update QComboBox appearance on editable change
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>
2014-10-24 08:51:18 +02:00
Paul Olav Tvete
2bfee10f3a QMainWindow: respect the maximum size of the central widget
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>
2014-10-24 07:54:36 +02:00
Friedemann Kleint
88057e3407 QSwipeGestureRecognizer: Fix gesture cancel on direction change.
Task-number: QTBUG-12736
Change-Id: I6d8d09843b45df17cb9158070f63b3397c5b4c07
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-10-23 21:14:23 +02:00
Friedemann Kleint
68d83e82f8 Add autotest for QGestureRecognizer.
Task-number: QTBUG-12736
Task-number: QTBUG-15768
Task-number: QTBUG-40461
Change-Id: Ib6dfaa9336f615e17d41444f7aa686cb93d04fca
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-10-23 21:11:28 +02:00
Jan Arve Saether
bf200fc948 Adjust the layout if a QGraphicsWidget is explicitly hidden
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>
2014-10-23 07:17:50 +02:00
Friedemann Kleint
ed0245e145 Fix QWidget::mapTo/FromGlobal() when embedded in QGraphicsView.
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>
2014-10-23 06:33:10 +02:00
Lars Knoll
bd4a19963e Respect contents margins when calculating the size hint
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>
2014-10-22 07:23:37 +02:00
Friedemann Kleint
ab556d6b32 Fix height of combo popup when the list view has non-zero spacing.
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>
2014-10-22 06:21:54 +02:00
Friedemann Kleint
6c7a348cf8 Set correct transient parent in q_createNativeChildrenAndSetParent().
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>
2014-10-21 06:30:15 +02:00
Frederik Gladhorn
3361fcbc28 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
2014-10-20 19:12:25 +02:00
Gabriel de Dietrich
59ebcdc540 Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-10-18 13:24:33 +02:00
Marc Mutz
239b71d07d Fix use-after-delete bug in tst_QWidget::taskQTBUG_27643_enterEvents()
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>
2014-10-18 00:33:03 +02:00
Frederik Gladhorn
b55a688b61 Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: Ic01820f2390e419a5b286643e7351e85ae032473
2014-10-14 13:54:50 +02:00
Maximilian Hrabowski
4cbb99c5e2 QAbstractItemView: fix CTRL+A select all behavior
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>
2014-10-13 13:53:28 +02:00
Frederik Gladhorn
881ceeff42 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
2014-10-09 17:56:52 +02:00
Alessandro Portale
106487387d Removing a few unneeded "? true : false"
Change-Id: Ib13f0ddd65fe78f5559f343f2fc30756b1d3ef76
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-10-09 09:43:26 +02:00
Oswald Buddenhagen
f49d5b578c Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
2014-10-06 11:59:47 +02:00
Friedemann Kleint
39b32f0874 Stabilize tst_qwizard.
- 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>
2014-10-03 19:07:22 +02:00
Friedemann Kleint
839ceb00b0 tst_QFiledialog::completer(): Avoid directories starting with 'c'.
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>
2014-10-03 19:01:43 +02:00
Paul Olav Tvete
c171a21ae4 Enable the qmdiarea test on X11
Task-number: QTBUG-25298
Change-Id: Iec7591e9e84951a1aea47590aaedaac877cd111e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-10-03 12:27:16 +02:00
Friedemann Kleint
54814bbd8f Refactor tst_QFiledialog::completer().
- 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>
2014-10-03 09:03:04 +02:00
Friedemann Kleint
289b4ed705 QMdiArea: Fix positioning of cascaded sub windows.
Take PM_FocusFrameVMargin into account.

Task-number: QTBUG-35146
Change-Id: I1499790537ddf9fbb912ab764b7d049ee11af95d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-09-30 10:32:52 +02:00
Eskil Abrahamsen Blomfeldt
27bc4c4ce5 QPlainTextEdit: Fix crash on complex undo w/full width selection
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>
2014-09-30 10:21:39 +02:00
Oswald Buddenhagen
189dc655bb Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/tools/qbytearray.cpp
	src/gui/image/qimage.cpp
	src/gui/image/qppmhandler.cpp
	src/gui/kernel/qguiapplication.cpp
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
2014-09-29 14:08:49 +02:00
Marc Mutz
55fbf1db19 Widgets: remove references to QStyleOptionFrameV<n>
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>
2014-09-26 00:39:48 +02:00
Friedemann Kleint
4b03b18548 Generate Show/Hide events for widgets when minimized state changes.
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>
2014-09-24 23:07:15 +02:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Frederik Gladhorn
c96426f19f Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-09-24 12:04:52 +02:00
Kalle Viironen
00b1360d9d Blacklist constantly failing test cases on OS X
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>
2014-09-23 16:26:59 +02:00
Allan Sandfeld Jensen
710530bc55 Fix too fast zooming in QTextEdit with smooth scrolling events
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>
2014-09-23 15:59:38 +02:00
Allan Sandfeld Jensen
dfb4af1fd3 Fix spin box with fine grained wheel events
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>
2014-09-23 11:35:30 +02:00
Frederik Gladhorn
c5a3e5edd9 Merge remote-tracking branch 'origin/5.3' into 5.4
The isAlwaysAskOption was removed in 3862171315
so manually removed code in
src/plugins/bearer/connman/qconnmanengine.cpp

Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/tools/qcollator_macx.cpp
	src/corelib/tools/qstring.cpp
	src/gui/kernel/qwindow.cpp
	src/gui/kernel/qwindow_p.h
	src/gui/text/qtextengine.cpp
	src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
	src/plugins/platforms/android/qandroidinputcontext.cpp
	src/plugins/platforms/xcb/qglxintegration.cpp
	src/plugins/platforms/xcb/qglxintegration.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/testlib/qtestcase.cpp
	src/testlib/qtestlog.cpp
	src/widgets/dialogs/qfiledialog.cpp
	src/widgets/kernel/qwindowcontainer.cpp
	tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
	tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
	tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
	tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp

Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
2014-09-23 11:23:36 +02:00
Dyami Caliri
75e5ffe0f7 Update widget winId when screen changes
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>
2014-09-19 19:15:42 +02:00
Giuseppe D'Angelo
bb3d2ca9f1 QToolButton: properly reset the size hint when a menu is set on it
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>
2014-09-16 22:42:47 +02:00
Alexander Volkov
80ca159b47 Fix saving handle width in QSplitter::saveState()
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>
2014-09-16 20:35:31 +02:00
Giuseppe D'Angelo
b2b9fdfda0 QSizeGrip: use a QPointer to the tracked TLW
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>
2014-09-15 20:50:50 +02:00
Alexander Volkov
256df2484c Make the default value of QTreeView::indentation() be style dependent
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>
2014-09-15 10:05:25 +02:00
David Faure
de4cad945d QAbstractItemView: add iconSizeChanged signal.
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>
2014-09-12 02:07:48 +02:00
Maks Naumov
9c4c044338 GraphicsView: Fix resolvePalette() for QGraphicsItem's children
Use a proper function for that.

Change-Id: I166ce44b8987d522cb01bae57009b2b862851b92
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-05 13:12:21 +02:00
Thomas Fischer
983dde1f2f Avoid adding widget to its own layout
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>
2014-09-05 00:05:45 +02:00