Is there the equivalent in Qt of the WindowFromPoint (win32) or XTranslateCoordinates (X-windows) method, which returns a window (preferably a QWidget) given a screen(global) x,y ? I have trawled the doc, but can't find one.
Is there the equivalent in Qt of the WindowFromPoint (win32) or XTranslateCoordinates (X-windows) method, which returns a window (preferably a QWidget) given a screen(global) x,y ? I have trawled the doc, but can't find one.
Try:
Qt Code:
To copy to clipboard, switch view to plain text mode
Many thanks. Got it. Must get new glasses.
Hi
I have the same need but this call doesn't seem to work for me. I need to know if QT have a call able to get the handle of a child control (like, for example, a text box) present at specified xy coordinates (like WindowFromPoint API do). Reading the documentation of this call it said:
Returns the widget at global screen position point, or 0 if there is no Qt widget there.
Than it seem it can detect only qt widget and not standard widget.
Do you know if using qt is possible to hqve a call act like WindowFromPoint but working for all child controls in windows, linux and mac?
Thank you
QApplication::widgetAt() works for all the widgets in the Qt application itself, top-level or child, thinly wrapped native or fully Qt. A Qt application cannot return a QWidget* for a non-Qt widget, or for an arbitrary widget in another application for obvious reasons. Use the Windows API if you want a Windows API handle to the window at the specified location. Do whatever the equivalent is for the Mac OS X and X11 environments. Just wanting to do this sort of thing means your application is almost certainly going to be platform-dependent anyway.
Hi
Thank you for reply. I could develop different code based to the running platform. I know how to do under windows, just found an example seem working in the same way for mac but I still miss the linux side. Do you know if linux have some api similar to WindowFromPoint()?
Thank you
Bookmarks