Commit fcb9207e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add print button

parent 3278c56b
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "../printpreviewpagewidget.h" #include "../printpreviewpagewidget.h"
#include <QTest> #include <QTest>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QPushButton>
PrintPreviewDialogTest::PrintPreviewDialogTest(QObject *parent) PrintPreviewDialogTest::PrintPreviewDialogTest(QObject *parent)
: QObject(parent) : QObject(parent)
...@@ -40,6 +41,9 @@ void PrintPreviewDialogTest::shouldHaveDefaultValue() ...@@ -40,6 +41,9 @@ void PrintPreviewDialogTest::shouldHaveDefaultValue()
QVERIFY(widget); QVERIFY(widget);
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox")); QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox); QVERIFY(buttonBox);
QPushButton *printButton = buttonBox->findChild<QPushButton *>(QStringLiteral("printbutton"));
QVERIFY(printButton);
} }
QTEST_MAIN(PrintPreviewDialogTest) QTEST_MAIN(PrintPreviewDialogTest)
...@@ -39,7 +39,6 @@ PrintConfigureDialog::PrintConfigureDialog(QWidget *parent) ...@@ -39,7 +39,6 @@ PrintConfigureDialog::PrintConfigureDialog(QWidget *parent)
connect(buttonBox, &QDialogButtonBox::accepted, this, &PrintConfigureDialog::accept); connect(buttonBox, &QDialogButtonBox::accepted, this, &PrintConfigureDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &PrintConfigureDialog::reject); connect(buttonBox, &QDialogButtonBox::rejected, this, &PrintConfigureDialog::reject);
} }
PrintConfigureDialog::~PrintConfigureDialog() PrintConfigureDialog::~PrintConfigureDialog()
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <KConfigGroup> #include <KConfigGroup>
#include <KSharedConfig> #include <KSharedConfig>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QPushButton>
using namespace WebEngineViewer; using namespace WebEngineViewer;
...@@ -36,6 +37,9 @@ PrintPreviewDialog::PrintPreviewDialog(QWidget *parent) ...@@ -36,6 +37,9 @@ PrintPreviewDialog::PrintPreviewDialog(QWidget *parent)
mPrintPreviewWidget->setObjectName(QStringLiteral("printpreviewwidget")); mPrintPreviewWidget->setObjectName(QStringLiteral("printpreviewwidget"));
layout->addWidget(mPrintPreviewWidget); layout->addWidget(mPrintPreviewWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QPushButton *printButton = new QPushButton;
printButton->setObjectName(QStringLiteral("printbutton"));
buttonBox->addButton(printButton, QDialogButtonBox::ActionRole);
buttonBox->setObjectName(QStringLiteral("buttonbox")); buttonBox->setObjectName(QStringLiteral("buttonbox"));
layout->addWidget(buttonBox); layout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::rejected, this, &PrintPreviewDialog::reject); connect(buttonBox, &QDialogButtonBox::rejected, this, &PrintPreviewDialog::reject);
......
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