68 HbWidget* CntAddressViewItem::createCustomWidget() |
68 HbWidget* CntAddressViewItem::createCustomWidget() |
69 { |
69 { |
70 HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>( |
70 HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>( |
71 modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); |
71 modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); |
72 |
72 |
73 HbWidget* widget = new HbWidget(); |
73 HbWidget* widget = NULL; |
|
74 |
74 if( itemType == HbDataFormModelItem::CustomItemBase ) |
75 if( itemType == HbDataFormModelItem::CustomItemBase ) |
75 { |
76 { |
76 QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Horizontal); |
77 HbPushButton* locationButton = new HbPushButton(this); |
77 widget->setLayout(layout); |
78 |
|
79 // Naming UI components for automation testability |
|
80 locationButton->setObjectName("Select location button"); |
|
81 locationButton->setText( hbTrId("txt_phob_button_select_location") ); |
|
82 locationButton->setTextAlignment( Qt::AlignCenter ); |
|
83 locationButton->setContentsMargins(0,0,0,0); |
78 |
84 |
79 HbStyleLoader::registerFilePath(":/style/cntlocationbutton.css"); |
85 connect(locationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker())); |
80 HbStyleLoader::registerFilePath(":/style/cntlocationbutton.hbpushbutton.widgetml"); |
|
81 HbDataForm* form = static_cast<HbDataForm*> (itemView()); |
|
82 HbDataFormModel* model = static_cast<HbDataFormModel*> (form->model()); |
|
83 |
86 |
84 HbPushButton* mLocationButton = new HbPushButton(this); |
87 widget = locationButton; |
85 mLocationButton->setObjectName("cntlocationbutton"); |
|
86 mLocationButton->setText( hbTrId("txt_phob_button_select_location") ); |
|
87 mLocationButton->setTextAlignment( Qt::AlignCenter ); |
|
88 |
|
89 connect(mLocationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker())); |
|
90 |
|
91 layout->addItem(mLocationButton); |
|
92 |
88 |
93 } |
89 } |
94 return widget; |
90 return widget; |
95 } |
91 } |
96 |
92 |