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

Add print button

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