qtwebkit qt5 beta webgl - qt

I was trying to run WebGL application on QtWebKit (Qt 5.0 beta Version). I am using eglfs plugin on a mips based platform. I used QtTestBrowser as the test browser.
I ran an webgl site-
./QtTestBrowser -webgl -graphicsbased http://jsbin.com/ulazel
It reported no-webgl support.
I did a bit of debugging and found that in file
qtwebkit/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
it returns as it cannot find glViewport:
QGLWidget* glViewport = qobject_cast<QGLWidget*>(scrollArea->viewport());
if (!glViewport) {
//Returns from here....
return;
}
By enabling “-gl-viewport” I was able to get the glContext in HTML page. But it was not properly displayed. Also since every widget (launcherWindow etc) it was trying to create a “Window” intern calling eglCreateWindow() and resulting in memory issues (Around 12 window was created all full size of 1920×1080. Finally the displayed image is also not proper.
Any one have suggestion? where i am going wrong?

WebGL is functional with additional patches on top of Qt5. You might want to take a look at the patchset for WebGL for eglfs, at the below link.
https://bugreports.qt-project.org/browse/QTBUG-30405
(Note - I have validated this only on ARMv7, but I cannot see a dependency on arch for this patchset)

Related

KDE Taskbar Progress

I am trying to show a progress in the taskbar of the plasma desktop using the KDE Frameworks. In short, it want to do the same thing as dolphin, when it copies files:
I'm kinda stuck, because I don't even know where to get started. The only thing I found that could be useful is KStatusBarJobTracker, but I don't know how to use it. I could not find any tutorials or examples how to do this.
So, after digging around, and thanks to the help of #leinir, I was able to find out the following:
Since Plasma 5.6 KDE supports the Unitiy DBus Launcher-API, which can be used, for example, to show progress
I found a post on AskUbuntu that explains how to use the API with Qt
The real problem is: This only works, if you have a valid desktop file in one of the standard locations! You need to pass the file as parameter of the DBus message to make it work.
Based on this information, I figured out how to use it and created a GitHub repository, that supports cross platform taskbar progress, and uses this API for the linux implementation.
However, here is how to do it anyways. It should work for KDE Plasma and the Unity desktop, maybe more (haven't tried any others):
Create a .desktop file for your application. For test purpose, this can be a "dummy" file, that could look like this:
[Desktop Entry]
Type=Application
Version=1.1
Name=MyApp
Exec=<path_to>/MyApp
Copy that file to ~/.local/share/applications/ (or wherever user specific desktop files go on your system)
In your code, all you need to do is execute the following code, to update the taskbar state:
auto message = QDBusMessage::createSignal(QStringLiteral("/com/example/MyApp"),
QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"));
//you don't always have to specify all parameters, just the ones you want to update
QVariantMap properties;
properties.insert(QStringLiteral("progress-visible"), true);// enable the progress
properties.insert(QStringLiteral("progress"), 0.5);// set the progress value (from 0.0 to 1.0)
properties.insert(QStringLiteral("count-visible"), true);// display the "counter badge"
properties.insert(QStringLiteral("count"), 42);// set the counter value
message << QStringLiteral("application://myapp.desktop") //assuming you named the desktop file "myapp.desktop"
<< properties;
QDBusConnection::sessionBus().send(message);
Compile and run your application. You don't have to start it via the desktop file, at least I did not need to. If you want to be sure your application is "connected" to that desktop file, just set a custom icon for the file. Your application should show that icon in the taskbar.
And thats basically it. Note: The system remembers the last state when restarting the application. Thus, you should reset all those parameters once when starting the application.
Right, so as it turns out you are right, there is not currently a tutorial for this. This reviewboard request, however, shows how it was implemented in KDevelop, and it should be possible for you to work it out through that :) https://git.reviewboard.kde.org/r/127050/
ps: that there is no tutorial now might be a nice way for you to hop in and help out, by writing a small, self contained tutorial for it... something i'm sure would be very much welcomed :)

Qt: Taking screenshot of EGLFS window - pixel-perfect identical result?

We're using EGLFS to run a QML app on an embedded linux device without a X server. So I can't use the usual techniques for getting a screenshot (e.g. using a screenshot utility app). In this question I found the technique of using QQuickView::grabWindow().
My question: Is the result of this function guaranteed to be pixel-perfect identical to what the user sees on the screen? I'm worried that to grab the window contents, Qt might have to rerender the window using a different code path (e.g. render-to-texture), which may cause results to differ.
I'd like a reliable reference included in your answers, too.
As far as I can tell, the screenshot is not going to be identical. Follow the code from QQuickWindow::grabWindow: it ends up calling qt_gl_read_framebuffer, which is always going to read the image out as RGB(A)8. Your actual framebuffer might be different (for instance, it could be RGB565).
(I also seem to remember that one cannot use RGBA reading via glReadPixels out of a RGB565 framebuffer, but I am not 100% sure that's true in all OpenGL versions/variants...)
Depending on your drivers, a workaround could be reading /dev/fb0 contents. Anyhow, please file a bug report if you need this functionality.

qt3d and the oculus sdk

Given qt3d's structure, is it possible to integrate the oculus sdk with a qt3d application?
I have tried but my two main obstacles are:
I cant use the textures from the texture swap chain created by the oculus sdk as a render target attachment
I am not able to call ovr_SubmitFrame at the end of each frame since qt3d doesnt have a signal that would allow me to do so.
Has anyone successfully gotten the oculus sdk to work with qt3d? If so, how did you overcome these issues?
Are there any plans for allowing the integration of VR SDKs (not just oculus') in qt3d in further releases?
You could probably do it with some sort of custom framegraph that encapsulated the stereo rendering functionality and included a custom component that could take the currently rendered content and submitted it to the SDK prior to the swapbuffer call.
Alternatively you could dive into the code that processes the framegraph itself and see how hard it would be to customize it to work against a VR API. I've done significant work with integrating Qt apps with VR, but not specifically with Qt3D.
The frame graph will indeed provide one part of the solution for the stereoscopic rendering setup. There is already an anaglyphic stereo example showing most of what you need that ships with Qt 3D.
To integrate the swap chain of the occulus SDK will require deeper integration. I do not know the details of the Occulus SDK as yet but we can take a look.
From what I can see you should be able to do something analogous to the Scene3D custom Qt Quick 2 item to be able to render to the textures provided by the Occulus SDK and to tell Qt 3D which OpenGL Context to use. See
http://code.qt.io/cgit/qt/qt3d.git/tree/src/quick3d/imports/scene3d?h=5.7
Nicolas, I also do not appreciate you publicly saying that KDAB are not much help. I only received an email from Karsten on Friday which I responded to despite being on vacation saying that we can help but it will be on a best efforts basis since you are not paying and I have a very full workload preparing Qt 3D for release at the end of the month along with Qt 5.7. Today is a public holiday in the UK, as you are aware, yet you are already saying detrimental things about us.
You were also directed to post to the interest#qt-project.org mailing list on the qt-forums as I do not tend to monitor SO or the qt-forums on a regular basis. You could have also emailed us directly or via the development#qt-interest mailing list.
We would be more than happy to set up a support agreement with you.

QT5 QSound does not play all wave files

I am in the midst of migrating our app based on QT4.X to QT5. Phonon support has been removed in QT5, so I have changed my code that plays a wave file to use QSound.
Change is pretty straightforward. I just had to use QSound, which is now located in Multimedia library. Here is the code:
QSound::play("small_wave_file.wav");
For most of my wave files, this works just fine; however, for my wave file(with 44100Hz sample rate) it does not work.
Official QT bug can be found here.
UPDATE: This bug has been fixed in qt 5.1
It turns out that some wave files confuse QSound. Still not sure exactly what causes the issue. When I loaded my wave file in Audacity, and then exported it back to a different wave file without any changes(same sample rate...). QSound played the file just fine.
In MacOSX when I click "Get Info" on the problematic wave file, general wave info record from the wave file was not available; so perhaps QSound was unable to get sample rate information from; and because it did not know which sample rate to expect from the wave file?
The interesting part is that iTunes played the original file just fine, and it had the correct sample rate somehow. Also Phonon used to play the original file as well just fine.
Anyhow, hopefully this helps with some people that had issues with QSound::play() method.
UPDATE: Since QSound::play() was very buggy on the mac, I opted to use the native NSSound to play my wave files from QT application on the mac. Here is the code:
void play_sound( const char* file)
{
NSSound *sound = [[NSSound alloc] initWithContentsOfFile:[NSString stringWithUTF8String:file] byReference:NO];
[sound play];
[sound release];
}
Also note that Qt has several different sound playback APIs. For small file playback with lower latency I found this to be much faster:
http://doc.qt.io/qt-5/qsoundeffect.html#details
Also:
http://doc.qt.io/qt-5/qmediaplayer.html

How do I fix an inconsistent linkage error in flex 3?

I was excited to find out that Adobe released the data visualization for free so I can use the fancy charts and all with my projects even though I don't have Flex Builder Professional. So I installed the new 3.4 sdk along with the data visualizations. Most all of my projects did fine except for one. This particular project uses localizations. Are there any new compiler arguments that I need to include? I current have -source-path=locale/{locale} -allow-source-path-overlap=true. I get the inconsistent linkage error below:
Inconsistant linkage in /Applications/Adobe Flex Builder 3/sdks/3.4.0/frameworks/locale/en_US/datavisualization_rb.swc$locale/en_US/core.properties - 'en_US$core_properties' is marked as extern, but 'en_USGBC$core_properties' is not.
Any help would be appreciated.
Try use -locale en_US

Resources