1 Attachment(s)
How to overcome the shade of the label in the background image?
Hi All,
I had attached a picture in which i have set the background and also kept two labels in it.
The Problem i have is the label border is above the background image and looks like a block in front.
I have to hide the border and only the wordings should alone be displayed!!!
Can anyone help me in finding a solution will be highly appreciated!!!
Thanks in advance and Regards, Attachment 7129
Re: How to overcome the shade of the label in the background image?
How did you apply the background?
Re: How to overcome the shade of the label in the background image?
I had done it with UI design and not through codewise.
Re: How to overcome the shade of the label in the background image?
You need to be more specific about what widgets will have the background applied. At the moment you are probably setting a background on the main widget and this cascades to all widgets placed on it.
Code:
#include <QtGui>
#include <QDebug>
Q_OBJECT
public:
central->setObjectName("centralWidget");
// this
central->setStyleSheet("#centralWidget { background: url('gradient.png'); }" );
// not this
// central->setStyleSheet("* { background: url('gradient.png'); }" );
layout->addWidget(label1);
layout->addWidget(label2);
central->setLayout(layout);
setCentralWidget(central);
}
public slots:
private:
};
int main(int argc, char *argv[])
{
MainWindow m;
m.show();
return app.exec();
}
#include "main.moc"