summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Removed references to stale links.Jerome Pasion2012-10-131-13/+10
| | | | | | | The links are from the qt-webpages.qdoc and no longer exist. Change-Id: I8329032215fa77811117e2767bae745795b209cb Reviewed-by: Martin Smith <martin.smith@digia.com>
* QGtkStyle: fix a warningMarc Mutz2012-10-131-1/+0
| | | | | | | | | | | | | | | Commit c0893962ef94f12594f936ef2a50db6d0328eca0 added two definitions of a variable named gtkToggleButtonStyle in nested scopes. Because of name lookup rules, the second one wasn't initialised with the first one, but with itself. This leaves the second gtkToggleButtonStyle uninit'ed. Simply remove the surplus declaration, leaving the name to the original declaration. Change-Id: I2269e1093f54643ff4dce27b39cc033db6697782 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Qt Widgets: Added a landing pageJerome Pasion2012-10-114-12/+150
| | | | | | | | | | -Landing page which lists articles in the module, including: -Graphics View, Model/View, Style Sheet, and widget galleries -Renamed some titles and a whitespace fix. Change-Id: I84be14d9a425ef380162e9a55ce2742c6812f510 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* Modularize documenation buildTor Arne Vestbø2012-10-102-4/+2
| | | | | | | | | | qdocconf files can now reference $QT_INSTALL_DOCS to pick up e.g. global includes, instead of using relative paths. Qt modules will automatically get a doc target that builds and installs into the right place (including supporting shadow-builds) if they set QMAKE_DOCS before loading(qt_module). Change-Id: Ia408385199e56e3ead0afa45645a059d1a8b0d48 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* QGtkStyle: use gtk_widget_get_style()J-P Nurmi2012-10-103-99/+118
| | | | | | | | Do not access GtkWidget::style directly, it doesn't exist in GTK3. Change-Id: I947776848f5dd64011a40446fcdb9079f295f182 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix a regression with regards to hfw behavior in QStackedWidgetJan Arve Saether2012-10-101-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression because we made QStackedWidget actually support heightForWidth in 4.8. This was done with change 4780f94e391b5e881497c5228661dead42c821fa. The problem was that heightForWidth was not calculated correctly because some of the pages were hidden. The hidden pages were actually not contributing to the hfw of the QStackedWidget at all. This again caused the QStackedWidget to change its heightForWidth() value when the current tab changed, which again could cause "jumps" in the UI when switching tabs (as demonstrated in the task). The problem was that the patch relied on calling QWidgetItem::heightForWidth(), and this function would return -1 if the widget was hidden. However, QWidget::heightForWidth() does not have this magic and returns the proper hfw value regardless of its visibility. One could argue about the correctness of this patch, but since QStackedLayout::sizeHint() disregards QWidgetItem::sizeHint() (it asks the widget directly), we do the same in QStackedLayoutHFW::heightForWidth() for consistency. In addition, QStackedLayout enforces that only widgets can be added to it, and you cannot add your own QLayoutItem subclasses to it: qWarning("QStackedLayout::addItem: Only widgets can be added"); Task-id: QTBUG-24758 Change-Id: I349cf8f4215e4581ea237ef773d53dcdf3db176b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Avoid warnings about an unreachable codeKonstantin Ritt2012-10-101-1/+0
| | | | | Change-Id: I57c2967db4c1bd2c39ecb3eac9b18eb7455c6a50 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Mac: Bring back "Text boxes and list only" tab navigationGabriel de Dietrich2012-10-103-6/+12
| | | | | | | | | | | | | Added ThemeHint::TabAllWidgets as a mean to access that platform specific bool. The default implementation returns always true when querying QPlatformTheme::themeHint(). Several auto-tests had to be updated to reflect for qt_tab_all_widgets' type change. One XFAIL removed from tst_QApplication::focusChanged(). Task-number: QTBUG-24372 Change-Id: Ie1f0486c19898fe54c53aa4a27e378485075e512 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix scrolldown arrow not showing on popup for QMenuMiikka Heikkinen2012-10-101-2/+4
| | | | | | | | | | | | | | | | Scrolldown arrow was not shown when a taller than screen QMenu was opened because the check to draw it used the size that was already adjusted to the screen. Fixed by using the actual menu size in the check. Also fixed the case where the menu was scrolled, closed, and reopened, in which case the size hint would return incorrect cached value. This led to scrolldown arrow not being shown in case the menu was previously fully scrolled down. Task-number: QTBUG-27445 Change-Id: Icd8d774071662a9317b3ac53cb05b31cadba96ff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QGtkStyle: use gtk_widget_get_parent() and gtk_widget_is_toplevel()J-P Nurmi2012-10-103-2/+10
| | | | | | | | | GtkWidget::parent does not exist in GTK3, and GTK_WIDGET_TOPLEVEL has been deprecated since GTK 2.20 - > use gtk_widget_is_toplevel() (available since GTK 2.18) instead. Change-Id: I0f082b2d69a795cadb321802f25c9993029f6865 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* QGtkStyle: use gtk_widget_get/set_allocation()J-P Nurmi2012-10-103-17/+39
| | | | | | | Do not access GtkWidget::allocation directly, it doesn't exist in GTK3. Change-Id: I8ce69fab19ce8f3afe35d0d30d4e28b0348fdaf1 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Don't try to emit focusObjectChanged if window pointer is zeroMiikka Heikkinen2012-10-101-2/+4
| | | | | | Task-number: QTBUG-27414 Change-Id: I75ad662e0a66d61b49d55d084f29cefc98221b7f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QGtkStyle: cleanup unused gdk_drawable_get_depth() (not avail in GTK3)J-P Nurmi2012-10-092-7/+0
| | | | | | Change-Id: Ifc04c768dcadc48d459eeb8dd95325823cc44dcd Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Add QEvent::StyleAnimationUpdate: style animation target should updateJ-P Nurmi2012-10-092-0/+4
| | | | | | | | | The event will be sent from the upcoming style animations. This change merely introduces the new event type and makes both QWidget and QGraphicsWidget call update() upon receiving the event. Change-Id: I69bb4d05bacb22f7e3a2512cae68848801e4f4d7 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* styles.pri: tabs to spacesJ-P Nurmi2012-10-081-69/+69
| | | | | Change-Id: I164368222d89ec2dc557bec02840f1d208e8f276 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QApplication::palette missing Q_NO_USING_KEYWORD implementationThiago A. Correa2012-10-081-0/+4
| | | | | | | | | | Added inline implementation of QApplication::palette when Q_NO_USING_KEYWORD is defined. Task-number: QTBUG-27393 Change-Id: I833efb950a579db28fcb243c931c9e22b28ec431 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Constify QTableWidget::selectedItemsStephen Kelly2012-10-052-3/+3
| | | | | | | Task-number: QTBUG-27448 Change-Id: I99175cc2b255b93f698d3c343639c19845c9f5a0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QMacStyle: use proper pimplJ-P Nurmi2012-10-053-47/+66
| | | | | | | | | QMacStylePrivate needed to be revised in order for it to have access to QCommonStylePrivate that is planned to manage style animations in a generic fashion in the near future. Change-Id: I03185ae210d2cfc253a236d6b2da35d0201f7e13 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix segfault when delegates change properties on editors.Stephen Kelly2012-10-041-2/+6
| | | | | | | | | | | The solution is similar to that in b84e180263d0da3d1e6967fcf759225a778ea6ea which affected QSortFilterProxyModel. Task-number: QTBUG-25370 Change-Id: I6bbb9d9786bcb2c9fa8027ab8a7cc13664784b8d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Mac: Safely dispose of scrollbars temporary NSGraphicsContextGabriel de Dietrich2012-10-041-0/+3
| | | | | | | | | | | | When rendering transient scrollbars, we instanciate a specialised NSGraphicsContext since those need non-opaque rendering. This context is being used as current context, but it was never properly released and the previous context never properly restored. Task-number: QTBUG-27327 Change-Id: I4e867e64a09368dbe64b84b17f07fd8e57bbae24 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* compile fix for MSVC 2008 and std::upper_boundThomas Hartmann2012-10-041-10/+11
| | | | | | | | | | | | qUpperBound was replaced by std::upper_bound. Unfortunately the STL of MSVC 2008 enforces the definition of the operator in both directions. Change-Id: I3e0f775c23e43332d106e0847d3611e488da6c06 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Show widget cursor after restoring last override cursorMiikka Heikkinen2012-10-041-7/+2
| | | | | | | | | | | | | | | | qwidget_qpa.cpp was setting cursor directly to platform window, so QWindow didn't actually know what cursor was supposed to be shown. Since QWindow now supports setting cursor and has override cursor handling there, set cursor via QWindow instead of platform window. Also changed QGuiApplication override cursor handling so that it will query the cursor from QWindow if there is no override cursor. With these changes, widget's custom cursor will be properly shown when final override cursor is restored. Task-number: QTBUG-24674 Change-Id: I2d2bb1027779256f9d6de560b6533f45e205ffe9 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix issue with mispositioned family name i QFontComboBoxEskil Abrahamsen Blomfeldt2012-10-031-1/+12
| | | | | | | | | | | | | | | | | | | | | | | Mac OS X 10.7 comes with the family of Stix fonts, some of which exposed an ugly layout bug in the QFontComboBox because the ascent/descent ratio is very large due to a very high ascent, so centering the text vertically might cause most of the text to be clipped away. The solution is to detect when the ascent is larger than the height of the destination rectangle (hence a large part of the characters will be clipped) and use the actual bounding rect for centralizing instead. Since this only happens for a very few of the fonts, the overhead of getting the bounding rect should be tolerable. This is a port of 4679c6901fc7c388fdf6c022d3499708222ef1f1 from Qt 4.8. Task-number: QTBUG-26691 Change-Id: Ia2014775e5baf0568df3290f2dc4ad64fb5a74bd Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Remove Cleanlooks as a dependency of QGtkStyleJens Bache-Wiig2012-10-025-96/+694
| | | | | | | | | | | | | Since we no longer do the sanity checking against gtk-qt-theme at startup, there is no longer any need to inherit from cleanlooks. Cleanlooks should no longer be needed as it has been completely replaced by Gtk style and this dependency is not required at this point. Change-Id: I05b59278cd3ff915df49a7ad2d04494258db0d42 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* fix QWidget::setWindowFilePath on Mac OSJoerg Bornemann2012-10-023-3/+13
| | | | | | | | Task-number: QTBUG-27299 Change-Id: I4dddbb9690aac327ad33477d8cea9afa84d10eb3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Mac: Fix label margins in QGroupBoxGabriel de Dietrich2012-09-281-17/+21
| | | | | | | | Also use mini-sized checkbox and label when checkable. This looks better when there are several group boxes on the same dialog. Change-Id: I69bb0240f2a6725afb9819d20696ca404be0bca7 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Doc: Small updates to QMenu's addAction() methods.Geir Vattekar2012-09-271-0/+12
| | | | | | | | | Task-number: QTBUG-26792 Change-Id: I41289cf10065161baca368ca195268d39cdff6cf Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix drag and drop with native widgetsjian liang2012-09-271-4/+4
| | | | | | | | | | | | | | | Task-number: QTBUG-27336 Don't check 'widget != m_widget' in QWidgetWindow::handleDragEnterMoveEvent() since the current window's parent widget may be the actual drop target. I replace it with a check '!widget->isWindow()' to prevent we pass through a top level window. I also change 'widget->mapFrom(m_widget, event->pos())' to 'widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()))' since m_widget may not be widget's parent. Change-Id: Ia4f10f85ccdf1e27223ddc51afabd98b5d16f2fb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Mac: Fix small glitch in editable combo boxesGabriel de Dietrich2012-09-271-1/+1
| | | | | Change-Id: I4b064116183834226372b14c3c442dcaa518c3b4 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix resetting of the QCompletionModel.Stephen Kelly2012-09-272-20/+4
| | | | | | | This model apparently pre-dates the API required to do resetting properly. Change-Id: I0ea903cef87077ca4a3d8ca2b53eba213e77cc26 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Store an unsigned temporary for the internalId.Stephen Kelly2012-09-271-1/+1
| | | | | | | | This is compared later with the internalId() of other indexes, which produces a warning. Change-Id: I57ea248c792db3b49947cc6a8fe989c68b67ff0f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Better drawn 1-pixel thick splitter on MacGabriel de Dietrich2012-09-271-9/+19
| | | | | | Change-Id: I72effdfb997a7733fbbd270db719c163d1d53a66 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fixed selected menu item (& Co.) text colorGabriel de Dietrich2012-09-271-1/+1
| | | | | | | | On Mac, highlighted text remains the same color as normal text. That's not the case for menu and combobox items. Change-Id: I3efe2547413f77921524b833b4b10cf2d533e110 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fixed text rendering in selected tab buttonGabriel de Dietrich2012-09-271-3/+10
| | | | | | | | We resort to custom Qt rendering when selected since it looks better than using Carbon's HITheme engine. Change-Id: Iefcc2bebb1ba58d0d99f078c4960c5126542f637 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* use QLatin1String::size() in qt_setWindowTitle_helperHelperJoerg Bornemann2012-09-271-4/+2
| | | | | Change-Id: I0c8193a7c6bf8b5f894da3e20af3c4d23e0b593a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* More consistent dock widget painting on WindowsJens Bache-Wiig2012-09-272-32/+12
| | | | | | | | | | | | | Before we would draw dock widget handles on windows classic and no handles on XP, Vista and Windows 8. This would make it very hard to make a consistent look and feel across those styles. I also added a workaround to avoid the redundant toolbar borders when they are used outside of the toolbar areas. Change-Id: Ib703453677fcac8d51b2180abe45527297af0a80 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix typo: contais -> contains.Stephen Kelly2012-09-271-1/+1
| | | | | Change-Id: I718b0178ba03fcf15f2962cb6f917efb2da27a04 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove CDE and Motif styles from qtbaseJens Bache-Wiig2012-09-2722-3128/+19
| | | | | | | | | | | | | | | | | It is time to clean up some of our legacy code. These styles have not been actively maintained for a long time and I think it is safe to say that they should no longer belong as part of the default distribution of Qt. We dont support any platforms based on CDE with our source packages. Note that even if we are removing these styles from the default distribution of Qt, applications that depend on them will still be able to bundle the existing (and unmodified) styles along with their own source code as we are not breaking compatibility. Change-Id: I1709630c20ba8e8088cd01628628d86856db57a4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* [Doc cleanup] Fix typos and style of QPushButton and QGroupBoxDavid Gil2012-09-272-18/+17
| | | | | | | | Fix some typos. Fix some sentences to make them clearer to understand. Since both of them are widgets, there's no Qt4-centric info. Change-Id: I5c3c4a23621505d47b00cf466e4daad9763c3076 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* ItemViews: Fix MinGW compiler warningKai Koehne2012-09-271-0/+3
| | | | | | | Fix compiler 'warning: "_WIN32_IE" redefined' Change-Id: I70ada35027a2bab0a6c4f84dd1384028d2afbcc9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* documentation fixesMarcel Krems2012-09-271-1/+1
| | | | | Change-Id: If165933df41e518f5ba6065792676260fd2492b6 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* QScrollBar: clean up wheelEvent() implementationMarc Mutz2012-09-261-14/+12
| | | | | | | | | | | | This code was moved from the general event() handler. Remove comments and casting that were necessary there. Task-number: QTBUG-27308 Reported-by: chenjiexin Task-number: QTBUG-21534 Reported-by: Martin Koller Change-Id: I14ef4c6363002032895f6840a7c68c1f5f665384 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* [QTBUG-27308][QTBUG-21534] Don't mouse-wheel-scroll QScrollBar when disabledMarc Mutz2012-09-262-8/+15
| | | | | | | | | | | | | | | | | | | | | | | This fixes a regression introduced in Qt 4 commit e855b199319c932f2e9500235775f961bc32e41a. The problem was that by handling the wheel event in event() instead of wheelEvent(), we lack the guard clause in QWidget that doesn't even call the handler if the widget is disabled, and the code didn't handle this itself. Fix by reimplementing wheelEvent() instead, which we can now do because we can break BC. This commit just moves the code. Another commit will clean up the implementation of wheelEvent(). Task-number: QTBUG-27308 Reported-by: chenjiexin Task-number: QTBUG-21534 Reported-by: Martin Koller Change-Id: Ibe6b89a81fe889f839c205b859a1492b39a4ddc3 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix restore/minimize/close buttons for maximized MDI subwidowsMiikka Heikkinen2012-09-262-0/+201
| | | | | | | | | | | | The style code to display the restore/minimize/close buttons in menubar for maximized MDI subwidows was removed in Qt5 as it was incorrectly ifdeffed with just QT_NO_WORKSPACE where QT_NO_MDIAREA should also have been used. Brought back the removed code with proper ifdeffing. Task-number: QTBUG-27235 Change-Id: I89607dd54eec00329e576c72b0e8b997f37cdb29 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* [docs] QApplication: fix keyboardInputDirection() docsMarc Mutz2012-09-261-9/+1
| | | | | | | | There were two documentation blocks: the first had the wrong class name, the second was duplicate. Change-Id: I241b3e6567376a46a6270837cce4aa380a6c8c49 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* [docs] QInputDialog: document deprecated member getInteger()Marc Mutz2012-09-261-0/+32
| | | | | | Change-Id: I2ac24acbecd67db74f9474a7a2a1ee94b03282d4 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QFileSystemModel: fix permission manglingMarc Mutz2012-09-262-8/+4
| | | | | | | | | | | | | | | | | | | The old code masked out write flags before returning permissions from permissions() or data(FilePermissions) in order to force QFileDialog to disable the rename and delete actions. This was to fix Task 143519, but introduced QTBUG-20503. Instead, revert to the pre-143519-bugfix code and do the necessary check in QFileDialog directly. Also add a testcase for 143519. Reported-by: Gilles Pascual Task-number: QTBUG-20503 Task-number: 143519 Change-Id: I140109341c0ed40722e3aac4327c2a740fb014c2 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Remove duplicate words and punctuation from documentation.Mitch Curtis2012-09-264-5/+5
| | | | | Change-Id: I5550c62d412510bc2c5acceb2cae7d2f2ef6a8d3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QFileInfoGatherer: general cleanupsMarc Mutz2012-09-252-12/+14
| | | | | | | | | | | | | | | - fix typo in comment - make translateDriveName file-static - use QList::reserve() - explicit ctor - annotate functions called by owning thread/run() - iconProvider() and resolveSymlinks() shouldn't be slots - private instead of protected - run() marked Q_DECL_OVERRIDE - annotate which members are protected by 'mutex' Change-Id: Ic176a030b0597c98f48185efd17260fd62532460 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fixed instances of "to to" in qtbase.Samuel Rødal2012-09-242-2/+2
| | | | | | | Really it should just be "to". Change-Id: I7d0fff334bac3f0ac78adb8131e3bf3df1f1b242 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>