example/DemoGUI/CustomListWidget.cpp
changeset 26 83d6a149c755
parent 16 b78fa4cdbf2b
equal deleted inserted replaced
25:a180113055cb 26:83d6a149c755
    82     setItemWidget(item,customwidget);
    82     setItemWidget(item,customwidget);
    83 }
    83 }
    84 
    84 
    85 void CustomListWidget::AddListItem(QMainWindow *mainWindow,QStringList aIconPath,QStringList aNames)
    85 void CustomListWidget::AddListItem(QMainWindow *mainWindow,QStringList aIconPath,QStringList aNames)
    86 {
    86 {
       
    87 	Q_UNUSED(mainWindow)
    87 	qDebug()<<"Inside GridView::CreateGridView()";
    88 	qDebug()<<"Inside GridView::CreateGridView()";
    88 	qDebug()<<"aIconPath count = "<<aIconPath.count();
    89 	qDebug()<<"aIconPath count = "<<aIconPath.count();
    89 	qDebug()<<"names count = "<<aNames.count();
    90 	qDebug()<<"names count = "<<aNames.count();
    90 
    91 
    91 	int row;
    92 	int row;
   119 	{
   120 	{
   120 		for(int j=0;j<col;j++)
   121 		for(int j=0;j<col;j++)
   121 		{
   122 		{
   122 		QPushButton *pushBtn = new QPushButton();
   123 		QPushButton *pushBtn = new QPushButton();
   123 		qDebug()<<"name = "<<aNames[index];
   124 		qDebug()<<"name = "<<aNames[index];
   124 		int gapFac = KHeadNameHeight+ToolbarIconHeight;
       
   125 		pushBtn->setGeometry(i*colSpace,(j*rowSpace + KWidgetGapFactor),colSpace,rowSpace);
   125 		pushBtn->setGeometry(i*colSpace,(j*rowSpace + KWidgetGapFactor),colSpace,rowSpace);
   126 		pushBtn->setIconSize(QSize(colSpace-(3*KWidgetGapFactor),colSpace+(3*KWidgetGapFactor)));
   126 		pushBtn->setIconSize(QSize(colSpace-(3*KWidgetGapFactor),colSpace+(3*KWidgetGapFactor)));
   127 		qDebug()<<"icon = "<<aIconPath[index];
   127 		qDebug()<<"icon = "<<aIconPath[index];
   128 		pushBtn->setIcon(QIcon(aIconPath[index]));
   128 		pushBtn->setIcon(QIcon(aIconPath[index]));
   129 		qDebug()<<"After image display";
   129 		qDebug()<<"After image display";
   317     customlist->setStyleSheet("selection-color: yellow;"
   317     customlist->setStyleSheet("selection-color: yellow;"
   318                           "selection-background-color: grey;");
   318                           "selection-background-color: grey;");
   319     return customlist;
   319     return customlist;
   320 	
   320 	
   321 	}
   321 	}
   322 QWidget* CreateListwidget(SmfActivityEntryList *activityList)
   322 /*QWidget* CreateListwidget(SmfActivityEntryList *activityList)
   323 			{
   323 			{
   324 	
   324 	
   325 			}
   325 			}*/
   326 
   326 
   327 /*QWidget* CustomListWidget::CreateListwidget(QString aIconPath,QString aFirstLine,QString aSecondLine)
   327 /*QWidget* CustomListWidget::CreateListwidget(QString aIconPath,QString aFirstLine,QString aSecondLine)
   328 {
   328 {
   329 	qDebug()<<"Inside CustomListWidget::CreateListwidget()";
   329 	qDebug()<<"Inside CustomListWidget::CreateListwidget()";
   330 	qDebug()<<"Icon path = "<<aIconPath;
   330 	qDebug()<<"Icon path = "<<aIconPath;