Results 1 to 2 of 2

Thread: hwnd to qwidget setparent error

Threaded View

Previous Post Previous Post   Next Post Next Post
  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.

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.