babu198649
6th March 2008, 06:33
hi
i want to change color of push button .
the does this in linux but in windows it does not work .
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPushButton b;
b.show();
QPalette palette;
QBrush brushg(QColor(0, 255, 0, 255));//green
palette.setBrush(QPalette::Active, QPalette::Button, brushg);
b.setPalette(palette);
return a.exec();
}
the above program displays a pushbutton in green color in linux, but the same program after compiling in windows and running the color of pushbutton is not green in color.
the same is with the designer. i can change the color of pushbutton using designer in linux but in windows it does not work.
i want to change color of push button .
the does this in linux but in windows it does not work .
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPushButton b;
b.show();
QPalette palette;
QBrush brushg(QColor(0, 255, 0, 255));//green
palette.setBrush(QPalette::Active, QPalette::Button, brushg);
b.setPalette(palette);
return a.exec();
}
the above program displays a pushbutton in green color in linux, but the same program after compiling in windows and running the color of pushbutton is not green in color.
the same is with the designer. i can change the color of pushbutton using designer in linux but in windows it does not work.