summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-05 13:42:11 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-05 13:42:11 +0100
commit5e8ae03578ecd0538a774505f2f7e2fc626b0ab7 (patch)
tree3b6f704df4d55d0ed2a5a706acf785541a74a45e /src/widgets
parent7a5fea113ec6088135b0b6a0fc4297e0ef362bc5 (diff)
parentbe3fb9afe50361e4b35d02d28ef30851335b17b6 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp4
-rw-r--r--src/widgets/itemviews/qheaderview.cpp14
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp28
-rw-r--r--src/widgets/styles/qgtkstyle.cpp30
-rw-r--r--src/widgets/styles/qgtkstyle_p.cpp7
-rw-r--r--src/widgets/styles/qgtkstyle_p_p.h2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm4
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp19
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp4
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp12
-rw-r--r--src/widgets/widgets/qtextedit.h2
12 files changed, 72 insertions, 60 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 3320cc7c04..f4aa91974b 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -2968,7 +2968,11 @@ void QFileDialogPrivate::_q_enterDirectory(const QModelIndex &index)
lineEdit()->clear();
}
} else {
- q->accept();
+ // Do not accept when shift-clicking to multi-select a file in environments with single-click-activation (KDE)
+ if (!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)
+ || q->fileMode() != QFileDialog::ExistingFiles || !(QGuiApplication::keyboardModifiers() & Qt::CTRL)) {
+ q->accept();
+ }
}
}
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index f04667e167..a396053a82 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -7375,8 +7375,8 @@ void QGraphicsItem::updateMicroFocus()
/*!
This virtual function is called by QGraphicsItem to notify custom items
that some part of the item's state changes. By reimplementing this
- function, your can react to a change, and in some cases, (depending on \a
- change,) adjustments can be made.
+ function, you can react to a change, and in some cases (depending on \a
+ change), adjustments can be made.
\a change is the parameter of the item that is changing. \a value is the
new value; the type of the value depends on \a change.
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index ec5620c14c..5599d251a1 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -1082,6 +1082,8 @@ int QHeaderView::logicalIndex(int visualIndex) const
}
/*!
+ \since 5.0
+
If \a movable is true, the header may be moved by the user; otherwise it
is fixed in place.
@@ -1105,6 +1107,8 @@ void QHeaderView::setSectionsMovable(bool movable)
*/
/*!
+ \since 5.0
+
Returns true if the header can be moved by the user; otherwise returns
false.
@@ -1128,6 +1132,8 @@ bool QHeaderView::sectionsMovable() const
*/
/*!
+ \since 5.0
+
If \a clickable is true, the header will respond to single clicks.
\sa sectionsClickable(), sectionClicked(), sectionPressed(),
@@ -1151,6 +1157,8 @@ void QHeaderView::setSectionsClickable(bool clickable)
*/
/*!
+ \since 5.0
+
Returns true if the header is clickable; otherwise returns false. A
clickable header could be set up to allow the user to change the
representation of the data in the view related to the header.
@@ -1187,6 +1195,8 @@ bool QHeaderView::highlightSections() const
}
/*!
+ \since 5.0
+
Sets the constraints on how the header can be resized to those described
by the given \a mode.
@@ -1205,6 +1215,8 @@ void QHeaderView::setSectionResizeMode(ResizeMode mode)
}
/*!
+ \since 5.0
+
Sets the constraints on how the section specified by \a logicalIndex in
the header can be resized to those described by the given \a mode. The logical
index should exist at the time this function is called.
@@ -1259,6 +1271,8 @@ void QHeaderView::setSectionResizeMode(int logicalIndex, ResizeMode mode)
*/
/*!
+ \since 5.0
+
Returns the resize mode that applies to the section specified by the given
\a logicalIndex.
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 554148675e..b65ce29b84 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -109,7 +109,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
win->setFlags(data.window_flags);
fixPosIncludesFrame();
- win->setGeometry(q->geometry());
+ if (q->testAttribute(Qt::WA_Moved))
+ win->setGeometry(q->geometry());
+ else
+ win->resize(q->size());
win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0));
if (q->testAttribute(Qt::WA_TranslucentBackground)) {
@@ -466,19 +469,6 @@ void QWidget::activateWindow()
wnd->requestActivate();
}
-// Position top level windows at the center, avoid showing
-// Windows at the default 0,0 position excluding the frame.
-static inline QRect positionTopLevelWindow(QRect geometry, const QScreen *screen)
-{
- if (screen && geometry.x() == 0 && geometry.y() == 0) {
- const QRect availableGeometry = screen->availableGeometry();
- if (availableGeometry.width() > geometry.width()
- && availableGeometry.height() > geometry.height())
- geometry.moveCenter(availableGeometry.center());
- }
- return geometry;
-}
-
// move() was invoked with Qt::WA_WState_Created not set (frame geometry
// unknown), that is, crect has a position including the frame.
// If we can determine the frame strut, fix that and clear the flag.
@@ -529,16 +519,16 @@ void QWidgetPrivate::show_sys()
if (q->isWindow())
fixPosIncludesFrame();
QRect geomRect = q->geometry();
- if (q->isWindow()) {
- if (!q->testAttribute(Qt::WA_Moved))
- geomRect = positionTopLevelWindow(geomRect, window->screen());
- } else {
+ if (!q->isWindow()) {
QPoint topLeftOfWindow = q->mapTo(q->nativeParentWidget(),QPoint());
geomRect.moveTopLeft(topLeftOfWindow);
}
const QRect windowRect = window->geometry();
if (windowRect != geomRect) {
- window->setGeometry(geomRect);
+ if (q->testAttribute(Qt::WA_Moved))
+ window->setGeometry(geomRect);
+ else
+ window->resize(geomRect.size());
}
if (QBackingStore *store = q->backingStore()) {
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 6d2c88bfea..9ebab8d52d 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -1881,8 +1881,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GtkShadowType shadow = (option->state & State_Sunken || option->state & State_On ) ?
GTK_SHADOW_IN : GTK_SHADOW_OUT;
- const QHashableLatin1Literal comboBoxPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- QHashableLatin1Literal("GtkComboBoxEntry") : QHashableLatin1Literal("GtkComboBox");
+ const QHashableLatin1Literal comboBoxPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry") : QHashableLatin1Literal("GtkComboBox");
// We use the gtk widget to position arrows and separators for us
GtkWidget *gtkCombo = d->gtkWidget(comboBoxPath);
@@ -1890,8 +1889,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
d->gtk_widget_set_direction(gtkCombo, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
d->gtk_widget_size_allocate(gtkCombo, &geometry);
- QHashableLatin1Literal buttonPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton") : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
+ QHashableLatin1Literal buttonPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
+ : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
GtkWidget *gtkToggleButton = d->gtkWidget(buttonPath);
d->gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
if (gtkToggleButton && (appears_as_list || comboBox->editable)) {
@@ -1900,8 +1899,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
// Draw the combo box as a line edit with a button next to it
if (comboBox->editable || appears_as_list) {
GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state;
- QHashableLatin1Literal entryPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new ? QHashableLatin1Literal("GtkComboBoxEntry.GtkEntry")
- : comboBox->editable ? QHashableLatin1Literal("GtkComboBox.GtkEntry") : QHashableLatin1Literal("GtkComboBox.GtkFrame");
+ QHashableLatin1Literal entryPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkEntry") : QHashableLatin1Literal("GtkComboBox.GtkFrame");
GtkWidget *gtkEntry = d->gtkWidget(entryPath);
d->gtk_widget_set_direction(gtkEntry, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
QRect frameRect = option->rect;
@@ -1969,7 +1967,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
// Draw the separator between label and arrows
- QHashableLatin1Literal vSeparatorPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new
+ QHashableLatin1Literal vSeparatorPath = comboBox->editable
? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkVSeparator")
: QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkVSeparator");
@@ -2006,7 +2004,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
state = GTK_STATE_NORMAL;
QHashableLatin1Literal arrowPath("");
- if (comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new) {
+ if (comboBox->editable) {
if (appears_as_list)
arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkArrow");
else
@@ -2044,7 +2042,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (sunken) {
int xoff, yoff;
- const QHashableLatin1Literal toggleButtonPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new
+ const QHashableLatin1Literal toggleButtonPath = comboBox->editable
? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
: QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
@@ -3812,15 +3810,19 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
case CC_ComboBox:
if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
// We employ the gtk widget to position arrows and separators for us
- GtkWidget *gtkCombo = box->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- d->gtkWidget("GtkComboBoxEntry") : d->gtkWidget("GtkComboBox");
+ GtkWidget *gtkCombo = box->editable ? d->gtkWidget("GtkComboBoxEntry")
+ : d->gtkWidget("GtkComboBox");
d->gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
GtkAllocation geometry = {0, 0, qMax(0, option->rect.width()), qMax(0, option->rect.height())};
d->gtk_widget_size_allocate(gtkCombo, &geometry);
int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, option, widget);
- QHashableLatin1Literal arrowPath = box->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton") : box->editable || appears_as_list ?
- QHashableLatin1Literal("GtkComboBox.GtkToggleButton") : QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
+ QHashableLatin1Literal arrowPath("GtkComboBoxEntry.GtkToggleButton");
+ if (!box->editable) {
+ if (appears_as_list)
+ arrowPath = "GtkComboBox.GtkToggleButton";
+ else
+ arrowPath = "GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow";
+ }
GtkWidget *arrowWidget = d->gtkWidget(arrowPath);
if (!arrowWidget)
diff --git a/src/widgets/styles/qgtkstyle_p.cpp b/src/widgets/styles/qgtkstyle_p.cpp
index 4d16e5b9fe..810a8995f8 100644
--- a/src/widgets/styles/qgtkstyle_p.cpp
+++ b/src/widgets/styles/qgtkstyle_p.cpp
@@ -133,7 +133,6 @@ Ptr_gtk_separator_tool_item_new QGtkStylePrivate::gtk_separator_tool_item_new =
Ptr_gtk_tree_view_new QGtkStylePrivate::gtk_tree_view_new = 0;
Ptr_gtk_combo_box_new QGtkStylePrivate::gtk_combo_box_new = 0;
Ptr_gtk_combo_box_entry_new QGtkStylePrivate::gtk_combo_box_entry_new = 0;
-Ptr_gtk_combo_box_new_with_entry QGtkStylePrivate::gtk_combo_box_new_with_entry = 0;
Ptr_gtk_progress_bar_new QGtkStylePrivate::gtk_progress_bar_new = 0;
Ptr_gtk_container_add QGtkStylePrivate::gtk_container_add = 0;
Ptr_gtk_menu_shell_append QGtkStylePrivate::gtk_menu_shell_append = 0;
@@ -411,7 +410,6 @@ void QGtkStylePrivate::resolveGtk() const
gtk_tree_view_new = (Ptr_gtk_tree_view_new)libgtk.resolve("gtk_tree_view_new");
gtk_combo_box_new = (Ptr_gtk_combo_box_new)libgtk.resolve("gtk_combo_box_new");
gtk_combo_box_entry_new = (Ptr_gtk_combo_box_entry_new)libgtk.resolve("gtk_combo_box_entry_new");
- gtk_combo_box_new_with_entry = (Ptr_gtk_combo_box_entry_new)libgtk.resolve("gtk_combo_box_new_with_entry");
gtk_range_get_adjustment = (Ptr_gtk_range_get_adjustment)libgtk.resolve("gtk_range_get_adjustment");
gtk_range_set_adjustment = (Ptr_gtk_range_set_adjustment)libgtk.resolve("gtk_range_set_adjustment");
gtk_range_set_inverted = (Ptr_gtk_range_set_inverted)libgtk.resolve("gtk_range_set_inverted");
@@ -575,10 +573,7 @@ void QGtkStylePrivate::initGtkWidgets() const
addWidget(QGtkStylePrivate::gtk_check_button_new());
addWidget(QGtkStylePrivate::gtk_radio_button_new(NULL));
addWidget(QGtkStylePrivate::gtk_combo_box_new());
- if (gtk_combo_box_entry_new)
- addWidget(QGtkStylePrivate::gtk_combo_box_entry_new());
- if (gtk_combo_box_new_with_entry)
- addWidget(QGtkStylePrivate::gtk_combo_box_new_with_entry());
+ addWidget(QGtkStylePrivate::gtk_combo_box_entry_new());
GtkWidget *entry = QGtkStylePrivate::gtk_entry_new();
// gtk-im-context-none is supported in gtk+ since 2.19.5
// and also exists in gtk3
diff --git a/src/widgets/styles/qgtkstyle_p_p.h b/src/widgets/styles/qgtkstyle_p_p.h
index 643f766215..fc77aea48b 100644
--- a/src/widgets/styles/qgtkstyle_p_p.h
+++ b/src/widgets/styles/qgtkstyle_p_p.h
@@ -143,7 +143,6 @@ typedef GtkWidget* (*Ptr_gtk_menu_bar_new)(void);
typedef GtkWidget* (*Ptr_gtk_menu_new)(void);
typedef GtkWidget* (*Ptr_gtk_combo_box_new)(void);
typedef GtkWidget* (*Ptr_gtk_combo_box_entry_new)(void);
-typedef GtkWidget* (*Ptr_gtk_combo_box_new_with_entry)(void);
typedef GtkWidget* (*Ptr_gtk_toolbar_new)(void);
typedef GtkWidget* (*Ptr_gtk_spin_button_new)(GtkAdjustment*, double, int);
typedef GtkWidget* (*Ptr_gtk_button_new)(void);
@@ -380,7 +379,6 @@ public:
static Ptr_gtk_tree_view_get_column gtk_tree_view_get_column;
static Ptr_gtk_combo_box_new gtk_combo_box_new;
static Ptr_gtk_combo_box_entry_new gtk_combo_box_entry_new;
- static Ptr_gtk_combo_box_new_with_entry gtk_combo_box_new_with_entry;
static Ptr_gtk_progress_bar_new gtk_progress_bar_new;
static Ptr_gtk_container_add gtk_container_add;
static Ptr_gtk_menu_shell_append gtk_menu_shell_append;
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 00356b7468..de7bac93a0 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -4257,7 +4257,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (isIndeterminate || tdi.value < tdi.max) {
if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)))
tdi.trackInfo.progress.phase = animation->animationStep();
- else
+ else if (opt->styleObject)
d->startAnimation(new QProgressStyleAnimation(d->animateSpeed(QMacStylePrivate::AquaProgressBar), opt->styleObject));
} else {
d->stopAnimation(opt->styleObject);
@@ -5013,6 +5013,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
bgColor.blue() < 128;
if (isDarkBg)
[scroller setKnobStyle:NSScrollerKnobStyleLight];
+ else
+ [scroller setKnobStyle:NSScrollerKnobStyleDefault];
[scroller setControlSize:(tdi.kind == kThemeSmallScrollBar ? NSMiniControlSize
: NSRegularControlSize)];
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 6b9b96c171..7087e2a5ca 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -2605,14 +2605,17 @@ static void updateObjects(const QList<const QObject *>& objects)
styleSheetCaches->renderRulesCache.remove(object);
}
}
- for (int i = 0; i < objects.size(); ++i) {
- QObject *object = const_cast<QObject *>(objects.at(i));
- if (object == 0)
- continue;
- if (QWidget *widget = qobject_cast<QWidget *>(object))
- widget->style()->polish(widget);
- QEvent event(QEvent::StyleChange);
- QApplication::sendEvent(object, &event);
+
+ QWidgetList widgets;
+ foreach (const QObject *object, objects) {
+ if (QWidget *w = qobject_cast<QWidget*>(const_cast<QObject*>(object)))
+ widgets << w;
+ }
+
+ QEvent event(QEvent::StyleChange);
+ foreach (QWidget *widget, widgets) {
+ widget->style()->polish(widget);
+ QApplication::sendEvent(widget, &event);
}
}
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 4d98739f63..e9bc17f78f 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -520,7 +520,11 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
}
break;
case PE_Frame: {
+#ifndef QT_NO_ACCESSIBILITY
if (QStyleHelper::isInstanceOf(option->styleObject, QAccessible::EditableText)) {
+#else
+ if (false) {
+#endif
painter->save();
int stateId = ETS_NORMAL;
if (!(state & State_Enabled))
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index 24a92f383e..391a06917c 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -329,13 +329,13 @@ void QAbstractScrollAreaPrivate::layoutChildren()
{
Q_Q(QAbstractScrollArea);
bool transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, vbar ? vbar : hbar);
- bool needh = (hbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
+ bool needh = (hbarpolicy != Qt::ScrollBarAlwaysOff) && ((hbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
|| ((hbarpolicy == Qt::ScrollBarAsNeeded || transient)
- && hbar->minimum() < hbar->maximum() && !hbar->sizeHint().isEmpty());
+ && hbar->minimum() < hbar->maximum() && !hbar->sizeHint().isEmpty()));
- bool needv = (vbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
+ bool needv = (vbarpolicy != Qt::ScrollBarAlwaysOff) && ((vbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
|| ((vbarpolicy == Qt::ScrollBarAsNeeded || transient)
- && vbar->minimum() < vbar->maximum() && !vbar->sizeHint().isEmpty());
+ && vbar->minimum() < vbar->maximum() && !vbar->sizeHint().isEmpty()));
QStyleOption opt(0);
opt.init(q);
@@ -1456,9 +1456,9 @@ void QAbstractScrollAreaPrivate::flashScrollBars()
{
Q_Q(QAbstractScrollArea);
bool transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, vbar ? vbar : hbar);
- if (hbarpolicy == Qt::ScrollBarAsNeeded || transient)
+ if ((hbarpolicy != Qt::ScrollBarAlwaysOff) && (hbarpolicy == Qt::ScrollBarAsNeeded || transient))
hbar->d_func()->flash();
- if (vbarpolicy == Qt::ScrollBarAsNeeded || transient)
+ if ((vbarpolicy != Qt::ScrollBarAlwaysOff) && (vbarpolicy == Qt::ScrollBarAsNeeded || transient))
vbar->d_func()->flash();
}
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index e5a67ba855..8eb274342f 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -84,7 +84,7 @@ class Q_WIDGETS_EXPORT QTextEdit : public QAbstractScrollArea
Q_PROPERTY(bool acceptRichText READ acceptRichText WRITE setAcceptRichText)
Q_PROPERTY(int cursorWidth READ cursorWidth WRITE setCursorWidth)
Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
- Q_PROPERTY(QTextDocument *document READ document WRITE setDocument)
+ Q_PROPERTY(QTextDocument *document READ document WRITE setDocument DESIGNABLE false)
public:
enum LineWrapMode {
NoWrap,