2022-08-26 18:31:27 +08:00
|
|
|
#pragma once
|
|
|
|
#include <QApplication>
|
|
|
|
#include "jkqtplotter/jkqtplotter.h"
|
2022-08-27 03:23:19 +08:00
|
|
|
#include "jkqtpappsettingcontroller.h"
|
2022-08-26 18:31:27 +08:00
|
|
|
#include <QDir>
|
2022-09-26 08:07:07 +08:00
|
|
|
#include <functional>
|
2022-08-26 18:31:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class JKQTPExampleApplication: public QApplication {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-08-29 04:48:14 +08:00
|
|
|
JKQTPExampleApplication(int &argc, char **argv, bool waitForScreenshotReady=false);
|
2022-08-26 18:31:27 +08:00
|
|
|
|
|
|
|
virtual ~JKQTPExampleApplication();
|
2022-09-26 08:07:07 +08:00
|
|
|
void addExportStepFunctor(const std::function<void(void)>& f);
|
2022-08-26 18:31:27 +08:00
|
|
|
int exec();
|
2023-07-22 20:26:02 +08:00
|
|
|
public Q_SLOTS:
|
2022-08-29 04:48:14 +08:00
|
|
|
void notifyReadyForScreenshot();
|
2022-08-26 18:31:27 +08:00
|
|
|
protected:
|
2022-08-29 04:48:14 +08:00
|
|
|
bool waitForScreenshotReady;
|
|
|
|
bool readyForScreenshot;
|
2022-08-26 18:31:27 +08:00
|
|
|
QDir screenshotDir;
|
|
|
|
bool saveScreenshot;
|
|
|
|
bool saveSmallScreenshot;
|
|
|
|
bool saveScreenshotPlot;
|
|
|
|
bool saveSmallScreenshotPlot;
|
2022-08-27 03:23:19 +08:00
|
|
|
bool scaleDownFromHighDPI;
|
2022-09-26 08:07:07 +08:00
|
|
|
bool iterateFunctorSteps;
|
|
|
|
bool iterateFunctorStepsSupressInitial;
|
2022-08-27 03:23:19 +08:00
|
|
|
QStringList screenshotBasename;
|
2022-09-26 08:07:07 +08:00
|
|
|
QVector<std::function<void(void)>> functors;
|
2022-08-26 18:31:27 +08:00
|
|
|
void readCmdLine();
|
|
|
|
QRect getBoundsWithoutColor(QImage qImage, const QColor &exclusionColor = Qt::white);
|
|
|
|
};
|