summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf3
-rw-r--r--src/widgets/itemviews/qlistview.cpp9
-rw-r--r--src/widgets/kernel/qtestsupport_widgets.cpp17
-rw-r--r--src/widgets/kernel/qtooltip.cpp24
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp7
-rw-r--r--src/widgets/widgets/qlineedit.cpp1
8 files changed, 29 insertions, 36 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index ce918b8a74..ac1952a642 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1890,7 +1890,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
"<p>Qt and the Qt logo are trademarks of The Qt Company Ltd.</p>"
"<p>Qt is The Qt Company Ltd product developed as an open source "
"project. See <a href=\"http://%3/\">%3</a> for more information.</p>"
- ).arg(QStringLiteral("2018"),
+ ).arg(QStringLiteral("2019"),
QStringLiteral("qt.io/licensing"),
QStringLiteral("qt.io"));
QMessageBox *msgBox = new QMessageBox(parent);
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index 4700ee29bf..5d7262fca1 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -40,6 +40,9 @@ exampledirs += ../../../examples/widgets \
excludedirs += snippets
+# Included in qttestlib.qdocconf instead
+excludefiles += ../kernel/qtestsupport_widgets.cpp
+
imagedirs += images \
../../../doc/src/images \
../../../examples/widgets/doc/images \
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index e5769940d4..1248e91c8c 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -982,18 +982,9 @@ void QListView::paintEvent(QPaintEvent *e)
? qMax(viewport()->size().width(), d->contentsSize().width()) - 2 * d->spacing()
: qMax(viewport()->size().height(), d->contentsSize().height()) - 2 * d->spacing();
- const int rowCount = d->commonListView->rowCount();
QVector<QModelIndex>::const_iterator end = toBeRendered.constEnd();
for (QVector<QModelIndex>::const_iterator it = toBeRendered.constBegin(); it != end; ++it) {
Q_ASSERT((*it).isValid());
- if (rowCount == 1)
- option.viewItemPosition = QStyleOptionViewItem::OnlyOne;
- else if ((*it).row() == 0)
- option.viewItemPosition = QStyleOptionViewItem::Beginning;
- else if ((*it).row() == rowCount - 1)
- option.viewItemPosition = QStyleOptionViewItem::End;
- else
- option.viewItemPosition = QStyleOptionViewItem::Middle;
option.rect = visualRect(*it);
if (flow() == TopToBottom)
diff --git a/src/widgets/kernel/qtestsupport_widgets.cpp b/src/widgets/kernel/qtestsupport_widgets.cpp
index b227e6ff5d..0056bebdc6 100644
--- a/src/widgets/kernel/qtestsupport_widgets.cpp
+++ b/src/widgets/kernel/qtestsupport_widgets.cpp
@@ -46,15 +46,14 @@
QT_BEGIN_NAMESPACE
-/*! \fn bool qWaitForWindowActive(QWidget *widget, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a widget's window is active.
Returns \c true if \c widget's window is active within \a timeout milliseconds, otherwise returns \c false.
- \sa QTest::qWaitForWindowExposed(), QWidget::isActiveWindow()
+ \sa qWaitForWindowExposed(), QWidget::isActiveWindow()
*/
Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowActive(QWidget *widget, int timeout)
{
@@ -63,8 +62,7 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowActive(QWidget *wid
return false;
}
-/*! \fn bool qWaitForWindowExposed(QWidget *widget, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a widget's window is exposed.
@@ -80,7 +78,7 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowActive(QWidget *wid
A specific configuration where this happens is when using QGLWidget as a viewport widget on macOS:
The viewport widget gets the expose event, not the parent widget.
- \sa QTest::qWaitForWindowActive()
+ \sa qWaitForWindowActive()
*/
Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowExposed(QWidget *widget, int timeout)
{
@@ -89,11 +87,12 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowExposed(QWidget *wi
return false;
}
-/*! \fn bool qWaitForWindowShown(QWidget *widget, int timeout)
- \relates QTest
+/*! \fn bool QTest::qWaitForWindowShown(QWidget *widget, int timeout)
\since 5.0
\deprecated
+ Use qWaitForWindowExposed() instead.
+
Waits for \a timeout milliseconds or until the \a widget's window is exposed.
Returns \c true if \c widget's window is exposed within \a timeout milliseconds, otherwise returns \c false.
@@ -107,7 +106,7 @@ Q_WIDGETS_EXPORT Q_REQUIRED_RESULT bool QTest::qWaitForWindowExposed(QWidget *wi
QTest::qWaitForWindowShown(&widget);
\endcode
- \sa QTest::qWaitForWindowActive(), QTest::qWaitForWindowExposed()
+ \sa qWaitForWindowActive(), qWaitForWindowExposed()
*/
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 9d8b0062f5..cf0f3f153b 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -216,7 +216,6 @@ void QTipLabel::reuseTip(const QString &text, int msecDisplayTime, const QPoint
}
#endif
- setWordWrap(true);
setText(text);
updateSize(pos);
restartExpireTimer(msecDisplayTime);
@@ -235,20 +234,17 @@ void QTipLabel::updateSize(const QPoint &pos)
// Make it look good with the default ToolTip font on Mac, which has a small descent.
if (fm.descent() == 2 && fm.ascent() >= 11)
++extra.rheight();
+ setWordWrap(Qt::mightBeRichText(text()));
QSize sh = sizeHint();
- if (wordWrap()) {
- // ### When the above WinRT code is fixed, windowhandle should be used to find the screen.
- QScreen *screen = QGuiApplication::screenAt(pos);
- if (!screen)
- screen = QGuiApplication::primaryScreen();
- if (screen) {
- const qreal screenWidth = screen->geometry().width();
- if (sh.width() > screenWidth) {
- // Try to use widely accepted 75chars max length or 80% of the screen width else.
- // See https://en.wikipedia.org/wiki/Line_length
- sh.setWidth(qMin(fm.averageCharWidth() * 75, static_cast<int>(screenWidth * .8)));
- sh.setHeight(heightForWidth(sh.width()));
- }
+ // ### When the above WinRT code is fixed, windowhandle should be used to find the screen.
+ QScreen *screen = QGuiApplication::screenAt(pos);
+ if (!screen)
+ screen = QGuiApplication::primaryScreen();
+ if (screen) {
+ const qreal screenWidth = screen->geometry().width();
+ if (!wordWrap() && sh.width() > screenWidth) {
+ setWordWrap(true);
+ sh = sizeHint();
}
}
resize(sh + extra);
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 6227996ff8..c66fc098a1 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -4517,7 +4517,7 @@ void QWidget::setForegroundRole(QPalette::ColorRole role)
the "color", "background-color", "selection-color",
"selection-background-color" and "alternate-background-color".
- \sa QApplication::palette(), QWidget::font(), \l {Qt Style Sheets}
+ \sa QApplication::palette(), QWidget::font(), {Qt Style Sheets}
*/
const QPalette &QWidget::palette() const
{
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 279c6c0282..991a05fa02 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -899,10 +899,10 @@ void QWidgetWindow::handleDragMoveEvent(QDragMoveEvent *event)
const QPoint mapped = widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()));
QDragMoveEvent translated(mapped, event->possibleActions(), event->mimeData(),
event->mouseButtons(), event->keyboardModifiers());
- translated.setDropAction(event->dropAction());
- translated.setAccepted(event->isAccepted());
if (widget == m_dragTarget) { // Target widget unchanged: Send DragMove
+ translated.setDropAction(event->dropAction());
+ translated.setAccepted(event->isAccepted());
QGuiApplication::forwardEvent(m_dragTarget, &translated, event);
} else {
if (m_dragTarget) { // Send DragLeave to previous
@@ -912,6 +912,9 @@ void QWidgetWindow::handleDragMoveEvent(QDragMoveEvent *event)
}
// Send DragEnter to new widget.
handleDragEnterEvent(static_cast<QDragEnterEvent*>(event), widget);
+ // Handling 'DragEnter' should suffice for the application.
+ translated.setDropAction(event->dropAction());
+ translated.setAccepted(event->isAccepted());
// The drag enter event is always immediately followed by a drag move event,
// see QDragEnterEvent documentation.
QGuiApplication::forwardEvent(m_dragTarget, &translated, event);
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 2ae2e16c89..4301a3a2e7 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -1681,6 +1681,7 @@ void QLineEdit::mouseDoubleClickEvent(QMouseEvent* e)
/*!
\fn void QLineEdit::inputRejected()
+ \since 5.12
This signal is emitted when the user presses a key that is not
considered to be acceptable input. For example, if a key press