Discussion:
[guidata/guiqwt] WinPython 2.7.9.3: First guidata example doesn't work?
x***@arcor.de
2015-05-15 14:43:23 UTC
Permalink
Hello to everyone,

some problems here to run the first guidata example

import guidata
guidata.qapplication() # not required if a QApplication has already been
created

import guidata.dataset.datatypes as dt
import guidata.dataset.dataitems as di

class Processing(dt.DataSet):
"""Example"""
a = di.FloatItem("Parameter #1", default=2.3)
b = di.IntItem("Parameter #2", min=0, max=10, default=5)
type = di.ChoiceItem("Processing algorithm",
("type 1", "type 2", "type 3"))

param = Processing()
param.edit()

from
https://pythonhosted.org/guidata/examples.html

The following 2 configurations
(1) WinPython-64bit-2.7.9.3.exe, installed on a Win7SP1x64 Computer
(2) WinPython-32bit-2.7.9.3.exe, installed on a Win7SP1x32 Computer
lead to the same message
'QWidget: Must construct a QApplication before a QPaintDevice'
in spyders python console and the examples guidata dialog doesn't appear.

The example works fine on a Windows XPSP3x32 Computer with Python(x,y)
2.6.2.0 installed.

Any ideas to solve this?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Big Stone
2015-05-17 08:32:27 UTC
Permalink
I guess the Qt application is created, then destroyed before use as not
referenced.

Change One line:

app = guidata.qapplication()
Post by x***@arcor.de
Hello to everyone,
some problems here to run the first guidata example
import guidata
guidata.qapplication() # not required if a QApplication has already been
created
import guidata.dataset.datatypes as dt
import guidata.dataset.dataitems as di
"""Example"""
a = di.FloatItem("Parameter #1", default=2.3)
b = di.IntItem("Parameter #2", min=0, max=10, default=5)
type = di.ChoiceItem("Processing algorithm",
("type 1", "type 2", "type 3"))
param = Processing()
param.edit()
from
https://pythonhosted.org/guidata/examples.html
The following 2 configurations
(1) WinPython-64bit-2.7.9.3.exe, installed on a Win7SP1x64 Computer
(2) WinPython-32bit-2.7.9.3.exe, installed on a Win7SP1x32 Computer
lead to the same message
'QWidget: Must construct a QApplication before a QPaintDevice'
in spyders python console and the examples guidata dialog doesn't appear.
The example works fine on a Windows XPSP3x32 Computer with Python(x,y)
2.6.2.0 installed.
Any ideas to solve this?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
x***@arcor.de
2015-05-18 21:39:52 UTC
Permalink
Thank you very much, now it works :-)
So without an object reference (as in the guidata example) Python 2.6.2
doesn't destroy the application but the newer Python 2.7.9 does.
I will keep it in mind.
Post by Big Stone
I guess the Qt application is created, then destroyed before use as not
referenced.
app = guidata.qapplication()
Post by x***@arcor.de
Hello to everyone,
some problems here to run the first guidata example
import guidata
guidata.qapplication() # not required if a QApplication has already been
created
import guidata.dataset.datatypes as dt
import guidata.dataset.dataitems as di
"""Example"""
a = di.FloatItem("Parameter #1", default=2.3)
b = di.IntItem("Parameter #2", min=0, max=10, default=5)
type = di.ChoiceItem("Processing algorithm",
("type 1", "type 2", "type 3"))
param = Processing()
param.edit()
from
https://pythonhosted.org/guidata/examples.html
The following 2 configurations
(1) WinPython-64bit-2.7.9.3.exe, installed on a Win7SP1x64 Computer
(2) WinPython-32bit-2.7.9.3.exe, installed on a Win7SP1x32 Computer
lead to the same message
'QWidget: Must construct a QApplication before a QPaintDevice'
in spyders python console and the examples guidata dialog doesn't appear.
The example works fine on a Windows XPSP3x32 Computer with Python(x,y)
2.6.2.0 installed.
Any ideas to solve this?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Big Stone
2015-05-19 18:07:17 UTC
Permalink
Yes,

The legacy code example was playing "russian roulette" by not keeping a
reference to the created object.
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...