[Qt-interest] When does QWidget have HWND?
william lee
welemon at gmail.com
Mon Feb 21 06:51:56 CET 2011
hi Girish,
Thanks for your info, I tested on XP today, and no surprise, the alien
widget works well.
There is only one HWND for top window, no HWND for each child widgets.
The same build binary runs on Win7 will have child each HWND, but runs on XP
it will only have one.
Maybe this is a bug on Win7, as you point out.
thanks!
William L.
On Fri, Feb 18, 2011 at 9:46 PM, william lee <welemon at gmail.com> wrote:
> Hi Girish,
> I am using win 7, but not touch screen.
> Is this problem happen on all win7 machine?
> I can test on XP when back to office.
>
> thanks,
> William L.
>
> On Fri, Feb 18, 2011 at 7:20 PM, Girish Ramakrishnan <
> girish at forwardbias.in> wrote:
>
>> Hi William,
>> Which Windows version are you using? Windows 7? Are you aware of
>> http://bugreports.qt.nokia.com/browse/QTBUG-14297?
>>
>> Girish
>>
>> On Fri, Feb 18, 2011 at 2:03 PM, william lee <welemon at gmail.com> wrote:
>> > Hi,
>> >
>> > I was using spy++ to check Qt application window, sometime I get the
>> HWND
>> > for each widget, like button, edit, combo etc. Sometime there isn’t HWND
>> for
>> > child widget at all.There is only a whole window HWND.
>> >
>> >
>> >
>> > For example, Qt 4.6.1.
>> >
>> > 1. When you launch qtdemo’s browser project(QtWebKit demo
>> browser),
>> > you can use spy++ to check on it, there is only one parent window HWND.
>> No
>> > child window HWND, like menu bar, toolbar etc.
>> >
>> > 2. When you launch qtdemo’s Text Edit project, you can use spy++
>> to
>> > check again, this time you will see every child window has HWND,
>> including
>> > menu bar, toolbar etc.
>> >
>> > 3. Another weird example is qtdemo’s SQL Browser project, when you
>> > launch this application, it will pop up a dialog, “Connect…”. This
>> Dialog is
>> > for adding connections.
>> >
>> > The first time launch this dialog(when app start, it will auto popup),
>> you
>> > use spy++ to check on it, there is only one HWND for whole dialog, no
>> child
>> > HWND.
>> >
>> > But when you close it, and launch again from File->Add connection…, you
>> can
>> > use spy++ to check again, now it will have all child widget with HWND…
>> >
>> >
>> >
>> > I googled, and find something about alien widget, I read this before.
>> The
>> > comments are like:
>> >
>> > Native Widgets vs Alien Widgets
>> >
>> > Introduced in Qt 4.4, alien widgets are widgets unknown to the windowing
>> > system. They do not have a native window handle associated with them.
>> This
>> > feature significantly speeds up widget painting, resizing, and removes
>> > flicker.
>> >
>> > Should you require the old behavior with native windows, you can choose
>> one
>> > of the following options:
>> >
>> > Use the QT_USE_NATIVE_WINDOWS=1 in your environment.
>> > Set the Qt::AA_NativeWindows attribute on your application. All widgets
>> will
>> > be native widgets.
>> > Set the Qt::WA_NativeWindow attribute on widgets: The widget itself and
>> all
>> > of its ancestors will become native (unless
>> Qt::WA_DontCreateNativeAncestors
>> > is set).
>> > Call QWidget::winId to enforce a native window (this implies 3).
>> > Set the Qt::WA_PaintOnScreen attribute to enforce a native window (this
>> > implies 3).
>> >
>> >
>> >
>> > http://doc.qt.nokia.com/latest/qwidget.html
>> >
>> >
>> >
>> > But I didn’t see any relative code in above three projects. Don’t know
>> why
>> > there is difference, especially for example 3, the same dialog can have
>> > different behavior.
>> >
>> >
>> >
>> > Can someone help me to explain it?
>> >
>> >
>> >
>> > Thanks!
>> >
>> >
>> >
>> > William L.
>> >
>> > _______________________________________________
>> > Qt-interest mailing list
>> > Qt-interest at qt.nokia.com
>> > http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>> >
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110221/63c008a7/attachment.html
More information about the Qt-interest-old
mailing list