Results 1 to 2 of 2

Thread: hwnd to qwidget setparent error

  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default hwnd to qwidget setparent error

    i try to convert the hwnd to qwidget acc. this post:
    http://www.qtcentre.org/threads/3713...idget*-pointer

    e.g.

    Qt Code:
    1. HWND hTable = tbl->winHWnd();
    2.  
    3. ::SetParent(hTable, (HWND)winq->winId());
    4.  
    5. QWidget* qTable = QWidget::find(hTable);
    To copy to clipboard, switch view to plain text mode 

    but after ::SetParent() from win API still the QWidget::find() only returns me null.
    I step into the debugger and find,

    before ::SetParent() was called, the QWidgetPrivate::mapper contains 2 elements,
    then after the mapper gained one more element but this element's value (the hwnd value?) is not the hTable!?

    is there any notes for the issue?


    -------------------------------------

    sry, the problem has nothing to do with ::SetParent(),
    the added element is from calling

    Qt Code:
    1. winq->winId()
    To copy to clipboard, switch view to plain text mode 
    Last edited by cic; 27th August 2013 at 09:55.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: hwnd to qwidget setparent error

    Quote Originally Posted by cic View Post
    sry, the problem has nothing to do with ::SetParent(),
    the added element is from calling

    Qt Code:
    1. winq->winId()
    To copy to clipboard, switch view to plain text mode 
    Yes, and the problem is...?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Converting from Qt's WId to Windows HWND?
    By ComServant in forum Newbie
    Replies: 3
    Last Post: 27th December 2012, 18:26
  2. error C2039: 'hwnd' : is not a member of QPalette
    By weixj2003ld in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2011, 06:32
  3. Replies: 2
    Last Post: 18th August 2011, 07:26
  4. Get HWND of QGLWidget
    By pl01 in forum Newbie
    Replies: 2
    Last Post: 19th December 2010, 21:18
  5. Convert Windows "HWND" to QWidget* pointer?
    By gerome69 in forum Qt Programming
    Replies: 4
    Last Post: 20th September 2006, 13:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.