Qt Creator, Symbian - how to package multiple aplications? - qt

Problem background:
I have a Qt/QML Symbian application targeting Qt 4.7.4, that requires a QML Camera component. The current state of Camera component has a serious performance bug, where once initialized, in order to overlay the camera view on the screen, it forces the whole application to "raster" graphics system. Even when the camera element is closed and destroyed the application remains in raster graphics system, and the whole app takes a large performance hit, rendering it almost unusable (scrolling lists, navigating through pages... ). The problem is gone only after the application is closed and restarted again, which is not really helpful.
As it appears this will not be resolved any time soon (it is marked as resolved only for some small subset of devices, which I doubt as I have a fairly high-end symbian device that suffers the same bug), I have to look into alternatives and workarounds.
One plausible workaround idea I have is to create a separate application, one whose only job is to capture the required image, process it and then closes. Currently I can do this by externally calling the native device camera application, but this is not a viable production solution. The main application would then start this second external application and wait for the result.
The question: is this possible with Qt creator? Packaging two different applications, and deploying them with a single deployment unit, such that the user does not have a complicated installation procedure?

I would have liked to solve this problem with QtCreator a few months ago but I failed. I managed to package two different applications into a single sis file by studying the pkg file format and creating a pkg file containing both applications.
It is worth examining the pkg files generated by QMake for each application and studying the pkg file format.
It is possible to get QMake to generate the desired pkg file. See the documentation of variable DEPLOYMENT, especially the part where pkg_postrules is discussed.

You can add your signed SIS file to another package with this line in PKG:
#"sub.sis",(0x20000002)

Related

QTCreator Memcheck performing analysis without letting me run the actual program?

I am attempting to use QTCreator's Memcheck tool to analyze the memory of a QT project, which is a dynamic library. It uses a QT Gui (QMainWindow) to allow the user to select a file, which is then processed, and then eventually returns to the mainwindow.
However, I cannot seem to use Memcheck properly.
When I select "Memcheck" and hit run, it instantly goes to "Analyzing memory" without ever letting the Gui pop up.
This is problematic. How can I get memcheck to work with this program?
I had two main issues:
1: Valgrind does not seem to play nice with QT Gui applications. It generates logs that are thousands of entries long for all the work QT is doing before it even gets to my application.
I had to make a separate, small non-GUI C++ program that would drive instead of the GUI application.
2: When trying to run from the command line, I needed to set an environment variable by using export. This needs to be the same as LD_LIBRARY_PATHS in QT Creator.
So I ran:
export LD_LIBRARY_PATH=X where X was the exact value I copied from LD_LIBRARY_PATHS in the variable from the QT Project.
Note: Running from the command line may have not be neccesary now that it isn't a GUI Application, memcheck might have passed just fine. Haven't tested since.

black screen flicker after starting QT linux application?

I used embedded linux (imx6q) with eglfs.
Framebuffer is drawing black screen while starting Qt application.
Simple application is black for 1sec under. Heavy application is for 4~5sec.
This happens only once when first QT run.
How to prevent qt from drawing to black? I can modify kernel or QT sources.
i am looking for qt and kernel source (related framebuffer blank, switch mode).
but, i have no idea. help me.
I already posted it on the qt forum, but there is no response.
Additional edits>
I think it only happens where using Linux framebuffer.
And it seems that the QT framework takes time to load the first one-time QML modules into the system.
After that, It use cached ones, so I wonder if there is flickr for a very short period of time.
The unavoidable loading time is fine.
But I want to prevent the QT system from erasing the framebuffer in black.

How to determine cause of DirectX 11 driver hang

I am working on a QT application for which I've integrated DirectX 11 into a custom widget. The application renders a scrolling display - a graphical representation of data being read from a file. The user can speed up and slow down the scrolling speed.
For the most part, this is working great. The DirectX 11 rendering is presented to my custom widget just as I'd expect. The problem is that the graphics driver randomly hangs and crashes my program. I say "random" because I have been testing this with the same data file and it never seems to crash at the same point in the file, after a specific amount of time, or at a specific scrolling speed (the faster the scrolling speed, the more work being done by the GPU per frame).
When the application hangs, my screen freezes for a moment, goes black, then returns with a nice message from NVidia that it has recovered from a driver crash. The Debug Output in Visual Studio contains the following:
D3D11: Removing Device.
D3D11 ERROR: ID3D11Device::RemoveDevice:
Device removal has been triggered for the following reason
(DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of
time to execute its commands, or the hardware crashed/hung. As a
result, the TDR (Timeout Detection and Recovery) mechanism has been
triggered. The current Device Context was executing commands when the
hang occurred. The application may want to respawn and fallback to
less aggressive use of the display hardware). [ EXECUTION ERROR #378:
DEVICE_REMOVAL_PROCESS_AT_FAULT]
I have discovered that by simply commenting out the IDXGISwapChain1::Present call, the application will run through the file at blazing speed. Graphics-wise it is still pushing data to the GPU and drawing to render targets, it just never gets displayed to my window.
What I'm hoping for is help with ideas of what types of things cause driver hangs. My shaders are incredibly simple - basically just positioning my vertices using a projection matrix. And considering what I described in the above paragraph, shaders should still be cranking through vertices and pixels even when Present isn't being called, yes?
I was suspicious that this could be a compatibility issue with Qt - I know DirectX isn't officially supported by Qt. So I tried creating a separate window using CreateWindowEx and using that for my swap chain instead of the custom Qt widget. It rendered to that window but also hung the driver just like before.
I was also suspicious of a driver bug in my laptop, so I tried running the application on a beefier desktop PC that regularly runs another DirectX 11 application (non-Qt) without a hitch (worth mentioning that this other application renders similar data in a scrolling display as well, using shaders that are a lot more complex). But my QT application hangs the driver on that PC as well.
Anyone know of a way I can get a more detailed description of what is causing the driver to hang?
Thank you in advance for any help you can offer.
UPDATE: 2013-08-01 17:16 CST
I am currently investigating a possible thread syncing issue that may be the culprit. Will continue tomorrow morning and post if I solve this on my own.
After some testing today, it appears to have been a threading issue. I have run several times today with no graphics crash. So my problem must be fixed, unless I've just been getting lucky with my tests today (or unlucky, rather - if this shows its ugly face again in a day or two).
I was aware that the immediate device context is not thread safe. Rather than using deferred contexts, though, I was using critical sections to sync my threads and coordinate use of the device context. What I did not realize is that it is not safe to call IDXGISwapChain1::Present while another thread is using the device context. Makes sense, but since it is not call directly from the device context itself, I overlooked it. I literally moved my Present() call a few lines up into my critical section block, and it hasn't given me a crash since.

Flash Projector with multiple windows, each with a new flashPlayer instance

Does anyone know of a flash projector 'project' or 'framework' that uses a new flashPlayer for each window?
We've used mProjector, which works well to a point, but I'm very disappointed in the fileIO patterns they use. It is very buggy with regard to reading and writing files.
mdm zinc uses multiple windows, but it is all sits on one flashPlayer 'session'. The same applies for AIR. It is great, but there isn't a way to make each window run on a seperate flashPlayer... extreme number crunching on one window will lock up all other windows.
Thank you in advance. --jeremy
edit - Just to clarify my needs (since I'm adding a little bounty), the app is an ERP application, built on Flex 3.x, and the size and scope of the project == huge.
tl;dr -- I need an exe wrapper (for windows), similar to AIR, that can have multiple windows, running each window on a seperate flashPlayer instance, and when a window is closed, it blows-away that flashPlayer instance / stage / etc.
How about a DotNet application to handle the wrapper? It can spawn windows each with it's own instance of the Flash Player (ActiveX dll) running in it.
I'm Sorry I found this too late to help you, but hopefully this saves someone else some work.
You can use SWF Studio to do this.
What you do is create a stub EXE that takes command line parameters to tell it which SWF to load. The parameter tells the EXE which SWF to load from its internal collection of files added to the SWF studio Files Tab. Whenever you need to open a new "window" you just execute your own EXE again and pass it the name of the SWF to use.
SWF Studio's App.sendData commands allows you to send data between youe various windows with very little effort so your separate applications can easily behave like they are all parts of a single application.

Qt performance when running executable outside of Qt Creator is awful!

I just tried running a program that I've been developing with Qt outside of Qt. I double clicked on the program in /release, resolve all the missing DLLs, and find that my app has awful slow performance compared to when it is launched from within Qt Creator. What might be the reason for this?!
Well, I have never encountered this. Is there any files you are loading in your application which is big enough to make the application load slow? Like reading a big flat file and get the contents out of it. If so, just make sure that the file's contents hasn't changed while you were running through Qt Creator and when you run it outside. It's my guess though. For me, the performances doesn't have much differences in either cases.

Resources