Results 1 to 7 of 7

Thread: QWidget created on Windows Widget

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

    Default QWidget created on Windows Widget

    Hello all,

    how to display one QLabel onto one Windows widget?

    Qt Code:
    1. m_label -> create(HWnd, true, true);
    2. m_label -> setGeometry(geometry);
    3. m_label -> setPixmap(QPixmap(QDir::currentPath() + QLatin1String("/logo.png")));
    4. m_label -> show();
    To copy to clipboard, switch view to plain text mode 

    with the codes above nothing was display... anyone has idea?

  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: QWidget created on Windows Widget

    What does the create() method do?
    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.


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

    Default Re: QWidget created on Windows Widget

    QWidget::create()
    void QWidget::create ( WId window = 0, bool initializeWindow = true, bool destroyOldWindow = true ) [protected]

    I used this one.

  4. #4
    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: QWidget created on Windows Widget

    I don't think this method does what you think it does.
    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.


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

    Default Re: QWidget created on Windows Widget

    @wysota,

    then how does Qt do in this situation?
    If I want a qwidget show onto a native Windows window?

  6. #6
    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: QWidget created on Windows Widget

    I have no idea other than using ActiveX. You can try digging out the MFC/Qt migration framework to see how they do it.
    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.


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

    Default Re: QWidget created on Windows Widget

    new update...

    QWidget::create();
    It can really create a QWidget onto existing Windows Handle.
    But I need to reimplement many intern logic. e.g. resizeEvent() ...

Similar Threads

  1. Replies: 4
    Last Post: 8th April 2013, 04:19
  2. QWidget cannot be created
    By Shien in forum Newbie
    Replies: 5
    Last Post: 31st May 2011, 07:34
  3. Subclassing a widget created in Qt Designer
    By dmginc in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2011, 06:30
  4. How to close all windows that were created in main()?
    By Mister_Crac in forum Qt Programming
    Replies: 6
    Last Post: 13th November 2006, 10:57
  5. Replies: 4
    Last Post: 12th January 2006, 04:16

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.