Re: [Interest] Best way to get a QWidget from a device context (HDC)

2015-01-08 Thread Jason Dolan
Thanks for the input guys. Given what I had to work with, I was able to save a local hash of the context and widget and do a lookup from that. However, It’s nice to know QWidget::find(wID) is well optimized. I wonder what the performance is of the Windows function WindowFromDC? Oh well, I

Re: [Interest] Best way to get a QWidget from a device context (HDC)

2015-01-07 Thread Andreas Pakulat
Hi Jason, On Wed, Jan 7, 2015 at 9:16 PM, Jason Dolan ja...@pcc.com wrote: I’m stuck with some 3rd party code where the input is a device context (HDC), and I need to get the widget it’s associated with. My current implementation (completely untested as of yet) is: QWidget *w =

Re: [Interest] Best way to get a QWidget from a device context (HDC)

2015-01-07 Thread Thiago Macieira
On Wednesday 07 January 2015 15:16:56 Jason Dolan wrote: I’m stuck with some 3rd party code where the input is a device context (HDC), and I need to get the widget it’s associated with. My current implementation (completely untested as of yet) is: QWidget *w =

[Interest] Best way to get a QWidget from a device context (HDC)

2015-01-07 Thread Jason Dolan
I’m stuck with some 3rd party code where the input is a device context (HDC), and I need to get the widget it’s associated with. My current implementation (completely untested as of yet) is: QWidget *w = QWidget::find((WId)WindowFromDC(hDC)); #1: I’m not even sure this will work (although I