[Qt-interest] unix SIGUSR1 signal on QT

Dmitry Erlih derlih at unison.com
Thu Feb 10 11:56:00 CET 2011


I think you can call slot QTimer::singleshot(0, SLOT(yourslot())) or QMetaObject::invokeMethod with Qt::QueuedConnection from unix signal handler.

QMetaObject::invokeMethod is for slot with arguments.

10.02.2011, в 13:44, Bo Thorsen написал(а):

Den 10-02-2011 11:31, Brian McGillion skrev:
http://doc.qt.nokia.com/4.7-snapshot/unix-signals.html

That doesn't really answer the question, but it's good to know.

Gigin, the signals have nothing to do with Qt signals. You have to code
it like you would in any other C or C++ project. Just be aware of the
warning above: Don't call a Qt function or method while you are in the
signal handler.

Bo Thorsen.

Hi,
I am working on ARM based embedded target with linux 2.6.30.4. I am
sending a signal from C code as mentioned :

kill(pidOf("main"),SIGUSR1);
The function pidOf returns the process ID of a process running on the unix
machine. Whenever I execute my above code, it is sendinh signal to the
"main" program and I am getting the printf signal mentioned in the signal
handler of main program. The main.c is given below:void mysignal(int i
){printf("Signal is Called\n");
}void main(){signal(SIGUSR1,mysignal);while(1) sleep(10);return;}


Is it possible that I can receive the same signal
(kill(pidOf("main"),SIGUSR1); ) from a QT application so that any given
slot is called once the signal is received.

Bo Thorsen,
Fionia Software.

--

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk

_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest


________________________________

This message (including attachments) is private and confidential. If you have received this message in error, please notify us and remove it from your system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110210/60517552/attachment.html 


More information about the Qt-interest-old mailing list