Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
PIM Messagelib
Commits
ead4712c
Commit
ead4712c
authored
May 13, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve tests application
parent
27d9d84e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
0 deletions
+121
-0
webengineviewer/src/print/tests/CMakeLists.txt
webengineviewer/src/print/tests/CMakeLists.txt
+21
-0
webengineviewer/src/print/tests/printwebenginetest_gui.cpp
webengineviewer/src/print/tests/printwebenginetest_gui.cpp
+62
-0
webengineviewer/src/print/tests/printwebenginetest_gui.h
webengineviewer/src/print/tests/printwebenginetest_gui.h
+38
-0
No files found.
webengineviewer/src/print/tests/CMakeLists.txt
View file @
ead4712c
...
...
@@ -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
)
webengineviewer/src/print/tests/printwebenginetest_gui.cpp
0 → 100644
View file @
ead4712c
/*
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
;
}
webengineviewer/src/print/tests/printwebenginetest_gui.h
0 → 100644
View file @
ead4712c
/*
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment