-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Released code for version 5.3.0-beta1.
- Loading branch information
1 parent
3737e0e
commit 5abbeab
Showing
43 changed files
with
1,257 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Project: PiOmxTextures | ||
* Author: Luca Carlon | ||
* Date: 11.29.2015 | ||
* | ||
* Copyright (c) 2015 Luca Carlon. All rights reserved. | ||
* | ||
* This file is part of PiOmxTextures. | ||
* | ||
* PiOmxTextures is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PiOmxTextures 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 PiOmxTextures. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/*------------------------------------------------------------------------------ | ||
| includes | ||
+-----------------------------------------------------------------------------*/ | ||
#include <QApplication> | ||
#include <QQuickView> | ||
#include <QQuickItem> | ||
#include <QtWebEngineWidgets> | ||
|
||
/*------------------------------------------------------------------------------ | ||
| main | ||
+-----------------------------------------------------------------------------*/ | ||
int main(int argc, char* argv[]) | ||
{ | ||
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); | ||
QApplication a(argc, argv); | ||
|
||
QStringList args = a.arguments(); | ||
const bool opengl = !args.contains("--no-opengl"); | ||
args.removeAll("--no-opengl"); | ||
|
||
if (opengl) { | ||
qDebug("QML QtWebEngine..."); | ||
|
||
QQuickView* view = new QQuickView; | ||
view->setSource(QUrl("qrc:/poc_main.qml")); | ||
view->showFullScreen(); | ||
|
||
QObject* o = view->rootObject()->findChild<QObject*>("webEngineView"); | ||
o->setProperty("url", args.at(1)); | ||
} | ||
else { | ||
qDebug("Widget QtWebEngine..."); | ||
|
||
QWebEngineView* view = new QWebEngineView; | ||
view->load(QUrl(args.at(1))); | ||
view->show(); | ||
} | ||
|
||
return a.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
QT += core gui webenginewidgets | ||
|
||
TARGET = piomxtextures_browser_we | ||
TEMPLATE = app | ||
|
||
SOURCES += main.cpp | ||
|
||
DISTFILES += \ | ||
poc_main.qml | ||
|
||
RESOURCES += \ | ||
res.qrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import QtQuick 2.0 | ||
import QtWebEngine 1.2 | ||
|
||
Rectangle { | ||
anchors.fill: parent | ||
color: "red" | ||
|
||
WebEngineView { | ||
objectName: "webEngineView" | ||
anchors.fill: parent | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>poc_main.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* Project: PiOmxTextures | ||
* Author: Luca Carlon | ||
* Date: 11.29.2015 | ||
* | ||
* Copyright (c) 2015 Luca Carlon. All rights reserved. | ||
* | ||
* This file is part of PiOmxTextures. | ||
* | ||
* PiOmxTextures is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PiOmxTextures 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 PiOmxTextures. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/*------------------------------------------------------------------------------ | ||
| includes | ||
+-----------------------------------------------------------------------------*/ | ||
#include <QApplication> | ||
#include <QWebView> | ||
#include <QQuickView> | ||
#include <QQuickItem> | ||
#include <QGraphicsView> | ||
#include <QGraphicsWebView> | ||
#include <QGraphicsScene> | ||
#include <QOpenGLWidget> | ||
#include <QSurfaceFormat> | ||
|
||
/*------------------------------------------------------------------------------ | ||
| main | ||
+-----------------------------------------------------------------------------*/ | ||
int main(int argc, char* argv[]) | ||
{ | ||
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); | ||
QApplication a(argc, argv); | ||
|
||
QStringList args = a.arguments(); | ||
const bool opengl = !args.contains("--no-opengl"); | ||
const bool wk2 = args.contains("--wk2"); | ||
args.removeAll("--no-opengl"); | ||
args.removeAll("--wk2"); | ||
args.removeAll("--wk1"); // Default. | ||
|
||
const QString surl = args.at(1); | ||
|
||
if (!wk2) { | ||
QGraphicsWebView* webItem = new QGraphicsWebView; | ||
QOpenGLWidget* glViewport = new QOpenGLWidget; | ||
|
||
QGraphicsView* view = new QGraphicsView; | ||
|
||
// Set EGL to 24bit color depth. | ||
QSurfaceFormat curSurface = glViewport->format(); | ||
curSurface.setRedBufferSize(8); | ||
curSurface.setGreenBufferSize(8); | ||
curSurface.setBlueBufferSize(8); | ||
curSurface.setAlphaBufferSize(0); | ||
glViewport->setFormat(curSurface); | ||
|
||
view->setRenderHints(QPainter::Antialiasing); | ||
view->setScene(new QGraphicsScene); | ||
if (opengl) | ||
view->setViewport(glViewport); | ||
else | ||
QObject::connect(qApp, SIGNAL(aboutToQuit()), | ||
glViewport, SLOT(deleteLater())); | ||
view->showFullScreen(); | ||
|
||
view->scene()->setBackgroundBrush(QBrush(Qt::red)); | ||
view->scene()->setSceneRect(QRectF(0, 0, 1910, 1070)); | ||
view->scene()->addItem(webItem); | ||
|
||
webItem->setUrl(QUrl(surl)); | ||
webItem->setMinimumSize(1910, 1070); | ||
} | ||
else { | ||
QQuickView* view = new QQuickView; | ||
view->setSource(QUrl("qrc:/main_wk2.qml")); | ||
view->show(); | ||
|
||
QObject* o = view->rootObject(); | ||
o->setProperty("url", args.at(1)); | ||
} | ||
|
||
return a.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import QtQuick 2.0 | ||
import QtWebKit 3.0 | ||
|
||
WebView { | ||
objectName: "webView" | ||
anchors.fill: parent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
QT += core gui webkitwidgets quick | ||
|
||
TARGET = piomxtextures_browser_wk | ||
TEMPLATE = app | ||
|
||
SOURCES += main.cpp | ||
|
||
RESOURCES += \ | ||
res.qrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>main_wk2.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.