[Haskell-cafe] adding state in GUIs (qtHaskell)
mpm at alumni.caltech.edu
Thu Sep 10 17:12:58 EDT 2009
Dan Weston wrote:
> One simple solution is to leave the state in Qt.
> As of Qt 4.2, in C++ you can use
> bool QObject::setProperty(const char * name, const QVariant & value)
> QVariant QObject::property(const char * name) const
> to set and get properties on any QObject (hence any QWidget).
> Since I believe these are (not yet) wrapped in QtHaskell, you can
> instead just create a widget that contains the state and just don't add
> it to a layout. Parent it to a widget and it will quietly disappear when
> its parent dies. If you want it to persist until you say so, don't
> parent it to anything (but then you might as well use Haskell for your
Thanks for the reply, Dan. I don't quite follow---you mean create a widget
in C++? I can't find setProperty/property in qtHaskell. I would like to
keep everything in Haskell, though.
More information about the Haskell-Cafe