[Qt-interest] Optionally deriving from QWidget
David Doria
daviddoria at gmail.com
Sun Sep 18 14:50:26 CEST 2011
On Fri, Sep 16, 2011 at 2:48 AM, Jonathan Greig <redteam316 at gmail.com>wrote:
> Alex approach of two classes is the best solution.
>
> - Swyped from my droid.
>
> On Sep 16, 2011 12:56 AM, "Andre Somers" <andre at familiesomers.nl> wrote:
>
> Op 15-9-2011 23:32, David Doria schreef:
>
> > I have a class that emits Qt signals. I want to use this class in two
> > ways:
> >
> > 1) Interactive ...
> I would choose a different approach:
>
> 1) Create a static library that contains all the business logic. This
> will be the heart of the application, but does not contain UI.
> 2) Create a thin application that uses this lib, and that provides the
> commandline version of the interface.
> 3) Create a simple GUI application that also uses the same lib, and that
> only provides the interactive UI.
>
> I think that would be a much clearer code structure. It will saves you
> lots of hard to read #ifdefs.
>
> André
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
Thanks for the input all. I agree that the preprocessor definitions are
annoying. I refactored to make the computation class into a real "Model"
that doesn't know anything about the View.
Thanks again,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110918/be3f0427/attachment.html
More information about the Qt-interest-old
mailing list