[vtkusers] QMainWindow+QVTKWidget issues on Mac

Raul Huertas rax20037 at gmail.com
Tue Nov 3 22:56:46 EST 2015


I had similar issues, use QVTKWidget2.



> El 3 nov. 2015, a las 4:10 p.m., Christian Askeland <christian.askeland at gmail.com> escribió:
> 
> 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
> 
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151103/05201361/attachment.html>


More information about the vtkusers mailing list