[vtkusers] qcombobox as a child of qvtkwidget doesn't show up on mac.

Simon ESNEAULT simon.esneault at gmail.com
Tue Jan 12 04:15:39 EST 2016


Hello,

Sorry I got no time to give you a full example but this
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/TexturedButtonWidget
As well as this class vtkEventQtSlotConnect
should point you to the right direction, just connect the button widget
vtkCommand::StateChangedEvent to a slot and popup the menu inside the slot :

vtkButtonWidget* l_button_widget = vtkButtonWidget::New();
// Configure the button widget here, create a representation, map it to a
Viewport

vtkEventQtSlotConnect* l_connection = vtkEventQtSlotConnect::New();
l_connection->Connect( l_button_widget, vtkCommand::StateChangedEvent,
this, SLOT( update() ) );

Something like this
Good luck, sorry for the late reply

Simon



2016-01-06 1:06 GMT+01:00 rakesh patil <prakeshofficial at gmail.com>:

> Hi Simon,
>
> Thank you for the reply. Can you point me to some links to examples
> related to this (texture button for popup) ?
>
> Thanks
>
>
> On Tuesday, January 5, 2016, Simon ESNEAULT <simon.esneault at gmail.com>
> wrote:
>
>> Hello,
>>
>> Well from my experience, it's is not easy to draw a qt widget on top of a
>> QVTKWidget, especially on OSX.
>> You can try to add some Qt flags (Qt::Tool or Qt::WindowStaysOnTopHint)
>> to the combobox. This may or not work, depending the version of Qt you're
>> running, and it may also introduce some weird behavior ...
>>
>> I would rather advice you put the widget beside the QVTKWidget, in a
>> vertical/horizontal layout, or you use some of VTK widget if you really
>> want to draw within the view (use a TextureButton together with a qt popup
>> menu for example)
>>
>> Good luck
>> Simon
>>
>> 2016-01-05 18:52 GMT+01:00 rakesh patil <prakeshofficial at gmail.com>:
>>
>>> Hello,
>>>
>>> I have derived my own class from QVTKwidget class. In the constructor of
>>> the class I am creating a combo box whose parent will be QVTKwidget.
>>> Example:
>>>
>>> Class mywidget : public QVTKwidget
>>> {
>>>    public:
>>>       mywidget ();
>>> };
>>>
>>> mywidget::mywidget ()
>>> {
>>>   ...
>>>   ...
>>>
>>>   mycombo = new QCombobox (this);
>>>   mycombo->setGeometry (0, 0, width, height);
>>>   ...
>>> }
>>>
>>> on MAC, the combo box appears below QVTKwidget and all vtk objects are
>>> rendered on top of the combo box, thus hiding it behind QVTKwidget. I need
>>> the combo box to appear above(on top of) QVTKwidget at top left corner. Can
>>> anyone help me to overcome this problem. ?
>>>
>>> Thanks
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>>
>>>
>>
>>
>> --
>> ------------------------------------------------------------------
>> Simon Esneault
>> Rennes, France
>> ------------------------------------------------------------------
>>
>


-- 
------------------------------------------------------------------
Simon Esneault
Rennes, France
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160112/a6bdcfd8/attachment.html>


More information about the vtkusers mailing list