QtHaskell types corresponding to a Qt class
Q
SomeQtClass
have the format
Q
SomeQtClass a
. They are
implemented as shadow types and hence if a parameter in a qtHaskell function
has the type
Q
SomeQtClass a
then any object
can be passed that whose qtHaskell type corresponds to the Qt type
Q
SomeQtClass
or any subclass
thereof. If subclass types are not required for a parameter of a qtHaskell
application function then the type
Q
SomeQtClass ()
should be used.
All qtHaskell types whose corresponding Qt baseclass is
QObject
also have a qtHaskell type
Q
SomeQtClass
Sc
.
This type should only be used when subclassing a qtHaskell type to add custom
slots or signals as in section 2.2. E.g.
type MyQDialog = QWidgetSc (CMyQDialog)
Qt enumerated and flags types have the C++ format
Q
SomeQtClass
::
SomeQtEnumeratedOrFlagsType
.
The corresponding qtHaskell type is usually just
SomeQtEnumeratedOrFlagsType
. In the case where the
same enumerated or flags types name is shared by more than one class, the
qtHaskell type is SomeQtClassSomeQtEnumeratedOrFlagsType
. E.g.
mb <- qMessageBox (eNoIcon::Icon, "", "", fNoButton::QMessageBoxStandardButtons, dialog)
QtHaskell objects can be converted from one type to another without
restriction. For each qtHaskell class type there is a corresponding
function
qCast_
SomeQtClass obj
.
This converts an object obj
of any class type
to type SomeQtClass
with the returned value
having the same internal pointer value as obj
.
This function should be used with caution.