FAQ
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.

Search Discussions

  • Phil Thompson at Aug 8, 2005 at 7:21 am

    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
  • Adriaan Renting at Aug 8, 2005 at 1:59 pm
    I find Eric3 very easy to work with when using Qt+Python. It will
    generate a Python wrapper for your Qt (Designer designed) form, that you
    can the sub-class and use as if it was a Python object.
    I'm hoping it will be available (together with PyQt, etc.) for Qt4 soon,
    but as I'm not paying a dime for it, I can only hope...

    Adriaan Renting | Email: renting at astron.nl
    ASTRON | Phone: +31 521 595 217
    P.O. Box 2 | GSM: +31 6 24 25 17 28
    NL-7990 AA Dwingeloo | FAX: +31 521 597 332
    The Netherlands | Web: http://www.astron.nl/~renting/
    "Phil Thompson" <phil at riverbankcomputing.co.uk> 08/08/05 9:21 AM >>>
    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
  • Madhusudan Singh at Aug 9, 2005 at 9:54 pm

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 8, '05 at 4:51a
activeAug 9, '05 at 9:54p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase