So this is where there is a slight disconnect in the way that
QtCreator/Designer auto fills the name of the header file. You should use
the name of the actual python file without the ".py". In this case that
would be "HistogramLUTWidget". Do not use the ".h" suffix. I think
QtCreateor/Designer fills that in automatically for a C++ header file.

Hope that helps.
Erik

On Thu, Jul 23, 2020 at 12:35 PM pilkrow slash <[email protected]>
wrote:

> Hello, so I first create a qwidget which I promote to HistogramLUTWidget,
> right?
> In the dialog window I choose the base class name as "QWidget"
> the Promoted class name to "HistogramLUTWidget"
> Do I use the pyqtgraph.h as Header File or I have to use another one?
> I attached a snapshot of qt designer.
> The qwidget is called wu.
>
> [image: Screenshot from 2020-07-23 21-29-31.png]
>
>
> Finally I have to insert the widget into my  code:
>
>
> uic.loadUi(‘CEtb26.ui’, self)
>
> self.wu = self.findChild(HistogramLUTWidget, 'wu')
> self.wu = pg.HistogramLUTWidget(fillHistogram=False)
>
>
>
> Is it correct?
>
> Best regards
>
> Τη Πέμπτη, 23 Ιουλίου 2020 - 7:37:51 μ.μ. UTC+3, ο χρήστης Erik J έγραψε:
>>
>> Hello,
>>
>> I have done this a few times. To make it work, I use a QWidget for the
>> histogram display which I then promote to a pyqtgraph HistogramLutWidget.
>> Try changing your QGraphics widget to be a QWidget then promote it to a
>> HistogramLUTWidget. I think if you do that the rest should work fine.
>>
>> Regards,
>> Erik
>>
>> On Thu, Jul 23, 2020 at 8:58 AM pilkrow slash <[email protected]>
>> wrote:
>>
>>> Hello, I have little experience about pyqtgraph and sometimes simple
>>> things look difficult.
>>> What I'm looking for is to display a histogramLUT widget into a gui
>>> created using qt Designer.
>>> I import the .ui file but I don't know how I can insert it into my code
>>> and connect it with an imageItem.
>>>
>>> [image: scrnsht1.png]
>>>
>>> [image: scrnsht0.png]
>>>
>>>
>>>
>>> class MainWindow(QMainWindow, ProcessDicom):
>>> …
>>> …
>>> uic.loadUi(‘CEtb26.ui’, self)
>>> …
>>> …
>>> self.im1 = pg.ImageItem(img,levels=[0, 255])
>>> self.histWindow = self.findChild(PlotWidget, ‘wu’)
>>> self.histWindow.setImageItem(self.im1)
>>>
>>>
>>> but the only thing I get is an empty plot!
>>>
>>>
>>> Thank you for your time.
>>>
>>> --
>>> 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/7e99924b-7997-4853-b486-e58c08bbd841o%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pyqtgraph/7e99924b-7997-4853-b486-e58c08bbd841o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
> 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/8da5b793-4558-4573-9e09-187ab3e49d4eo%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/8da5b793-4558-4573-9e09-187ab3e49d4eo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

************************************************
Erik JohanssonProject Manager, Wavefront Correction System
National Solar Observatory
Daniel K Inouye Solar Telescope
3665 Discovery Drive, Boulder, CO 80303
Tel: 303-735-7723
************************************************

-- 
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/CAMZ%2Bua%3D9LUg3SLvXy%3DCyKZbxfFT-8d9f%2BBc62P5o%2BDbunBWCKg%40mail.gmail.com.

Reply via email to