locationpickerservice/src/locationpickerappwindow.cpp
changeset 41 b3dd5ec3089d
parent 31 8db05346071b
equal deleted inserted replaced
38:793f76d9ab0c 41:b3dd5ec3089d
    64     //initialize potrait widgets and connect to respective signals 
    64     //initialize potrait widgets and connect to respective signals 
    65     mLocationPickerView->init( this->orientation(), mLocationPickerContent->getStandardModel());
    65     mLocationPickerView->init( this->orientation(), mLocationPickerContent->getStandardModel());
    66     addView( mLocationPickerView );
    66     addView( mLocationPickerView );
    67     setCurrentView(mLocationPickerView);
    67     setCurrentView(mLocationPickerView);
    68     //connect to orientationChanged signal
    68     //connect to orientationChanged signal
    69      connect(this, SIGNAL(orientationChanged(Qt::Orientation)),this, SLOT(changeOrientation(Qt::Orientation)));
    69      connect(this, SIGNAL(orientationChanged(Qt::Orientation)),this, 
       
    70      	SLOT(changeOrientation(Qt::Orientation)));
    70     connect(this, SIGNAL(aboutToChangeOrientation()),this, SLOT(closeDetailsDialog()));
    71     connect(this, SIGNAL(aboutToChangeOrientation()),this, SLOT(closeDetailsDialog()));
    71      
    72      
    72     }
    73     }
    73 }
    74 }
    74 
    75 
   112     if(!mLocationPickerSearchView)
   113     if(!mLocationPickerSearchView)
   113     {
   114     {
   114         mLocationPickerDocumentLoader->load(":/locationpickersearchview.docml", &ok);
   115         mLocationPickerDocumentLoader->load(":/locationpickersearchview.docml", &ok);
   115         Q_ASSERT_X(ok, "locationpickerService", "invalid DocML file");
   116         Q_ASSERT_X(ok, "locationpickerService", "invalid DocML file");
   116         //find the LocationPickerSearchView
   117         //find the LocationPickerSearchView
   117         QGraphicsWidget *locationPickerSearchWidget = mLocationPickerDocumentLoader->findWidget("LocationPickerSearchView");
   118         QGraphicsWidget *locationPickerSearchWidget = 
       
   119         	mLocationPickerDocumentLoader->findWidget("LocationPickerSearchView");
   118         Q_ASSERT_X((locationPickerSearchWidget != 0), "locationpickerService", "invalid DocML file");
   120         Q_ASSERT_X((locationPickerSearchWidget != 0), "locationpickerService", "invalid DocML file");
   119         mLocationPickerSearchView = qobject_cast<LocationPickerSearchView*>(locationPickerSearchWidget);
   121         mLocationPickerSearchView = qobject_cast<LocationPickerSearchView*>(locationPickerSearchWidget);
   120         Q_ASSERT_X((mLocationPickerSearchView != 0), "mLocationPickerSearchView", 
   122         Q_ASSERT_X((mLocationPickerSearchView != 0), "mLocationPickerSearchView", 
   121             "qobject cast failure");
   123             "qobject cast failure");
   122         //initialize the action items and connect to slots
   124         //initialize the action items and connect to slots
   123         mLocationPickerSearchView->init(mLocationPickerContent->getStandardModel());
   125         mLocationPickerSearchView->init(mLocationPickerContent->getStandardModel());
   124         connect(mLocationPickerSearchView,SIGNAL(switchView()),this,SLOT(activateLocationPickerView()));
   126         connect(mLocationPickerSearchView,SIGNAL(switchView()),
   125         connect(mLocationPickerSearchView,SIGNAL(selectItem( quint32 )),this,SLOT(itemSelected( quint32 )));
   127         	this,SLOT(activateLocationPickerView()));
       
   128         connect(mLocationPickerSearchView,SIGNAL(selectItem( quint32 )),
       
   129         	this,SLOT(itemSelected( quint32 )));
       
   130         connect(mLocationPickerSearchView,SIGNAL(completeService()),
       
   131         	this,SLOT(serviceComplete()));
   126         addView(mLocationPickerSearchView);
   132         addView(mLocationPickerSearchView);
   127     }
   133     }
   128     //set LocationPickerSearchview as current view
   134     //set LocationPickerSearchview as current view
   129     setCurrentView(mLocationPickerSearchView);
   135     setCurrentView(mLocationPickerSearchView);
   130    
   136