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. Strange behaviour of QWidget::leaveEvent(QEvent *ev)
Forum Updated to NodeBB v4.3 + New Features

Strange behaviour of QWidget::leaveEvent(QEvent *ev)

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.8k 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.
  • C Offline
    C Offline
    ChanchoCiego
    wrote on last edited by
    #1

    Hello, good afternoon,

    I have a QMainWindow that creates a QWidget wA borderless with QWidget::setWindowFlags(Qt::ToolTip|)Qt::WindowStaysOnTopHint), wA redeploys void leaveEvent(QEvent *ev)

    wA creates other two QWidget, wB and wC without edges with QWidget::setWindowFlags(Qt::ToolTip|)Qt::WindowStaysOnTopHint), and also redeploys void leaveEvent(QEvent *ev)

    Then, QMainWindow creates and displays wA and wA creates and displays wB and wC.

    QMainWindow launches wA when the mouse cursor passes over an edge of the desktop, and when the mouse cursor is outside of wA, and wB and WC, the QWidgets should hide but they are not hidden.

    So the leaveEvent event is thrown, each of the three QWidget should before I click

    I tried with activateWindow() and setFocus() but does not change the behavior.

    Is this normal? As I can do to make the QWidgets be concealed without having to click on each one of them?

    Thanks a lot.

    Dario.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mohsen
      wrote on last edited by
      #2

      where have you got such "leaveEvent(QHideEvent *ev)" for QWidget?
      leaveEvent and hideEvent both are separated implementable methods. we don't have leaveEvent with QHideEvent prototype.
      use the correct method based on "documents":http://qt-project.org/doc/qt-4.8/qwidget.html#leaveEvent

      @
      void QWidget::leaveEvent ( QEvent * event )
      @

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChanchoCiego
        wrote on last edited by
        #3

        Sorry, the correct is leaveEvent(QEvent *ev)
        was a mistake in drafting

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mohsen
          wrote on last edited by
          #4

          so, did your problem solved after using "leaveEvent(QEvent *event)"?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChanchoCiego
            wrote on last edited by
            #5

            Not because the mistake with "leaveEvent(QEvent *event) was to write the post
            The code use "leaveEvent(QEvent *event)

            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