![]() |
2010-11-13
, 17:13
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#1
|
![]() |
2010-11-13
, 19:32
|
|
Posts: 319 |
Thanked: 221 times |
Joined on Jan 2010
@ Finland
|
#2
|
The Following User Says Thank You to rooster13 For This Useful Post: | ||
![]() |
2010-11-14
, 20:44
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#3
|
![]() |
2010-11-14
, 21:22
|
|
Posts: 319 |
Thanked: 221 times |
Joined on Jan 2010
@ Finland
|
#4
|
ui->listWidget->setItemDelegate(newListDelegate(ui->listWidget)); QListWidgetItem*item=newQListWidgetItem(); QIconappIcon=QIcon::fromTheme(icon,QIcon(":/images/general_applications.png")); item->setData(Qt::DecorationRole,appIcon); item->setData(Qt::DisplayRole,realName); item->setData(Qt::UserRole,QVariant(exec)); item->setData(Qt::UserRole+1,QVariant(comment.trimmed())); item->setData(Qt::WhatsThisRole,QVariant(2)); ui->listWidget->addItem(item);
The Following User Says Thank You to rooster13 For This Useful Post: | ||
![]() |
2010-11-15
, 07:21
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#5
|
Hope it helps, and if you ever find out how to resize the icon on the DecorationRole, I would really appreciate if you tell me how you did it, cause I am currently having problems with scalable icons on the QListWidget...
The Following User Says Thank You to Diph For This Useful Post: | ||
![]() |
2010-11-15
, 11:51
|
|
Posts: 319 |
Thanked: 221 times |
Joined on Jan 2010
@ Finland
|
#6
|
![]() |
2010-11-15
, 19:21
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#7
|
![]() |
2010-11-15
, 19:50
|
|
Posts: 319 |
Thanked: 221 times |
Joined on Jan 2010
@ Finland
|
#8
|
![]() |
2010-11-15
, 20:22
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#9
|
IAre u by any chance including the Delegate twice in two different classes?
#include "file2.h"
#include "file1.h"
The Following User Says Thank You to Diph For This Useful Post: | ||
![]() |
2010-11-15
, 20:36
|
|
Posts: 319 |
Thanked: 221 times |
Joined on Jan 2010
@ Finland
|
#10
|
But if you have it like this way there is a problem:
file1.h:
file2.hCode:#include "file2.h"
Use forward declaration like rooster13 said.Code:#include "file1.h"