diff --git a/QtCustomStyleEx/ExCustomStyle.cpp b/QtCustomStyleEx/ExCustomStyle.cpp index adb7498..41163ca 100644 --- a/QtCustomStyleEx/ExCustomStyle.cpp +++ b/QtCustomStyleEx/ExCustomStyle.cpp @@ -6,7 +6,6 @@ ExCustomStyle::ExCustomStyle() { } - //静态static的函数+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void ExCustomStyle::drawPrimitive(const QStyle *style, ExCustomStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) { @@ -56,6 +55,58 @@ inline QRect ExCustomStyle::subElementRect(ExCustomStyle::SubElement subElement, proxy()->subElementRect(static_cast(subElement), option, widget); } +<<<<<<< Updated upstream +//静态static的函数+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +void ExCustomStyle::drawPrimitive(const QStyle *style, ExCustomStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) +{ +// DStyleHelper dstyle(style); + + switch (pe) { +// case value: +// break; + default: + break; + } +} + +void ExCustomStyle::drawControl(const QStyle *style, ExCustomStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) +{ +} + +QRect ExCustomStyle::subElementRect(const QStyle *style, ExCustomStyle::SubElement subElement, const QStyleOption *option, const QWidget *widget) +{ + return QRect(); +} + +QSize ExCustomStyle::sizeFromContents(const QStyle *style, ExCustomStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) +{ + return QSize(); +} + +QIcon ExCustomStyle::standardIcon(const QStyle *style, ExCustomStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) +{ + return QIcon(); +} + +//内联inline的函数+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +//实际上,只需要在实现处添加inline,声明出不需要写inline +inline void ExCustomStyle::drawPrimitive(ExCustomStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const +{ + proxy()->drawPrimitive(static_cast(pe), opt, p, w); +} + +inline void ExCustomStyle::drawControl(ExCustomStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) const +{ + proxy()->drawControl(static_cast(element), opt, p, w); +} + +inline QRect ExCustomStyle::subElementRect(ExCustomStyle::SubElement subElement, const QStyleOption *option, const QWidget *widget) const +{ + proxy()->subElementRect(static_cast(subElement), option, widget); +} + +======= +>>>>>>> Stashed changes inline int ExCustomStyle::pixelMetric(ExCustomStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const { proxy()->pixelMetric(static_cast(metric), option, widget);