Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MouseMoveEvent and QColorDialog

MouseMoveEvent and QColorDialog

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deac
    wrote on last edited by
    #1

    Hello,
    I have a problem with the mouse event when a QColorDialog is opened.
    The problem appends on a mac 10.9.4, with Qt5.2.
    I made a sample to display the problem:
    I open a QColorDialog on doubleClick event of the mainWindow. When the QColorDialog is closed an event MouseMoveEvent is send on the mainWindow. This event have no reason to be sent.
    Note : sometimes the mouseMoveEvent is not sent, I think it depends of the position of the dialog and mouse.

    The problem doesn’t appear on an ubuntu 13.04 with Qt5.2 and on Mac 10.6.8 with Qt4.8.
    Have you got any idea ?

    @void MainWindow::mouseDoubleClickEvent(QMouseEvent* event)
    {
    qDebug()<<"MainWindow::mouseDoubleClickEvent "<<event->pos();
    QColorDialog::getColor( QColor(255,0,0) , this);
    }

    void MainWindow::mouseMoveEvent(QMouseEvent* event)
    {
    qDebug()<<"MainWindow::mouseMoveEvent "<<event->pos();
    if ( event->buttons() == Qt::LeftButton )
    {
    qDebug()<<"leftButton";
    }
    }

    void MainWindow::mousePressEvent(QMouseEvent* event)
    {
    qDebug()<<"MainWindow::mousePressEvent "<<event->pos();
    }

    void MainWindow::mouseReleaseEvent(QMouseEvent* event)
    {
    qDebug()<<"MainWindow::mouseReleaseEvent "<<event->pos();
    }@

    Afeter double clic on mainWindow and select a color the console display:

    MainWindow::mousePressEvent QPoint(191,159)
    MainWindow::mouseReleaseEvent QPoint(191,159)
    MainWindow::mousePressEvent QPoint(191,159)
    MainWindow::mouseDoubleClickEvent QPoint(191,159)
    MainWindow::mouseMoveEvent QPoint(292,369)
    leftButton
    MainWindow::mouseReleaseEvent QPoint(292,369)

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      I checked on windows as well. It does not send the move event as explained here. It seems to be bug to me. Did it cause any issue to you ? We can make work-around to fix this. Don't pass this as parent in second argument.
      i.e try with

      QColorDialog::getColor( QColor(255,0,0));

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • D Offline
        D Offline
        deac
        wrote on last edited by
        #3

        Thanks for your reply.

        I tried without parent but it doesn't work either.
        It is a problem for me, I have made a workaround with a boolean but it is not satisfactory.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved