1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Require Qt 5.7

This commit is contained in:
David Rosca 2016-10-24 20:11:50 +02:00
parent f7835b7ba8
commit cf3fa88942
12 changed files with 10 additions and 61 deletions

View File

@ -16,18 +16,18 @@ General
CONFIG += debug
QupZilla requires Qt (>= 5.6) and QtWebEngine (at least version included in Qt 5.6)
QupZilla requires Qt (>= 5.7) and QtWebEngine (at least version included in Qt 5.7)
Microsoft Windows
----------------------------------------------------------------------------------
You need Microsoft Visual C++ Compiler, Qt Libraries 5.6.0 or higher and openssl
You need Microsoft Visual C++ Compiler, Qt Libraries 5.7.0 or higher and openssl
libraries. in order to build QupZilla.
Linux / Unix
----------------------------------------------------------------------------------
You need to have Qt 5 (>= 5.6) with QtWebEngine.
You need to have Qt 5 (>= 5.7) with QtWebEngine.
Next compulsory requirement is OpenSSL (libcrypto). xcb libraries are also
required unless you specify NO_X11 build option.
@ -46,7 +46,7 @@ MAC OS X
You need to have Xcode from the Apple App Store installed in Applications, [Command Line Tools for the same Xcode version](https://developer.apple.com/),
[Homebrew](http://brew.sh/), and `$ brew install openssl` for openssl.
Next compulsory requirement is Qt 5 (>= 5.6) with QtWebEngine.
Next compulsory requirement is Qt 5 (>= 5.7) with QtWebEngine.
After successful compilation, you need to run macdeploy.sh script to correctly
build the application bundle. You will do it with following command:

View File

@ -6,12 +6,12 @@
#
#-------------------------------------------------
lessThan(QT_VERSION, 5.6) {
error("QupZilla requires at least Qt 5.6!")
lessThan(QT_VERSION, 5.7) {
error("QupZilla requires at least Qt 5.7!")
}
lessThan(QT.webengine.VERSION, 5.6) {
error("QupZilla requires at least QtWebEngine 5.6!")
lessThan(QT.webengine.VERSION, 5.7) {
error("QupZilla requires at least QtWebEngine 5.7!")
}
# Create plugins directory first on Mac / Linux

View File

@ -33,7 +33,7 @@ are using QtWebEngine.
Compiling
----------------------------------------------------------------------------------------
Before you start compiling, make sure that you have installed the Qt (>= 5.6) development libraries
Before you start compiling, make sure that you have installed the Qt (>= 5.7) development libraries
and you have read the [BUILDING.md](https://github.com/QupZilla/qupzilla/blob/master/BUILDING.md) information.
**Linux**

View File

@ -128,7 +128,7 @@ bool QtLocalPeer::isClient()
}
bool res = server->listen(socketName);
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(4,5,0))
#if defined(Q_OS_UNIX)
// ### Workaround
if (!res && server->serverError() == QAbstractSocket::AddressInUseError) {
QFile::remove(QDir::cleanPath(QDir::tempPath()) + QLatin1Char('/') + socketName);

View File

@ -625,7 +625,6 @@ void BrowserWindow::changeEncoding()
void BrowserWindow::printPage()
{
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
QPrintDialog* dialog = new QPrintDialog(this);
dialog->setOptions(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintShowPageSize);
#ifndef Q_OS_WIN
@ -668,7 +667,6 @@ void BrowserWindow::printPage()
}, dialog->printer()->pageLayout());
}
}
#endif
}
void BrowserWindow::bookmarkPage()

View File

@ -81,9 +81,7 @@ void MainMenu::initSuperMenu(QMenu* superMenu) const
superMenu->addAction(m_actions[QSL("File/OpenFile")]);
superMenu->addSeparator();
superMenu->addAction(m_actions[QSL("File/SendLink")]);
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
superMenu->addAction(m_actions[QSL("File/Print")]);
#endif
superMenu->addSeparator();
superMenu->addAction(m_actions[QSL("Edit/SelectAll")]);
superMenu->addAction(m_actions[QSL("Edit/Find")]);
@ -531,13 +529,9 @@ void MainMenu::init()
ADD_ACTION("File/OpenFile", m_menuFile, QIcon::fromTheme(QSL("document-open")), tr("Open &File..."), SLOT(openFile()), "Ctrl+O");
ADD_ACTION("File/CloseWindow", m_menuFile, QIcon::fromTheme(QSL("window-close")), tr("Close Window"), SLOT(closeWindow()), "Ctrl+Shift+W");
m_menuFile->addSeparator();
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
ADD_ACTION("File/SavePageAs", m_menuFile, QIcon::fromTheme(QSL("document-save")), tr("&Save Page As..."), SLOT(savePageAs()), "Ctrl+S");
#endif
ADD_ACTION("File/SendLink", m_menuFile, QIcon::fromTheme(QSL("mail-message-new")), tr("Send Link..."), SLOT(sendLink()), "");
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
ADD_ACTION("File/Print", m_menuFile, QIcon::fromTheme(QSL("document-print")), tr("&Print..."), SLOT(printPage()), "Ctrl+P");
#endif
m_menuFile->addSeparator();
m_menuFile->addAction(m_actions[QSL("Standard/Quit")]);

View File

@ -351,9 +351,7 @@ void TabBar::contextMenuEvent(QContextMenuEvent* event)
}
menu.addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, SLOT(pinTab()));
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
menu.addAction(webTab->isMuted() ? tr("Un&mute Tab") : tr("&Mute Tab"), this, SLOT(muteTab()));
#endif
menu.addSeparator();
menu.addAction(tr("Re&load All Tabs"), m_tabWidget, SLOT(reloadAllTabs()));
menu.addAction(tr("&Bookmark This Tab"), this, SLOT(bookmarkTab()));

View File

@ -139,7 +139,6 @@ void TabIcon::paintEvent(QPaintEvent* event)
void TabIcon::mousePressEvent(QMouseEvent *event)
{
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
qreal x = event->localPos().x();
qreal y = event->localPos().y();
// if audio icon is clicked - we don't propagate mouse press to the tab
@ -147,7 +146,4 @@ void TabIcon::mousePressEvent(QMouseEvent *event)
m_tab->toggleMuted();
else
QWidget::mousePressEvent(event);
#else
QWidget::mousePressEvent(event);
#endif
}

View File

@ -113,12 +113,7 @@ QVariant WebPage::execJavaScript(const QString &scriptSource, quint32 worldId, i
QVariant result;
QTimer::singleShot(timeout, loop.data(), &QEventLoop::quit);
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
runJavaScript(scriptSource, worldId, [loop, &result](const QVariant &res) {
#else
Q_UNUSED(worldId);
runJavaScript(scriptSource, [loop, &result](const QVariant &res) {
#endif
if (loop && loop->isRunning()) {
result = res;
loop->quit();
@ -143,22 +138,12 @@ void WebPage::runJavaScript(const QString &scriptSource, const QWebEngineCallbac
void WebPage::runJavaScript(const QString &scriptSource, quint32 worldId)
{
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
QWebEnginePage::runJavaScript(scriptSource, worldId);
#else
Q_UNUSED(worldId);
QWebEnginePage::runJavaScript(scriptSource);
#endif
}
void WebPage::runJavaScript(const QString &scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback)
{
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
QWebEnginePage::runJavaScript(scriptSource, worldId, resultCallback);
#else
Q_UNUSED(worldId);
QWebEnginePage::runJavaScript(scriptSource, resultCallback);
#endif
}
QPoint WebPage::mapToViewport(const QPoint &pos) const
@ -343,11 +328,7 @@ void WebPage::setupWebChannel()
QWebChannel *channel = new QWebChannel(this);
channel->registerObject(QSL("qz_object"), new ExternalJsObject(this));
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
setWebChannel(channel, SafeJsWorld);
#else
setWebChannel(channel);
#endif
if (old) {
delete old->registeredObjects().value(objectName);

View File

@ -38,12 +38,8 @@ class QUPZILLA_EXPORT WebPage : public QWebEnginePage
Q_OBJECT
public:
enum JsWorld {
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
// SafeJsWorld = QWebEngineScript::ApplicationWorld
SafeJsWorld = QWebEngineScript::MainWorld
#else
SafeJsWorld = QWebEngineScript::MainWorld
#endif
};
explicit WebPage(QObject* parent = 0);

View File

@ -441,9 +441,7 @@ void WebView::copyLinkToClipboard()
void WebView::savePageAs()
{
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
triggerPageAction(QWebEnginePage::SavePage);
#endif
}
void WebView::copyImageToClipboard()
@ -690,9 +688,7 @@ void WebView::createPageContextMenu(QMenu* menu)
menu->addAction(pageAction(QWebEnginePage::Stop));
menu->addSeparator();
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("Book&mark page"), this, SLOT(bookmarkLink()));
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, SLOT(savePageAs()));
#endif
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy page link"), this, SLOT(copyLinkToClipboard()))->setData(url());
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send page link..."), this, SLOT(sendPageByMail()));
menu->addSeparator();

View File

@ -142,9 +142,7 @@ WebTab::WebTab(BrowserWindow* window)
connect(m_webView, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
connect(m_webView, SIGNAL(titleChanged(QString)), this, SLOT(titleChanged(QString)));
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
connect(m_webView->page(), &QWebEnginePage::recentlyAudibleChanged, tabIcon(), &TabIcon::updateAudioIcon);
#endif
}
TabbedWebView* WebTab::webView() const
@ -297,20 +295,12 @@ void WebTab::setPinned(bool state)
bool WebTab::isMuted() const
{
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
return m_webView->page()->isAudioMuted();
#else
return false;
#endif
}
void WebTab::setMuted(bool muted)
{
#if QT_VERSION >= QT_VERSION_CHECK(5,7,0)
m_webView->page()->setAudioMuted(muted);
#else
Q_UNUSED(muted)
#endif
}
void WebTab::toggleMuted()