Hi All!
I use linux, Qt creator, Qt and qwt lib. I've created 2 QwtPlot objects - plot_1 and plot_3. plot_3 is transparent, because I'm going to add curves on the plot_1 and I have to watch them under the plot_3.
mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow:: MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this)
c1 = new QwtPlotCanvas();
c1->setFrameStyle(QFrame::NoFrame);
c1->setPaintAttribute(QwtPlotCanvas::BackingStore, false);
ui->plot_3->setAutoFillBackground(false);
ui->plot_3->setCanvas(c1);
ui->plot_3->setCanvasBackground(QColor(255,0,0,10));
}
mainwindow.h
#include <QMainWindow>
#include "qwt_plot_canvas.h"
class MainWindow: public QMainWindow
{ Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
QwtPlotCanvas *c1;
private:
Ui::MainWindow *ui;
};
This is a simple code and it is working, the plot_3 is transtarent and I can see the plot_1 under the plot_3.
But there is a very strange effect. I move the main window and transparent of the plot_3 is missed. After several mooving the transparent is dessapeared and the color becomes solid.
Also, something happens with plot_3 and transparent when I change the size of the main window.
Could you please help and explain mee why does this effect happen and how to avoid it?
Bookmarks