summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-10-08 13:52:51 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-10-08 13:52:51 (GMT)
commit61975fcccac7dc20f0fcda4294a4660560501afc (patch)
treeda47fa4bc83b3450503265e03185f9dee05678ff /src/gui
parent3973481089f9101668c20a9317b759e09a784070 (diff)
parentb546a7c8c57fdfe18b3293c8fef8c4a58ad77f59 (diff)
downloadQt-61975fcccac7dc20f0fcda4294a4660560501afc.zip
Qt-61975fcccac7dc20f0fcda4294a4660560501afc.tar.gz
Qt-61975fcccac7dc20f0fcda4294a4660560501afc.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication.cpp7
-rw-r--r--src/gui/kernel/qapplication_s60.cpp6
-rw-r--r--src/gui/kernel/qclipboard_x11.cpp24
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm5
-rw-r--r--src/gui/kernel/qdnd_x11.cpp2
-rw-r--r--src/gui/kernel/qmotifdnd_x11.cpp2
-rw-r--r--src/gui/kernel/qt_x11_p.h2
-rw-r--r--src/gui/kernel/qwidget_x11.cpp21
-rw-r--r--src/gui/painting/qpaintengine_s60.cpp63
-rw-r--r--src/gui/styles/qgtkstyle.cpp29
-rw-r--r--src/gui/styles/qmacstyle_mac.mm10
-rw-r--r--src/gui/styles/qs60style.cpp2
-rw-r--r--src/gui/widgets/qmenubar.cpp30
13 files changed, 126 insertions, 77 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index fdacefc..3323fbc 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -477,11 +477,14 @@ bool Q_GUI_EXPORT qt_tab_all_widgets = true;
bool qt_in_tab_key_event = false;
int qt_antialiasing_threshold = -1;
static int drag_time = 500;
+#ifndef QT_GUI_DRAG_DISTANCE
+#define QT_GUI_DRAG_DISTANCE 4
+#endif
#ifdef Q_OS_SYMBIAN
// The screens are a bit too small to for your thumb when using only 4 pixels drag distance.
-static int drag_distance = 12;
+static int drag_distance = 12; //XXX move to qplatformdefs.h
#else
-static int drag_distance = 4;
+static int drag_distance = QT_GUI_DRAG_DISTANCE;
#endif
static Qt::LayoutDirection layout_direction = Qt::LeftToRight;
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 1127c84..296f24f 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -152,18 +152,12 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible)
if (backingStore.data()) {
backingStore.registerWidget(widget);
} else {
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
- S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer);
-#endif
backingStore.create(window);
backingStore.registerWidget(widget);
qt_widget_private(widget)->invalidateBuffer(widget->rect());
widget->repaint();
}
} else {
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
- S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer);
-#endif
backingStore.unregisterWidget(widget);
// In order to ensure that any resources used by the window surface
// are immediately freed, we flush the WSERV command buffer.
diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp
index 4b75f0a..55548ef 100644
--- a/src/gui/kernel/qclipboard_x11.cpp
+++ b/src/gui/kernel/qclipboard_x11.cpp
@@ -595,7 +595,7 @@ static inline int maxSelectionIncr(Display *dpy)
{ return XMaxRequestSize(dpy) > 65536 ? 65536*4 : XMaxRequestSize(dpy)*4 - 100; }
bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deleteProperty,
- QByteArray *buffer, int *size, Atom *type, int *format, bool nullterm)
+ QByteArray *buffer, int *size, Atom *type, int *format)
{
int maxsize = maxSelectionIncr(display);
ulong bytes_left; // bytes_after
@@ -641,13 +641,13 @@ bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deletePrope
break;
}
- int newSize = proplen + (nullterm ? 1 : 0);
+ int newSize = proplen;
buffer->resize(newSize);
bool ok = (buffer->size() == newSize);
VDEBUG("QClipboard: read_property(): buffer resized to %d", buffer->size());
- if (ok) {
+ if (ok && newSize) {
// could allocate buffer
while (bytes_left) {
@@ -683,23 +683,19 @@ bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deletePrope
XTextProperty textprop;
textprop.encoding = *type;
textprop.format = *format;
- textprop.nitems = length;
+ textprop.nitems = buffer_offset;
textprop.value = (unsigned char *) buffer->data();
char **list_ret = 0;
int count;
if (XmbTextPropertyToTextList(display, &textprop, &list_ret,
&count) == Success && count && list_ret) {
- offset = strlen(list_ret[0]);
- buffer->resize(offset + (nullterm ? 1 : 0));
+ offset = buffer_offset = strlen(list_ret[0]);
+ buffer->resize(offset);
memcpy(buffer->data(), list_ret[0], offset);
}
if (list_ret) XFreeStringList(list_ret);
}
-
- // zero-terminate (for text)
- if (nullterm)
- buffer->data()[buffer_offset] = '\0';
}
// correct size, not 0-term.
@@ -742,7 +738,7 @@ QByteArray QX11Data::clipboardReadIncrementalProperty(Window win, Atom property,
if (event.xproperty.atom != property ||
event.xproperty.state != PropertyNewValue)
continue;
- if (X11->clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0, false)) {
+ if (X11->clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0)) {
if (length == 0) { // no more data, we're done
if (nullterm) {
buf.resize(offset+1);
@@ -836,7 +832,7 @@ static Atom send_selection(QClipboardData *d, Atom target, Window window, Atom p
ATOM(INCR), 32, PropModeReplace, (uchar *) &bytes, 1);
(void)new QClipboardINCRTransaction(window, property, atomFormat, dataFormat, data, increment);
- return ATOM(INCR);
+ return property;
}
// make sure we can perform the XChangeProperty in a single request
@@ -1070,7 +1066,7 @@ bool QClipboard::event(QEvent *e)
QByteArray multi_data;
if (req->property == XNone
|| !X11->clipboardReadProperty(req->requestor, req->property, false, &multi_data,
- 0, &multi_type, &multi_format, 0)
+ 0, &multi_type, &multi_format)
|| multi_format != 32) {
// MULTIPLE property not formatted correctly
XSendEvent(dpy, req->requestor, False, NoEventMask, &event);
@@ -1292,7 +1288,7 @@ QByteArray QClipboardWatcher::getDataInFormat(Atom fmtatom) const
Atom type;
XSelectInput(dpy, win, PropertyChangeMask);
- if (X11->clipboardReadProperty(win, ATOM(_QT_SELECTION), true, &buf, 0, &type, 0, false)) {
+ if (X11->clipboardReadProperty(win, ATOM(_QT_SELECTION), true, &buf, 0, &type, 0)) {
if (type == ATOM(INCR)) {
int nbytes = buf.size() >= 4 ? *((int*)buf.data()) : 0;
buf = X11->clipboardReadIncrementalProperty(win, ATOM(_QT_SELECTION), nbytes, false);
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 7a9dc70..9b07d64 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -320,5 +320,10 @@ static void cleanupCocoaApplicationDelegate()
[NSApp terminate:self];
}
+- (void)qtDispatcherToQAction:(id)sender
+{
+ [[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender];
+}
+
@end
#endif
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index 92dd0a1..68d7688 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -1887,7 +1887,7 @@ static QVariant xdndObtainData(const char *format, QVariant::Type requestedType)
if (got) {
Atom type;
- if (X11->clipboardReadProperty(tw->effectiveWinId(), ATOM(XdndSelection), true, &result, 0, &type, 0, false)) {
+ if (X11->clipboardReadProperty(tw->effectiveWinId(), ATOM(XdndSelection), true, &result, 0, &type, 0)) {
if (type == ATOM(INCR)) {
int nbytes = result.size() >= 4 ? *((int*)result.data()) : 0;
result = X11->clipboardReadIncrementalProperty(tw->effectiveWinId(), ATOM(XdndSelection), nbytes, false);
diff --git a/src/gui/kernel/qmotifdnd_x11.cpp b/src/gui/kernel/qmotifdnd_x11.cpp
index 0a7b350..3334455 100644
--- a/src/gui/kernel/qmotifdnd_x11.cpp
+++ b/src/gui/kernel/qmotifdnd_x11.cpp
@@ -766,7 +766,7 @@ QVariant QX11Data::motifdndObtainData(const char *mimeType)
if (got) {
Atom type;
- if (X11->clipboardReadProperty(tw->internalWinId(), Dnd_selection, true, &result, 0, &type, 0, false)) {
+ if (X11->clipboardReadProperty(tw->internalWinId(), Dnd_selection, true, &result, 0, &type, 0)) {
}
}
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index 7383382..d62d9c3 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -350,7 +350,7 @@ struct QX11Data
// from qclipboard_x11.cpp
bool clipboardWaitForEvent(Window win, int type, XEvent *event, int timeout);
bool clipboardReadProperty(Window win, Atom property, bool deleteProperty,
- QByteArray *buffer, int *size, Atom *type, int *format, bool nullterm);
+ QByteArray *buffer, int *size, Atom *type, int *format);
QByteArray clipboardReadIncrementalProperty(Window win, Atom property, int nbytes, bool nullterm);
// from qdnd_x11.cpp
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 8d80e10..9085e98 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1933,20 +1933,27 @@ void QWidgetPrivate::show_sys()
if (flags & Qt::WindowStaysOnTopHint) {
if (flags & Qt::WindowStaysOnBottomHint)
qWarning() << "QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time";
- netWmState.append(ATOM(_NET_WM_STATE_ABOVE));
- netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_ABOVE)))
+ netWmState.append(ATOM(_NET_WM_STATE_ABOVE));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_STAYS_ON_TOP)))
+ netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP));
} else if (flags & Qt::WindowStaysOnBottomHint) {
- netWmState.append(ATOM(_NET_WM_STATE_BELOW));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_BELOW)))
+ netWmState.append(ATOM(_NET_WM_STATE_BELOW));
}
if (q->isFullScreen()) {
- netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_FULLSCREEN)))
+ netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN));
}
if (q->isMaximized()) {
- netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ));
- netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ)))
+ netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_VERT)))
+ netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT));
}
if (data.window_modality != Qt::NonModal) {
- netWmState.append(ATOM(_NET_WM_STATE_MODAL));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_MODAL)))
+ netWmState.append(ATOM(_NET_WM_STATE_MODAL));
}
if (!netWmState.isEmpty()) {
diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_s60.cpp
index 068ca0c..d7fc0af 100644
--- a/src/gui/painting/qpaintengine_s60.cpp
+++ b/src/gui/painting/qpaintengine_s60.cpp
@@ -59,44 +59,63 @@ bool QS60PaintEngine::begin(QPaintDevice *device)
{
Q_D(QS60PaintEngine);
- pixmapData->beginDataAccess();
- bool ret = QRasterPaintEngine::begin(device);
- // Make sure QPaintEngine::paintDevice() returns the proper device.
- // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPixmapData
- // which is incorrect in Symbian.
- d->pdev = device;
- return ret;
+ if (pixmapData->classId() == QPixmapData::RasterClass) {
+ pixmapData->beginDataAccess();
+ bool ret = QRasterPaintEngine::begin(device);
+ // Make sure QPaintEngine::paintDevice() returns the proper device.
+ // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPixmapData
+ // which is incorrect in Symbian.
+ d->pdev = device;
+ return ret;
+ }
+
+ return QRasterPaintEngine::begin(device);
}
bool QS60PaintEngine::end()
{
- bool ret = QRasterPaintEngine::end();
- pixmapData->endDataAccess();
- return ret;
+ if (pixmapData->classId() == QPixmapData::RasterClass) {
+ bool ret = QRasterPaintEngine::end();
+ pixmapData->endDataAccess();
+ return ret;
+ }
+ return QRasterPaintEngine::end();
}
void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
{
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
- srcData->beginDataAccess();
- QRasterPaintEngine::drawPixmap(p, pm);
- srcData->endDataAccess();
+ if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
+ QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ srcData->beginDataAccess();
+ QRasterPaintEngine::drawPixmap(p, pm);
+ srcData->endDataAccess();
+ } else {
+ QRasterPaintEngine::drawPixmap(p, pm);
+ }
}
void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
{
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
- srcData->beginDataAccess();
- QRasterPaintEngine::drawPixmap(r, pm, sr);
- srcData->endDataAccess();
+ if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
+ QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ srcData->beginDataAccess();
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+ srcData->endDataAccess();
+ } else {
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+ }
}
void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
{
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
- srcData->beginDataAccess();
- QRasterPaintEngine::drawTiledPixmap(r, pm, sr);
- srcData->endDataAccess();
+ if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
+ QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ srcData->beginDataAccess();
+ QRasterPaintEngine::drawTiledPixmap(r, pm, sr);
+ srcData->endDataAccess();
+ } else {
+ QRasterPaintEngine::drawTiledPixmap(r, pm, sr);
+ }
}
void QS60PaintEngine::prepare(QImage *image)
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index c5429dd..9cc64b3 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -225,9 +225,8 @@ QPalette QGtkStyle::standardPalette() const
GtkStyle *style = d->gtkStyle();
GtkWidget *gtkButton = d->gtkWidget("GtkButton");
GtkWidget *gtkEntry = d->getTextColorWidget();
-
- GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg;
- QColor bg, base, text, fg, highlight, highlightText;
+ GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg, gdkaSbg, gdkaSfg;
+ QColor bg, base, text, fg, highlight, highlightText, inactiveHighlight, inactiveHighlightedTExt;
gdkBg = style->bg[GTK_STATE_NORMAL];
gdkForeground = gtkButton->style->fg[GTK_STATE_NORMAL];
@@ -237,14 +236,23 @@ QPalette QGtkStyle::standardPalette() const
gdkText = gtkEntry->style->text[GTK_STATE_NORMAL];
gdkSbg = gtkEntry->style->base[GTK_STATE_SELECTED];
gdkSfg = gtkEntry->style->text[GTK_STATE_SELECTED];
+
+ // The ACTIVE base color is really used for inactive windows
+ gdkaSbg = gtkEntry->style->base[GTK_STATE_ACTIVE];
+ gdkaSfg = gtkEntry->style->text[GTK_STATE_ACTIVE];
+
bg = QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8);
text = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8);
fg = QColor(gdkForeground.red>>8, gdkForeground.green>>8, gdkForeground.blue>>8);
base = QColor(gdkBase.red>>8, gdkBase.green>>8, gdkBase.blue>>8);
highlight = QColor(gdkSbg.red>>8, gdkSbg.green>>8, gdkSbg.blue>>8);
highlightText = QColor(gdkSfg.red>>8, gdkSfg.green>>8, gdkSfg.blue>>8);
+ inactiveHighlight = QColor(gdkaSbg.red>>8, gdkaSbg.green>>8, gdkaSbg.blue>>8);
+ inactiveHighlightedTExt = QColor(gdkaSfg.red>>8, gdkaSfg.green>>8, gdkaSfg.blue>>8);
palette.setColor(QPalette::HighlightedText, highlightText);
+
+
palette.setColor(QPalette::Light, bg.lighter(125));
palette.setColor(QPalette::Shadow, bg.darker(130));
palette.setColor(QPalette::Dark, bg.darker(120));
@@ -279,6 +287,10 @@ QPalette QGtkStyle::standardPalette() const
highlightText.setHsv(highlightText.hue(), 0, highlightText.value(), highlightText.alpha());
palette.setColor(QPalette::Disabled, QPalette::Highlight, highlight);
palette.setColor(QPalette::Disabled, QPalette::HighlightedText, highlightText);
+
+ palette.setColor(QPalette::Inactive, QPalette::HighlightedText, inactiveHighlightedTExt);
+ palette.setColor(QPalette::Inactive, QPalette::Highlight, inactiveHighlight);
+
style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow",
d->gtk_window_get_type());
if (style) {
@@ -791,10 +803,13 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
// ### this mess should move to subcontrolrect
QRect frameRect = option->rect.adjusted(1, 1, -1, -2);
- if (qobject_cast<const QTabBar*>(widget))
- frameRect.adjust(-1, 1, 1, 1);
-
- gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style);
+ if (qobject_cast<const QTabBar*>(widget)) {
+ GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+ style = gtkPainter.getStyle(gtkNotebook);
+ gtkPainter.paintFocus(gtkNotebook, "tab", frameRect.adjusted(-1, 1, 1, 1), GTK_STATE_ACTIVE, style);
+ } else {
+ gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style);
+ }
}
break;
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 671a888..fb31ae4 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -3336,6 +3336,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (needText) {
QPalette pal = tb->palette;
QPalette::ColorRole role = QPalette::NoRole;
+ if (!proxy()->styleHint(SH_UnderlineShortcut, tb, w))
+ alignment |= Qt::TextHideMnemonic;
if (down)
cr.translate(shiftX, shiftY);
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5
@@ -3353,13 +3355,13 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
role = QPalette::HighlightedText;
}
}
- drawItemText(p, cr, alignment, pal,
- tb->state & State_Enabled, tb->text, role);
+ proxy()->drawItemText(p, cr, alignment, pal,
+ tb->state & State_Enabled, tb->text, role);
if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 &&
(tb->state & State_Sunken)) {
// Draw a "drop shadow" in earlier versions.
- drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment,
- tb->palette, tb->state & State_Enabled, tb->text);
+ proxy()->drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment,
+ tb->palette, tb->state & State_Enabled, tb->text);
}
}
} else {
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 718774e..1e32bd8 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2453,7 +2453,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_PanelItemViewRow: // ### Qt 5: remove
#ifndef QT_NO_ITEMVIEWS
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
- if (QS60StylePrivate::equalToThemePalette(vopt->palette.base().texture().cacheKey(), QPalette::Base)) {
+ if (!QS60StylePrivate::equalToThemePalette(vopt->palette.base().texture().cacheKey(), QPalette::Base)) {
//QPalette::Base has been changed, let commonstyle draw the item
commonStyleDraws = true;
} else {
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index df16f7f..ae56fa5 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -1628,10 +1628,10 @@ bool QMenuBar::eventFilter(QObject *object, QEvent *event)
}
/*!
- \internal
+ Returns the QAction at \a pt. Returns 0 if there is no action at \a pt or if
+the location has a separator.
- Return the item at \a pt, or 0 if there is no item there or if it is
- a separator item.
+ \sa addAction(), addSeparator()
*/
QAction *QMenuBar::actionAt(const QPoint &pt) const
{
@@ -1640,9 +1640,9 @@ QAction *QMenuBar::actionAt(const QPoint &pt) const
}
/*!
- \internal
+ Returns the geometry of action \a act as a QRect.
- Returns the geometry of action \a act.
+ \sa actionAt()
*/
QRect QMenuBar::actionGeometry(QAction *act) const
{
@@ -1836,10 +1836,17 @@ void QMenuBarPrivate::_q_updateLayout()
}
/*!
- \internal
+ \fn void QMenuBar::setCornerWidget(QWidget *widget, Qt::Corner corner)
- This sets widget \a w to be shown directly on the left of the first or
- the right of the last menu item, depending on \a corner.
+ This sets the given \a widget to be shown directly on the left of the first
+ menu item, or on the right of the last menu item, depending on \a corner.
+
+ The menu bar takes ownership of \a widget, reparenting it into the menu bar.
+ However, if the \a corner already contains a widget, this previous widget
+ will no longer be managed and will still be a visible child of the menu bar.
+
+ \note Using a corner other than Qt::TopRightCorner or Qt::TopLeftCorner
+ will result in a warning.
*/
void QMenuBar::setCornerWidget(QWidget *w, Qt::Corner corner)
{
@@ -1869,10 +1876,11 @@ void QMenuBar::setCornerWidget(QWidget *w, Qt::Corner corner)
}
/*!
- \internal
+ Returns the widget on the left of the first or on the right of the last menu
+ item, depending on \a corner.
- Returns the widget in the left of the first or the right of the last menu
- item, depending on \a corner.
+ \note Using a corner other than Qt::TopRightCorner or Qt::TopLeftCorner
+ will result in a warning.
*/
QWidget *QMenuBar::cornerWidget(Qt::Corner corner) const
{