summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp4
-rw-r--r--src/widgets/itemviews/qlistview.cpp5
-rw-r--r--src/widgets/styles/qcommonstyle.cpp5
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp4
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp6
-rw-r--r--src/widgets/widgets/qtextedit.cpp2
7 files changed, 21 insertions, 7 deletions
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp
index 338817ea74..70e3090cde 100644
--- a/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qwidget.cpp
@@ -44,7 +44,7 @@ w->setWindowState(w->windowState() ^ Qt::WindowFullScreen);
//! [1]
-w->setWindowState(w->windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
+w->setWindowState((w->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
//! [1]
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp
index ccc51120a9..40d32ea1d5 100644
--- a/src/widgets/graphicsview/qgraphicswidget.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget.cpp
@@ -2274,7 +2274,7 @@ void QGraphicsWidget::paintWindowFrame(QPainter *painter, const QStyleOptionGrap
const QPointF styleOrigin = this->windowFrameRect().topLeft();
painter->translate(styleOrigin);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
const QSize pixmapSize = windowFrameRect.size();
if (pixmapSize.width() <= 0 || pixmapSize.height() <= 0)
return;
@@ -2342,7 +2342,7 @@ void QGraphicsWidget::paintWindowFrame(QPainter *painter, const QStyleOptionGrap
frameOptions.midLineWidth = 1;
style()->drawPrimitive(QStyle::PE_FrameWindow, &frameOptions, painter, widget);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
realPainter->drawPixmap(QPoint(), pm);
delete painter;
#endif
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 7f7c60b10e..135f89d4ac 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -915,6 +915,11 @@ QStyleOptionViewItem QListView::viewOptions() const
} else {
option.decorationPosition = QStyleOptionViewItem::Left;
}
+
+ if (d->gridSize().isValid()) {
+ option.rect.setSize(d->gridSize());
+ }
+
return option;
}
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index a9f1c3bbbc..2d7107598f 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -838,7 +838,10 @@ QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItem *option, int
break;
case QStyleOptionViewItem::Top:
case QStyleOptionViewItem::Bottom:
- bounds.setWidth(wrapText ? option->decorationSize.width() : QFIXED_MAX);
+ if (wrapText)
+ bounds.setWidth(bounds.isValid() ? bounds.width() - 2 * textMargin : option->decorationSize.width());
+ else
+ bounds.setWidth(QFIXED_MAX);
break;
default:
break;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 2f36e0e53c..6bd0ba37c8 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4710,7 +4710,9 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
break;
case PM_TabBarBaseOverlap: {
- const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget();
+ const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w);
+ if (!tabWidget && w)
+ tabWidget = w->parentWidget();
if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) {
return 0;
}
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 2f36944b5e..af379b756e 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -1879,7 +1879,11 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
XPThemeData ftheme(widget, painter,
QWindowsXPStylePrivate::EditTheme,
partId, stateId, r);
- ftheme.noContent = true;
+ // The spinbox in Windows QStyle is drawn with frameless QLineEdit inside it
+ // That however breaks with QtQuickControls where this results in transparent
+ // spinbox background, so if there's no "widget" passed (QtQuickControls case),
+ // let ftheme.noContent be false, which fixes the spinbox rendering in QQC
+ ftheme.noContent = (widget != NULL);
d->drawBackground(ftheme);
}
if (sub & SC_SpinBoxUp) {
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 49e05e8e14..e47abace4d 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -2042,7 +2042,7 @@ QList<QTextEdit::ExtraSelection> QTextEdit::extraSelections() const
This function returns a new MIME data object to represent the contents
of the text edit's current selection. It is called when the selection needs
to be encapsulated into a new QMimeData object; for example, when a drag
- and drop operation is started, or when data is copyied to the clipboard.
+ and drop operation is started, or when data is copied to the clipboard.
If you reimplement this function, note that the ownership of the returned
QMimeData object is passed to the caller. The selection can be retrieved