Bonjour,
J'aimerai juste savoir comment enregistrer une QIcon dans un fichier.
Merci
Version imprimable
Bonjour,
J'aimerai juste savoir comment enregistrer une QIcon dans un fichier.
Merci
salut,
regarde du côté de l'opérateur <<
Documentation de QIconCitation:
Related Non-Members
QDataStream & operator<< ( QDataStream & stream, const QIcon & icon )
This is an overloaded member function, provided for convenience.
Writes the given icon to the the given stream as a PNG image. If the icon contains more than one image, all images will be written to the stream. Note that writing the stream to a file will not produce a valid image file.
This function was introduced in Qt 4.2.
Reviens nous dire comment t'as fait précisément dès que ça marche 8-)
voilà
Code:
1
2
3 QPixmap pixmap = icon.pixmap ( const QSize & size); pixmap.save(path + ".png", "png");