PDA

View Full Version : Background image "bleeds through" other widgets



tfultz33
6th April 2011, 21:38
I finally realized i needed a resource file for the main window form to display a background image. Now the other widgets are all taking on the background image. I tried to set the border of a button to black and the whole button except for the text vanished.

I cant stylize any widgets now. The background image is yellow and black. Every time i add a button it turns yellow.

Heres part of the file:


QPalette palette;
MainWindow->setPalette(palette);
QIcon icon;
icon.addFile(QString::fromUtf8(":/newPrefix/images/window_icon.png"), QSize(), QIcon::Normal, QIcon::Off);
MainWindow->setWindowIcon(icon);
MainWindow->setAutoFillBackground(false);
MainWindow->setStyleSheet(QString::fromUtf8("background-image: url(:/newPrefix/images/500px-Anarcho-capitalist_flag.svg.png); no-repeat;\n"
""));

Im using Qt Designer 4.6.2 on ubuntu lucid