Yes, I subclassed QWindowsStyle and drew some of my own controls. I just tried doing it with the built-in styles but it was the same.
Here are some snippets of how I'm using the styles.
//this is main, the only place I can set styles and have it work
int main(int argc, char * argv[])
{
app.setStyle(new MaxStyle());
LightPrimitiveProperties * properties = new LightPrimitiveProperties();
LightPrimitiveDialog light(properties);
light.show();
app.exec();
return 0;
}
//here is part of the main Dialog's constructor, any style here does nothing
this
->setWindowIcon
(QIcon(m_install_directory
+ "/Icons/icon.png"));
this->setStyle(new MaxStyle());
this
->setPalette
(QPalette(QColor(197,
197,
197)));
//match 3DSMax color scheme
//here is the actual widget I need the style on, does nothing ("this" refers to the Dialog)
m_dialog_scrollarea->setStyle(new MaxStyle());
m_dialog_scrollarea->setFixedSize(210, 800);
m_dialog_scrollarea->setWindowFlags(Qt::FramelessWindowHint);
m_dialog_scrollarea->setWidget(this);
//this is main, the only place I can set styles and have it work
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
app.setStyle(new MaxStyle());
LightPrimitiveProperties * properties = new LightPrimitiveProperties();
LightPrimitiveDialog light(properties);
light.show();
app.exec();
return 0;
}
//here is part of the main Dialog's constructor, any style here does nothing
this->setWindowIcon(QIcon(m_install_directory + "/Icons/icon.png"));
this->setStyle(new MaxStyle());
this->setPalette(QPalette(QColor(197, 197, 197))); //match 3DSMax color scheme
//here is the actual widget I need the style on, does nothing ("this" refers to the Dialog)
m_dialog_scrollarea = new QScrollArea();
m_dialog_scrollarea->setStyle(new MaxStyle());
m_dialog_scrollarea->setFixedSize(210, 800);
m_dialog_scrollarea->setWindowFlags(Qt::FramelessWindowHint);
m_dialog_scrollarea->setWidget(this);
To copy to clipboard, switch view to plain text mode
I'd appreciate any help you can give, this is the first time I've customized a style.
Bookmarks