[vtkusers] QMainWindow+QVTKWidget issues on Mac

Christian Askeland christian.askeland at gmail.com
Tue Nov 3 16:10:04 EST 2015


Hi all,

I have an issue with QMainWindow when using a QVTKWidget as the
centralwidget. Both the Toolbars and DockWidgets get messed up, meaning
that for some toolbar elements get unclickable after some reordering of the
elements, and moving DockWidgets causes a large white square to appear.

The following snippet produces a white square over the window when
attempting to dock DockWidget "B" onto Dockwidget "A":
(A full compiling version is also available at
https://github.com/christiana/issue1044)

main.cpp:

int main(int argc, char *argv[])

{

  QApplication app(argc, argv);


  MainWindow window;

  window.resize(800,500);

  window.show();


  return app.exec();

}

MainWindow.cpp:
MainWindow::MainWindow(){	QVTKWidget* widget = new
QVTKWidget();	this->setCentralWidget(widget);
	// The hidden toolbar makes the bug more obvious.	// Without this the
drag/drop of QDockWidgets is still messed
up.	this->addHiddenToolbar();
	// drag A on top of B -> white square appears (if not already present
at startup)	this->addDock("A");	this->addDock("B");}
void MainWindow::addHiddenToolbar(){	QToolBar* toolbar = new
QToolBar("FooBar");	this->addToolBar(toolbar);	toolbar->hide();	toolbar->addAction("Foo");}
void MainWindow::addDock(QString name){	QDockWidget* dockWidget = new
QDockWidget(name, this);	dockWidget->setWidget(new
QLabel(name));	this->addDockWidget(Qt::LeftDockWidgetArea,
dockWidget);}

This seems to have been present since Qt 5.0,
and is still there with VTK 6.3 and Qt 5.5.1.

Mac only (OSX10.8-10.11).

I'll continue working on this issue, but any tips and comments are

very welcome.


Best,

Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151103/08f05aa5/attachment.html>


More information about the vtkusers mailing list