PDA

View Full Version : setMask and setBrush problem using png with shadow



rmagro
1st August 2012, 11:08
Hi all,
I need your help to understand why may code is not able to load correctly a png image with shadow (that you can see attached) whan I try to set it in a QMainWindows with custom shape..

Code follows:



setMask((new QPixmap(":/dike5prova/logoic_big.png"))->mask());
QPalette* palette = new QPalette();
palette->setBrush(QPalette::Window,*(new QBrush(*(new QPixmap(":/dike5prova/logoic_big.png")))));
setPalette(*palette);
setWindowFlags(Qt::FramelessWindowHint);
QWidget *centralWidget = new QWidget(this);


it works well with normal png..
but using that one I'm not able to see the shadow correctly, only a black stripe..

How Can I correct my code ?

Many thanks in advance,
Roberto
8080

high_flyer
6th August 2012, 11:18
Where is the code you posted located in - in which class? is it in a QMainWindow subclass?

rmagro
2nd October 2012, 14:48
it is in the MainWindows..

myExample::myExample()
{

here..

}


class myExample: public QMainWindow
{
Q_OBJECT

public:
myExample();

...

}