Results 1 to 8 of 8

Thread: Using QWidget as container

  1. #1
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Using QWidget as container

    Hello friends,

    is there a possibility to embed w32 created windows in QWidget? I read something about QWinWidget for embedding qt things in mfc or like that.
    But the interesting thing for me is the opposite way.

    Yours,

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Using QWidget as container

    I would try QWidget::create().
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Using QWidget as container

    Hello high_flyer,
    QWidget::create() is protected?! Is there an example already metioned?

    I think I have to decribe it in more detail. When I get an handle from this:
    Qt Code:
    1. hWnd = CreateWindow(ClsName,
    2. WndName,
    3. WS_OVERLAPPEDWINDOW,
    4. CW_USEDEFAULT,
    5. CW_USEDEFAULT,
    6. CW_USEDEFAULT,
    7. CW_USEDEFAULT,
    8. NULL,
    9. NULL,
    10. hInstance,
    11. NULL);
    To copy to clipboard, switch view to plain text mode 

    How can I take this and put it into a QWidget??

    Yours,

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Using QWidget as container

    Do you know what subclassing is?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Using QWidget as container

    yes i know.

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Using QWidget as container

    So where is the problem?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Using QWidget as container

    I ask me where I have to call the method create(). In the contructor of the widget? Or do I have to customize or call other methods too?

    Yours,

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Using QWidget as container

    This comment in the docs might help:
    The QWidget constructor calls create(0,true,true) to create a window for this widget.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 2
    Last Post: 27th July 2011, 15:49
  2. Symbian Scroll Kinetic in QWidget Container
    By jgaleanog in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th March 2011, 23:21
  3. Replies: 4
    Last Post: 27th October 2010, 16:43
  4. Quick ? about qSort(Container & container)
    By JimDaniel in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2007, 11:20
  5. Container Extensions
    By mariok in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2007, 11:06

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.