Hi, Have you tried the 'sizeChanged' signal?
Also, have a look at the QgsComposerItemWidget class, specifically this function: https://github.com/qgis/QGIS/blob/master/src/app/composer/qgscomposeritemwidget.cpp#L378. It might contain some pointers for your use case. All the best. Regards, John On Wed, Jan 13, 2016 at 4:26 AM, a arias <[email protected]> wrote: > > > Hi. I'm working on a plugin for the Composer, but it seems that few people > are interested in this aspect of QGIS, so I rarely get answers to my > difficulties on stackexchange ( > http://gis.stackexchange.com/questions/174648/how-to-use-itemchanged-signal-to-update-data > ). > > I need to to call a function when I move one of the QgsComposerItems on > the composer. For example a QgsComposerLabel that is already placed on the > composer and whose variable name is *label1*, this code > > def setCoordText(): > > label1.setText(str(label1.x()) + "," + str(label1.y())) > > label1.itemChanged.connect(setCoordText) > > > should show the x and y numbers of the label's new location. However this > only works if the label is moved AND then is put back with an UNDO command. > It is as if the signal is triggered by the Undo command, but not the move > itself. Can anybody help me with this? Thank you > > _______________________________________________ > Qgis-developer mailing list > [email protected] > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer >
_______________________________________________ Qgis-developer mailing list [email protected] List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
