[vtkusers] QMainWindow+QVTKWidget issues on Mac

Christian Askeland christian.askeland at gmail.com
Wed Nov 4 15:22:06 EST 2015


That's very interesting. In my example code, replacing QVTKWidget with
QVTKWidget2 gives exactly the same result. Do you have any code showing the
improvement? Do you, for example, wrap the QVTKWidget2 in anything?

-Christian

On Wed, Nov 4, 2015 at 4:56 AM, Raul Huertas <rax20037 at gmail.com> wrote:

> 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/20151104/7b7ed254/attachment.html>


More information about the vtkusers mailing list