PDA

View Full Version : about QT style



iGoo
29th May 2006, 11:36
In QT4.1.2

I designe dialog in QT designer,and preview in "plastique style".
It looks beautiful with bright background just like Opera---an Internet Explorer.


But when I Set the style in my source code it look gray,urgly.


on Windows 2k pro.

any one help?
Thanks.
Below is my code snippet:

int main(int argc, char *argv[])
{
QPlastiqueStyle *pque;

pque = new QPlastiqueStyle;
/*
Should I call some member function of QPlastiqueStyle to
change it's default look?
pque->。。。

*/

QApplication::setStyle(pque);
QApplication app(argc, argv);
dlg imageDlg;
imageDlg.show();
//QCDEStyle::
imageDlg.setImg();
return app.exec();
}

evgenM
29th May 2006, 14:33
try:
QApplication app(argc, argv);
app.setStyle(pque);

iGoo
30th May 2006, 03:03
try:
QApplication app(argc, argv);
app.setStyle(pque);


Things goes the same.

jens
30th May 2006, 10:22
It is simply picking up the windows palette from your system.
Here is how you use the palette provided by the style:


QApplication::setPalette(QApplication::style()->standardPalette());

iGoo
31st May 2006, 04:19
Thanks all.

It works in the way jens says,thanks.