2

I have subclassed the QMdiSubWindow and overwritten the QMoveEvent. But when actually moving the subwindow, the QMoveEvent is never emitted. Any ideas why that could be? Any suggestions on how to fix my problem?

subwindow.h

#ifndef SUBWINDOW_H
#define SUBWINDOW_H

#include <QtCore>
#include <QtGui>
#include "iwb4.h"
#include "ui_iwb4.h"


class SubWindow : public QMdiSubWindow
{
Q_OBJECT

public:
    SubWindow();

void moveEvent(QMoveEvent* e);

private:

};

#endif // SUBWINDOW_H

subwindow.cpp

#include "stdafx.h"
#include "SubWindow.h"
#include "iwb4.h"
#include "ui_iwb4.h"
#include "OpenGLScene.h"
#include <QtCore>
#include <QtGui>

SubWindow::SubWindow()
: QMdiSubWindow()
{

}
void SubWindow::moveEvent(QMoveEvent* e)
{
    if (e->pos() != e->oldPos())
    {
    //do stuff
    }
}
hbrown
  • 41
  • 4
  • is it possible to post some code? – fecub May 19 '15 at 07:21
  • `Move events are sent to widgets that have been moved to a new position relative to their parent.` I see no parent in the example. – Amartel May 19 '15 at 08:29
  • Okay I see, but now I have set my mainwindow as the parent, but it still doesn't change anything. Do I have to do anyting else to emit the signal? As I understood it, it should just be emitted whenever a move has been made. – hbrown May 19 '15 at 11:32

0 Answers0