Change qgis-bin dialog text in Python

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Change qgis-bin dialog text in Python

Jakob Lanstorp
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:



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()

Jakob
Jakob Lanstorp
Reply | Threaded
Open this post in threaded view
|

Re: Change qgis-bin dialog text in Python

Salvatore Larosa-2
Hi Jakob,

On Wed, Oct 21, 2015 at 9:31 AM, Jakob Lanstorp <[hidden email]> 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
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Change qgis-bin dialog text in Python

Jakob Lanstorp
Thanks Salvatore, it did the job.

Jakob
Jakob Lanstorp