phonebookui/pbkcommonui/src/cntaddressviewitem.cpp
changeset 53 e6aff7b69165
parent 47 7cbcb2896f0e
child 61 d30183af6ca6
--- a/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp	Wed Jul 21 11:37:51 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp	Fri Jul 23 12:43:48 2010 +0300
@@ -70,25 +70,21 @@
     HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>( 
               modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
     
-    HbWidget* widget = new HbWidget();
+    HbWidget* widget = NULL;
+    
     if( itemType ==  HbDataFormModelItem::CustomItemBase )
     {
-        QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Horizontal);
-        widget->setLayout(layout);
-    
-        HbStyleLoader::registerFilePath(":/style/cntlocationbutton.css");
-        HbStyleLoader::registerFilePath(":/style/cntlocationbutton.hbpushbutton.widgetml");
-        HbDataForm* form = static_cast<HbDataForm*> (itemView());
-        HbDataFormModel* model = static_cast<HbDataFormModel*> (form->model());
+        HbPushButton* locationButton = new HbPushButton(this);
+        
+        // Naming UI components for automation testability
+        locationButton->setObjectName("Select location button");
+        locationButton->setText( hbTrId("txt_phob_button_select_location") );
+        locationButton->setTextAlignment( Qt::AlignCenter );
+        locationButton->setContentsMargins(0,0,0,0);
     
-        HbPushButton* mLocationButton = new HbPushButton(this);
-        mLocationButton->setObjectName("cntlocationbutton");
-        mLocationButton->setText( hbTrId("txt_phob_button_select_location") );
-        mLocationButton->setTextAlignment( Qt::AlignCenter );
+        connect(locationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker()));
     
-        connect(mLocationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker()));
-    
-        layout->addItem(mLocationButton);
+        widget = locationButton;
         
     }
     return widget;
@@ -151,6 +147,6 @@
    
 }
 
- Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem)
+Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem)
 
 // End of File