From 743b4c3ec596c0c6e2212a0f83e9990809f19367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Thu, 4 Jan 2024 15:02:33 +0100 Subject: examples: update sql/books icons Change-Id: I4fe6e62fa643b1e073eea8ec49f3864abc810108 Fixes: PYSIDE-2521 Pick-to: 6.6 Reviewed-by: Adrian Herrmann --- examples/sql/books/bookdelegate.py | 10 ++- examples/sql/books/books.qrc | 3 +- examples/sql/books/images/star-filled.svg | 1 + examples/sql/books/images/star.png | Bin 782 -> 0 bytes examples/sql/books/images/star.svg | 1 + examples/sql/books/rc_books.py | 142 ++++++++++++++++++------------ 6 files changed, 97 insertions(+), 60 deletions(-) create mode 100644 examples/sql/books/images/star-filled.svg delete mode 100644 examples/sql/books/images/star.png create mode 100644 examples/sql/books/images/star.svg (limited to 'examples') diff --git a/examples/sql/books/bookdelegate.py b/examples/sql/books/bookdelegate.py index d9f4ef7e0..78295adf1 100644 --- a/examples/sql/books/bookdelegate.py +++ b/examples/sql/books/bookdelegate.py @@ -13,7 +13,8 @@ class BookDelegate(QSqlRelationalDelegate): def __init__(self, parent=None): QSqlRelationalDelegate.__init__(self, parent) - self.star = QPixmap(":/images/star.png") + self.star = QPixmap(":/images/star.svg") + self.star_filled = QPixmap(":/images/star-filled.svg") def paint(self, painter, option, index): """ Paint the items in the table. @@ -49,8 +50,11 @@ class BookDelegate(QSqlRelationalDelegate): height = self.star.height() x = option.rect.x() y = option.rect.y() + (option.rect.height() / 2) - (height / 2) - for i in range(rating): - painter.drawPixmap(x, y, self.star) + for i in range(5): + if i < rating: + painter.drawPixmap(x, y, self.star_filled) + else: + painter.drawPixmap(x, y, self.star) x += width pen = painter.pen() diff --git a/examples/sql/books/books.qrc b/examples/sql/books/books.qrc index d6ad21337..a52ee381b 100644 --- a/examples/sql/books/books.qrc +++ b/examples/sql/books/books.qrc @@ -1,5 +1,6 @@ - images/star.png + images/star.svg + images/star-filled.svg diff --git a/examples/sql/books/images/star-filled.svg b/examples/sql/books/images/star-filled.svg new file mode 100644 index 000000000..8a2aee27f --- /dev/null +++ b/examples/sql/books/images/star-filled.svg @@ -0,0 +1 @@ + diff --git a/examples/sql/books/images/star.png b/examples/sql/books/images/star.png deleted file mode 100644 index 87f4464bd..000000000 Binary files a/examples/sql/books/images/star.png and /dev/null differ diff --git a/examples/sql/books/images/star.svg b/examples/sql/books/images/star.svg new file mode 100644 index 000000000..d959abc18 --- /dev/null +++ b/examples/sql/books/images/star.svg @@ -0,0 +1 @@ + diff --git a/examples/sql/books/rc_books.py b/examples/sql/books/rc_books.py index b589380e4..123d50de8 100644 --- a/examples/sql/books/rc_books.py +++ b/examples/sql/books/rc_books.py @@ -1,62 +1,86 @@ # Resource object code (Python 3) # Created by: object code -# Created by: The Resource Compiler for Qt version 6.2.2 +# Created by: The Resource Compiler for Qt version 6.6.1 # WARNING! All changes made in this file will be lost! from PySide6 import QtCore qt_resource_data = b"\ -\x00\x00\x03\x0e\ -\x89\ -PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ -\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ -\x00\x00\x00\x09pHYs\x00\x00\x0b\x11\x00\x00\x0b\x11\ -\x01\x7fd_\x91\x00\x00\x00\x07tIME\x07\xd4\x09\ -\x03\x12\x11\x08\x18~\xe5:\x00\x00\x00\x06bKGD\ -\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x02\x9bID\ -AT8\xcbc\x98:c\x1e#:\xe6\xe5d\xcf\x17\ -\x12\x12\x16\xc4&\x87\x8e\x19\xb0\x09v\xc6\x18\xb7x\xea\ -\x8b\xcd\x9c=o\x09i\x06,X4\x8f\xf1\xd2\xa5\x99\ -L\xb9\xa1\x16\xc5\xc7\xbb\xed\xff\x0a\xf2\xb2;M\x9f\xb5\ -\x908\x03\x16,\x9a\xcb\xf8\xe0\xde\x04\x96\xc7\x0f\xdby\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\x00\x13\x10\x8b\ -\x03\xb1?\x10\xe7\xf5\x16\xd8\xde\xf8p\xc6\xe4\xbf\x9d<\ -\xf7t\x7fC\xe9\x95\xb7\x96\xd9\xff\x9b\x9c,\xfdN@\ -@H\x14\x9b\x01LP,\x06\xc4\x19@|\x22;\xca\ -\xf0\xe7\xe9\xf9\x06\xff\x81\xec\x03@\xbc^\x82\x9f\xf3\xf6\ -\x9e\x1a\xf3_az\x823P\xd2\x01T#3\x10\x0b\ -\x00\xb1\x1e\x10\x17\x03\xf1\xd1\xa8@\xdd\x9f\xad\x09J \ -\x03\xfe\x00\xf17 >\x0f\xb4kf\xb9\xa7\xea\x0d}\ -i>#d\x03\xb4\x808\x08\x88k\x81x\x09\xd4\xc6\ -\x1b\x11a\x06\xdf\xec\x94\xb8\xdf\x03\xd9;\x81x\x1a\x10\ -\xf7\x82\xd4\xb0\xb2\xb1G\xf9\xda\x99:L\x9d9\x9f\x09\ -f\x80\x0e\x10;\x02\xb1\x13\x10[\x00\xb1\x01\x10\x07\x06\ -{h\x9c\x02\xd2k\xa0\x86\x8b\x001\x17\x10\xf3\x80\xb0\ -\x88\x88(\xcb,hFC\xf6\x02\x08\xb3\x001+\x10\ -K122\xe4\x01i7 \x96\x01b6\xa88\x0b\ -T=cW\xef$\xb0\x01\x00\xceo{\xf5UL\xf0\ -\xac\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x02e\ +<\ +svg xmlns=\x22http:\ +//www.w3.org/200\ +0/svg\x22 width=\x2224\ +\x22 height=\x2224\x22 fi\ +ll=\x22#0d0d0d\x22>\x0a\ +\x00\x00\x01\xfa\ +<\ +svg xmlns=\x22http:\ +//www.w3.org/200\ +0/svg\x22 width=\x2224\ +\x22 height=\x2224\x22 fi\ +ll=\x22none\x22>\x0a\ " qt_resource_name = b"\ @@ -64,19 +88,25 @@ qt_resource_name = b"\ \x07\x03}\xc3\ \x00i\ \x00m\x00a\x00g\x00e\x00s\ +\x00\x0f\ +\x02\x11 \x07\ +\x00s\ +\x00t\x00a\x00r\x00-\x00f\x00i\x00l\x00l\x00e\x00d\x00.\x00s\x00v\x00g\ \x00\x08\ -\x0a\x85X\x07\ +\x0a\x85U\x87\ \x00s\ -\x00t\x00a\x00r\x00.\x00p\x00n\x00g\ +\x00t\x00a\x00r\x00.\x00s\x00v\x00g\ " qt_resource_struct = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01z\xe7\xee&\xfd\ +\x00\x00\x01\x8c\xd4\xc79\xcf\ +\x00\x00\x006\x00\x00\x00\x00\x00\x01\x00\x00\x02i\ +\x00\x00\x01\x8c\xd4\xc79\xcf\ " def qInitResources(): -- cgit v1.2.3