summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-10-04 14:12:39 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-10-04 14:12:39 (GMT)
commit3ea28c383846a4af67ddd0c7d33dad0537a9972e (patch)
tree901f26b86b820ec4b4fc949ae38b6ce165b386af /src/gui/styles
parent7cc2e423d39c3b519279d21cd3881f1a135913fd (diff)
parentd04664b9da6356d3c97e632fb35e27c6822e0dc9 (diff)
downloadQt-3ea28c383846a4af67ddd0c7d33dad0537a9972e.zip
Qt-3ea28c383846a4af67ddd0c7d33dad0537a9972e.tar.gz
Qt-3ea28c383846a4af67ddd0c7d33dad0537a9972e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qgtkstyle_p.cpp24
-rw-r--r--src/gui/styles/qgtkstyle_p.h1
-rw-r--r--src/gui/styles/qs60style.cpp2
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp2
4 files changed, 19 insertions, 10 deletions
diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
index 4ed0fab..fdbe1f8 100644
--- a/src/gui/styles/qgtkstyle_p.cpp
+++ b/src/gui/styles/qgtkstyle_p.cpp
@@ -524,7 +524,9 @@ void QGtkStylePrivate::initGtkWidgets() const
QGtkStylePrivate::gtk_widget_realize(gtkWindow);
if (displayDepth == -1)
displayDepth = QGtkStylePrivate::gdk_drawable_get_depth(gtkWindow->window);
- gtkWidgetMap()->insert(QHashableLatin1Literal::fromData(strdup("GtkWindow")), gtkWindow);
+ QHashableLatin1Literal widgetPath = QHashableLatin1Literal::fromData(strdup("GtkWindow"));
+ removeWidgetFromMap(widgetPath);
+ gtkWidgetMap()->insert(widgetPath, gtkWindow);
// Make all other widgets. respect the text direction
@@ -576,6 +578,7 @@ void QGtkStylePrivate::initGtkWidgets() const
if (!strchr(it.key().data(), '.')) {
addAllSubWidgets(it.value());
}
+ free(const_cast<char *>(it.key().data()));
}
}
} else {
@@ -743,19 +746,24 @@ void QGtkStylePrivate::setupGtkWidget(GtkWidget* widget)
}
}
+void QGtkStylePrivate::removeWidgetFromMap(const QHashableLatin1Literal &path)
+{
+ WidgetMap *map = gtkWidgetMap();
+ WidgetMap::iterator it = map->find(path);
+ if (it != map->end()) {
+ free(const_cast<char *>(it.key().data()));
+ map->erase(it);
+ }
+}
+
void QGtkStylePrivate::addWidgetToMap(GtkWidget *widget)
{
if (Q_GTK_IS_WIDGET(widget)) {
gtk_widget_realize(widget);
QHashableLatin1Literal widgetPath = classPath(widget);
- WidgetMap *map = gtkWidgetMap();
- WidgetMap::iterator it = map->find(widgetPath);
- if (it != map->end()) {
- free(const_cast<char *>(it.key().data()));
- map->erase(it);
- }
- map->insert(widgetPath, widget);
+ removeWidgetFromMap(widgetPath);
+ gtkWidgetMap()->insert(widgetPath, widget);
#ifdef DUMP_GTK_WIDGET_TREE
qWarning("Inserted Gtk Widget: %s", widgetPath.data());
#endif
diff --git a/src/gui/styles/qgtkstyle_p.h b/src/gui/styles/qgtkstyle_p.h
index 68a04e9..4e1d07a 100644
--- a/src/gui/styles/qgtkstyle_p.h
+++ b/src/gui/styles/qgtkstyle_p.h
@@ -502,6 +502,7 @@ protected:
static void addWidgetToMap(GtkWidget* widget);
static void addAllSubWidgets(GtkWidget *widget, gpointer v = 0);
static void addWidget(GtkWidget *widget);
+ static void removeWidgetFromMap(const QHashableLatin1Literal &path);
virtual void init();
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index bafc5f3..3a01f3f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2001,7 +2001,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_ShapedFrame:
if (const QTextEdit *textEdit = qobject_cast<const QTextEdit *>(widget)) {
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option);
- if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget))
+ if (frame && QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget))
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags);
else
QCommonStyle::drawControl(element, option, painter, widget);
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index d36011c..a5e9c19 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -2154,7 +2154,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
p->setPen(menuitem->palette.text().color());
p->setBrush(Qt::NoBrush);
if (checked)
- p->drawRect(vIconRect.adjusted(-1, -2, 1, 1));
+ p->drawRect(vIconRect.adjusted(-1, -1, 0, 0));
p->drawPixmap(vIconRect.topLeft(), pixmap);
// draw checkmark -------------------------------------------------