121 |
121 |
122 The user can also provide connection information to correspoding content widget of each |
122 The user can also provide connection information to correspoding content widget of each |
123 HbDataFormModelItem using API |
123 HbDataFormModelItem using API |
124 addConnection(HbDataFormModelItem* item, const char* signal, QObject* receiver, const char* slot) |
124 addConnection(HbDataFormModelItem* item, const char* signal, QObject* receiver, const char* slot) |
125 provided in HbDataForm. The connection will be established when the item visualization is created. |
125 provided in HbDataForm. The connection will be established when the item visualization is created. |
|
126 Using addConnection() API user can also connect to hbdialog's signals(for ex: aboutToClose) in case |
|
127 of popup items like radio button list item and multi selection list item. Below code snippet demonstrates |
|
128 the same: |
|
129 |
|
130 \code |
|
131 HbDataFormModelItem *days = model->appendDataFormItem(HbDataFormModelItem::MultiselectionItem, |
|
132 QString("Days"), themeGeneral); |
|
133 QStringList multiItems; |
|
134 multiItems<<"Sunday"<<"Monday"<<"Tuesday"<<"Wednesday"<<"Thursday"<<"Friday"; |
|
135 days->setContentWidgetData(QString("items"), multiItems); |
|
136 QList<QVariant> selected; |
|
137 selected<<2<<3; |
|
138 days->setContentWidgetData(QString("selectedItems"), selected); |
|
139 days->setContentWidgetData(QString("items"), multiItems); |
|
140 form->addConnection(days, SIGNAL(aboutToShow()), this, SLOT(aboutToShow())); |
|
141 form->addConnection(days, SIGNAL(aboutToHide()()), this, SLOT(aboutToHide()())); |
|
142 form->addConnection(days, SIGNAL(aboutToClose()), this, SLOT(aboutToClose())); |
|
143 form->addConnection(days, SIGNAL(finished(HbAction*)), this, SLOT(finished(HbAction*))); |
|
144 |
|
145 \endcode |
|
146 |
126 Similar way |
147 Similar way |
127 removeConnection(HbDataFormModelItem *item, const char* signal, QObject *receiver, const char* slot) |
148 removeConnection(HbDataFormModelItem *item, const char* signal, QObject *receiver, const char* slot) |
128 and removeAllConnection() API can be used. Connection can be established or removed even at runtime. |
149 and removeAllConnection() API can be used. Connection can be established or removed even at runtime. |
129 An example of how to make connection and setting the content widget property: |
150 An example of how to make connection and setting the content widget property: |
130 |
151 |