sternocera
29th March 2009, 22:32
Hello,
I'm writing a Qt for embedded Linux application (version 4.5). This is a single purpose embedded application, so non-portable solutions are acceptable. I have a QTreeView, populated by a QStandardItemModel, which is in turn populated by a database. *Some* of these records have images associated with them (those images are PNG files, stored as binary blobs in the db). Because the font I'm using with the QTreeView is somewhat large, each row is also large (this is a touchscreen application, so everything is chunky). Here's how my QTreeview looks at the moment:
+--+-------------------
| #| description
+--+-------------------
| #| description
+--+-------------------
| #| description
+--+-------------------
What I'd like is for those rows and *only* those rows that have images associated with them to become thicker to accommodate the 100 * 100 pixels PNG image:
+--+-------------------
| #| description
+--+-------------------
| |
| #| [pic] description
| |
+--+-------------------
| #| description
+--+-------------------
Can you suggest an approach to:
1. Construct a QImage, or QPixmap, or whatever is appropriate using the raw PNG file from the database (I'll have a char pointer to a buffer and an integer that holds the size of the file in bytes).
2. Thicken, and then draw the PNG file onto those rows that have an image to display, as illustrated.
Your help is greatly appreciated,
Regards,
Sternocera
I'm writing a Qt for embedded Linux application (version 4.5). This is a single purpose embedded application, so non-portable solutions are acceptable. I have a QTreeView, populated by a QStandardItemModel, which is in turn populated by a database. *Some* of these records have images associated with them (those images are PNG files, stored as binary blobs in the db). Because the font I'm using with the QTreeView is somewhat large, each row is also large (this is a touchscreen application, so everything is chunky). Here's how my QTreeview looks at the moment:
+--+-------------------
| #| description
+--+-------------------
| #| description
+--+-------------------
| #| description
+--+-------------------
What I'd like is for those rows and *only* those rows that have images associated with them to become thicker to accommodate the 100 * 100 pixels PNG image:
+--+-------------------
| #| description
+--+-------------------
| |
| #| [pic] description
| |
+--+-------------------
| #| description
+--+-------------------
Can you suggest an approach to:
1. Construct a QImage, or QPixmap, or whatever is appropriate using the raw PNG file from the database (I'll have a char pointer to a buffer and an integer that holds the size of the file in bytes).
2. Thicken, and then draw the PNG file onto those rows that have an image to display, as illustrated.
Your help is greatly appreciated,
Regards,
Sternocera