Commit 72445bd3 authored by Laurent Montel's avatar Laurent Montel 😁

improve

parent 30ad6902
......@@ -37,7 +37,7 @@ ecm_add_test(printconfigurewidgettest.cpp ../printconfigurewidget.cpp ${print_a
LINK_LIBRARIES Qt5::Test Qt5::Widgets Qt5::Gui KF5::I18n Qt5::PrintSupport
)
ecm_add_test(printselectpagedialogtest.cpp ../printselectpagedialog.cpp ${print_autotest_SRCS}
ecm_add_test(printselectpagedialogtest.cpp ../printselectpagedialog.cpp ../printselectpagewidget.cpp ${print_autotest_SRCS}
TEST_NAME printselectpagedialogtest
NAME_PREFIX "webengineviewer-print-"
LINK_LIBRARIES Qt5::Test Qt5::Widgets Qt5::Gui KF5::I18n Qt5::PrintSupport
......
......@@ -18,6 +18,7 @@
*/
#include "printselectpagedialog.h"
#include "printselectpagewidget.h"
#include <KLocalizedString>
#include <QVBoxLayout>
......@@ -28,10 +29,25 @@ using namespace WebEngineViewer;
PrintSelectPageDialog::PrintSelectPageDialog(QWidget *parent)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mPrintSelectPage = new PrintSelectPageWidget(this);
mPrintSelectPage->setObjectName(QStringLiteral("printselectpage"));
mainLayout->addWidget(mPrintSelectPage);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
mainLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &PrintSelectPageDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &PrintSelectPageDialog::reject);
}
PrintSelectPageDialog::~PrintSelectPageDialog()
{
}
QList<int> PrintSelectPageDialog::pages() const
{
return mPrintSelectPage->pages();
}
......@@ -24,12 +24,17 @@
namespace WebEngineViewer
{
class PrintSelectPageWidget;
class PrintSelectPageDialog : public QDialog
{
Q_OBJECT
public:
explicit PrintSelectPageDialog(QWidget *parent = Q_NULLPTR);
~PrintSelectPageDialog();
QList<int> pages() const;
private:
PrintSelectPageWidget *mPrintSelectPage;
};
}
......
......@@ -18,15 +18,26 @@
*/
#include "printselectpagewidget.h"
#include <QVBoxLayout>
#include <KLocalizedString>
using namespace WebEngineViewer;
PrintSelectPageWidget::PrintSelectPageWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setMargin(0);
//TODO
}
PrintSelectPageWidget::~PrintSelectPageWidget()
{
}
QList<int> PrintSelectPageWidget::pages() const
{
//TODO
return {};
}
......@@ -29,6 +29,8 @@ class PrintSelectPageWidget : public QWidget
public:
explicit PrintSelectPageWidget(QWidget *parent = Q_NULLPTR);
~PrintSelectPageWidget();
QList<int> pages() const;
};
}
#endif // PRINTSELECTPAGEWIDGET_H
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