Embedding a runtime graph in Qt3 designer generated UI

  • Thread starter Madhusudan Singh
  • Start date
M

Madhusudan Singh

Hi

Two questions :

1. Is it possible to use an import command in a qt3 designer code ? (I know
that it is possible to write python inside the braces -- but is it possible
to use an import command for some rather large libraries I wrote that I
need to access ?).

2. In the same vein, how does one embed a runtime plot in a qt3 UI ? It will
need to be a python solution since I am using python libraries to acquire
the data.
 
P

Phil Thompson

Hi
Two questions :

1. Is it possible to use an import command in a qt3 designer code ? (I
know
that it is possible to write python inside the braces -- but is it
possible
to use an import command for some rather large libraries I wrote that I
need to access ?).

You can include import statements in Designer's comment dialog by
prefixing them with "Python: ". This is covered in the PyQt documentation.
2. In the same vein, how does one embed a runtime plot in a qt3 UI ? It
will
need to be a python solution since I am using python libraries to acquire
the data.

Have a look at PyQwt which is a set of Python bindings for the Qt-based
Qwt plotting library.

Phil
 
M

Madhusudan Singh

Phil said:
Have a look at PyQwt which is a set of Python bindings for the Qt-based
Qwt plotting library.

Phil

Can a designer plugin be used this way ?

I tried inserting a FileChooser (available as an .so file under designer
plugins) object onto the main window and then used pyuic.

Traceback (most recent call last):
File "measure.py", line 16, in ?
f = MEASURE()
File "/home/m_singh/measure.py", line 422, in __init__
self.fileChooser1 = FileChooser(self.groupBox4,"fileChooser1")
NameError: global name 'FileChooser' is not defined

The wrapper in my .py file :

from qt import *
from measure import *
import sys
if __name__ == "__main__":
app = QApplication(sys.argv)
f = MEASURE()
f.show()
app.setMainWidget(f)
app.exec_loop()

An attempt to use QwtPlot gives the same kind of error. Or is the only way
forward for me to generate a .py file from non-plugin objects, and then
hand code the pyqwt part into that result (Or use Python: in the ui).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,986
Latest member
ColbyG935

Latest Threads

Top