By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,977 Members | 1,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,977 IT Pros & Developers. It's quick & easy.

Embedding a runtime graph in Qt3 designer generated UI

P: n/a
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.
Aug 8 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> 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

Aug 8 '05 #2

P: n/a
Phil Thompson wrote:
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


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).
Aug 9 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.