diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-05 22:25:45 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-17 01:26:00 +0000 |
commit | 4cdff7a0ea95a881bba859157e6eb847f6c10dc5 (patch) | |
tree | d6eeffb4d847e1e0c9eee2d26e0713c985d979c4 /src/widgets/styles | |
parent | 4da46bbb9a1b97759f3552c58e1b6d48e290e8ef (diff) |
QtWidgets: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.
Change-Id: Ia0aac2f09e9245339951ffff13c94684f8498f21
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 6 | ||||
-rw-r--r-- | src/widgets/styles/qgtk2painter.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qgtkstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 8589b6b544..1f7a87e23d 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -3707,12 +3707,12 @@ QPixmap QFusionStyle::standardPixmap(StandardPixmap standardPixmap, const QStyle #ifndef QT_NO_IMAGEFORMAT_XPM switch (standardPixmap) { case SP_TitleBarNormalButton: - return QPixmap((const char **)dock_widget_restore_xpm); + return QPixmap(dock_widget_restore_xpm); case SP_TitleBarMinButton: - return QPixmap((const char **)workspace_minimize); + return QPixmap(workspace_minimize); case SP_TitleBarCloseButton: case SP_DockWidgetCloseButton: - return QPixmap((const char **)dock_widget_close_xpm); + return QPixmap(dock_widget_close_xpm); default: break; diff --git a/src/widgets/styles/qgtk2painter.cpp b/src/widgets/styles/qgtk2painter.cpp index 45528cd52c..489d456617 100644 --- a/src/widgets/styles/qgtk2painter.cpp +++ b/src/widgets/styles/qgtk2painter.cpp @@ -234,7 +234,7 @@ void QGtk2Painter::paintBoxGap(GtkWidget *gtkWidget, const gchar* part, shadow, NULL, gtkWidget, - (gchar*)part, + (const gchar*)part, 0, 0, rect.width(), rect.height(), @@ -618,7 +618,7 @@ void QGtk2Painter::paintExtention(GtkWidget *gtkWidget, if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { DRAW_TO_CACHE(QGtk2PainterPrivate::gtk_paint_extension (style, pixmap, state, shadow, NULL, gtkWidget, - (gchar*)part, 0, 0, + (const gchar*)part, 0, 0, rect.width(), rect.height(), gap_pos)); diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp index a585755ddd..348727b328 100644 --- a/src/widgets/styles/qgtkstyle.cpp +++ b/src/widgets/styles/qgtkstyle.cpp @@ -4056,7 +4056,7 @@ QPixmap QGtkStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, switch (sp) { case SP_TitleBarNormalButton: { - QImage restoreButton((const char **)dock_widget_restore_xpm); + QImage restoreButton(dock_widget_restore_xpm); QColor alphaCorner = restoreButton.color(2); alphaCorner.setAlpha(80); restoreButton.setColor(2, alphaCorner.rgba()); @@ -4069,7 +4069,7 @@ QPixmap QGtkStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, case SP_TitleBarCloseButton: // Fall through case SP_DockWidgetCloseButton: { - QImage closeButton((const char **)dock_widget_close_xpm); + QImage closeButton(dock_widget_close_xpm); QColor alphaCorner = closeButton.color(2); alphaCorner.setAlpha(80); closeButton.setColor(2, alphaCorner.rgba()); diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 014333700a..4993457b32 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -1478,7 +1478,7 @@ public: do { const ushort *uc = (const ushort *)nodeName.constData(); const ushort *e = uc + nodeName.length(); - const uchar *c = (uchar *)metaObject->className(); + const uchar *c = (const uchar *)metaObject->className(); while (*c && uc != e && (*uc == *c || (*c == ':' && *uc == '-'))) { ++uc; ++c; @@ -1579,7 +1579,7 @@ QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const styleSelector.styleSheets += objectSs; StyleSelector::NodePtr n; - n.ptr = (void *)obj; + n.ptr = const_cast<QObject *>(obj); QVector<QCss::StyleRule> rules = styleSelector.styleRulesForNode(n); styleSheetCaches->styleRulesCache.insert(obj, rules); return rules; |