Discussion:
Using widget plugins in Qt Designer
Michael DePalatis
2014-08-06 12:52:09 UTC
Permalink
I would like to use the custom CurveWidget and ImageWidget plugins for Qt
Designer which seem to be defined in a "qtdesigner.ui" file (found for me
on Linux in /usr/local/lib/python2.7/dist-packages/guiqwt/tests). However,
I cannot figure out how to actually do this, and the Qt Designer
documentation that talks about plugins seems to assume I want to write my
own plugins rather than just install those written by others. It is worth
noting that with Python(x,y) in Windows, it is setup automatically to give
me these plugins. Does anyone know how I can add these on Linux?
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Carlos Pascual
2014-08-06 13:20:12 UTC
Permalink
In our library [1], we do it as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from guiqwt.qtdesigner import create_qtdesigner_plugin
PlotPlugin = create_qtdesigner_plugin("guiqwt", "guiqwt.plot",
"CurveWidget",
icon="curve.png")
ImagePlotPlugin = create_qtdesigner_plugin("guiqwt", "guiqwt.plot",
"ImageWidget",
icon="image.png")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


[1]
https://sourceforge.net/p/sardana/sardana.git/ci/master/tree/taurus/lib/taurus/qt/qtdesigner/extraguiqwtplugin.py

I hope this helps


Carlos
Post by Michael DePalatis
I would like to use the custom CurveWidget and ImageWidget plugins for
Qt Designer which seem to be defined in a "qtdesigner.ui" file (found
for me on Linux in
/usr/local/lib/python2.7/dist-packages/guiqwt/tests). However, I
cannot figure out how to actually do this, and the Qt Designer
documentation that talks about plugins seems to assume I want to
write my own plugins rather than just install those written by
others. It is worth noting that with Python(x,y) in Windows, it is
setup automatically to give me these plugins. Does anyone know how I
can add these on Linux?
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
ALBA Synchrotron [http://www.albasynchrotron.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpascual-***@public.gmane.org
Phone: +34 93 592 4428
+----------------------------------------------------+
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Michael DePalatis
2014-08-06 14:13:59 UTC
Permalink
I appear to be missing something. This creates some Python objects, but
then how do I translate this into something that Qt Designer can understand
when I'm running it by itself?
Post by Carlos Pascual
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from guiqwt.qtdesigner import create_qtdesigner_plugin
PlotPlugin = create_qtdesigner_plugin("guiqwt", "guiqwt.plot",
"CurveWidget",
icon="curve.png")
ImagePlotPlugin = create_qtdesigner_plugin("guiqwt", "guiqwt.plot",
"ImageWidget",
icon="image.png")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1]
https://sourceforge.net/p/sardana/sardana.git/ci/master/tree/taurus/lib/taurus/qt/qtdesigner/extraguiqwtplugin.py
I hope this helps
Carlos
Post by Michael DePalatis
I would like to use the custom CurveWidget and ImageWidget plugins for
Qt Designer which seem to be defined in a "qtdesigner.ui" file (found
for me on Linux in
/usr/local/lib/python2.7/dist-packages/guiqwt/tests). However, I
cannot figure out how to actually do this, and the Qt Designer
documentation that talks about plugins seems to assume I want to
write my own plugins rather than just install those written by
others. It is worth noting that with Python(x,y) in Windows, it is
setup automatically to give me these plugins. Does anyone know how I
can add these on Linux?
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
ALBA Synchrotron [http://www.albasynchrotron.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
Phone: +34 93 592 4428
+----------------------------------------------------+
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Carlos Pascual
2014-08-07 06:37:25 UTC
Permalink
Ups..., sorry, you are right.
I forget about these details because we use a custom-modified qtdesigner
[1] that takes care of it ...

But I would say that you just need to set the PYQTDESIGNERPATH
environment variable to contain the dirs where your plugins are created
(make sure you define them in files whose name ends in "*plugin.py"). Have
a look at the QtDesigner docs:

http://pyqt.sourceforge.net/Docs/PyQt4/designer.html#writing-qt-designer-plugins

Refs:

[1]
https://sourceforge.net/p/sardana/sardana.git/ci/master/tree/taurus/lib/taurus/qt/qtdesigner/taurusdesigner.py

Cheers!
Post by Michael DePalatis
I appear to be missing something. This creates some Python objects,
but then how do I translate this into something that Qt Designer can
understand when I'm running it by itself?
Post by Carlos Pascual
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from guiqwt.qtdesigner import create_qtdesigner_plugin
PlotPlugin = create_qtdesigner_plugin("guiqwt", "guiqwt.plot",
"CurveWidget",
icon="curve.png")
ImagePlotPlugin = create_qtdesigner_plugin("guiqwt", "guiqwt.plot",
"ImageWidget",
icon="image.png")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1]
https://sourceforge.net/p/sardana/sardana.git/ci/master/tree/taurus/
lib/taurus/qt/qtdesigner/extraguiqwtplugin.py
I hope this helps
Carlos
Post by Michael DePalatis
I would like to use the custom CurveWidget and ImageWidget plugins
for Qt Designer which seem to be defined in a "qtdesigner.ui"
file (found for me on Linux in
/usr/local/lib/python2.7/dist-packages/guiqwt/tests). However, I
cannot figure out how to actually do this, and the Qt Designer
documentation that talks about plugins seems to assume I want to
write my own plugins rather than just install those written by
others. It is worth noting that with Python(x,y) in Windows, it is
setup automatically to give me these plugins. Does anyone know how I
can add these on Linux?
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
ALBA Synchrotron [http://www.albasynchrotron.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpascual-***@public.gmane.org
Phone: +34 93 592 4428
+----------------------------------------------------+
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...