Background Information:
I am trying to create an application using Qt. This application has QMdiArea and a child window. My child window will have a menu that can be integrated into QMdiArea or shared and attached to the child himself. Although, this is a little more detailed than necessary ...
Problem:
I would like my child widget to have a menu labeled "CTRL + W". But, since I'm using QMdiArea, the shortcut is already in use, calling:
QAction :: eventFilter: Undefined label overload: Ctrl + W
How can I get rid of this shortcut and require it inside my child widget?
Update:
Here is what I tried with no luck:
class MDI : public QMdiArea
{
Q_OBJECT
private:
bool event(QEvent *tEvent)
{
if (tEvent->type() == QEvent::KeyPress)
{
QKeyEvent* ke = static_cast<QKeyEvent*>(tEvent);
if (ke->key()== Qt::Key_W && ke->modifiers() & Qt::ControlModifier)
emit KeyCW();
return true;
}
return QMdiArea::event(tEvent);
}
public:
signals:
void KeyCW();
};
, - , change Qt::Key_W to Qt::Key_L. - . W . event QMainWindow, eventFilter QMdiArea. , - , QMdiArea.