Skip to content

Commit

Permalink
chore: update deprecated Qt code (#2065)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomiguelino authored Sep 12, 2024
1 parent 8d74226 commit 3808372
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion webview/ScreenlyWebview.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app

QT += webengine webenginewidgets dbus
QT += webenginecore webenginewidgets dbus
CONFIG += c++11

SOURCES += src/main.cpp \
Expand Down
1 change: 0 additions & 1 deletion webview/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <QApplication>
#include <QDebug>
#include <QtDBus>
#include <QtWebEngine>
#include <QWebEngineView>

#include "mainwindow.h"
Expand Down
7 changes: 2 additions & 5 deletions webview/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@

MainWindow::MainWindow() : QMainWindow()
{
QWebEngineSettings::globalSettings() -> setAttribute(QWebEngineSettings::LocalStorageEnabled, true);

// for QT5.10 and higher
QWebEngineSettings::globalSettings() -> setAttribute(QWebEngineSettings::ShowScrollBars, false);

view = new View(this);
view -> settings() -> setAttribute(QWebEngineSettings::LocalStorageEnabled, false);
view -> settings() -> setAttribute(QWebEngineSettings::ShowScrollBars, false);
setCentralWidget(view);
}

Expand Down
2 changes: 1 addition & 1 deletion webview/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ void View::handleAuthRequest(QNetworkReply* reply, QAuthenticator* auth)
{
Q_UNUSED(reply)
Q_UNUSED(auth)
load(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, "res/access_denied.html")));
load(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::AppDataLocation, "res/access_denied.html")));
}
1 change: 1 addition & 0 deletions webview/src/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <QWebEnginePage>
#include <QWidget>
#include <QEventLoop>
#include <QNetworkReply>

class View : public QWebEngineView
{
Expand Down

0 comments on commit 3808372

Please sign in to comment.