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

improve tests application

parent 27d9d84e
......@@ -9,10 +9,31 @@ add_executable(printpreviewdialog_gui ${printpreviewdialog_gui_test_SRCS})
target_link_libraries(printpreviewdialog_gui
Qt5::Widgets
Qt5::Gui
KF5::I18n
KF5::WidgetsAddons
Poppler::Qt5
KF5::ConfigCore
)
#########
set(printwebenginetest_gui_test_SRCS
printwebenginetest_gui.cpp
../printpreviewdialog.cpp
../printpreviewpageviewer.cpp
../printpreviewpagewidget.cpp
)
add_executable(printwebenginetest_gui ${printwebenginetest_gui_test_SRCS})
target_link_libraries(printwebenginetest_gui
Qt5::Widgets
Qt5::Gui
KF5::I18n
KF5::WidgetsAddons
Poppler::Qt5
KF5::ConfigCore
Qt5::PrintSupport
Qt5::WebEngineWidgets
Qt5::WebEngine
)
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "printwebenginetest_gui.h"
#include <QApplication>
#include <QStandardPaths>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QWebEngineView>
PrintWebEngineTest_Gui::PrintWebEngineTest_Gui(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout;
setLayout(mainLayout);
mWebEngine = new QWebEngineView(this);
mainLayout->addWidget(mWebEngine);
QPushButton *printButton = new QPushButton(QStringLiteral("Print"), this);
mainLayout->addWidget(printButton);
connect(printButton, &QPushButton::clicked, this, &PrintWebEngineTest_Gui::slotPrint);
}
PrintWebEngineTest_Gui::~PrintWebEngineTest_Gui()
{
}
void PrintWebEngineTest_Gui::slotPrint()
{
//TODO
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
PrintWebEngineTest_Gui *w = new PrintWebEngineTest_Gui;
w->show();
const int ret = app.exec();
return ret;
}
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PRINTWEBENGINETEST_GUI_H
#define PRINTWEBENGINETEST_GUI_H
#include <QWidget>
class QWebEngineView;
class PrintWebEngineTest_Gui : public QWidget
{
Q_OBJECT
public:
explicit PrintWebEngineTest_Gui(QWidget *parent = Q_NULLPTR);
~PrintWebEngineTest_Gui();
private Q_SLOTS:
void slotPrint();
private:
QWebEngineView *mWebEngine;
};
#endif // PRINTWEBENGINETEST_GUI_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