Skip to content

Commit 5abbeab

Browse files
committed
Released code for version 5.3.0-beta1.
1 parent 3737e0e commit 5abbeab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1257
-316
lines changed

PiOmxTextures.pro

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,21 @@ SUBDIRS = \
3131
piomxtextures_app \
3232
piomxtextures_pocplayer \
3333
piomxtextures_samples \
34-
piomxtextures_qmlutils
34+
piomxtextures_qmlutils \
35+
piomxtextures_pocplayer_widget
36+
37+
qtHaveModule(webkit) {
38+
message("Building wk1 sample...")
39+
SUBDIRS += piomxtextures_browser_wk
40+
SUBDIRS += piomxtextures_pocplayer_yt
41+
}
42+
43+
qtHaveModule(webenginewidgets) {
44+
#message("Building we sample based on widgets...")
45+
#SUBDIRS += piomxtextures_browser_we_widget
46+
}
47+
48+
qtHaveModule(webengine) {
49+
message("Building we sample based on QML...")
50+
SUBDIRS += piomxtextures_browser_we
51+
}

piomxtextures_browser_we/main.cpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Project: PiOmxTextures
3+
* Author: Luca Carlon
4+
* Date: 11.29.2015
5+
*
6+
* Copyright (c) 2015 Luca Carlon. All rights reserved.
7+
*
8+
* This file is part of PiOmxTextures.
9+
*
10+
* PiOmxTextures is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 3 of the License, or
13+
* (at your option) any later version.
14+
*
15+
* PiOmxTextures is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with PiOmxTextures. If not, see <http://www.gnu.org/licenses/>.
22+
*/
23+
24+
/*------------------------------------------------------------------------------
25+
| includes
26+
+-----------------------------------------------------------------------------*/
27+
#include <QApplication>
28+
#include <QQuickView>
29+
#include <QQuickItem>
30+
#include <QtWebEngineWidgets>
31+
32+
/*------------------------------------------------------------------------------
33+
| main
34+
+-----------------------------------------------------------------------------*/
35+
int main(int argc, char* argv[])
36+
{
37+
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
38+
QApplication a(argc, argv);
39+
40+
QStringList args = a.arguments();
41+
const bool opengl = !args.contains("--no-opengl");
42+
args.removeAll("--no-opengl");
43+
44+
if (opengl) {
45+
qDebug("QML QtWebEngine...");
46+
47+
QQuickView* view = new QQuickView;
48+
view->setSource(QUrl("qrc:/poc_main.qml"));
49+
view->showFullScreen();
50+
51+
QObject* o = view->rootObject()->findChild<QObject*>("webEngineView");
52+
o->setProperty("url", args.at(1));
53+
}
54+
else {
55+
qDebug("Widget QtWebEngine...");
56+
57+
QWebEngineView* view = new QWebEngineView;
58+
view->load(QUrl(args.at(1)));
59+
view->show();
60+
}
61+
62+
return a.exec();
63+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
QT += core gui webenginewidgets
2+
3+
TARGET = piomxtextures_browser_we
4+
TEMPLATE = app
5+
6+
SOURCES += main.cpp
7+
8+
DISTFILES += \
9+
poc_main.qml
10+
11+
RESOURCES += \
12+
res.qrc
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import QtQuick 2.0
2+
import QtWebEngine 1.2
3+
4+
Rectangle {
5+
anchors.fill: parent
6+
color: "red"
7+
8+
WebEngineView {
9+
objectName: "webEngineView"
10+
anchors.fill: parent
11+
}
12+
}

piomxtextures_browser_we/res.qrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<RCC>
2+
<qresource prefix="/">
3+
<file>poc_main.qml</file>
4+
</qresource>
5+
</RCC>

piomxtextures_browser_wk/main.cpp

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Project: PiOmxTextures
3+
* Author: Luca Carlon
4+
* Date: 11.29.2015
5+
*
6+
* Copyright (c) 2015 Luca Carlon. All rights reserved.
7+
*
8+
* This file is part of PiOmxTextures.
9+
*
10+
* PiOmxTextures is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 3 of the License, or
13+
* (at your option) any later version.
14+
*
15+
* PiOmxTextures is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with PiOmxTextures. If not, see <http://www.gnu.org/licenses/>.
22+
*/
23+
24+
/*------------------------------------------------------------------------------
25+
| includes
26+
+-----------------------------------------------------------------------------*/
27+
#include <QApplication>
28+
#include <QWebView>
29+
#include <QQuickView>
30+
#include <QQuickItem>
31+
#include <QGraphicsView>
32+
#include <QGraphicsWebView>
33+
#include <QGraphicsScene>
34+
#include <QOpenGLWidget>
35+
#include <QSurfaceFormat>
36+
37+
/*------------------------------------------------------------------------------
38+
| main
39+
+-----------------------------------------------------------------------------*/
40+
int main(int argc, char* argv[])
41+
{
42+
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
43+
QApplication a(argc, argv);
44+
45+
QStringList args = a.arguments();
46+
const bool opengl = !args.contains("--no-opengl");
47+
const bool wk2 = args.contains("--wk2");
48+
args.removeAll("--no-opengl");
49+
args.removeAll("--wk2");
50+
args.removeAll("--wk1"); // Default.
51+
52+
const QString surl = args.at(1);
53+
54+
if (!wk2) {
55+
QGraphicsWebView* webItem = new QGraphicsWebView;
56+
QOpenGLWidget* glViewport = new QOpenGLWidget;
57+
58+
QGraphicsView* view = new QGraphicsView;
59+
60+
// Set EGL to 24bit color depth.
61+
QSurfaceFormat curSurface = glViewport->format();
62+
curSurface.setRedBufferSize(8);
63+
curSurface.setGreenBufferSize(8);
64+
curSurface.setBlueBufferSize(8);
65+
curSurface.setAlphaBufferSize(0);
66+
glViewport->setFormat(curSurface);
67+
68+
view->setRenderHints(QPainter::Antialiasing);
69+
view->setScene(new QGraphicsScene);
70+
if (opengl)
71+
view->setViewport(glViewport);
72+
else
73+
QObject::connect(qApp, SIGNAL(aboutToQuit()),
74+
glViewport, SLOT(deleteLater()));
75+
view->showFullScreen();
76+
77+
view->scene()->setBackgroundBrush(QBrush(Qt::red));
78+
view->scene()->setSceneRect(QRectF(0, 0, 1910, 1070));
79+
view->scene()->addItem(webItem);
80+
81+
webItem->setUrl(QUrl(surl));
82+
webItem->setMinimumSize(1910, 1070);
83+
}
84+
else {
85+
QQuickView* view = new QQuickView;
86+
view->setSource(QUrl("qrc:/main_wk2.qml"));
87+
view->show();
88+
89+
QObject* o = view->rootObject();
90+
o->setProperty("url", args.at(1));
91+
}
92+
93+
return a.exec();
94+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import QtQuick 2.0
2+
import QtWebKit 3.0
3+
4+
WebView {
5+
objectName: "webView"
6+
anchors.fill: parent
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
QT += core gui webkitwidgets quick
2+
3+
TARGET = piomxtextures_browser_wk
4+
TEMPLATE = app
5+
6+
SOURCES += main.cpp
7+
8+
RESOURCES += \
9+
res.qrc

piomxtextures_browser_wk/res.qrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<RCC>
2+
<qresource prefix="/">
3+
<file>main_wk2.qml</file>
4+
</qresource>
5+
</RCC>

piomxtextures_lib/piomxtextures_lib.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
TEMPLATE = lib
2525

26-
VERSION = 5.2.0
26+
VERSION = 5.3.0
2727

2828
QT += core core-private gui gui-private opengl quick quick-private
2929
CONFIG += no_private_qt_headers_warning

0 commit comments

Comments
 (0)