Commit 0d23c4b9 authored by Laurent Montel's avatar Laurent Montel 😁

Return pagelayout

parent 8e1dfe01
......@@ -18,6 +18,7 @@
#include "printwebengineviewjobtest.h"
#include "../printwebengineviewjob.h"
#include <QTest>
#include <QPageLayout>
PrintWebEngineViewJobTest::PrintWebEngineViewJobTest(QObject *parent)
: QObject(parent)
......@@ -34,6 +35,7 @@ void PrintWebEngineViewJobTest::shouldHaveDefaultValue()
{
WebEngineViewer::PrintWebEngineViewJob job;
QVERIFY(!job.engineView());
QVERIFY(!job.pageLayout().isValid());
}
QTEST_MAIN(PrintWebEngineViewJobTest)
......@@ -46,3 +46,8 @@ PrintConfigureDialog::~PrintConfigureDialog()
{
}
QPageLayout PrintConfigureDialog::currentPageLayout() const
{
return mConfigureWidget->currentPageLayout();
}
......@@ -19,6 +19,8 @@
#define PRINTCONFIGUREDIALOG_H
#include <QDialog>
#include <QPageLayout>
namespace WebEngineViewer
{
class PrintConfigureWidget;
......@@ -28,6 +30,7 @@ class PrintConfigureDialog : public QDialog
public:
explicit PrintConfigureDialog(QWidget *parent = Q_NULLPTR);
~PrintConfigureDialog();
QPageLayout currentPageLayout() const;
private:
PrintConfigureWidget *mConfigureWidget;
};
......
......@@ -73,6 +73,11 @@ void PrintWebEngineViewJob::slotHandlePdfPrinted(const QByteArray &result)
//TODO
}
QPageLayout PrintWebEngineViewJob::pageLayout() const
{
return mPageLayout;
}
QWebEngineView *PrintWebEngineViewJob::engineView() const
{
return mEngineView;
......@@ -82,3 +87,8 @@ void PrintWebEngineViewJob::setEngineView(QWebEngineView *engineView)
{
mEngineView = engineView;
}
void PrintWebEngineViewJob::setPageLayout(const QPageLayout &pageLayout)
{
mPageLayout = pageLayout;
}
......@@ -19,6 +19,7 @@
#define PRINTWEBENGINEVIEWJOB_H
#include <QObject>
#include <QPageLayout>
#include <QTemporaryFile>
class QWebEngineView;
......@@ -36,6 +37,11 @@ public:
QWebEngineView *engineView() const;
void setEngineView(QWebEngineView *engineView);
void setPageLayout(const QPageLayout &pageLayout);
QPageLayout pageLayout() const;
Q_SIGNALS:
void failed();
void success();
......@@ -44,6 +50,7 @@ private Q_SLOTS:
void slotHandlePdfPrinted(const QByteArray &result);
private:
QPageLayout mPageLayout;
QTemporaryFile mTemporaryFile;
QWebEngineView *mEngineView;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment