Results 1 to 8 of 8

Thread: DockWidget with Direct3D Widget and expanding problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: DockWidget with Direct3D Widget and expanding problem

    Did you call setWidget() on the dock widget?

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    d_stranz (29th December 2014)

  3. #2
    Join Date
    Dec 2014
    Posts
    49
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Windows

    Default Re: DockWidget with Direct3D Widget and expanding problem

    So i just created a QVBoxLayout based on the code snippet above, but still got the same results.

    EditorSceneWindow file
    Qt Code:
    1. void EditorSceneWindow::Create(WeakPtr<Engine> engine) {
    2. engine_ = engine;
    3.  
    4. QVBoxLayout* layout = new QVBoxLayout(this);
    5.  
    6. d3dRendererWidget_ = new D3DRenderWidget(this, engine_);
    7. layout->addWidget(d3dRendererWidget_);
    8.  
    9. this->setLayout(layout);
    10. }
    To copy to clipboard, switch view to plain text mode 

    D3DRenderWidget file
    Qt Code:
    1. D3DRenderWidget::D3DRenderWidget(QWidget* parent, Engine* engine) :
    2. QWidget(parent) {
    3.  
    4. setAttribute(Qt::WA_PaintOnScreen, true);
    5. setAttribute(Qt::WA_NativeWindow, true);
    6.  
    7. QSizePolicy sizePolicy = this->sizePolicy();
    8. setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    9. }
    To copy to clipboard, switch view to plain text mode 

  4. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,319
    Thanks
    316
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: DockWidget with Direct3D Widget and expanding problem

    Did you try calling QDockWidget::setWidget() as anda_skoa suggested?

    Does your render widget have an inherent size? Or do you have to set it somewhere? Presumably if you are going to use it to render something with Direct3D, you need to give it a size somewhere. What happens if you call resize( 300, 300 ) (for example) in the render widget constructor?

  5. The following user says thank you to d_stranz for this useful post:

    NIteLordz (30th December 2014)

Similar Threads

  1. Expanding custom widget
    By Raz0rEdge in forum Qt Programming
    Replies: 2
    Last Post: 14th November 2012, 14:56
  2. Direct3D widget
    By ixSci in forum Qt Programming
    Replies: 19
    Last Post: 15th October 2009, 21:40
  3. Expanding/shrinking a widget
    By punkypogo in forum Qt Programming
    Replies: 6
    Last Post: 27th May 2008, 16:50
  4. How to put a DockWidget or Widget over others??
    By dungsivn in forum Qt Programming
    Replies: 6
    Last Post: 25th October 2007, 06:12
  5. Expanding and hiding a widget
    By Dauntless in forum Newbie
    Replies: 3
    Last Post: 12th December 2006, 06:28

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.