example/DemoGUI/CustomListWidget.cpp
author cgandhi
Mon, 11 Oct 2010 21:59:54 +0530
changeset 26 83d6a149c755
parent 16 b78fa4cdbf2b
permissions -rw-r--r--
Submitting following changes - AuthApps for Last.fm and Twitter added API for checking ServiceAuthorization added for SMFCredMgrClient API added for forcefully removing credential details from SMFCredMgr Extra argument checks in SMfClient APIs APIs for service login and logout from SMFClient Redundant members removed from SmfServerSymbian DSM bug fixes Test Apps included
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     1
#include "CustomListWidget.h"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     2
#include <qlistwidget.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     3
#include <qboxlayout.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     4
#include <qlabel.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     5
#include <qdebug.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     6
#include "ScreenSize.h"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     7
#include <qpushbutton.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     8
#include "WidgetConstants.h"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     9
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    10
CustomListWidget::CustomListWidget()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    11
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    12
     setStyleSheet("selection-color: yellow;"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    13
                      "selection-background-color: grey;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    14
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    15
CustomListWidget::~CustomListWidget()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    16
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    17
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    18
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    19
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    20
void CustomListWidget::AddListItem(QString aIconPath,QString aFirstLine,QString aSecondLine)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    21
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    22
    QWidget* customwidget = new QWidget;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    23
    QHBoxLayout* HMainlayout = new QHBoxLayout(customwidget);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    24
    QLabel *lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    25
    lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    26
    lab->setFixedSize(60,60);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    27
    HMainlayout->addWidget(lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    28
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    29
    //To add First & second row horizontal layouts
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    30
    QVBoxLayout* VTextlayout = new QVBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    31
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    32
    QHBoxLayout* HFirstrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    33
    //Add FirstLine label
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    34
    QLabel *lab1 =new QLabel(aFirstLine);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    35
    lab1->setStyleSheet("font: bold 20px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    36
    HFirstrowLayout->addWidget(lab1);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    37
    //Add Images to
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    38
    QLabel *Img1lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    39
    Img1lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    40
    Img1lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    41
    QLabel *Img2lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    42
    Img2lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    43
    Img2lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    44
    QLabel *Img3lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    45
    Img3lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    46
    Img3lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    47
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    48
    HFirstrowLayout->addWidget(Img1lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    49
    HFirstrowLayout->addWidget(Img2lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    50
    HFirstrowLayout->addWidget(Img3lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    51
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    52
//        HFirstrowLayout->setAlignment(Img3lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    53
//        HFirstrowLayout->setAlignment(Img2lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    54
//        HFirstrowLayout->setAlignment(Img1lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    55
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    56
    VTextlayout->addLayout(HFirstrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    57
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    58
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    59
     QHBoxLayout* HSecondrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    60
    QLabel *lab2 =new QLabel(aSecondLine);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    61
    lab2->setStyleSheet("font: 16px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    62
    HSecondrowLayout->addWidget(lab2);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    63
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    64
    QLabel *Timestamplabel =new QLabel("00:00 JUL 12");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    65
    Timestamplabel->setStyleSheet("font: 12px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    66
    HSecondrowLayout->addWidget(Timestamplabel);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    67
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    68
    HSecondrowLayout->setAlignment(Timestamplabel,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    69
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    70
    VTextlayout->addLayout(HSecondrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    71
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    72
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    73
    HMainlayout->addLayout(VTextlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    74
    customwidget->setLayout(HMainlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    75
    QListWidgetItem *item=new QListWidgetItem;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    76
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    77
    //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    78
    //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    79
    item->setSizeHint(QSize(60,60));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    80
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    81
    addItem(item);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    82
    setItemWidget(item,customwidget);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    83
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    84
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    85
void CustomListWidget::AddListItem(QMainWindow *mainWindow,QStringList aIconPath,QStringList aNames)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    86
{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 16
diff changeset
    87
	Q_UNUSED(mainWindow)
16
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    88
	qDebug()<<"Inside GridView::CreateGridView()";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    89
	qDebug()<<"aIconPath count = "<<aIconPath.count();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    90
	qDebug()<<"names count = "<<aNames.count();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    91
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    92
	int row;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    93
	int col;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    94
	//QWidget* widget = new QWidget();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    95
	QGridLayout* GridLayout = new QGridLayout(this);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    96
	if((6 == aIconPath.count()) || (5 == aIconPath.count()))
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    97
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    98
		row = 3;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    99
		col = 2;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   100
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   101
	else if((4 == aIconPath.count()) || (3 == aIconPath.count()))
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   102
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   103
		row = col = 2;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   104
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   105
	else if((2 == aIconPath.count()) || (1 == aIconPath.count()))
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   106
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   107
		row = 1;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   108
		col = 2;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   109
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   110
	else if(0 == aIconPath.count())
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   111
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   112
		row = col = 0;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   113
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   114
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   115
	int rowSpace = (ScreenSize::GetScreenRect().height() - (KHeadNameHeight+ToolbarIconHeight+2*KWidgetGapFactor))/row;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   116
	int colSpace = (ScreenSize::GetScreenRect().width() - 2*KWidgetGapFactor )/col;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   117
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   118
	int index = 0;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   119
	for(int i=0;i<row;i++)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   120
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   121
		for(int j=0;j<col;j++)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   122
		{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   123
		QPushButton *pushBtn = new QPushButton();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   124
		qDebug()<<"name = "<<aNames[index];
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   125
		pushBtn->setGeometry(i*colSpace,(j*rowSpace + KWidgetGapFactor),colSpace,rowSpace);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   126
		pushBtn->setIconSize(QSize(colSpace-(3*KWidgetGapFactor),colSpace+(3*KWidgetGapFactor)));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   127
		qDebug()<<"icon = "<<aIconPath[index];
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   128
		pushBtn->setIcon(QIcon(aIconPath[index]));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   129
		qDebug()<<"After image display";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   130
		GridLayout->addWidget(pushBtn,i,j);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   131
		
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   132
		index++;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   133
		if(index == aNames.count())
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   134
			{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   135
			qDebug()<<"Count became same so exiting";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   136
			break;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   137
			}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   138
		}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   139
	if(index == aNames.count())
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   140
		{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   141
		qDebug()<<"Count became same so exiting";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   142
		break;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   143
		}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   144
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   145
	//Its required please don't remove
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   146
	show();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   147
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   148
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   149
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   150
QWidget* CustomListWidget::CreateListwidget(SmfContactList* friendsList)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   151
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   152
	qDebug()<<"Inside CustomListWidget::CreateListwidget() for friends";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   153
	qDebug()<<"Friends count = "<<friendsList->count();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   154
	
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   155
    QListWidget* customlist = new QListWidget();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   156
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   157
    // Todo:- Display something when no friends are available
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   158
    foreach(SmfContact contact, *friendsList)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   159
    {
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   160
    	QString name(contact.value("Name").value<QContactName>().firstName());
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   161
    	QString status(contact.value("Presence").value<QContactPresence>().customMessage());
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   162
    	if(!status.size())
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   163
    		status.append("Not available");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   164
    	//QUrl url(contact.value("Avatar").value<QContactAvatar>().imageUrl());
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   165
    	QString url("C:\\data\\sample.bmp"); // ToDo:- should be the profile image path
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   166
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   167
        QWidget* widgetItem = new QWidget();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   168
        QHBoxLayout* HMainlayout = new QHBoxLayout(widgetItem);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   169
        QLabel *lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   170
        lab->setPixmap(QPixmap(url));  
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   171
        lab->setFixedSize(60,60);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   172
        HMainlayout->addWidget(lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   173
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   174
        //To add First & second row horizontal layouts
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   175
        QVBoxLayout* VTextlayout = new QVBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   176
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   177
        QHBoxLayout* HFirstrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   178
        
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   179
        //Add FirstLine label
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   180
        QLabel *lab1 = new QLabel(name);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   181
        lab1->setStyleSheet("font: bold 16px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   182
        HFirstrowLayout->addWidget(lab1);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   183
        
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   184
        //Add Images to
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   185
        QLabel *Img1lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   186
        Img1lab->setPixmap(QPixmap(url));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   187
        Img1lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   188
        QLabel *Img2lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   189
        Img2lab->setPixmap(QPixmap(url));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   190
        Img2lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   191
        QLabel *Img3lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   192
        Img3lab->setPixmap(QPixmap(url));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   193
        Img3lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   194
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   195
        HFirstrowLayout->addWidget(Img1lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   196
        HFirstrowLayout->addWidget(Img2lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   197
        HFirstrowLayout->addWidget(Img3lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   198
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   199
//        HFirstrowLayout->setAlignment(Img3lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   200
//        HFirstrowLayout->setAlignment(Img2lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   201
//        HFirstrowLayout->setAlignment(Img1lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   202
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   203
        VTextlayout->addLayout(HFirstrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   204
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   205
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   206
         QHBoxLayout* HSecondrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   207
        QLabel *lab2 =new QLabel(status);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   208
        lab2->setStyleSheet("font: 8px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   209
        HSecondrowLayout->addWidget(lab2);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   210
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   211
        QLabel *Timestamplabel =new QLabel("");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   212
        Timestamplabel->setStyleSheet("font: 7px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   213
        HSecondrowLayout->addWidget(Timestamplabel);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   214
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   215
        HSecondrowLayout->setAlignment(Timestamplabel,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   216
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   217
        VTextlayout->addLayout(HSecondrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   218
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   219
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   220
        HMainlayout->addLayout(VTextlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   221
        widgetItem->setLayout(HMainlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   222
        QListWidgetItem *item=new QListWidgetItem;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   223
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   224
        //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   225
        //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   226
        item->setSizeHint(QSize(60,60));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   227
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   228
        customlist->addItem(item);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   229
        customlist->setItemWidget(item,widgetItem);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   230
    }
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   231
    customlist->setStyleSheet("selection-color: yellow;"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   232
                          "selection-background-color: grey;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   233
    return customlist;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   234
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   235
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   236
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   237
QWidget* CustomListWidget::CreateListwidget(SmfPostList *postsList)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   238
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   239
	qDebug()<<"Inside CustomListWidget::CreateListwidget() for posts";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   240
	qDebug()<<"Posts count = "<<postsList->count();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   241
	
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   242
    QListWidget* customlist = new QListWidget();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   243
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   244
    // Todo:- Display something when no posts are available
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   245
    foreach(SmfPost post, *postsList)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   246
    {
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   247
    	QString text(post.description());
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   248
    	QString ownerName(post.owner().value("Name").value<QContactName>().firstName());
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   249
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   250
    	//QUrl url(contact.value("Avatar").value<QContactAvatar>().imageUrl());
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   251
    	QString url("C:\\data\\sample.bmp"); // ToDo:- should be the profile image path
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   252
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   253
        QWidget* widgetItem = new QWidget();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   254
        QHBoxLayout* HMainlayout = new QHBoxLayout(widgetItem);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   255
        QLabel *lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   256
        lab->setPixmap(QPixmap(url));  
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   257
        lab->setFixedSize(60,60);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   258
        HMainlayout->addWidget(lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   259
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   260
        //To add First & second row horizontal layouts
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   261
        QVBoxLayout* VTextlayout = new QVBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   262
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   263
        QHBoxLayout* HFirstrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   264
        
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   265
        //Add FirstLine label
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   266
        QLabel *lab1 = new QLabel(ownerName);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   267
        lab1->setStyleSheet("font: bold 16px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   268
        HFirstrowLayout->addWidget(lab1);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   269
        
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   270
        //Add Images to
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   271
        QLabel *Img1lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   272
        Img1lab->setPixmap(QPixmap(url));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   273
        Img1lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   274
        QLabel *Img2lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   275
        Img2lab->setPixmap(QPixmap(url));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   276
        Img2lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   277
        QLabel *Img3lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   278
        Img3lab->setPixmap(QPixmap(url));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   279
        Img3lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   280
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   281
        HFirstrowLayout->addWidget(Img1lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   282
        HFirstrowLayout->addWidget(Img2lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   283
        HFirstrowLayout->addWidget(Img3lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   284
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   285
//        HFirstrowLayout->setAlignment(Img3lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   286
//        HFirstrowLayout->setAlignment(Img2lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   287
//        HFirstrowLayout->setAlignment(Img1lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   288
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   289
        VTextlayout->addLayout(HFirstrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   290
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   291
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   292
         QHBoxLayout* HSecondrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   293
        QLabel *lab2 =new QLabel(text);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   294
        lab2->setStyleSheet("font: 8px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   295
        HSecondrowLayout->addWidget(lab2);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   296
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   297
        QLabel *Timestamplabel =new QLabel("");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   298
        Timestamplabel->setStyleSheet("font: 7px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   299
        HSecondrowLayout->addWidget(Timestamplabel);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   300
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   301
        HSecondrowLayout->setAlignment(Timestamplabel,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   302
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   303
        VTextlayout->addLayout(HSecondrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   304
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   305
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   306
        HMainlayout->addLayout(VTextlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   307
        widgetItem->setLayout(HMainlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   308
        QListWidgetItem *item=new QListWidgetItem;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   309
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   310
        //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   311
        //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   312
        item->setSizeHint(QSize(60,60));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   313
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   314
        customlist->addItem(item);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   315
        customlist->setItemWidget(item,widgetItem);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   316
    }
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   317
    customlist->setStyleSheet("selection-color: yellow;"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   318
                          "selection-background-color: grey;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   319
    return customlist;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   320
	
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   321
	}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 16
diff changeset
   322
/*QWidget* CreateListwidget(SmfActivityEntryList *activityList)
16
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   323
			{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   324
	
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 16
diff changeset
   325
			}*/
16
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   326
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   327
/*QWidget* CustomListWidget::CreateListwidget(QString aIconPath,QString aFirstLine,QString aSecondLine)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   328
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   329
	qDebug()<<"Inside CustomListWidget::CreateListwidget()";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   330
	qDebug()<<"Icon path = "<<aIconPath;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   331
	qDebug()<<"firstline = "<<aFirstLine;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   332
	qDebug()<<"second line = "<<aSecondLine;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   333
    QListWidget* customlist = new QListWidget();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   334
    //for(int i =0;i<2;i++)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   335
    //{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   336
        QWidget* widgetItem = new QWidget();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   337
        QHBoxLayout* HMainlayout = new QHBoxLayout(widgetItem);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   338
        QLabel *lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   339
        lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   340
        lab->setFixedSize(60,60);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   341
        HMainlayout->addWidget(lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   342
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   343
        //To add First & second row horizontal layouts
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   344
        QVBoxLayout* VTextlayout = new QVBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   345
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   346
        QHBoxLayout* HFirstrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   347
        //Add FirstLine label
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   348
        QLabel *lab1 =new QLabel(aFirstLine);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   349
        lab1->setStyleSheet("font: bold 16px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   350
        HFirstrowLayout->addWidget(lab1);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   351
        //Add Images to
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   352
        QLabel *Img1lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   353
        Img1lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   354
        Img1lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   355
        QLabel *Img2lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   356
        Img2lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   357
        Img2lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   358
        QLabel *Img3lab =new QLabel();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   359
        Img3lab->setPixmap(QPixmap(aIconPath));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   360
        Img3lab->setFixedSize(10,10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   361
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   362
        HFirstrowLayout->addWidget(Img1lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   363
        HFirstrowLayout->addWidget(Img2lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   364
        HFirstrowLayout->addWidget(Img3lab);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   365
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   366
//        HFirstrowLayout->setAlignment(Img3lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   367
//        HFirstrowLayout->setAlignment(Img2lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   368
//        HFirstrowLayout->setAlignment(Img1lab,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   369
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   370
        VTextlayout->addLayout(HFirstrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   371
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   372
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   373
         QHBoxLayout* HSecondrowLayout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   374
        QLabel *lab2 =new QLabel(aSecondLine);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   375
        lab2->setStyleSheet("font: 8px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   376
        HSecondrowLayout->addWidget(lab2);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   377
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   378
        QLabel *Timestamplabel =new QLabel("00:00 JUN 29");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   379
        Timestamplabel->setStyleSheet("font: 7px;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   380
        HSecondrowLayout->addWidget(Timestamplabel);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   381
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   382
        HSecondrowLayout->setAlignment(Timestamplabel,Qt::AlignRight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   383
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   384
        VTextlayout->addLayout(HSecondrowLayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   385
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   386
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   387
        HMainlayout->addLayout(VTextlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   388
        widgetItem->setLayout(HMainlayout);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   389
        QListWidgetItem *item=new QListWidgetItem;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   390
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   391
        //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   392
        //customlist->adjustSize();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   393
        item->setSizeHint(QSize(60,60));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   394
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   395
        customlist->addItem(item);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   396
        customlist->setItemWidget(item,widgetItem);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   397
    //}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   398
customlist->setStyleSheet("selection-color: yellow;"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   399
                          "selection-background-color: grey;");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   400
    return customlist;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   401
}*/