summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qtabbar.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QTabBar: Add setAccessibleTabName() and accessibleTabName()Dongmei Wang2016-04-241-0/+28
| | | | | | | | | | | Currently, a tab's text is used as its accessibleName. When a tab's text is empty, there is no API to set the tab's accessibleName. The two APIs are added to set and return the accessibleName property of a tab. Task-number: QTBUG-46530 Change-Id: Idf88b5f905fe66c6365ea0eeb650e74211db90e1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-041-6/+21
|\ | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| * QTabBar: enable high dpi moving of a tabGiuseppe D'Angelo2016-03-251-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving tabs of a QTabBar goes through a temporary QWidget that captures a "screenshot" of the tab, and then gets moved around. Unfortunately, that screenshot was not using the devicePixelRatio, resulting in blurry text and icons. For some reason, setting the DPR on the pixmap isn't enough -- that causes it to be drawn twice as big (bug somewhere in Qt styles?). Work around that by not using the palette, but a simple widget which draws the pixmap (which also leads to somehow clean code). Change-Id: Id12f9251625693d108031488ddfab86277128705 Task-number: QTBUG-50898 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * QtWidgets: includemocsMarc Mutz2016-03-181-1/+1
| | | | | | | | | | | | | | | | A very simple way to save ~3KiB in test size and 440b in data size on GCC 5.3 Linux AMD64 release builds. Change-Id: I6619148cc497116b9772a00e1bc30d573a2b2534 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QtWidgets: prevent detach attempts from first()/etc. use [dialogs, kernel, ↵Marc Mutz2016-02-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | util, widgets] The algorithm used was: - If possible, just declare the container const - Otherwise, for first()/last(), use constFirst()/constLast() and for front()/back(), to not destroy the use of the STL API subset, use qAsConst() Did some caching of function returns here and there, and converted one 0 to nullptr as a drive-by. Also saves almost 4KiB in text size on optimized GCC 4.9 Linux AMD64 builds. Change-Id: I04b7bfd68dc85c22de247cb65a310e1cbbca1e8c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QTabBar: remove dead codeGiuseppe D'Angelo2016-02-051-3/+0
| | | | | | | | | | Change-Id: Iaad0ef8fe66e925f9dcbc94693d078612a92969f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Widgets: enable scroll buttons to be placed anywhere on a QTabBarRichard Moe Gustavsen2015-11-161-87/+170
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a tab bar contain more tabs than it can fit inside its geometry, it will show two scroll buttons that lets the user scroll left or right. From before, those buttons where hard coded to always be placed together on the right side of the tab bar. This patch will make it possible for the style to specify the exact geometry of both scroll buttons. The reason for this is that 3rd party styles has a specific need to place the "scroll left" button on the left side, and the "scroll right" on the right side. Additionally, there is a need to draw fade-out effects on tabs that end up half-way obscured by the buttons. This can already be achieved by extending the tab tear concept to include two tears/fade effects, one for each side of the tab bar. Previous code in QTabBar that hard-coded scroll buttons and related functionality will now be factored out to the style, and the base style (QCommonStyle) will implement the old default logic of placing the buttons together on the right side. Six new style enums will be added: SE_TabBarScrollLeftButton: the rect of the left scroll button SE_TabBarScrollRightButton: the rect of the right scroll button SE_TabBarTearIndicatorLeft: the rect of the left tab tear SE_TabBarTearIndicatorRight: the rect of the right tab tear PE_IndicatorTabTearLeft: draw the left tab tear PE_IndicatorTabTearRight: draw the right tab tear Change-Id: I4cda05c2f7323de5cbd3ca071eb796085257c19b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* QtWidgets: remove use of obsolete QStyleOption*V<N>Marc Mutz2015-11-041-22/+17
| | | | | | | | They are obsolete since Qt 5.0. Change-Id: I3a1ee314126bd245a3c788ac7af49905ab50945f Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Replace MAC OS X with OS XNico Vertriest2015-06-301-1/+1
| | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Add Q_UNUSED for parameter (OS X)Timur Pocheptsov2015-04-071-0/+2
| | | | | | | | Ifdefs exclude the code on OS X, but there is still unused parameter and annoying compiler (either warning or error, depending on ...). Change-Id: I913c25b4f96ebe275a6b1d15873bccf4aebe9e7a Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* QTabBar: Disable wheel events on MacGabriel de Dietrich2015-03-301-0/+2
| | | | | | | | | | Many people complain about this unexpected behavior. We may consider introducing a style hint later for those few people that may want it. Change-Id: Ifab663b4b5c3a78a3544ab4408cf34f672df8c05 Task-number: QTBUG-8428 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Make it more obvious that Q_WS_ is dead code, and should perhaps be portedTor Arne Vestbø2015-02-031-4/+4
| | | | | | | | | | | | We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* fix the build with animation omittedShawn Rutledge2014-11-271-0/+2
| | | | | | | configure -no-feature-STATEMACHINE -no-feature-ANIMATION Change-Id: Idb89c0bae8d699e76916317f83490c6c94c7d8b4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Add the QTabBar::changeCurrentOnDrag property.Ivan Komissarov2014-08-061-0/+71
| | | | | | | | | | This property indicates that the current tab will change whilst dragging over the tabbar [ChangeLog][QtWidgets][QTabBar] Added changeCurrentOnDrag property. Change-Id: Ib7d5a7613c9cd8432b84c523f66c02cd6c3c3c81 Reviewed-by: David Faure <david.faure@kdab.com>
* Added autoHide property to QTabBarIvan Komissarov2014-07-101-0/+40
| | | | | | | | | 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>
* Mac: Implement unified toolbar look for QTabBarMorten Johan Sørvig2014-04-091-28/+43
| | | | | | | | | | | | | | | | | | | | | | | | | Extend the unified title and toolbar gradient to tabs in document mode that are adjacent unified tool bars. Change the updateMacBorderMetrics() function to register the tab bar geometry and visibility status with the Cocoa platform plugin. The Cocoa platform plugin will then merge this area with other registered areas if possible. Add QCocoaNativeInterface::testContentBorderPosition(). This function tests whether the given point is within the unified title and toolbar area. Use testContentBorderPosition() in QMacStyle to enable code paths that skips drawing the QToolBar bottom separator line and paints the active tab background with transparent pixels to make the background gradient visible. Change-Id: I2b70f9bb0c2c59af053a691a7df538f958783dab Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QTabWidget: fix moving of the current tabJ-P Nurmi2014-02-051-0/+3
| | | | | | | Task-number: QTBUG-36455 Change-Id: I38687283d60fe38a4b586b064d5ddd4ed3be06b6 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Ivan Komissarov <ABBAPOH@me.com>
* Fix potential BC break in QTabBar.Friedemann Kleint2013-11-081-17/+6
| | | | | | | | | Move code from mouseDoubleClickEvent() to event(). Introduced by 252bad7c589e03d3e12df02354b00a84d8e3159a . Task-number: QTBUG-34670 Change-Id: I98ed24f26977220cf03524cfe001524364473982 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-3/+3
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* De-inline virtuals of some non-exported private classes in QtGuiThiago Macieira2013-09-231-0/+12
| | | | | | | | | | This is to work around a bug in GCC 4.7's link-time optimiser. Without it, linking QtOpenGL and QtPrintSupport fails because the compiler generates the code for the virtuals, including the virtual table, but not the methods. Change-Id: Idcecd51c32e6228e0eefe67f1bd630ea1f5d5da7 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Add useful signals to QTabBar and QTabWidgetIvan Komissarov2013-08-131-0/+46
| | | | | | | | | | In this patch we introduce tabBarClicked and tabBarDoubleClicked to get a finer grained information on the user interaction with the tab bar. Done-with: kevin.ottens@kdab.com Change-Id: I7be76a556ca09186e98f2e076fe2512d6c5e6773 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-191-1/+1
| | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove ifdefs for supporting Mac OS <= 10.5Tor Arne Vestbø2013-02-181-1/+1
| | | | | | | | Qt5 requires Mac OS 10.6, so we can remove checks such as if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 Change-Id: Iea21727a277291148704ecf9677ed0b68c24920f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Do not send QAccessible::Focus when current index is changed.Jan Arve Saether2013-01-041-3/+5
| | | | | | | | | | | | This had the unfortunate side-effect that focus was reported to change (but it didn't) just because the qtabbar was shown. Found by clicking the different categories on the left-hand side of the options dialog in Qt Creator. So, what happened was that clicking "Text Editor" would move the accessibility focus (that the AT client saw) to the "Font & Colors" tab) Change-Id: I19a508f6a32a77696079d24c3c6408cb6c3d9fd5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* QtWidgets docs: use Fusion screenshotsJ-P Nurmi2012-11-281-4/+4
| | | | | | | | The Plastique style no longer exists in QtBase. All the references have been updated to Fusion, and the obsolete screenshots have been removed. Change-Id: I771a9ecf23b82965c7b3c41a40945cf051cb5f3a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add HasFrame feature to QStyleOptionTabJens Bache-Wiig2012-10-161-0/+1
| | | | | | | | This makes it possible for styles like Fusion to draw tabbars different when they have a frame. Change-Id: I1bb21198c0c3caf44c757f6f39310bf2509054bf Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QTabBar docs: cleanup Qt3 support left oversJ-P Nurmi2012-08-171-17/+0
| | | | | Change-Id: If2c9245ad454b1f34c44f1d0a0c61700cea53cf3 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* QtWidgets: remove \link usagesGiuseppe D'Angelo2012-05-291-1/+1
| | | | | Change-Id: I9887a24485233f29d07054b3110d4db9e499b9f4 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Fix \sa usageMarius Storm-Olsen2012-05-111-4/+4
| | | | | | | | | Ensure comma between elements (757 missing), single space and curly- braces around title elements, etc. Change-Id: Id16c3fda7fc47a12a0682f8720214f4990609a97 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Merge master into api_changesKent Hansen2012-03-231-2/+4
|\ | | | | | | Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
| * Remove QAccessibleEvent child parameter.Frederik Gladhorn2012-03-191-2/+4
| | | | | | | | | | | | | | | | | | This makes the api cleaner and generally the child should not be there. It is only sometimes more convenient not to create a QAccessibleInterface instance, so the functionallity is kept. Change-Id: I26018a6d3e0549f4d79856775b4167c5660e229d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-161-3/+7
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp src/gui/kernel/qplatformsurface_qpa.cpp tests/auto/corelib/tools/qtimeline/qtimeline.pro Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
| * Fix compiling with --no-accessibilityJerome Leclanche2012-03-151-1/+3
| | | | | | | | | | | | | | | | Adds missing QT_NO_ACCESSIBILITY checks where required to build without accessibility support. Change-Id: Id98ecdcb9b351289b21dc2d382100d0b63857db9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
| * Use pointers for QAccessibleEvent.Frederik Gladhorn2012-03-151-2/+4
| | | | | | | | | | | | | | | | | | At least on mac g++ badly wants to copy the event and cannot use the copy ctor. The sensible solution is thus to use pointers. This is in line with QCoreApplication::sendEvent. Change-Id: Icb58852be351ab04ffa17069989d7a07d4b377da Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* | QTabBar - add minimumTabSizeHint as virtual function.Thorbjørn Lund Martsum2012-03-101-8/+12
|/ | | | | | | | Just implements what the note states (and removes the private function) Change-Id: Ida009e1836ded5816218372edb8c178523242a9e Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Fix off by one in updateAccessibility.Frederik Gladhorn2012-03-071-2/+2
| | | | | | | | Now that indexOfChild is 0-based, the update notifications should follow. Change-Id: I5e0303516d503d5e23061df5894b2428c00da2ce Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-9/+9
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Accessibility: Use new updateAccessibility() API in widgets.Friedemann Kleint2012-02-011-2/+2
| | | | | Change-Id: Id69cc28a54abc675a991f2c657a446f38313ac6e Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove Symbian and Maemo 5 code from QtWidgets.Xizhi Zhu2012-01-311-39/+0
| | | | | Change-Id: I715c0ec70cbad05a6ba9737e49be9da7cbd65bf9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Clean-up a macro for CocoaMorten Sorvig2011-10-101-2/+0
| | | | | | | | | Remove the usage of Q_MAC_USE_COCOA and Carbon code paths. Change-Id: Ib569ad8c6d9ffe258f454b3c3b06e95294a10112 Reviewed-on: http://codereview.qt-project.org/5100 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Sanity-Review: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Move the documentation for the classes to their modules.Casper van Donderen2011-10-031-1/+1
| | | | | | | | | | | All documented classes under src/widgets should now be under the QtWidgets module in the documentation. The QtPrintSupport classes should now be under the QtPrintSupport module in the documentation. Change-Id: I236b15443b8b93a61578a1d10f52b64dba938f29 Reviewed-on: http://codereview.qt-project.org/5520 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>