Asynchronous calculation of document text layout

This commit is contained in:
Jakub Melka
2020-01-01 18:23:18 +01:00
parent c832c4ecef
commit e9481fc446
12 changed files with 313 additions and 81 deletions

View File

@ -27,19 +27,25 @@
namespace pdf
{
struct ProgressStartupInfo
{
bool showDialog = false;
QString text;
};
class PDFFORQTLIBSHARED_EXPORT PDFProgress : public QObject
{
Q_OBJECT
public:
explicit PDFProgress(QObject* parent) : QObject(parent) { }
explicit PDFProgress(QObject* parent);
void start(size_t stepCount);
void start(size_t stepCount, ProgressStartupInfo startupInfo);
void step();
void finish();
signals:
void progressStarted();
void progressStarted(ProgressStartupInfo info);
void progressStep(int percentage);
void progressFinished();
@ -49,6 +55,8 @@ private:
std::atomic<int> m_percentage = 0;
};
Q_DECLARE_METATYPE(ProgressStartupInfo)
} // namespace pdf
#endif // PDFPROGRESS_H