is there any other ways to promote more than one class? So actualy I need to use PlotWidget and GhrapicLayoutWidget
Pada Rabu, 18 Desember 2013 09.36.06 UTC+7, Luke Campagnola menulis: > > On Mon, Dec 16, 2013 at 7:26 AM, Su-Shin Ang <[email protected] > <javascript:>> wrote: > >> I am trying to embed a pyqtgraph, i.e a PlotWidget, into a GraphicsView >> window created within qt designer. I followed the steps included in the >> documentation: >> >> "Pyqtgraph’s widgets can be included in Designer’s ui files via the >> “Promote To...” functionality: >> >> 1. In Designer, create a QGraphicsView widget (“Graphics View” under >> the “Display Widgets” category). >> 2. Right-click on the QGraphicsView and select “Promote To...”. >> 3. Under “Promoted class name”, enter the class name you wish to use >> (“PlotWidget”, “GraphicsLayoutWidget”, etc). >> 4. Under “Header file”, enter “pyqtgraph”. >> 5. Click “Add”, then click “Promote”." >> >> After this, how do I use the methods within the widget? I saw some >> suggestions about doing this in the Main Window class? Is that the right >> place to do so? If possible, I would really appreciate a code stub, >> providing an example of how the widget might be deployed. >> > > > There are a few different approaches to getting your .ui file loaded in to > python. See: > http://stackoverflow.com/questions/2398800/linking-a-qtdesigner-ui-file-to-python-pyqt > > The VideoSpeedTest and ScatterPlotSpeedTest examples in pyqtgraph both use > .ui files that were compiled using the tools/rebuildUi.py script (which > just calls pyuic4 or pyside-uic, depending on which you have). You could > look through those to see how they access the widgets defined in the .ui > file. > > I have just added an example of another approach to the repository at > github: > https://github.com/pyqtgraph/pyqtgraph/commit/4e9e75817fb0d2b5f6880278857621af30d7d0f1 > These directly load the .ui file into python at runtime, rather than > compiling python modules with uic. > > Let us know if you need more help with this.. > > > Luke > -- You received this message because you are subscribed to the Google Groups "pyqtgraph" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/236c9e89-83d4-49cd-9e9b-01ce785a932d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
