[KPhotoAlbum] Associating multiple tags with one area?
tobias.leupold at web.de
Sun Oct 5 21:54:24 BST 2014
> I would load all positioned tags along with their "ID", the raw coordinates
Developing it further, we actually already have the ID (of course, because we
do need the coordinates anyway). When a tag has an "area" attribute, it's
parsed to a QRect and passed to the database object (cf.
XMLDB::Database::readOptions). We don't need an additional "ID"
infrastructure, as we can use this QRect as well (e. g. for the ID->area map).
All we have to do is (apart from the GUI changes) changing the way a
ResizableFrame object gets and holds the tag data, and of course how this data
is put to the database instance.
The area creation is handled in AnnotationDialog::Dialog::load(), the area-to-
database conversion is done in AnnotationDialog::Dialog::writeToInfo() (at
least I think so ;-). Putting it to the XML database and reading it out should
"just work", as the _taggedAreas variable of the ImageInfo class is a
QMap<QString, QMap<QString, QRect>>, where the keys are "category", "tag" and
"area", so we don't have collisions here (kindly, the area data is a value,
not a key).
Just have a look at the classes. I think it's possible to implement what you
As Johannes said, if you need comments or help, just ask!
More information about the Kphotoalbum