QPlastiqueStyle [SOLVED]
-
how can i set it's base style to fusion ?
-
Use the style factory:
@
QStyle *style = new QProxyStyle (QStyleFactory::create("fusion"));
@ -
What project is it you want to port to Qt 5? I did remember a program I ported which had QPlastique. Seeing that Qt 5 didn't support it I simply removed all instances of it. It fixed it a bit, but whether or not it completely work I can't remember.
-
can i post you the code to suggest me any solution ?
-
Sure
-
@class CS57Colour : public QPlastiqueStyle
{
public:
CS57Colour (int Time);
void polish (QPalette &palette);void drawControl ( ControlElement element, const QStyleOption * option,
QPainter * painter, const QWidget * widget = 0 ) const
{
if(element == CE_PushButton)
{
const QStyleOptionButton *b = qstyleoption_cast<const QStyleOptionButton *>(option);QStyleOptionButton *btn = (QStyleOptionButton *)b; if (btn) { if (btn->state & State_HasFocus) { //TRACE("reseted the focus"); btn->state = btn->state ^ State_HasFocus; } } QPlastiqueStyle::drawControl(element, btn, painter, widget);
}
else
{
QPlastiqueStyle::drawControl(element, option, painter, widget);
}
}private:
QPalette m_Pal; // PALETTE USED FOR THIS S-57 TYPE OF CONTROLS
};#endif // S57COLOUR_H@
-
...you should highlight your code by enclosing it in @.. It's quite unreadable
-
done!
[quote author="bruceoutdoors" date="1368455723"]...you should highlight your code by enclosing it in @.. It's quite unreadable[/quote] -
o. Haha... I'm a novice myself see, but @Jens was right. QPlastique is deprecated and replaced by fusion. Have you come across this post: http://qt-project.org/forums/viewthread/25530
If you're asking how to fix the code itself I'm not so sure. If there's anyone know would know it would be @Jens(I'm assuming it's the same Jens that wrote "this":http://blog.qt.digia.com/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/ ... but there's an example called stylesheet you can check out.
-
Hey clouca, I'm just going to take a guess. Try replacing all instances of "QPlastiqueStyle" with "QStyle". If it fails then... well, it's worth a try.
-
Or rather replace all those QPlastiqueStyle with QProxyStyle as I suggested earlier. :)
-
Well clouca you heard the man. I didn't realize I missed that part of Jens post. He practically answered your question right there.
-
I tried these solutions both but not work.. i will send you the error shortly
-
Thanks. It works.. but.. :) the menus have no outline.. how can i select a style from here http://blog.qt.digia.com/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/ like fusion ?