filemanager/src/filemanager/src/components/fmcombinedquery.cpp
changeset 37 15bc28c9dd51
parent 14 1957042d8c7e
equal deleted inserted replaced
16:ada7962b4308 37:15bc28c9dd51
    23 #include <hblistwidget.h>
    23 #include <hblistwidget.h>
    24 #include <hbaction.h>
    24 #include <hbaction.h>
    25 #include <hblistwidgetitem.h>
    25 #include <hblistwidgetitem.h>
    26 #include <hbabstractviewitem.h>
    26 #include <hbabstractviewitem.h>
    27 
    27 
    28 FmCombinedQuery::FmCombinedQuery( QGraphicsItem *parent ) : HbDialog( parent ), 
    28 FmCombinedQuery::FmCombinedQuery( QGraphicsItem *parent ) : FmDialog( parent ), 
    29     mSelectMode ( MultiSelectMode ), mDominantIndex ( -1 )
    29     mSelectMode ( MultiSelectMode ), mDominantIndex ( -1 )
    30 {
    30 {
       
    31     setObjectName( "combinedQueryDialog" );
    31 	mContentWidget = new QGraphicsWidget();
    32 	mContentWidget = new QGraphicsWidget();
       
    33 	mContentWidget->setObjectName( "CombinedQueryContentWidget" );
    32 	setContentWidget(mContentWidget);
    34 	setContentWidget(mContentWidget);
    33 
    35 
    34 	QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
    36 	QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
    35     vLayout->setOrientation( Qt::Vertical );
    37     vLayout->setOrientation( Qt::Vertical );
    36 
    38 
    37     mListWidget = new HbListWidget();
    39     mListWidget = new HbListWidget();
    38 	vLayout->addItem( mListWidget );
    40 	vLayout->addItem( mListWidget );
    39 
    41 
    40     mListWidget->setFontSpec( HbFontSpec( HbFontSpec::Primary ) );
    42     mListWidget->setFontSpec( HbFontSpec( HbFontSpec::Primary ) );
    41 
    43     mListWidget->setObjectName( "CombinedQueryListWidget" );
    42 	this->setTimeout( NoTimeout );
    44 	this->setTimeout( NoTimeout );
    43 	mContentWidget->setLayout( vLayout );
    45 	mContentWidget->setLayout( vLayout );
    44 
    46 
    45     setSelectMode( mSelectMode );
    47     setSelectMode( mSelectMode );
    46 	connect( mListWidget, SIGNAL( activated  ( const QModelIndex& ) ), this, SLOT( activated( const QModelIndex& ) ) );
    48 	connect( mListWidget, SIGNAL( activated  ( const QModelIndex& ) ), this, SLOT( activated( const QModelIndex& ) ) );
   108     }
   110     }
   109 }
   111 }
   110 
   112 
   111 void FmCombinedQuery::activated( const QModelIndex &index )
   113 void FmCombinedQuery::activated( const QModelIndex &index )
   112 {
   114 {
   113 	int selectedRow = mListWidget->indexPosition( index );
   115 	int selectedRow = index.row();
   114 	if( selectedRow == mDominantIndex ){
   116 	if( selectedRow == mDominantIndex ){
   115 		QModelIndexList modelIndexList = mListWidget->selectionModel()->selectedIndexes();
   117 		QModelIndexList modelIndexList = mListWidget->selectionModel()->selectedIndexes();
   116 		for( QModelIndexList::const_iterator it = modelIndexList.begin(); it != modelIndexList.end(); ++it ){
   118 		for( QModelIndexList::const_iterator it = modelIndexList.begin(); it != modelIndexList.end(); ++it ){
   117 			if( ( *it ) == index  ){
   119 			if( ( *it ) == index  ){
   118 				mListWidget->clearSelection();
   120 				mListWidget->clearSelection();