Results 1 to 3 of 3

Thread: Corner widget in QTabWidget doesn't show up

  1. #1
    Join Date
    Mar 2006
    Location
    India
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Corner widget in QTabWidget doesn't show up

    The corner widget in a QTabWidget doesn't render at all.
    I have tried to use QToolButton and QLabel.
    Qt Code:
    1. {
    2. QLabel *label = new QLabel("foo");
    3. tw.setCornerWidget (label);
    4. }
    To copy to clipboard, switch view to plain text mode 

    Simple enough, and I do see a little extra space at the beginning of the tab-list, but nothing is rendered there.
    Qt 4.2 (qt-copy in KDE svn)
    KDE 4.0 (svn)
    Currently developing Anthias

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Corner widget in QTabWidget doesn't show up

    Try showing the label.
    Save yourself some pain. Learn C++ before learning Qt.

  3. #3
    Join Date
    Mar 2006
    Location
    India
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Corner widget in QTabWidget doesn't show up

    Well, it worked, after QLabel was parented to the tab! Usually these things are auto-parented; and that's why the confusion.

    Qt Code:
    1. {
    2. QLabel *label = new QLabel("foo", &tw);
    3. tw.setCornerWidget (label);
    4. }
    To copy to clipboard, switch view to plain text mode 
    Qt 4.2 (qt-copy in KDE svn)
    KDE 4.0 (svn)
    Currently developing Anthias

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 08:06
  2. How to show the widget?
    By kommu in forum Qt Programming
    Replies: 1
    Last Post: 21st October 2008, 09:43
  3. QTabWidget: corner widget is not shown
    By dv_ in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2008, 18:30
  4. Replies: 4
    Last Post: 4th February 2008, 07:16
  5. How to show custom widget in TreeView's cell :-/
    By WolfMM in forum Qt Programming
    Replies: 2
    Last Post: 7th July 2007, 12: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.