[Qgis-developer] Change qgis-bin dialog text in Python

Salvatore Larosa lrssvtml at gmail.com
Wed Oct 21 00:59:40 PDT 2015


Hi Jakob,

On Wed, Oct 21, 2015 at 9:31 AM, Jakob Lanstorp <jlanstorp at gmail.com> wrote:
> I have an Python action using a REST service to get picture. The picture is
> rendered with a QLabel. How can I change the default dialog text 'qgis-bin'?
>
> Dialog:
>
> <http://osgeo-org.1560.x6.nabble.com/file/n5231588/Image4.jpg>
>
> WFS layer action code:
>
> import urllib
> from PyQt4.QtCore import Qt
> img = QtGui.QImage()
> lbl = QtGui.QLabel()
> url = r'[% "cyklogram" %]'
> data = urllib.urlopen(url).read()
> img.loadFromData(data)
> lbl.setPixmap(QtGui.QPixmap(img).scaled(650,250,Qt.KeepAspectRatio))
> lbl.show()

it should be enough to insert:

label.setWindowTitle("title window")

QLabel inherits such a property from QWidget.

Regards,
-SL


-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode


More information about the Qgis-developer mailing list