I want to use the itemDoubleClicked(QTreeWidgetItem*,int)
signal in a Haskell program I'm writing where I am using qtHaskell for the GUI. To connect a function I have at other places done the following:
dummyWidget <- myQWidget
connectSlot object signal dummyWidget "customSlot()" $ f
Where object
is some QWidget
and signal
is a string representing the signal, e.g. "triggered()"
, and f
is the function I want to be called when the signale is send.
The definition of connectSlot
in the API is:
class Qcs x where
connectSlot :: QObject a -> String -> QObject b -> String -> x -> IO ()
where the instances ofQcs
are:
Qcs ()
Qcs (QObject c -> String -> IO ())
Qcs (QObject c -> Object d -> IO ())
Qcs (QObject c -> Bool -> IO ())
Qcs (QObject c -> Int -> IO ())
Qcs (QObject c -> IO ())
Qcs (QObject c -> OpenGLVersionFlag -> IO ())
The first Arguments passed is supposed to be the QObject
of which I'm using a signal. As you can see, there is no instance where f
, the function to connect to the signal, can have two further arguments to recieve the QWidget
and the integer send by the signal. Is there a way to nevertheless connect that signal to a custom function?