i am developing a very simple application for nokia mobile.my task is to find what are all the process currently running ? after that i have to kill(exit that application i.e camera or musicplayer) that process! i have tried to find some simple method in Qprocess but there is no function to listout the current process. is there any possible way in NokiaQT or i have to use symbianC++????
Qt does not provide an API to do this. You will need to use the appropriate OS API instead. I'm not familiar with Symbian, so I can't tell you what that might be.
Related
I would like to run some shell commands during using the QT Install Framework in order to recover information required to configure the installation itself (e.g listing the network adapter).
Currently IFW seems to allow one to prepare canned shell operations (addOperation, addElevatedOperation) that run only after the installer configuration process.
I would like, instead, to run them during the installation set-up. E.g. running an operation in one of the installer page and retrieve the result.
Something like:
Component.prototype.pageChanged = function (page) {
if (page === QInstaller.ReadyForInstallation) {
component.runOperation(...)
}
};
QT Installation Framework installer provides a way to solve this issue.
You can use installer.performOperation running a ConsumeOutput operation.
ConsumeOutput allows one to run an external process and store the process output into an installer key.
I would like to run an external process and wait on its result in my
installer based on Qt Installer Framework. How can I do that?
This can be resolved either with native API (Windows example) or with Qt QProcess::WaitOnFinish (more universal). So, likely you need to somehow work around the installer's API with C++ code.
Is there a framework to simulate a deterministically pseudorandom series of clicks imposed upon a Qt application - in order to try to trigger any memory leaks, threading errors etc - typical monkey-testing?
Some exotic, monkey use for QTestLib?
Yes, you can use the useful unit test module. Look in particular at the class QTestEventList. Just provide the QWidget you want to test, or the QMainWindow or whatever subclass you want and add the list of events you want to generate. If you want to generate a sequence of points so that you can reproduce in case of failure, use qsrand() and qrand().
The Squish automated GUI testing framework can be used to do monkey clicking in your application. There are a couple of nice things about using Squish for this purpose:
Squish runs on Windows, Mac, Linux and Android
It logs whatever random steps it happens to perform as a script that can be re-run (monkey testing docs)
It has an option to take a screenshot on application crash (screenshot on failure settings docs)
Disadvantages: Squish is not free. Setting up Squish to run your application can be super-irritating, especially if your application requires specific build characteristics of Qt or Python.
i am working on sample applications using QT on Mac and i found out problem with one of its API. I want to run process so i am using following function
QProcess::startDetached();
And i am passing program(location of exe )and argument list as parameter now problem is that if the application is allready running then the this will create another process and runs it where as when i cross cheked with Windows its behavior is different in the sense that it does not start application which is allready running. can anyone help me how to fix the issue??
I think, it depends on the application properties. On window you can open multiple Doc files but cannot open Window Media player in two different (new) window.
So, First try opening a new application while its running. If its success, then it should work with QProcess .
I am about to implement the schduled kind of task, not sure whether should implement in window sevice or window schduler.
The use case is, there will be one executable deployed on the mechine, which is attached to the scanner. For every five minutes, the exe will be reading the scanned files from the specified folder and upload the files to the server.
What would be the best solution for this use case.
Thanks
Use a scheduled task. A windows service would have to be specially written, and this is perfectly suited for a simple job which runs at 5 minute intervals.
You'll find some good comparisons here:
windows service vs scheduled task
Personally, I would use the Windows Service because it is easier to troubleshoot, locate the logs and restart if necessary.
I've developed a Qt application which contains a TCP server and such. I'm now trying to make Ubuntu packages and let the application automatically start on startup.
The application needs to be running even if nobody is logged in, which means a daemon started via a script in /etc/init.d/
I tried simply running the application on start and sending a kill-signal on stop in the init.d script but that means the application runs in the foreground and blocks the init-script.
Forking like in an other question almost seems to work, I get 'unknown error' after trying to start a TCP server. Nevertheless, there should be an easy to way to write a init-script that runs my application in the background on startup on the various Linux distributions.
Could anyone point me in the right direction?
Using Ubuntu 9.10 with Qt 4.5
The best way is probably to use QtService where the work of forking is taken care of for you.
However, if you want to continue to build your own, you should either background the application or run it via start-stop-daemon that comes with OpenRC or a similar utility for your distribution.
Also, make sure that you only link to the QtCore shared library. Although the application might be command line and never pull up the GUI, that doesn't mean that X isn't required in order for the application to run. For example, a set of unit tests:
$ ldd runTests | grep Qt
libQtTest.so.4 => /usr/lib/qt4/libQtTest.so.4 (0x00007fd424de9000)
libQtXml.so.4 => /usr/lib/qt4/libQtXml.so.4 (0x00007fd424baa000)
libQtGui.so.4 => /usr/lib/qt4/libQtGui.so.4 (0x00007fd4240db000)
libQtCore.so.4 => /usr/lib/qt4/libQtCore.so.4 (0x00007fd422644000)
Because QtGui is present, all the X libraries are also brought in, although filtered from the above output.
Is your program a GUI application or does it work without GUI?
Why don't you just background it within the init script using &?
You need to add a symbolic link into any of the rc?.d directories under /etc depending on the default runlevel. Or use the update-rc.d script: first you need to create a script into /etc/init.d that executes the application; second, use the update-rc.d script to add the needed files to start.
You can find information about how to do it by reading update-rc.d manual page:
$man update-rc.d
I think the simplest way is to not have any daemonize logic in your application itself, instead use a helper program to start the app in the background and manage a pid for it.
For example, startproc.
You can take a look at the many scripts already in your /etc/init.d for inspiration. From what I see there, most of standard linux daemons depend on startproc for start, and killproc for stopping.