summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Correct minor link issue in qwidget.cppNico Vertriest2019-01-291-2/+1
| | | | | | Change-Id: I3b69a18c65b75f3e0014a12284904af208ef058d Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Don't enable the input method for the QListView in a QInputDialogAndy Shaw2019-01-281-3/+14
| | | | | | | | | | As the listview in an input dialog is only used for selecting the entry in place of a combobox, then we should prevent the input method from being enabled. This ensures that it does not show an invalid text cursor on devices like iOS and Android. Change-Id: Ifb854e509573ec2d63d4cbcfa61335ae5b251ab5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QColorDialog: Remove flag Qt::MSWindowsFixedSizeDialogHintFriedemann Kleint2019-01-271-1/+1
| | | | | | | | | | | | The flag causes issues with High DPI scaling (the OS maintains the size in device pixels when moving across screens). It does not really make a difference (apart from the resize handle appearing) since the dialog uses QLayout::SetFixedSize. Fixes: QTBUG-73232 Change-Id: Iad08427796890582ac05758678d24e3cd707e669 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QAbstractItemView: fix rendering centered/right aligned item textChristian Ehrlicher2019-01-241-13/+23
| | | | | | | | | | | | | | | | | | | | | | Commit 5712c62d1cfdcf56c772d8a63d52ad58945f194c introduced a regression for item texts which were aligned right or horizontally centered. The layoutRect was calculated wrong and started below zero and later the correct x offset could not be calculated since QTextLine::x() does not return a calculated value. Fix it by first calculating the complete string and pass it completely to QTextLayout::draw() instead trying to draw the single lines on our own - QTextLayout has a better working algorithm so no need to reinvent the wheel here. [ChangeLog][QtWidgets][ItemViews] Fixed a regression with wrongly drawn centered/right aligned item texts Fixes: QTBUG-34133 Fixes: QTBUG-56759 Fixes: QTBUG-72805 Fixes: QTBUG-72869 Change-Id: I0ed521c3a9d35446d190ac22aa9f2374814fd278 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-01-238-36/+29
|\ | | | | | | Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
| * Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-0818-83/+227
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qtooltip.cpp Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
| * | Drag'n'Drop: fix dnd when dragMoveEvent() is not implementedChristian Ehrlicher2019-01-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactoring of dnd with f8944a7f07112c85dc4f66848cabb490514cd28e added a regression which results in a need to reimplement dragMoveEvent() on the drop side. Before this change it was possible to accept the dnd in dragEnterEvent() without again accepting it in dragMoveEvent(). Fix it in a similar way it's done in QGuiApplicationPrivate::processDrag() by prefilling the first simulated QDragMoveEvent with the values from the previous QDragEnterEvent before it is sent to the drop receiver. Fixes: QTBUG-72844 Change-Id: I1300dd02b7f1d9dcd44ecefa8335f92ad6c6cafa Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * | Revert "QListView: Honor css :first/:middle/:last Pseudo-States"Christian Ehrlicher2019-01-041-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1aa3edf3f888f394040d32d4a211257f9e9e2791 since it created a regression within the windows styling. Task-number: QTBUG-27110 Fixes: QTBUG-72748 Change-Id: I7e5004be6cf398ef0b533a25066d924310ed1e48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | Doc: Restore documentation for QTest functions in other modulesTopi Reinio2019-01-042-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Test library sources specific to Core, GUI and Widgets modules were moved around in commit 88867e39b. The new source locations must be referenced in Qt Test documentation configuration. The same sources are excluded in their original doc projects, and the related snippet file is moved over to qttestlib. The commit also fixes the remaining documentation issues for Qt Test. Change-Id: Ibe011aa83639e574d647f12bc9e53e618781bce6 Reviewed-by: Martin Smith <martin.smith@qt.io>
| * | Restore behavior for QToolTip not wrapping by defaultKai Koehne2019-01-041-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts 7a1d77b6e4ec38ae8fc17, which caused regressions e.g. in Qt Creator. The behavior of QToolTip for wrapping has been always special in that wordWrap was enabled as soon as some HTML tags were detected, while plain text was not wrapped. This is arguably bad API, but by now a lot of applications depend on this exact behavior, so I don't think it's worth to change this anymore. What can be kept though is the check for overlong tooltips that do not fit on the screen. In this case wrapping makes sense. [ChangeLog][QtWidgets] Reverted a Qt 5.12.0 behavior change in QToolTip that made plain tooltip text be wrapped automatically. Fixes: QTBUG-72568 Change-Id: I6fa3e455f09cffaeb8ad1cdc6e81d71ae344dd34 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Doc: Fix linking errors qtbaseNico Vertriest2019-01-031-1/+1
| | | | | | | | | | | | | | | Change-Id: I225e59bea0a8eac14fd11ef2b091907ae955c447 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * | Doc: Add missing \since to QLineEdit's inputRejected signalPaul Wicking2018-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signal was introduced in 5.12.0, according to qtbase/dist/changes-5.12.0 (which refers to QTBUG-57448). Also confirmed in qtdoc/doc/src/whatsnew/whatsnew512.qdoc. Added in commit c901cdadc0a. Fixes: QTBUG-72386 Change-Id: I291dfefe40eea0e9208bda6eed6dd96e41ba6d2b Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * | Bump copyright year to 2019Kai Koehne2018-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-72635 Change-Id: Idc9bd97fe873b332d7ff72cb44a00334a472404f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Fix resolve() on fonts returned from QWidget::font()Allan Sandfeld Jensen2019-01-223-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the inherited properties as resolved on the font, so non-default values are passed on in contexts that does resolve logic like QPainter. One test is updated as it actually tests what it is supposed to on more configurations. Fixes: QTBUG-39560 Change-Id: Ief668e992ccdc091337a259a4c1306a00e67c73f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Documentation: Add \nullptr macro and use where applicableFriedemann Kleint2019-01-1019-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt for Python users reading the documentation assume that int(0) can be passed for pointer parameters. Use the newly introduced \nullptr to disambiguate this. In a follow-up step, the \nullptr macro can be defined as None when generating the Qt for Python documentation. Task-number: PYSIDE-903 Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Emit paletteChanged and send ApplicationPaletteChange on theme changeTimur Pocheptsov2019-01-082-18/+21
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-72575 Change-Id: I407e081295a456a7bdd36de91ca5bbf74bba6078 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | QSplashScreen: Fix positioning in multimonitor setupsFriedemann Kleint2019-01-081-10/+47
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, QSplashScreen::setPixmap() used QDesktopWidgetPrivate::screenGeometry().center() to determine the screen position, which would always result in the primary screen being used. That is counter to the documentation of QSplashScreen(QWidget *, QPixmap), which states that a desktop screen widget can be passed as parent to set the screen. To fix that and make it easier to work with QScreen (which is the likely outcome of QTBUG-62094), extract the setPixmap() to QSplashScreenPrivate with an additional QScreen * parameter and add a helper to determine it. Do not set a position in case no parent was passed so that QPlatformWindow::initialGeometry() triggers, centering it over the cursor. Fixes: QTBUG-72819 Task-number: QTBUG-62094 Change-Id: Ic38cfecd24c3ff6b82dff37702b627c5a50a3e1d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Respect roles of buttons added to QMessageBoxVitaly Fanaskov2019-01-033-15/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a button added to QMessageBox has AcceptRole or YesRole, the signal accepted() will be emitted upon click on the button. If the button has RejectRole or NoRole, the signal rejected() will be emitted upon click on the button. If a button has a different role, neither accepted() nor rejected() will be emitted. This works for both standard and custom buttons. The signal finished() with result code will be sent regardless of a clicked button role. Also added documentation strings for some methods of private classes in order to have better tooltips in IDE(s). Task-number: QTBUG-44131 Change-Id: I521a4e5112eb4cf168f6fbb4c002dbe119aeeb09 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QDialog: Pass transient parent as a parent to native dialogsAlexander Volkov2018-12-242-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it's needed to show a native dialog for another process, for example in xdg-desktop-portal-kde. In this case we have WId of a parent window which can be used for calling QWindow::setTransientParent(QWindow::fromWinId(...)). Pass this transient parent to a native dialog so it could use it as a transient parent for itself. Rename QDialogPrivate::parentWindow() for clarity. Change-Id: I68974ddea35f9366a0ddffe602d9d028f45e26fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Doc: Fix typo in QStyleKai Koehne2018-12-221-1/+1
| | | | | | | | | | Change-Id: Ic979cb66acb3f8824aefb6ad858c0f746ce3e02b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Pass the alignment to QFontMetrics::elidedText()Andy Shaw2018-12-211-1/+2
| | | | | | | | | | | | | | | | | | When the text is elided, it needs to account for the mnenomic if there is one so it does not end up eliding the text unnecessarily. Change-Id: I77c15067f3e8d57d8deca83090bcb80554c3733f Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QToolTip - set correct screen before resizeThorbjørn Lund Martsum2018-12-185-19/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to get a correctly not truncated size we need the hint to be calculated based on the screen it is about to be shown on. This patch places some code in QWidgetPrivate that is used by QMenu and QToolTip + can be used to solve similar problems in the future. Task-number: QTBUG-72306 Change-Id: I58c058761f71b4a7675b6a078be62aa813ead752 Reviewed-by: Morten Kristensen <msk@nullpointer.dk> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | QTableView: Fix keyboard navigation with disabled rowsChristian Ehrlicher2018-12-182-32/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The keyboard navigation with MovePageUp/Down and MoveEnd did not honor disabled cells in all cases which lead to inconsistencies in the navigation (esp. since MoveHome does honor them correctly). Therefore make sure that all four move operations work consistent by refactoring the code to use common functions. Fixes: QTBUG-72400 Change-Id: I63fa3b626510d21c66f4f9b2b1bfb3261728ecaf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QRegularExpression: anchor wildcard patternSamuel Gaist2018-12-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of wildcardToRegularExpression doesn't anchor the pattern which makes it not narrow enough for globbing patterns. This patch fixes that by applying anchoredPattern before returning the wildcard pattern. [ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression method now returns a properly anchored pattern. Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5 Fixes: QTBUG-72539 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QAbstractSlider: fix invertedControls having no effect for left/right keysMitch Curtis2018-12-131-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a comment in the code that said: // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird. It's not clear what that was referring to, but in its current state, a slider with invertedControls set to true will not behave as expected: pressing the left arrow key will decrease its value instead of increasing it, and vice versa for the right arrow key. As stated in the documentation (and by its name), invertedAppearance only controls the appearance of the slider, and not the effect of key events. Remove the comment and use invertedControls instead. Change-Id: I13296cbda9244413978ef0d7f0856065f74fd0bf Fixes: QTBUG-25988 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | When warning about invalid style override also print available onesSergio Martins2018-12-121-2/+4
| | | | | | | | | | Change-Id: Ia017a342648a1f1e1185e74ddec1a77cb6dcfebe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QFileDialog: Remember last visited directory correctlyFriedemann Kleint2018-12-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | QFileDialogPrivate::init() sets the working directory derived from the URL passed in, causing the lastVisitedDir to be set. This in turn prevented the restoreState() logic from setting the directory retrieved from the file. Clear lastVisitedDir in init() in case the initial URL was invalid. Fixes: QTBUG-70798 Change-Id: I19084e24eb6d469330c4dd8c50495b4996279189 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Specify the date-time spec when setting max timeEdward Welbourne2018-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QDateTimeEdit::setMaximumTime() constructed a QDateTime from the given time and its current max date without propagating its existing spec; it thus got a local time. All other QDateTimeEdit methods setting bounds do propagate the spec. So bring setMaximumTime() in line with the others. Fixes: QTBUG-71311 Change-Id: Ic97d22185f76bed46bc8d2884b131942874d9a0a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fusion: Don't draw the background of the lineedit when drawing the frameAndy Shaw2018-12-101-1/+0
|/ | | | | | | | | | | Since only the frame is being drawn here, it should only draw the outline. Otherwise it will override any background drawing done via a stylesheet. Change-Id: I408fc44743747ad369c700b3d52935bfc8826f11 Fixes: QTBUG-71950 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-12-101-0/+1
|\ | | | | | | Change-Id: If49df791f73e9edf616baa094e0f301a44cb853d
| * Ensure QOpenGLWidget FBO is always initializedTor Arne Vestbø2018-11-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLWidget uses an FBO internally, that is glCleared whenever recreated. But for the clear to be visible across shared contexts we must also issue a glFlush. QOpenGLWidget defers this flush until the compositing step, in QOpenGLWidgetPrivate::beginCompose(), based on a flushPending variable. This variable is set either after invoking the user's paintGL() function, or when opening a QPainter on the QOpenGLWidget, via QOpenGLWidgetPaintDevice::ensureActiveTarget(). Unfortunately, if QOpenGLWidget::paintEvent() is overridden or intercepted (meaning we will not end up calling paintGL()), but the overridden paint event does not open a QPainter, we end up never setting flushPending to true, and end up composing an uninitialized FBO. This can lead to rendering issues, or even kernel panics with some unfortunate GL drivers. The fix is to ensure the glClear is always flushed before composing, by forcing a pending flush whenever the FBO is recreated. Fixes: QTBUG-70921 Change-Id: I72b596c09dcf54bd0f37668062daaad2d6f7f4bd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | QToolButton: Don't elide text if an icon is presentChristian Ehrlicher2018-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous fix which adds an automatic text elision when the QToolButton is not large enough brought up an inconsistency between QToolButton::sizeHint() and QCommonStyle::drawControl(). Fix it by syncing the magic numbers between QToolButton::sizeHint() and QCommonStyle::drawControl(). Fixes: QTBUG-72226 Change-Id: If4a76792cb97bcdb918e18c6b29cb637730acec0 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Set QScroller's parent to its widget, for memory managementShawn Rutledge2018-12-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | If the widget to which the scroller was assigned is deleted, the QScroller ought to be deleted too, to avoid filtering events and then following a dangling pointer while trying to react. Fixes: QTBUG-71232 Change-Id: I62680df8d84fb630df1bd8c482df099989457542 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | QScroller: Fix crash when multiple scrollers are registeredFriedemann Kleint2018-12-071-3/+5
| | | | | | | | | | | | | | | | | | | | Ensure the scroller cannot be added multiple times to the list of active scrollers. Patch as contributed on bug report. Amends 8b8e53f7267911c4f406f5c6f54e4a60a0f32112. Change-Id: Ic4e7d3e981f36e330dfd28d468288c5ef4b74a4c Fixes: QTBUG-72244 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix inability to edit lines in QGraphicsTextItem when pageSize is setVitaly Fanaskov2018-12-071-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous implementation relies on the fact that the only text document with height -1 can grow or shrink vertically, and, hence, a bounding rect should be updated under this circumstances. But method QTextDocument::setPageSize might set a height different from -1, and QGraphicsTextItem will be growing/shrinking vertically as well. So, we have to relax condition to cover all use cases. Bounding rect will be updated if new size is different from current size. This also doesn't affect performance. Fixes: QTBUG-55527 Change-Id: Id2c8e15d859aff9dde62c8ee14a6859c0c03f0d4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Preallocate buffer for QLineEdit when used for password inputIvan Čukić2018-12-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the user is entering the password, the string variable that stores the value might have to reallocate its content from time to time (when the string needs to grow beyond its current capacity). When the reallocation happens, the old buffer is freed, but its data is not zeroed-out. This means that a QLineEdit that serves as a password input field might leak chunks of the password during its lifetime, and the leaks will persist after its destruction. Since the QLineEdit can not control the behavior of the QString it uses to store the entered value, the only thing it can do is try to make the reallocations rare. This patch reserves the space for 30 characters for the string which stores the QLineEdit value when said QLineEdit is used for password input. This is enough to make sure no reallocation happens in majority of cases as barely anyone uses passwords longer than 30 characters. [ChangeLog][QtWidgets][QWidgetLineControl/security] Preallocate a buffer for the string that contains the entered value when the QLineEdit serves as a password input field to minimize reallocations. Change-Id: I3e695db93e34c93335c3bf9dbcbac832fc18b62d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Erase password data on QLineEdit destructionIvan Čukić2018-12-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The contents of a deleted QString can still remain in memory and can be accessible by tools that read the raw process memory. This means that a QLineEdit that serves as a password input field can leak the password after it is destroyed. With this patch, the contents of the m_text string member variable will be zeroed-out before the m_text is destructed. This is done only in the cases when the QLineEdit serves as a password field. [ChangeLog][QtWidgets][QWidgetLineControl/security] Zero-out the string that contains a password entered into the QLineEdit Change-Id: I8f88f952244bf8a0399c14acf0869439ca0a60ca Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Fusion style - avoid a warningTimur Pocheptsov2018-11-301-0/+3
| | | | | | | | | | | | | | | | | | ... printed by QPainter when it gets a pixmap with one or both of dimensions equal to 0 (and a nullptr as a paintEngine). Task-number: QTBUG-71806 Change-Id: I978f56c843daab307042e34390fc33f338ce8cf5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Doc: specifically list the QToolButton properties that actions affectMitch Curtis2018-11-291-1/+17
| | | | | | | | | | | | | | | | | | Also, add a note that explains that autoRepeat does not affect QToolButton's autoRepeat property. Change-Id: I9e95cef9e9d1b5ee6cb1114d0b9a9fad562db601 Fixes: QTBUG-48204 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Destroy QWindowContainer's fake parent window when not neededTor Arne Vestbø2018-11-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Keeping the fake parent window around in a created state means we're wasting system resources such as native platform views/windows, and makes it harder to debug the lifetime of these resources. The fake window will be re-created if re-parented into at a later point. Change-Id: Ib82560e7e565af19d58afe121fd087669a6ffb95 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QWindowContainer: Fix warning triggered by QT_ASCII_CAST_WARNFriedemann Kleint2018-11-281-1/+1
| | | | | | | | | | | | | | Amends 52bd707f0d6a585c2f5da9565834eb91f1d3dbc8. Change-Id: Icc42edc7a943099b36bfa92fe7cd1a92db344991 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QFocusFrame: protect it from being moved around by accidentRichard Moe Gustavsen2018-11-271-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a focus frame is set around a widget that exist inside a QAbstractItemView, both the focus frame and the widget will be scrolled when the table is scrolled (since the focus frame is a child of the view). The result is that after the widget has been scrolled (which will move the focus frame to the correct position as well), the focus frame will be scrolled next, and therefore away from the widget. This patch will catch this case by always adjusting the focus frame position when someone tries to move it. Trying to move the focus frame away from the widget it tracks will anyway be flaky. Fixes: QTBUG-63877 Change-Id: Ic2aacc4fafc219280e32092c258a7539d0db9cd0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QDateTimeEdit: fix setDate() if time is in a spring-forwardEdward Welbourne2018-11-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | If the time the widget is set to use falls in the gap skipped by a spring-forward, setting the date to the day of the spring-forward turned a valid date into an invalid date-time. So use the usual trick to map the "draft" date-time to a valid one. Fixes: QTBUG-64485 Fixes: QTBUG-58947 Change-Id: Ib8f0f092cd5d6dce3da31eb52cd42150ca0d1fcb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix calculation of text margin if line edit contains side widgetsVitaly Fanaskov2018-11-263-30/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation leads to infinite chain of showing/hidden line edit under circumstances described in QTBUG-54676. We basically got the situation when size hint were calculated differently depending on the line edit visibility state. In this case toolbar layout have to show/hide extension button and line edit a lot of times and can never leave this "loop" (please note, that the chain is much more complicated in reality): Resize toolbar -> Set layout geometry -> Size is OK to display line edit -> Set layout geometry -> Hide extension button -> Set layout geometry (wrong size is calculated here, so "run out of space") -> Hide line edit -> Set layout geometry -> Show extension button -> Set layout geometry - > Size is OK to display line edit ... And we're in the "loop" Clear button is hidden if there is no text in a line edit. In the previous implementation, the button was always visible, only opacity was changing in order to "hide" the button. It resulted to incorrect size hints (regular and minimum). In the current implementation the button is really hidden/shown, and size hints calculated correctly. Also updated unit test for line edit. Remove code duplication in functions for calculation text margin Fixes: QTBUG-54676 Change-Id: I4549c9ea98e10b750ba855a07037f6392276358b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Windows: Fix embedded application not getting focus after clicking outsideFriedemann Kleint2018-11-241-9/+14
| | | | | | | | | | | | | | | | | | | | Amend the check introduced by bde6a049494f40cd71004d6926899f115af0c3e6 to not apply to embedded windows and plugin applications. Fixes: QTBUG-71991 Task-number: QTBUG-7081 Change-Id: I80b3dc0fa20ee3447a4bc4bbb41e66d4d90ab726 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add translator's comment to the copyright noteFriedemann Kleint2018-11-231-2/+3
| | | | | | | | | | | | | | | | | | | | State the policy that so far only exists in the localization wiki and is currently not followed by all translators. Task-number: QTBUG-57697 Change-Id: I2aa9f1bbd244b53e48e59f625520a7f86d2df347 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove unused inRepaint member of QWidgetPrivateTor Arne Vestbø2018-11-232-6/+1
| | | | | | | | | | | | | | The code that used it was removed in 55fa3c189f889 6 years ago. Change-Id: I76e42f147342feb1bda9bc2c5aa882af62757812 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Improve logging of QWindowContainer operationsTor Arne Vestbø2018-11-231-0/+6
| | | | | | | | | | | | | | | | By explicitly identifying the fake window created for the window container. Change-Id: Id67a6e22588d04e68f5ede09bc078bb387c12e0b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QGraphicsProxyWidget: Don't crash within setWidget() when a child proxy has ↵Christian Ehrlicher2018-11-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | no assigned widget QGraphicsProxyWidget::setWidget() is checking if the newly assigned widget is already assigned to a child proxy widget without checking if the child has a widget assigned at all which lead to a nullptr reference if it is not the case. Therefore check if the assigned widget is a valid pointer. Fixes: QTBUG-15442 Change-Id: I006877f99895ca01975bdcad071cfcf90bea22ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QScrollBar: fix horizontal scrollbars in RTL modeChristian Ehrlicher2018-11-191-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a QScrollBar had a stylesheet the subControlRect() was not properly mirrored which lead to a wrong scrolling behavior. Fix it by adjusting the resulting rect with visualRect(). This reverts 00c9ec63a552d040e851b561c11428fabf1a2b08 since it did not completely fixed the issue for all use cases. Fixes: QTBUG-27279 Fixes: QTBUG-38748 Fixes: QTBUG-40443 Change-Id: I19718287be7b4cfc9dbe6951fff99ae48264a855 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>