MantisBT - VTK
View Issue Details
0015013VTK(No Category)public2014-09-29 09:472016-08-12 09:55
B3nni 
Kitware Robot 
normalminorhave not tried
closedmoved 
6.0.0 
 
TBD
incorrect functionality
0015013: QMainMenu behaves weirdly if QVTKWidget is the central widget of QMainWindow
As already posted to http://stackoverflow.com/questions/25797486/qmainmenu-behaves-weirdly-if-qvtkwidget-is-the-central-widget-of-qmainwindow [^] (without any outcome).
Qt Version: 5.3.1
vtk Version: 6.1.0

The main menu in my Qt/vtk application is behaving weirdly if the central widget is QVTKWidget. Errornous clicking behaviour on the menu is as follows:

First click: pop down
Second click: pop up
Third click: does nothing
Fourth click: pop down again

Now this wouldn't be that bad, but the problem is that the states are remembered. So if the user clicks the menu twice -- i.e., closes it manually -- the next click on the menu bar will not do anything, even if he used other GUI element in between. This leads to an annoying user experience.

I created a minimal failing example:


#include <QAction>
#include <QApplication>
#include <QLabel>
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>

#include <QVTKWidget.h>

int main(int argc, char** argv)
{
  QApplication app(argc, argv);

  QMainWindow mainWindow;
  QMenu *menu = mainWindow.menuBar()->addMenu("TestMenu");
  QAction *action = menu->addAction("TestAction");

  // Setting the central widget to QVTKWidget, produces a weirdly
  // behaving menu bar:
  // First click: pop down
  // Second click: pop up
  // Third click: does nothing
  // Fourth click: pop down again
  mainWindow.setCentralWidget(new QVTKWidget());

  // Setting the central widget to any other QWidget, like QLabel, produces a
  // normally behaving menu bar:
  // First click: pop down
  // Second click: pop up
  // Third click: pop down again
  // mainWindow.setCentralWidget(new QLabel("TestLabel"));

  mainWindow.show();

  return app.exec();
}
qt, VTK
Issue History
2014-09-29 09:47B3nniNew Issue
2014-09-29 09:48B3nniTag Attached: qt
2014-09-29 09:48B3nniTag Attached: VTK
2015-03-26 23:59B3nniNote Added: 0034328
2016-07-06 16:47Berk GeveciStatusbacklog => expired
2016-08-12 09:55Kitware RobotNote Added: 0037342
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0034328)
B3nni   
2015-03-26 23:59   
The bug does not occur any more in vtk 6.2.0 with Qt 5.4.1.
Close?
(0037342)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.