Results 1 to 2 of 2

Thread: What's the use of setCornerWidget

  1. #1
    Join Date
    Aug 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default What's the use of setCornerWidget

    Who can tell me the usage about "void QAbstractScrollArea::setCornerWidget ( QWidget * widget )"?
    I just think that i can place a widget on the corner of the two scroolbar from the name of the method. So i create a graWidget and a navWidget which are all derived from QGraphicsView and derived form QAbstractScrollArea in chain .

    graWidget = new GraphWidget( scene );
    navWidget = new NavigateWidget( scene );
    navWidget->setMainWindow(this);

    graWidget->setCornerWidget(navWidget);

    and I overload the void mousePressEvent ( QMouseEvent * e ) as void NavigateWidget::mousePressEvent ( QMouseEvent * e ), the the function I just send a message to the MainWindows' statusbar. but when i click on the corner ,nothing was show on the statusbar ? does i misuse the setcorner method ?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: What's the use of setCornerWidget

    At first, Qt 4.2 is still at development stage. Maybe this has not yet been fully implemented. Are you using the tech preview or the latest snapshot anyway?

    I have the feeling that the corner widget is intended to be something smaller than another scroll area. If I got it right, the "corner widget" will appear in the bottom right corner (in LTR layout) between the scroll bars. How does a widget with yet another scroll bars fit into that tiny area in between the scroll bars?

    And notice what docs have to say about this:
    You will probably also want to set at least one of the scroll bar modes to AlwaysOn.
    This will assure that the corner widget has some space to show itself.
    J-P Nurmi

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.