Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3358642
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:46:37+00:00 2026-05-18T02:46:37+00:00

This is my first attempt at writing a QT app, and I’m just trying

  • 0

This is my first attempt at writing a QT app, and I’m just trying to get a feel for how it works. My goal is to have a 400×400 widget which knows the exact position of the mouse when the mouse is hovering over it. For example, if the mouse was hovering in the top left corner, the position might be 10,10 (or something similar). If the mouse is in the bottom right corner, it might say 390,390.

Eventually, these coordinates will be displayed in a label on the main window, but that should be trivial. I’m stuck at the actual fetching of the coordinates. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:46:38+00:00Added an answer on May 18, 2026 at 2:46 am

    For your widget, you must enable mouse tracking.

    Then, you can either install an event filter, paying attention to mouse events and looking for the move event, or you can inherit from QWidget and override the mouse event, looking for mouse move events.

    http://doc.qt.io/qt-4.8/qwidget.html#mouseTracking-prop

    http://doc.qt.io/qt-4.8/eventsandfilters.html

    http://doc.qt.io/qt-4.8/qmouseevent.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application using DDD techniques. This is my first attempt at a
Up front: This is my first attempt at an Android app. I'm in that
I'm trying to create a simple threading procedure (granted this is my first attempt
First of all, this is my first attempt at a silverlight app and it's
My issue is I am trying my first attempt at writing a very basic
This is my first ever attempt at writing a recursive function in c. The
Ok, so this is my first attempt at doing anything with JSON. I have
I am currently writing my first iPhone app, but have encountered an issue. I
This is my first attempt to build an ASP.NET server control. Writing the control
This is my first-attempt at writing anything even slightly complicated in C++, I'm attempting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.