Results 1 to 3 of 3

Thread: Qt and VTK graphical issue on MacOS when using QVTKWidget and QMainWindow

  1. #1
    Join Date
    Aug 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt and VTK graphical issue on MacOS when using QVTKWidget and QMainWindow

    I get a graphical glitch with the top toolbar in a QMainWidow when going fullscreen with macOS. The issue appears when using QVTKWidget in the central widget.

    Minimal program that reproduces the issue:

    Qt Code:
    1. #include <QApplication>
    2. #include <QMainWindow>
    3. #include <QWidget>
    4. #include <QToolBar>
    5. #include <QVTKWidget.h>
    6.  
    7. int main(int argc, char *argv[])
    8. {
    9. QApplication app(argc, argv);
    10.  
    11. QMainWindow * window = new QMainWindow();
    12. QVTKWidget * widget = new QVTKWidget(window);
    13. window->setCentralWidget(widget);
    14. QToolBar * toolBar = new QToolBar(window);
    15. window->addToolBar(Qt::TopToolBarArea, toolBar);
    16.  
    17. window->show();
    18. return app.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 

    Screen Shot 2017-07-31 at 20.49.45.jpg

    If QWidget is used instead of a QVTKWidget the glitch does not occur:

    Qt Code:
    1. #include <QApplication>
    2. #include <QMainWindow>
    3. #include <QWidget>
    4. #include <QToolBar>
    5. #include <QVTKWidget.h>
    6.  
    7. int main(int argc, char *argv[])
    8. {
    9. QApplication app(argc, argv);
    10.  
    11. QMainWindow * window = new QMainWindow();
    12. QWidget * widget = new QWidget(window);
    13. window->setCentralWidget(widget);
    14. QToolBar * toolBar = new QToolBar(window);
    15. window->addToolBar(Qt::TopToolBarArea, toolBar);
    16.  
    17. window->show();
    18. return app.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 

    Screen Shot 2017-07-31 at 20.50.38.jpg

    macOS Sierra, Qt 5.9.1, VTK 8.0.0 (I also observed this behavior with previous versions of VTK).

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt and VTK graphical issue on MacOS when using QVTKWidget and QMainWindow

    Which Xcode version you use?

    terminal this...
    Qt Code:
    1. /usr/bin/xcodebuild -version
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt and VTK graphical issue on MacOS when using QVTKWidget and QMainWindow

    I use cmake & Xcode Xcode 7.3.1 osx 10.11.6 el capitan
    Build version 7D1014
    This error i have to build your code:
    Ask error in beautifull new Xcode 7-8

    http://www.vtk.org/Wiki/VTK/VTK_6_Mi...equire_defines

    If you build your project with CMake, and you use the standard find_package(VTK) and include(${VTK_USE_FILE}) then this problem should not occur. (Because the defines will be automatically added for you by virtue of the include(${VTK_USE_FILE})...) Consider following the guide to using implementation modules, which has fuller details on using implementation modules without using CMake if your project demands it.

Similar Threads

  1. Replies: 4
    Last Post: 6th March 2014, 06:57
  2. Dealing With a Graphical Issue in ToolBar
    By korg1988 in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2013, 21:16
  3. Strange issue with QFileOpenEvent on MacOS
    By Andrey Saenko in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2011, 17:50
  4. Application.app/Contents/MacOS file issue
    By sgmurphy19 in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2008, 10:03
  5. Another MacOS issue ?!
    By Nemo in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2006, 10:16

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.