Results 1 to 2 of 2

Thread: odd double widgets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: odd double widgets

    I'm answering my own post.
    I finally figured out the answer to this problem which is in the constructor for the model.cpp class. The SoQtExaminerViewer portion below uses a protected constructor, and delaying a superclass viewer from building it's decorations is done by passing build==FALSE as the last argument of the protected constructor. You then have to explicitly trigger the building in your own constructor.

    model.cpp
    Qt Code:
    1. Model::Model( QWidget *parent,
    2. const char * name,
    3. const SbBool embed)
    4. : SoQtExaminerViewer( parent,
    5. name,
    6. embed,
    7. SoQtFullViewer::BUILD_ALL,
    8. SoQtViewer::BROWSER, FALSE)
    9.  
    10. // Explicitly triggers the construction of viewer decorations.
    11. QWidget * widget = this->buildWidget(this->getParentWidget());
    12. this->setBaseWidget(widget);
    To copy to clipboard, switch view to plain text mode 
    ...therefore with "...SoQtViewer::BROWSER, TRUE)", above, the viewer decorations were getting built twice. Yikes.
    Last edited by jhearon; 23rd February 2008 at 18:23.

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


Similar Threads

  1. Double Click Capturing
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2011, 14:12
  2. Qt3 - Multiple transparent widgets
    By bythesea in forum Qt Programming
    Replies: 4
    Last Post: 11th September 2009, 11:24
  3. widgets behind hidden widgets not working
    By bpetty in forum Newbie
    Replies: 13
    Last Post: 7th September 2007, 20:23
  4. Replies: 11
    Last Post: 7th July 2006, 13:09
  5. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37

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.