mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
JKQTPlotter: NEW: Added signals JKQTBasePlotter::beforeExporting()/JKQTBasePlotter::afterExporting() and JKQTBasePlotterJKQTBasePlotter:beforePrinting()/JKQTBasePlotter::afterPrinting() which allow to modify the plot just before and just after an export/print
This commit is contained in:
parent
b7b78814da
commit
16df80c8c7
@ -50,6 +50,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
|
|||||||
<li>NEW: added JKQTPXYGraph::setKeyColumn()/JKQTPXYGraph::getKeyColumn() and JKQTPXYGraph::setValueColumn()/JKQTPXYGraph::getValueColumn() and corresponding functions in other classes. In most graph classes they point to xColumn for key and yColumn for values. These functions are virtual and overwritten in derived classes with horizontally oriented graphs, where they point to yColumn for key and yColumn for value. This way you can write generic code with classes for both orientations.</li>
|
<li>NEW: added JKQTPXYGraph::setKeyColumn()/JKQTPXYGraph::getKeyColumn() and JKQTPXYGraph::setValueColumn()/JKQTPXYGraph::getValueColumn() and corresponding functions in other classes. In most graph classes they point to xColumn for key and yColumn for values. These functions are virtual and overwritten in derived classes with horizontally oriented graphs, where they point to yColumn for key and yColumn for value. This way you can write generic code with classes for both orientations.</li>
|
||||||
<li>NEW: barcharts (derived from JKQTPBarGraphBase) can be configured to use different fill styles above and below the baseline, see JKQTPBarGraphBase::FillMode </li>
|
<li>NEW: barcharts (derived from JKQTPBarGraphBase) can be configured to use different fill styles above and below the baseline, see JKQTPBarGraphBase::FillMode </li>
|
||||||
<li>NEW: added new error indicator styles JKQTPErrorHalfBarsOutwards, JKQTPErrorHalfBarsInwards, JKQTPErrorHalfBarsAbove, JKQTPErrorHalfBarsBelow which are especially useful for barcharts</li>
|
<li>NEW: added new error indicator styles JKQTPErrorHalfBarsOutwards, JKQTPErrorHalfBarsInwards, JKQTPErrorHalfBarsAbove, JKQTPErrorHalfBarsBelow which are especially useful for barcharts</li>
|
||||||
|
<li>NEW: Added signals JKQTBasePlotter::beforeExporting()/JKQTBasePlotter::afterExporting() and JKQTBasePlotterJKQTBasePlotter:beforePrinting()/JKQTBasePlotter::afterPrinting() which allow to modify the plot just before and just after an export/print</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
|
|
||||||
<li>JKQTMathText:<ul>
|
<li>JKQTMathText:<ul>
|
||||||
|
@ -1508,6 +1508,7 @@ void JKQTBasePlotter::print(QPrinter* printer, bool displayPreview) {
|
|||||||
p->setPageOrientation(QPageLayout::Portrait);
|
p->setPageOrientation(QPageLayout::Portrait);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
|
||||||
printpreviewNew(p, false, -1.0, -1.0, displayPreview);
|
printpreviewNew(p, false, -1.0, -1.0, displayPreview);
|
||||||
|
|
||||||
if (delP) delete p;
|
if (delP) delete p;
|
||||||
@ -3646,6 +3647,7 @@ void JKQTBasePlotter::saveAsPDF(const QString& filename, bool displayPreview) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!fn.isEmpty()) {
|
if (!fn.isEmpty()) {
|
||||||
|
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
|
||||||
QPrinter* printer=new QPrinter;
|
QPrinter* printer=new QPrinter;
|
||||||
bool doLandscape=widgetWidth>widgetHeight;
|
bool doLandscape=widgetWidth>widgetHeight;
|
||||||
if (gridPrinting) {
|
if (gridPrinting) {
|
||||||
@ -3746,6 +3748,8 @@ void JKQTBasePlotter::saveImage(const QString& filename, bool displayPreview) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
|
||||||
|
|
||||||
gridPrintingCalc();
|
gridPrintingCalc();
|
||||||
QPaintDevice* paintDevice=jkqtpPaintDeviceAdapters[adapterID]->createPaintdevice(fn, jkqtp_roundTo<int>(gridPrintingSize.width()), jkqtp_roundTo<int>(gridPrintingSize.height()));
|
QPaintDevice* paintDevice=jkqtpPaintDeviceAdapters[adapterID]->createPaintdevice(fn, jkqtp_roundTo<int>(gridPrintingSize.width()), jkqtp_roundTo<int>(gridPrintingSize.height()));
|
||||||
|
|
||||||
@ -3819,7 +3823,7 @@ void JKQTBasePlotter::saveAsPixelImage(const QString& filename, bool displayPrev
|
|||||||
form="XPM";
|
form="XPM";
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
|
||||||
gridPrintingCalc();
|
gridPrintingCalc();
|
||||||
//std::cout<<gridPrintingSize.width()<<", "<<gridPrintingSize.height()<<std::endl;
|
//std::cout<<gridPrintingSize.width()<<", "<<gridPrintingSize.height()<<std::endl;
|
||||||
|
|
||||||
@ -3850,6 +3854,7 @@ void JKQTBasePlotter::saveAsPixelImage(const QString& filename, bool displayPrev
|
|||||||
if (form=="NONE") png.save(fn);
|
if (form=="NONE") png.save(fn);
|
||||||
else png.save(fn, form.toLatin1().data());
|
else png.save(fn, form.toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3863,6 +3868,7 @@ QImage JKQTBasePlotter::grabPixelImage(QSize size, bool showPreview)
|
|||||||
printSizeX_Millimeter=widgetWidth;
|
printSizeX_Millimeter=widgetWidth;
|
||||||
printSizeY_Millimeter=widgetHeight;
|
printSizeY_Millimeter=widgetHeight;
|
||||||
}
|
}
|
||||||
|
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
|
||||||
if (!showPreview||exportpreview(gridPrintingSize, false)) {
|
if (!showPreview||exportpreview(gridPrintingSize, false)) {
|
||||||
|
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
@ -3901,6 +3907,7 @@ void JKQTBasePlotter::copyPixelImage(bool showPreview) {
|
|||||||
printSizeX_Millimeter=gridPrintingSize.width();
|
printSizeX_Millimeter=gridPrintingSize.width();
|
||||||
printSizeY_Millimeter=gridPrintingSize.height();
|
printSizeY_Millimeter=gridPrintingSize.height();
|
||||||
|
|
||||||
|
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
|
||||||
if (!showPreview||exportpreview(gridPrintingSize, false)) {
|
if (!showPreview||exportpreview(gridPrintingSize, false)) {
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
|
|
||||||
@ -4005,6 +4012,7 @@ void JKQTBasePlotter::saveAsSVG(const QString& filename, bool displayPreview) {
|
|||||||
QFile::copy(fn, tempFM);
|
QFile::copy(fn, tempFM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
|
||||||
gridPrintingCalc();
|
gridPrintingCalc();
|
||||||
QSvgGenerator* svg=new QSvgGenerator;
|
QSvgGenerator* svg=new QSvgGenerator;
|
||||||
svg->setResolution(96);
|
svg->setResolution(96);
|
||||||
|
@ -1112,6 +1112,38 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
|
|||||||
/** \brief emitted before the plot scaling has been recalculated */
|
/** \brief emitted before the plot scaling has been recalculated */
|
||||||
void beforePlotScalingRecalculate();
|
void beforePlotScalingRecalculate();
|
||||||
|
|
||||||
|
/** \brief emitted just before exporting the current plot as image, or just before the export preview dialog is shown
|
||||||
|
*
|
||||||
|
* This signal can be used to e.g. modify the plotter settings before an export.
|
||||||
|
*
|
||||||
|
* \see afterExporting(), beforePrinting(), afterPrinting()
|
||||||
|
*/
|
||||||
|
void beforeExporting();
|
||||||
|
|
||||||
|
/** \brief emitted just before exporting the current plot as image, or just before the export preview dialog is shown
|
||||||
|
*
|
||||||
|
* This signal can be used to e.g. modify the plotter settings after an export.
|
||||||
|
*
|
||||||
|
* \see beforeExporting(), beforePrinting(), afterPrinting()
|
||||||
|
*/
|
||||||
|
void afterExporting();
|
||||||
|
|
||||||
|
/** \brief emitted just before Printing the current plot as image, or just before the print preview dialog is shown
|
||||||
|
*
|
||||||
|
* This signal can be used to e.g. modify the plotter settings before a print.
|
||||||
|
*
|
||||||
|
* \see afterPrinting(), beforeExporting(), afterExporting()
|
||||||
|
*/
|
||||||
|
void beforePrinting();
|
||||||
|
|
||||||
|
/** \brief emitted just before Printing the current plot as image, or just before the print preview dialog is shown
|
||||||
|
*
|
||||||
|
* This signal can be used to e.g. modify the plotter settings after a print.
|
||||||
|
*
|
||||||
|
* \see beforePrinting(), beforeExporting(), afterExporting()
|
||||||
|
*/
|
||||||
|
void afterPrinting();
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user