Hi,
i wrote a class PrintPreview to show a preview of of our data.
It could be a Plot or a Report (with more data and the plot).
I modified the QPrintPreviewDialog and add two QCheckBoxes
PreviewPlotReport.png
The QCheckboxes are autoexclusive and with
checkPlot.setChecked( false or true );
checkReport.setChecked( true or false );
checkPlot.setChecked( false or true );
checkReport.setChecked( true or false );
To copy to clipboard, switch view to plain text mode
i can set the initial render style and everthing works fine.
I can see on first exec() either the "Plot" or the "Report".
When i switch between "Plot" and "Report" style using the
QCheckboxes inside the QToolBar during the QPrintPreviewDialog
is executed, it doesn't work.
If i click on "Report" my debug shows:
void PrintPreview
::renderReport(QPrinter*)
void PrintPreview::render(QPrinter*)
void PrintPreview::renderReport(QPrinter*)
To copy to clipboard, switch view to plain text mode
If i click on "Plot" my debug shows:
void PrintPreview
::renderPlot(QPrinter*)
void PrintPreview::render(QPrinter*)
void PrintPreview::renderPlot(QPrinter*)
To copy to clipboard, switch view to plain text mode
Both rendering slots are called, but the preview itself is not updated.
// connection paintReqnested
connect( pPreview,
SIGNAL(paintRequested
(QPrinter*)),
this,
SLOT(render
(QPrinter*)));
void PrintPreview
::render(QPrinter *printer
) {
qDebug() << Q_FUNC_INFO;
if( checkPlot.isChecked() )
renderPlot( printer );
if( checkReport.isChecked() )
renderReport( printer );
}
// connection paintReqnested
connect( pPreview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(render(QPrinter*)));
void PrintPreview::render(QPrinter *printer)
{
qDebug() << Q_FUNC_INFO;
if( checkPlot.isChecked() )
renderPlot( printer );
if( checkReport.isChecked() )
renderReport( printer );
}
To copy to clipboard, switch view to plain text mode
Can anybody help why QPrintPreviewDialog doesn't update preview?
Thx
Bookmarks