forked from qt-creator/qt-creator
Migrate ManhattanStyle to use QProxyStyle
This commit is contained in:
@@ -120,18 +120,10 @@ bool lightColored(const QWidget *widget)
|
|||||||
class ManhattanStylePrivate
|
class ManhattanStylePrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ManhattanStylePrivate(const QString &baseStyleName);
|
explicit ManhattanStylePrivate();
|
||||||
|
|
||||||
~ManhattanStylePrivate()
|
|
||||||
{
|
|
||||||
delete style;
|
|
||||||
style = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QStyle *style;
|
|
||||||
const QImage lineeditImage;
|
const QImage lineeditImage;
|
||||||
const QImage lineeditImage_disabled;
|
const QImage lineeditImage_disabled;
|
||||||
const QPixmap extButtonPixmap;
|
const QPixmap extButtonPixmap;
|
||||||
@@ -139,18 +131,17 @@ public:
|
|||||||
StyleAnimator animator;
|
StyleAnimator animator;
|
||||||
};
|
};
|
||||||
|
|
||||||
ManhattanStylePrivate::ManhattanStylePrivate(const QString &baseStyleName) :
|
ManhattanStylePrivate::ManhattanStylePrivate() :
|
||||||
style(QStyleFactory::create(baseStyleName)),
|
|
||||||
lineeditImage(QLatin1String(":/core/images/inputfield.png")),
|
lineeditImage(QLatin1String(":/core/images/inputfield.png")),
|
||||||
lineeditImage_disabled(QLatin1String(":/core/images/inputfield_disabled.png")),
|
lineeditImage_disabled(QLatin1String(":/core/images/inputfield_disabled.png")),
|
||||||
extButtonPixmap(QLatin1String(":/core/images/extension.png")),
|
extButtonPixmap(QLatin1String(":/core/images/extension.png")),
|
||||||
closeButtonPixmap(QLatin1String(":/core/images/closebutton.png"))
|
closeButtonPixmap(QLatin1String(":/core/images/closebutton.png"))
|
||||||
{
|
{
|
||||||
QTC_ASSERT(style, /**/);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManhattanStyle::ManhattanStyle(const QString &baseStyleName)
|
ManhattanStyle::ManhattanStyle(const QString &baseStyleName)
|
||||||
: QWindowsStyle(), d(new ManhattanStylePrivate(baseStyleName))
|
: QProxyStyle(QStyleFactory::create(baseStyleName)),
|
||||||
|
d(new ManhattanStylePrivate())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,11 +151,6 @@ ManhattanStyle::~ManhattanStyle()
|
|||||||
d = 0;
|
d = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStyle *ManhattanStyle::systemStyle() const
|
|
||||||
{
|
|
||||||
return d->style;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draws a CSS-like border image where the defined borders are not stretched
|
// Draws a CSS-like border image where the defined borders are not stretched
|
||||||
void drawCornerImage(const QImage &img, QPainter *painter, QRect rect,
|
void drawCornerImage(const QImage &img, QPainter *painter, QRect rect,
|
||||||
int left = 0, int top = 0, int right = 0,
|
int left = 0, int top = 0, int right = 0,
|
||||||
@@ -209,25 +195,13 @@ void drawCornerImage(const QImage &img, QPainter *painter, QRect rect,
|
|||||||
|
|
||||||
QPixmap ManhattanStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
|
QPixmap ManhattanStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
|
||||||
{
|
{
|
||||||
QPixmap result;
|
return QProxyStyle::generatedIconPixmap(iconMode, pixmap, opt);
|
||||||
result = d->style->generatedIconPixmap(iconMode, pixmap, opt);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ManhattanStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1,
|
|
||||||
QSizePolicy::ControlType control2,
|
|
||||||
Qt::Orientation orientation,
|
|
||||||
const QStyleOption * option ,
|
|
||||||
const QWidget * widget ) const
|
|
||||||
{
|
|
||||||
return d->style->layoutSpacing(control1, control2, orientation, option, widget);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize ManhattanStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
|
QSize ManhattanStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
|
||||||
const QSize &size, const QWidget *widget) const
|
const QSize &size, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
QSize newSize = d->style->sizeFromContents(type, option, size, widget);
|
QSize newSize = QProxyStyle::sizeFromContents(type, option, size, widget);
|
||||||
|
|
||||||
if (type == CT_Splitter && widget && widget->property("minisplitter").toBool())
|
if (type == CT_Splitter && widget && widget->property("minisplitter").toBool())
|
||||||
return QSize(1, 1);
|
return QSize(1, 1);
|
||||||
@@ -238,31 +212,25 @@ QSize ManhattanStyle::sizeFromContents(ContentsType type, const QStyleOption *op
|
|||||||
|
|
||||||
QRect ManhattanStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
|
QRect ManhattanStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
QRect rect;
|
return QProxyStyle::subElementRect(element, option, widget);
|
||||||
rect = d->style->subElementRect(element, option, widget);
|
|
||||||
return rect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect ManhattanStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option,
|
QRect ManhattanStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option,
|
||||||
SubControl subControl, const QWidget *widget) const
|
SubControl subControl, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
QRect rect;
|
return QProxyStyle::subControlRect(control, option, subControl, widget);
|
||||||
rect = d->style->subControlRect(control, option, subControl, widget);
|
|
||||||
return rect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStyle::SubControl ManhattanStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option,
|
QStyle::SubControl ManhattanStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option,
|
||||||
const QPoint &pos, const QWidget *widget) const
|
const QPoint &pos, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
SubControl result = QStyle::SC_None;
|
return QProxyStyle::hitTestComplexControl(control, option, pos, widget);
|
||||||
result = d->style->hitTestComplexControl(control, option, pos, widget);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ManhattanStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
|
int ManhattanStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
retval = d->style->pixelMetric(metric, option, widget);
|
retval = QProxyStyle::pixelMetric(metric, option, widget);
|
||||||
switch (metric) {
|
switch (metric) {
|
||||||
case PM_SplitterWidth:
|
case PM_SplitterWidth:
|
||||||
if (widget && widget->property("minisplitter").toBool())
|
if (widget && widget->property("minisplitter").toBool())
|
||||||
@@ -299,19 +267,17 @@ int ManhattanStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
|
|||||||
|
|
||||||
QPalette ManhattanStyle::standardPalette() const
|
QPalette ManhattanStyle::standardPalette() const
|
||||||
{
|
{
|
||||||
QPalette result;
|
return QProxyStyle::standardPalette();
|
||||||
result = d->style->standardPalette();
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ManhattanStyle::polish(QApplication *app)
|
void ManhattanStyle::polish(QApplication *app)
|
||||||
{
|
{
|
||||||
d->style->polish(app);
|
return QProxyStyle::polish(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ManhattanStyle::unpolish(QApplication *app)
|
void ManhattanStyle::unpolish(QApplication *app)
|
||||||
{
|
{
|
||||||
d->style->unpolish(app);
|
return QProxyStyle::unpolish(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPalette panelPalette(const QPalette &oldPalette, bool lightColored = false)
|
QPalette panelPalette(const QPalette &oldPalette, bool lightColored = false)
|
||||||
@@ -330,12 +296,12 @@ QPalette panelPalette(const QPalette &oldPalette, bool lightColored = false)
|
|||||||
|
|
||||||
void ManhattanStyle::polish(QWidget *widget)
|
void ManhattanStyle::polish(QWidget *widget)
|
||||||
{
|
{
|
||||||
d->style->polish(widget);
|
QProxyStyle::polish(widget);
|
||||||
|
|
||||||
// OxygenStyle forces a rounded widget mask on toolbars
|
// OxygenStyle forces a rounded widget mask on toolbars
|
||||||
if (d->style->inherits("OxygenStyle")) {
|
if (baseStyle()->inherits("OxygenStyle")) {
|
||||||
if (qobject_cast<QToolBar*>(widget))
|
if (qobject_cast<QToolBar*>(widget))
|
||||||
widget->removeEventFilter(d->style);
|
widget->removeEventFilter(baseStyle());
|
||||||
}
|
}
|
||||||
if (panelWidget(widget)) {
|
if (panelWidget(widget)) {
|
||||||
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
||||||
@@ -362,7 +328,7 @@ void ManhattanStyle::polish(QWidget *widget)
|
|||||||
|
|
||||||
void ManhattanStyle::unpolish(QWidget *widget)
|
void ManhattanStyle::unpolish(QWidget *widget)
|
||||||
{
|
{
|
||||||
d->style->unpolish(widget);
|
QProxyStyle::unpolish(widget);
|
||||||
if (panelWidget(widget)) {
|
if (panelWidget(widget)) {
|
||||||
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, false);
|
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, false);
|
||||||
if (qobject_cast<QTabBar*>(widget))
|
if (qobject_cast<QTabBar*>(widget))
|
||||||
@@ -376,11 +342,10 @@ void ManhattanStyle::unpolish(QWidget *widget)
|
|||||||
|
|
||||||
void ManhattanStyle::polish(QPalette &pal)
|
void ManhattanStyle::polish(QPalette &pal)
|
||||||
{
|
{
|
||||||
d->style->polish(pal);
|
QProxyStyle::polish(pal);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon ManhattanStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option,
|
QIcon ManhattanStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
|
||||||
const QWidget *widget) const
|
|
||||||
{
|
{
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
switch (standardIcon) {
|
switch (standardIcon) {
|
||||||
@@ -388,7 +353,7 @@ QIcon ManhattanStyle::standardIconImplementation(StandardPixmap standardIcon, co
|
|||||||
case QStyle::SP_ToolBarHorizontalExtensionButton:
|
case QStyle::SP_ToolBarHorizontalExtensionButton:
|
||||||
return QIcon(standardPixmap(standardIcon, option, widget));
|
return QIcon(standardPixmap(standardIcon, option, widget));
|
||||||
default:
|
default:
|
||||||
icon = d->style->standardIcon(standardIcon, option, widget);
|
icon = baseStyle()->standardIcon(standardIcon, option, widget);
|
||||||
}
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
@@ -397,7 +362,7 @@ QPixmap ManhattanStyle::standardPixmap(StandardPixmap standardPixmap, const QSty
|
|||||||
const QWidget *widget) const
|
const QWidget *widget) const
|
||||||
{
|
{
|
||||||
if (widget && !panelWidget(widget))
|
if (widget && !panelWidget(widget))
|
||||||
return d->style->standardPixmap(standardPixmap, opt, widget);
|
return QProxyStyle::standardPixmap(standardPixmap, opt, widget);
|
||||||
|
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
switch (standardPixmap) {
|
switch (standardPixmap) {
|
||||||
@@ -408,7 +373,7 @@ QPixmap ManhattanStyle::standardPixmap(StandardPixmap standardPixmap, const QSty
|
|||||||
pixmap = d->closeButtonPixmap;
|
pixmap = d->closeButtonPixmap;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pixmap = d->style->standardPixmap(standardPixmap, opt, widget);
|
pixmap = QProxyStyle::standardPixmap(standardPixmap, opt, widget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return pixmap;
|
return pixmap;
|
||||||
@@ -417,7 +382,7 @@ QPixmap ManhattanStyle::standardPixmap(StandardPixmap standardPixmap, const QSty
|
|||||||
int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget,
|
int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget,
|
||||||
QStyleHintReturn *returnData) const
|
QStyleHintReturn *returnData) const
|
||||||
{
|
{
|
||||||
int ret = d->style->styleHint(hint, option, widget, returnData);
|
int ret = QProxyStyle::styleHint(hint, option, widget, returnData);
|
||||||
switch (hint) {
|
switch (hint) {
|
||||||
// Make project explorer alternate rows all the way
|
// Make project explorer alternate rows all the way
|
||||||
case QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea:
|
case QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea:
|
||||||
@@ -441,7 +406,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
QPainter *painter, const QWidget *widget) const
|
QPainter *painter, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
if (!panelWidget(widget))
|
if (!panelWidget(widget))
|
||||||
return d->style->drawPrimitive(element, option, painter, widget);
|
return QProxyStyle::drawPrimitive(element, option, painter, widget);
|
||||||
|
|
||||||
bool animating = (option->state & State_Animating);
|
bool animating = (option->state & State_Animating);
|
||||||
int state = option->state;
|
int state = option->state;
|
||||||
@@ -499,7 +464,8 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (element) {
|
switch (element) {
|
||||||
case PE_PanelItemViewItem:
|
/*
|
||||||
|
case PE_PanelItemViewItem:
|
||||||
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
|
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
|
||||||
if (vopt->state & State_Selected) {
|
if (vopt->state & State_Selected) {
|
||||||
QLinearGradient gradient;
|
QLinearGradient gradient;
|
||||||
@@ -507,7 +473,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
gradient.setFinalStop(option->rect.bottomRight());
|
gradient.setFinalStop(option->rect.bottomRight());
|
||||||
gradient.setColorAt(0, option->palette.highlight().color().lighter(115));
|
gradient.setColorAt(0, option->palette.highlight().color().lighter(115));
|
||||||
gradient.setColorAt(1, option->palette.highlight().color().darker(135));
|
gradient.setColorAt(1, option->palette.highlight().color().darker(135));
|
||||||
painter->fillRect(option->rect, Qt::blue);
|
painter->fillRect(option->rect, gradient);
|
||||||
} else {
|
} else {
|
||||||
if (vopt->backgroundBrush.style() != Qt::NoBrush) {
|
if (vopt->backgroundBrush.style() != Qt::NoBrush) {
|
||||||
QPointF oldBO = painter->brushOrigin();
|
QPointF oldBO = painter->brushOrigin();
|
||||||
@@ -518,6 +484,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
case PE_PanelLineEdit:
|
case PE_PanelLineEdit:
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
@@ -668,7 +635,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
d->style->drawPrimitive(element, option, painter, widget);
|
QProxyStyle::drawPrimitive(element, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -677,7 +644,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
QPainter *painter, const QWidget *widget) const
|
QPainter *painter, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
if (!panelWidget(widget))
|
if (!panelWidget(widget))
|
||||||
return d->style->drawControl(element, option, painter, widget);
|
return QProxyStyle::drawControl(element, option, painter, widget);
|
||||||
|
|
||||||
switch (element) {
|
switch (element) {
|
||||||
case CE_MenuBarItem:
|
case CE_MenuBarItem:
|
||||||
@@ -765,7 +732,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
||||||
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
||||||
} else {
|
} else {
|
||||||
d->style->drawControl(element, option, painter, widget);
|
QProxyStyle::drawControl(element, option, painter, widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -874,7 +841,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
d->style->drawControl(element, option, painter, widget);
|
QProxyStyle::drawControl(element, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -883,7 +850,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
QPainter *painter, const QWidget *widget) const
|
QPainter *painter, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
if (!panelWidget(widget))
|
if (!panelWidget(widget))
|
||||||
return d->style->drawComplexControl(control, option, painter, widget);
|
return QProxyStyle::drawComplexControl(control, option, painter, widget);
|
||||||
|
|
||||||
QRect rect = option->rect;
|
QRect rect = option->rect;
|
||||||
switch (control) {
|
switch (control) {
|
||||||
@@ -1009,8 +976,8 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
int right = !reverse ? rect.right() : rect.left() + menuButtonWidth;
|
int right = !reverse ? rect.right() : rect.left() + menuButtonWidth;
|
||||||
QRect arrowRect((left + right) / 2 + (reverse ? 6 : -6), rect.center().y() - 3, 9, 9);
|
QRect arrowRect((left + right) / 2 + (reverse ? 6 : -6), rect.center().y() - 3, 9, 9);
|
||||||
if (option->state & State_On)
|
if (option->state & State_On)
|
||||||
arrowRect.translate(d->style->pixelMetric(PM_ButtonShiftHorizontal, option, widget),
|
arrowRect.translate(QProxyStyle::pixelMetric(PM_ButtonShiftHorizontal, option, widget),
|
||||||
d->style->pixelMetric(PM_ButtonShiftVertical, option, widget));
|
QProxyStyle::pixelMetric(PM_ButtonShiftVertical, option, widget));
|
||||||
|
|
||||||
QStyleOption arrowOpt = *option;
|
QStyleOption arrowOpt = *option;
|
||||||
arrowOpt.rect = arrowRect;
|
arrowOpt.rect = arrowRect;
|
||||||
@@ -1029,15 +996,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
d->style->drawComplexControl(control, option, painter, widget);
|
QProxyStyle::drawComplexControl(control, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mac style reimplements this to control the
|
|
||||||
// focus widget among other things
|
|
||||||
bool ManhattanStyle::event(QEvent *e)
|
|
||||||
{
|
|
||||||
Q_ASSERT(d->style);
|
|
||||||
return d->style->event(e);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "core_global.h"
|
#include "core_global.h"
|
||||||
|
|
||||||
#include <QtGui/QWindowsStyle>
|
#include <QtGui/QProxyStyle>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QLinearGradient;
|
class QLinearGradient;
|
||||||
@@ -41,7 +41,7 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
class ManhattanStylePrivate;
|
class ManhattanStylePrivate;
|
||||||
|
|
||||||
class CORE_EXPORT ManhattanStyle : public QWindowsStyle
|
class CORE_EXPORT ManhattanStyle : public QProxyStyle
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -50,8 +50,6 @@ public:
|
|||||||
|
|
||||||
~ManhattanStyle();
|
~ManhattanStyle();
|
||||||
|
|
||||||
QStyle *systemStyle() const;
|
|
||||||
|
|
||||||
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
|
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
|
||||||
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
|
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
|
||||||
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
|
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
|
||||||
@@ -76,17 +74,8 @@ public:
|
|||||||
|
|
||||||
void unpolish(QWidget *widget);
|
void unpolish(QWidget *widget);
|
||||||
void unpolish(QApplication *app);
|
void unpolish(QApplication *app);
|
||||||
|
|
||||||
protected:
|
|
||||||
bool event(QEvent *e);
|
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const;
|
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const;
|
||||||
int layoutSpacingImplementation(QSizePolicy::ControlType control1,
|
|
||||||
QSizePolicy::ControlType control2,
|
|
||||||
Qt::Orientation orientation,
|
|
||||||
const QStyleOption *option = 0,
|
|
||||||
const QWidget *widget = 0) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ManhattanStylePrivate *d;
|
ManhattanStylePrivate *d;
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ bool CommonOptionsPage::matches(const QString &s) const
|
|||||||
static inline bool oxygenStyle()
|
static inline bool oxygenStyle()
|
||||||
{
|
{
|
||||||
if (const ManhattanStyle *ms = qobject_cast<const ManhattanStyle *>(qApp->style()))
|
if (const ManhattanStyle *ms = qobject_cast<const ManhattanStyle *>(qApp->style()))
|
||||||
return !qstrcmp("OxygenStyle", ms->systemStyle()->metaObject()->className());
|
return !qstrcmp("OxygenStyle", ms->baseStyle()->metaObject()->className());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3055,7 +3055,7 @@ void BaseTextEditor::drawFoldingMarker(QPainter *painter, const QPalette &pal,
|
|||||||
Q_UNUSED(hovered)
|
Q_UNUSED(hovered)
|
||||||
QStyle *s = style();
|
QStyle *s = style();
|
||||||
if (ManhattanStyle *ms = qobject_cast<ManhattanStyle*>(s))
|
if (ManhattanStyle *ms = qobject_cast<ManhattanStyle*>(s))
|
||||||
s = ms->systemStyle();
|
s = ms->baseStyle();
|
||||||
|
|
||||||
if (!qstrcmp(s->metaObject()->className(), "OxygenStyle")) {
|
if (!qstrcmp(s->metaObject()->className(), "OxygenStyle")) {
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|||||||
Reference in New Issue
Block a user