Added Support for QString slots
Status: Inactive
Brought to you by:
manyoso
From: Marcus <ma...@my...> - 2003-01-17 07:14:09
|
Today I added support for slots that accept a signal QString parameter. Using this type of slot has a couple of tricks because of the way strings are mapped in this version of Qt#: in the places where the C++ member function takes a QString, the C# equivalent uses a string. (The Qt# binding takes care of the conversion.) Qt#'s signal connection code expected to find a slot with the same parameter type(s) as the signal. Suppose that I want to connect a QLineEdit's textchanged signal to a QLabel's setText slot. The QLineEdit actually has a parameter with type QString, but QLabel's SetText takes a *string* parameter. As a consequence, you can only connect to a user-defined slot like public void StringSlot(QString s) For an example, see the attached file qstring-slot.cs, also found in the samples directory in CVS (QTSHARP-0_6_BRANCH). |