Hi friends/experts,
im using Qt.5.7 and qwt version 6.1.2
i tired to initialize qwt plot by following
pLayout->setCanvasMargin(0);
pLayout->setAlignCanvasToScales (true);
//Canvas setup
m_pCanvas->setLineWidth( 1);
m_pCanvas->setContentsMargins(0,0,0,0);
m_pCanvas
->setPaintAttribute
(QwtPlotCanvas::BackingStore,
false);
m_pCanvas->setAttribute( Qt::WA_OpaquePaintEvent, false );
m_pCanvas->setAutoFillBackground( false);
background.setAlpha(255);
palette.
setColor(QPalette::Window, background
);
setPalette(palette);
setCanvasBackground (background);
setAttribute(Qt::WA_TranslucentBackground);
setCanvas( m_pCanvas );
QwtPlotLayout *pLayout = plotLayout();
pLayout->setCanvasMargin(0);
pLayout->setAlignCanvasToScales (true);
//Canvas setup
m_pCanvas = new QwtPlotCanvas();
m_pCanvas->setFrameStyle( QFrame::Box | QFrame::Plain );
m_pCanvas->setLineWidth( 1);
m_pCanvas->setContentsMargins(0,0,0,0);
m_pCanvas->setPaintAttribute(QwtPlotCanvas::BackingStore, false);
m_pCanvas->setPaintAttribute(QwtPlotCanvas::Opaque, false);
m_pCanvas->setAttribute( Qt::WA_OpaquePaintEvent, false );
m_pCanvas->setAutoFillBackground( false);
QColor background = QColor(QColor(255,255,255));
background.setAlpha(255);
QPalette palette;
palette.setColor(QPalette::Window, background);
setPalette(palette);
setCanvasBackground (background);
setAttribute(Qt::WA_TranslucentBackground);
setCanvas( m_pCanvas );
To copy to clipboard, switch view to plain text mode
but line width or border of canvas is not visible at all.
i tired setting canvas color
as
QPalette p = palette();
p.setColor(QPalette::Window, color);
canvas()->setPalette(p);
canvas()->setAutoFillBackground(true);
but canvas color is not reflecting in the plot.
please help me and suggest me some solution. same was working in qt.4.7
Bookmarks