Dear to all,
I need to insert an icon into every index of a QSqlQueryModel (so I
can retrieve them from DB but mark them with the icon).
I need something like QStandardItem (const QIcon &icon, const QString
&text) constructor, but I don't know how can I subclass It.
I need also to activate the tool
Thanks a lot, Thales.
Regards
--
Héctor A. Rompato Carricart
Buenos Aires - Argentina
15 6652 7388
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
Hi Michele.
I think you will need to inherit QSqlQueryModel and reimplement the method:
virtual QVariant data(const QModelIndex &item, int role =
Qt::DisplayRole ) const
When "item" is your table index and role == Qt::DecorationRole, you can
return the desirable icon.
I hope this solution might
Thanks Thales but, I've no idea how can I do this :(
could you provide me any example for do this?
Thanks a lot!
Michele
2012/2/19 Thales Lange
> Hi Michele.
>
> I think you will need to inherit QSqlQueryModel and reimplement the method:
>
> virtual QVariant data(const QModelIndex &item, int
Hello Thales!!
Thanks a lot for your example!! It's great!! Now I understand how can I
solve my problem (I took some test and run perfectly!)
Thanks a lot!!
Michele
2012/2/20 Thales Lange
> Michele,
>
> I attached an example. This example contains:
> 1) SQL script to create the schema.
> 2) Ex
Hi Thales,
Could you sent the examples to the list? I'm interested too
Regads
--
Héctor A. Rompato Carricart
Buenos Aires - Argentina
15 6652 7388
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest