Commit 641c266d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add test application for comparing accesskey

parent 9b946cee
...@@ -348,4 +348,9 @@ void MailWebView::openBlockableItemsDialog() ...@@ -348,4 +348,9 @@ void MailWebView::openBlockableItemsDialog()
} }
delete dlg; delete dlg;
} }
void MailWebView::showAccessKeys()
{
mWebViewAccessKey->showAccessKeys();
}
#include "moc_mailwebview.cpp" #include "moc_mailwebview.cpp"
...@@ -69,6 +69,7 @@ public: ...@@ -69,6 +69,7 @@ public:
void saveMainFrameScreenshotInFile(const QString &filename); void saveMainFrameScreenshotInFile(const QString &filename);
void openBlockableItemsDialog(); void openBlockableItemsDialog();
void showAccessKeys();
public Q_SLOTS: public Q_SLOTS:
void slotShowDetails(); void slotShowDetails();
void slotZoomChanged(qreal zoom); void slotZoomChanged(qreal zoom);
......
...@@ -28,7 +28,7 @@ set(webengineaccesskey_test_SRCS ...@@ -28,7 +28,7 @@ set(webengineaccesskey_test_SRCS
add_executable(webengineaccesskeytest ${webengineaccesskey_test_SRCS}) add_executable(webengineaccesskeytest ${webengineaccesskey_test_SRCS})
target_link_libraries(webengineaccesskeytest target_link_libraries(webengineaccesskeytest
Qt5::Widgets KF5::MessageViewer Qt5::WebEngine Qt5::WebEngineWidgets KF5::XmlGui KF5::IconThemes Qt5::Widgets KF5::MessageViewer Qt5::WebEngine Qt5::WebEngineWidgets KF5::XmlGui KF5::IconThemes KF5::WebKit Qt5::WebKitWidgets
) )
#### ####
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
#include "testwebengineaccesskey.h" #include "testwebengineaccesskey.h"
#include "viewer/webengine/mailwebengineaccesskey.h" #include "viewer/webengine/mailwebengineaccesskey.h"
#include "viewer/webengine/mailwebengineview.h" #include "viewer/webengine/mailwebengineview.h"
#include "viewer/webview/mailwebview.h"
#include "viewer/webview/webviewaccesskey.h"
#include "messageviewer/messageviewersettings.h" #include "messageviewer/messageviewersettings.h"
#include <QApplication> #include <QApplication>
#include <QHBoxLayout> #include <QHBoxLayout>
...@@ -36,6 +40,9 @@ TestWidget::TestWidget(QWidget *parent) ...@@ -36,6 +40,9 @@ TestWidget::TestWidget(QWidget *parent)
hbox->setMargin(0); hbox->setMargin(0);
TestWebEngineAccesskey *webEngine = new TestWebEngineAccesskey(this); TestWebEngineAccesskey *webEngine = new TestWebEngineAccesskey(this);
hbox->addWidget(webEngine); hbox->addWidget(webEngine);
TestWebKitAccesskey *webKit = new TestWebKitAccesskey(this);
hbox->addWidget(webKit);
} }
TestWidget::~TestWidget() TestWidget::~TestWidget()
...@@ -50,8 +57,7 @@ TestWebKitAccesskey::TestWebKitAccesskey(QWidget *parent) ...@@ -50,8 +57,7 @@ TestWebKitAccesskey::TestWebKitAccesskey(QWidget *parent)
QLabel *label = new QLabel(QStringLiteral("WebKit")); QLabel *label = new QLabel(QStringLiteral("WebKit"));
vboxLayout->addWidget(label); vboxLayout->addWidget(label);
mTestWebEngine = new MessageViewer::MailWebEngineView(new KActionCollection(this), this); mTestWebEngine = new MessageViewer::MailWebView(new KActionCollection(this), this);
mTestWebEngine->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
vboxLayout->addWidget(mTestWebEngine); vboxLayout->addWidget(mTestWebEngine);
mTestWebEngine->load(QUrl(QStringLiteral("http://www.kde.org"))); mTestWebEngine->load(QUrl(QStringLiteral("http://www.kde.org")));
QPushButton *searchAccessKey = new QPushButton(QStringLiteral("AccessKey"), this); QPushButton *searchAccessKey = new QPushButton(QStringLiteral("AccessKey"), this);
...@@ -74,6 +80,8 @@ TestWebEngineAccesskey::TestWebEngineAccesskey(QWidget *parent) ...@@ -74,6 +80,8 @@ TestWebEngineAccesskey::TestWebEngineAccesskey(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
QVBoxLayout *vboxLayout = new QVBoxLayout(this); QVBoxLayout *vboxLayout = new QVBoxLayout(this);
QLabel *label = new QLabel(QStringLiteral("WebEngine"));
vboxLayout->addWidget(label);
mTestWebEngine = new MessageViewer::MailWebEngineView(new KActionCollection(this), this); mTestWebEngine = new MessageViewer::MailWebEngineView(new KActionCollection(this), this);
mTestWebEngine->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); mTestWebEngine->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
namespace MessageViewer namespace MessageViewer
{ {
class MailWebEngineView; class MailWebEngineView;
class MailWebView;
} }
class TestWidget : public QWidget class TestWidget : public QWidget
...@@ -45,7 +46,7 @@ private Q_SLOTS: ...@@ -45,7 +46,7 @@ private Q_SLOTS:
void slotShowAccessKey(); void slotShowAccessKey();
private: private:
MessageViewer::MailWebEngineView *mTestWebEngine; MessageViewer::MailWebView *mTestWebEngine;
}; };
......
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