Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux system daemon in Qt

Tags:

linux

daemon

qt

I need to write some linux specific system daemon(it will run with root privileges).

I have stereotype, that Qt is all about GUI applications, so daemon that depends on Qt looks strange to me.

On the other side, Qt has nice C++ bindings for DBUS/threads/settings/... - everything i need for my daemon.

Now I am interested, is it okay to write non GUI system tools/daemons with Qt? Are there examples of such tools?

like image 532
nmikhailov Avatar asked Dec 20 '22 09:12

nmikhailov


2 Answers

is it okay to write non GUI system tools/daemons with Qt?

Yes, this is perfectly fine.

There is the QCoreApplication class for non UI applications.

Specific to daemons, you might want to check out Daemonizing a Qt-application.

like image 194
Andreas Fester Avatar answered Dec 28 '22 20:12

Andreas Fester


Since Qt4, Qt library has been splitted in a number of modules.

You could use Qt Core without having even installed Qt Gui or any other graphical thing.

I can think of a fiew command line only examples that use Qt (like qdbus)

like image 24
peoro Avatar answered Dec 28 '22 19:12

peoro