I second that opinion. Subclassing by functionality is definitely good
for a single app, but if you need to have the two parts running at
different times a daemon app and a GUI app is the way to go.

Another option you could use to interact with your two apps is through
dbus itself, ince you will already be using that kind of code.

- ianaré sévi



2010/5/7 Ram Kurvakat <rkma...@gmx.com>:
> just my 2 pence worth.
>
> you should perhaps try to make 2 different apps for it.
>
> 1 which runs as a daemon and invoked on startup using an upstart script.
>
> and the other a GUI based app , that can interact with your daemon, via
> files, sockets, any which way.
>
> cheers
>
> Ram
>
> ----- Original Message -----
>
> From: Scifi Guy
>
> Sent: 05/07/10 03:26 PM
>
> To: maemo-developers@maemo.org
>
> Subject: Noob question re Qt Application structure
>
> Hi All,
>
> I am developing a Qt4.6 based application that monitors outgoing
> international calls (by connecting to relevant DBUS signals) and routes
> them via a calling card number. I have developed a configuration UI widget
> (QWidget subclass) to enable/disable such routing.
> The problem is that the UI widget code and DBUS slots code are all in the
> same class. If I launch the application, the UI widget is shown.
>
> This is the code in my main.cpp.
>
>
> #include <QtGui/QApplication>
> #include "eventmonitor.h"
> #include <QDebug>
>
> int main(int argc, char *argv[])
> {
>
>     QApplication a(argc, argv);
>     EventMonitor w;
>     w.show();
>     return a.exec();
> }
>
>
> EventMonitor is a QWidget subclass which also has functions to connect to
> DBUS signals. My aim is to separate the functionality into two different
> classes. The class with DBus slots should be running as a daemon which is
> invoked on startup.
> The class with QWidget (config screen) should be invoked when user launches
> the app from the applications menu. Think on the lines of AutoDisconnect.
>
> What is the best way to achieve this? Let me know if you want me to post
> more code.
>
>
> Thanks & Regards,
> Sudheer
> ________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
> Get started.
>
>
>
>
>
> _______________________________________________
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers
>
>
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to