Hi Uwe;
First of all I represent my deep sincere to you for your reply.
I have already tried your suggestion. It seems transparent but when I add another widget behind the plotter, this translucent canvas isn't seem transparent as it should be.
For example, please add following code
pb->setGeometry(100, 100, 100, 50);
pb->lower();
QPushButton *pb = new QPushButton(this);
pb->setGeometry(100, 100, 100, 50);
pb->lower();
To copy to clipboard, switch view to plain text mode
anywhere in MainWindow.cpp's constructor. And after you have run, if you can see widget which will be behind the canvas, that time this problem is related with me and forgive my foolish faults. If you won't see the background widget like me, please help me to solve this problem
I have tried to these steps, and can see background widget, but replot call in each interval doesn't erase the canvas anymore in this way;
Firstly revert the all changes in Oscilascope sample and then add following codes in plot.cpp's constructor.
canvas
()->setPaintAttribute
(QwtPlotCanvas::HackStyledBackground,
false);
canvas
()->setPaintAttribute
(QwtPlotCanvas::ImmediatePaint,
true);
canvas()->setPaintAttribute(QwtPlotCanvas::Opaque, false);
canvas()->setPaintAttribute(QwtPlotCanvas::HackStyledBackground, false);
canvas()->setPaintAttribute(QwtPlotCanvas::ImmediatePaint, true);
To copy to clipboard, switch view to plain text mode
Then change initGradient as you suggested;
c.setAlpha( 0 );
canvas()->setPalette( pal );
canvas()->setAutoFillBackground( true );
QColor c( Qt::gray );
c.setAlpha( 0 );
QPalette pal;
pal.setColor( QPalette::Window, c );
canvas()->setPalette( pal );
canvas()->setAutoFillBackground( true );
To copy to clipboard, switch view to plain text mode
And add background widget which I have mentioned in the beginning of message in mainwindow's constructor again.
Then you can see the background widget which we have added to mainwindow already. But this time canvas refreshing problem occurs.
How can I make my canvas full transparent without kind of these awkward problems?
Thanks in advance Uwe.
İyi Günler
(Have a nice day in Turkish)
Ümit Uzun
Bookmarks