Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1358

Not possible to grab QEvent::NonClientAreaMouseButtonRelease

    XMLWordPrintable

Details

    Description

      When dragging a window around on Windows by the titlebar, then it is only possible to get hold of the QEvent::NonClientAreaMouseButtonPress, but it is not possible to grab the QEvent::NonClientAreaMouseButtonRelease

      Reproducible with the following example:

      #include <QtGui>
      
      class DockWidget : public QDockWidget
      {
      public:
      	DockWidget(QWidget *parent) : QDockWidget(parent)
      	{
      	}
      	
      	bool event(QEvent *event)
      	{
      		if (event->type() == QEvent::NonClientAreaMouseButtonRelease) {
      		qDebug() << "button release";
      		}
      		if (event->type() == QEvent::NonClientAreaMouseButtonPress)
      		{
      			qDebug() << "button press";
      		}
      		return QDockWidget::event(event);
      	}
      
      };
      class MainWindow : public QMainWindow
      {
      	Q_OBJECT
      public:
      	MainWindow()
      	{
      		DockWidget *dock1 = new DockWidget(this);
      		addDockWidget(Qt::TopDockWidgetArea, dock1);
      		
      	}
      
      	bool event(QEvent *event)
      	{
      		if (event->type() == QEvent::NonClientAreaMouseButtonRelease) {
      		qDebug() << "mainwindow release ";
      		}
      		if (event->type() == QEvent::NonClientAreaMouseButtonPress)
      		{
      			qDebug() << "mainwindwo press";
      		}
      		return QMainWindow::event(event);
      	}
      
      	
      
      
      
      
      public slots:
      
      	void testSlot()
      	{
      	}
      
      
      };
      
      
      #include "main.moc"
      
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
          MainWindow box;
          box.show();
          return app.exec();    
      }
      
      
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pullatti Prasanth Ullattil
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes