[Interest] Displaying First video frame (android)

2016-03-25 Thread Jason H
I have an app that on OSX, I can play() and pause() back-to-back to get the 
first frame on screen.

On android this doesn't seem  to work, it stays black (black background rect). 
Is there a way I can ensure the first videoframe is presented?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Canvas keeping artifacts

2016-03-25 Thread Jason H


> Sent: Friday, March 25, 2016 at 5:14 AM
> From: "Nikita Krupenko" 
> To: interest@qt-project.org
> Subject: Re: [Interest] Canvas keeping artifacts
>
> 2016-03-24 15:49 GMT+02:00 Jason H :
> > By the way, reset() is not a W3C function, and it's also not in the QML
> > Canvas documentation.
> >
> > I'm wondering how you found it?
> 
> In fact, it is in the doc:
> https://doc.qt.io/qt-5/qml-qtquick-context2d.html#reset-method


Ah, I see what I happened. I read docs for Canvas element, and missed the link 
for "Context2D", which has the info. 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Freetype and color fonts

2016-03-25 Thread Allan Sandfeld Jensen
On Friday 25 March 2016, Illogica Studio wrote:
> bump
> 
> Maybe I'm saying something incredibly stupid here? Please feel free to let
> me know!
> 
I don't think the Qt freetype backend have had color font support added yet. 
Qt itself does have it, since it was implemented for the Cocoa backend, but it 
hasn't been added to the freetype fontengine.

If you want to have a go at it, I would suggest looking in qfontengine_ft.cpp 
and add handling of FT_PIXEL_MODE_BGRA

The basics should be simple enough. But keep in mind you also need to ensure 
the glyph backing store to also use the right format (Format_ARGB). 

`Allan
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Freetype and color fonts

2016-03-25 Thread Robert Buchinger
On Friday, March 25, 2016 1:45:30 PM CET Illogica Studio wrote:
> bump
> 
> Maybe I'm saying something incredibly stupid here? Please feel free to let
> me know!
> 
> 2016-03-22 8:17 GMT+01:00 Illogica Studio :
> > Hi all,
> > 
> > 
> > I've been trying to use Google color emoji font
> > https://www.google.com/get/noto/#emoji-qaae-color with no luck.
> > When I try to load the font using FontLoader I obtain an error:
> > QML FontLoader: Cannot load font:
> > "file:///E:/Qt/FontTest/NotoColorEmoji.ttf"
> > but the font is in place, I can successfully load other fonts in the same
> > folder.
> > According to http://www.freetype.org/ , Freetype is supposed to support
> > Google color fonts since version 2.5 (3 years ago).
> > 
> > What am I missing?
Hi,
What versio of QT are you using?

Can you post the piece of code how you try to add the font to your 
application?


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Freetype and color fonts

2016-03-25 Thread Illogica Studio
bump

Maybe I'm saying something incredibly stupid here? Please feel free to let
me know!

2016-03-22 8:17 GMT+01:00 Illogica Studio :

> Hi all,
>
>
> I've been trying to use Google color emoji font
> https://www.google.com/get/noto/#emoji-qaae-color with no luck.
> When I try to load the font using FontLoader I obtain an error:
> QML FontLoader: Cannot load font:
> "file:///E:/Qt/FontTest/NotoColorEmoji.ttf"
> but the font is in place, I can successfully load other fonts in the same
> folder.
> According to http://www.freetype.org/ , Freetype is supposed to support
> Google color fonts since version 2.5 (3 years ago).
>
> What am I missing?
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Very large QRC file

2016-03-25 Thread André Pönitz
On Wed, Mar 23, 2016 at 09:49:41PM +, Scott Aron Bloom wrote:
> > 
> > CONFIG += resources_big
> 
> 
>  Nice. Since 5.4. Never knew. "Just works". Thanks!
> 
> 
> What does this flag do?

It replaces the creation of a big .cpp with a char[] containing the data
by two passes, first creating a .cpp with an empty array of the final
size and a second pass that patches the .o file to have the proper
contents.

> Is there an equivalent flag for CMake???

I am not aware of such. But you should be able to use the feature
nevertheless by replacing the monolithic rcc build step by 
suitable rcc -pass 1 ... and rcc -pass 2 ... steps, similar to
what mkspecs/features/resources.prf does around line 100.

Andre'
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Structuring of QML app as set of interlinked screens for maximum code reuse

2016-03-25 Thread Nikita Krupenko
2016-03-22 21:13 GMT+02:00 Elvis Stansvik :
> But this will only allow me to redefine properties, and add new child
> items. How would I then be able to define both which content goes in
> the main area (the content Rectangle in the "base" item) and in the
> two navigation bars (topBar and bottomBar Rectangles)?
>
> It seems QML is not really meant to be used this way, and I'd have to
> essentially redefine these things in each of my screens, even if
> they'll all have the same general structure? There's no "template"
> mechanism so to speak?

You can use Page from Qt Quick Controls 2:
http://doc-snapshots.qt.io/qt5-5.6/qml-qt-labs-controls-page.html
It has header and foote properties and can be used as a skeleton of
your pages and you can place this pages into StackView then.
Note however, that Qt Quick Controls 1 and 2 is a different modules.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Qt 3D] Using an orthographic projection

2016-03-25 Thread Adrián Chaves Fernández
2016-03-25 9:32 GMT+01:00 Sean Harmer :
> The camera lens just constructs the view volume. In this case a cuboid
from
> -10 to +10 in x and y but your near plane and far plane values look
strange
> (2.0f and -1.0f). Try setting these to something like 0.01 and 20.0 to
give
> you a viewing volume that is (almost) a cube. This defines the volume of
space
> relative to your camera that will get rendered.

That was it, many thanks!

I had to:
- Switch the nearPlane and farPlane values (2.0f, -1.0f → -1.0f, 2.0f). In
the perspective projection the near plane is the closest to the camera
position and the far planest is the farthest, but it looks like it is the
opposite in the orthographic projection.
- Increase the value of the farPlane to include the camera (2.0f → 6.0f).
In the perspective projection the camera does not need to be inside the
rendering area, but it looks like it does in the orthographic projection.
- Define the aspect ratio through the left/right/bottom/top parameters
(-10.0f, 10.0f, -10.0f, 10.0f → -16.0f, 16.0f, -9.0f, 9.0f). That was easy
to figure out once I was able to see the rendering results.

Result:
cameraEntity->setUpVector(QVector3D(0, 1, 0));
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
cameraEntity->setPosition(QVector3D(0.0f, 0.0f, 5.0f));
// cameraEntity->lens()->setPerspectiveProjection(60.0f, 16.0f /
9.0f, 2.0f, -1.0f);
cameraEntity->lens()->setOrthographicProjection(-16.0f, 16.0f, -9.0f,
9.0f, -1.0f, 6.0f);

PS: Answering to the list this time.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Canvas keeping artifacts

2016-03-25 Thread Nikita Krupenko
2016-03-24 15:49 GMT+02:00 Jason H :
> By the way, reset() is not a W3C function, and it's also not in the QML
> Canvas documentation.
>
> I'm wondering how you found it?

In fact, it is in the doc:
https://doc.qt.io/qt-5/qml-qtquick-context2d.html#reset-method
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Qtwebengine] Inject QWebChannel and/or JQuery into QWebEnginePage

2016-03-25 Thread NoRulez
Thank you very much, now it is working as expected.

Best Regards

> Am 21.03.2016 um 15:48 schrieb Aleksey Yermakov :
> 
> Hi,
> 
> You don't have to inject QWebChannel.js every time if you use 
> QWebEngineScriptCollection in your QWebEngineProfile. Here is a sample code 
> from my project:
> 
> const char s_qWebChannelAdditionalScript[] = "new 
> QWebChannel(qt.webChannelTransport, function(channel) {"
>  "  window.exported_object = 
> channel.objects.exported_object;"
>  "});";
> 
> QWebEngineProfile *WebEngineView::prepareProfile()
> {
> QWebEngineProfile *profile = new QWebEngineProfile("Profile", this);
> 
> ...
> 
> // Preparing qwebchannel.js for injection
> QFile qWebChannelJsFile(":/qtwebchannel/qwebchannel.js");
> 
> if(! qWebChannelJsFile.open(QIODevice::ReadOnly)) {
> MY_ERROR("Failed to load qwebchannel.js with error: " + 
> qWebChannelJsFile.errorString());
> } else {
> QByteArray qWebChannelJs = qWebChannelJsFile.readAll();
> 
> qWebChannelJs.append(QString(s_qWebChannelAdditionalScript));
> 
> QWebEngineScript script;
> 
> script.setSourceCode(qWebChannelJs);
> script.setName("qwebchannel.js");
> script.setWorldId(QWebEngineScript::MainWorld);
> script.setInjectionPoint(QWebEngineScript::DocumentCreation);
> script.setRunsOnSubFrames(false);
> 
> profile->scripts()->insert(script);
> }
> 
> return profile;
> }
> 
> Don't forget to create your QWebEnginePage with this profile instead of 
> default one.
> 
> Cheers,
> Aleksey
> 
>> On Sun, Mar 20, 2016 at 9:30 PM, NoRulez  wrote:
>> Hello,
>> 
>> Did I have to inject QWebChannel and for example JQuery every time before or 
>> after I call setUrl()/load() to QWebEngineView or only once?
>> 
>> Because the jquery event for loading a site is only called once and if 
>> loaded then it has the previous url:
>> 
>> $(window).load(function () {
>> alert('page is loaded');
>> alert(window.location.href);
>> });
>> 
>> Thanks in advance
>> 
>> Best Regards
>> 
>> ___
>> QtWebEngine mailing list
>> qtwebeng...@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qtwebengine
> 
> 
> 
> -- 
> Aleksey Yermakov
> 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [Qt 3D] Using an orthographic projection

2016-03-25 Thread Adrián Chaves Fernández
I am working on a game engine with a top-down view where X represents
North-South, Y represents West-East, and Z is the height (so, Y and Z are
switched, regarding the OpenGL standard).

So far I have been successfully using a perspective projection (with some
help
),
but I would like to switch to an orthographic projection.

However, I have no idea how to do so. This is what I got so far, but it is
not working as I expect:

cameraEntity->setUpVector(QVector3D(0, 1, 0));
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
cameraEntity->setPosition(QVector3D(0.0f, 0.0f, 5.0f));
// cameraEntity->lens()->setPerspectiveProjection(60.0f, 16.0f / 9.0f,
2.0f, -1.0f);
cameraEntity->lens()->setOrthographicProjection(-10.0f, 10.0f, -10.0f,
10.0f, 2.0f, -1.0f);

Is the Y-Z switch the issue here, or is it something else? If the Y-Z
switch is the issue, is there a way to handle it, or do I need to go back
to the OpenGL standard?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest