How to implement an icon/pattern editor in QWidget?
-
I want to implement an icon/pattern editor inside my application. I am thinking about a grid of pixels of size 10x10 (or something "grained" like so), and a pallette of colors to define each pixel. This "icon" (or more precisely, "pattern", because will be put size by size in a map) has low resolution because will be used as a graphical signature for low resolution vegetation maps. I am kind of lost here about how to implement this "low resolution" image editor.
Does anybody has an idea here on how I could write that?
I have no experience with graphical objects in Qt (and newbie in Qt, actually), and I've been reading about QPainter/QImage/QPixmap and even an example regarding ImageModel, but I didn't find the way yet...
Thanks a lot in advance.
-
Download this book:
http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip
(this book is free, source code of book is also downloadable)In the 5th chapter your will find a complete IconEditor app.
-
Thank you very much, broadpeak, for the information and the link! Great text! Problem solved ;)