Results 1 to 5 of 5

Thread: QVtkWidget under QTabWidget interactions are not working

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QVtkWidget under QTabWidget interactions are not working

    Here is my code:

    Qt Code:
    1. vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<vtkImageViewer2>::New();
    2. vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    3. // this class is reimplemented from VtkInteractorStyleImage
    4. vtkSmartPointer<MyVtkInteractorStyleImage> myInteractorStyle = vtkSmartPointer<MyVtkInteractorStyleImage>::New();
    5.  
    6. renderWindowInteractor->SetInteractorStyle(myInteractorStyle);
    7. myInteractorStyle->SetImageViewer(imageViewer);
    8.  
    9. imageViewer->SetupInteractor(renderWindowInteractor);
    10.  
    11. QVTKWidget *qvtkWidget = this->ptrMainWindow->GetQVtkWidget(viewerId);
    12. qvtkWidget->SetRenderWindow(imageViewer->GetRenderWindow());
    13. imageViewer->GetRenderer()->ResetCamera();
    14. imageViewer->Render();
    15. qvtkWidget->GetRenderWindow()->SetInteractor(imageViewer->GetRenderWindow()->GetInteractor());
    To copy to clipboard, switch view to plain text mode 

    When I use QVtkWidget as a mainwindow child then the interactions are working perfectly. But, I need to put three QVtkWidgets. So, I used QTabWidget inside mainwindow and put three QVtkWidgets in multiple tabs of QTabWidget. It load the data, but the interactions become jam.

    Any help.
    Last edited by anda_skoa; 13th May 2016 at 09:38. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,318
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QVtkWidget under QTabWidget interactions are not working

    Sorry, but I don't know enough about vtk to help. Doesn't Kitware have a forum for vtk? You might be better off to post your question there.

  3. #3
    Join Date
    May 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QVtkWidget under QTabWidget interactions are not working

    But I think, this is not the problem at vtk side. It may be more on Qt side. But any way thanks for your time.

Similar Threads

  1. keyPressEvent() not working for a tab within QTabWidget
    By sadastronaut in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2014, 19:13
  2. QTabWidget QSS transparency not working under Windows
    By il_gatto in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2011, 12:02
  3. Replies: 1
    Last Post: 6th December 2010, 15:18
  4. QT Class GUI Interactions??
    By mikey33 in forum Newbie
    Replies: 3
    Last Post: 19th November 2009, 02:01
  5. Block for interactions
    By mpi in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2009, 09:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.