Results 1 to 3 of 3

Thread: print a QLabel over a QWidget

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default print a QLabel over a QWidget

    Hi to all,
    I have a QWidget showing an audio waveform. I would display over such widget a QLabel indicating the elapsed time from the moment the user
    press play.
    How can I show such label? For example at position 20, 20.
    The value of the timer is updated depending of the time_position in the sound.

    Regards,
    Franco
    Franco Amato

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: print a QLabel over a QWidget

    You can make the label a child of the QWidget, and then set its position by QWidget::move.
    Dont set the label in a layout.

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: print a QLabel over a QWidget

    Or check the QToolTip class... it is best suited for such small info.

Similar Threads

  1. layout QLabel and QWidget
    By franco.amato in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2010, 11:53
  2. Prevent a QLabel resizing the parent QWidget
    By danc81 in forum Qt Programming
    Replies: 6
    Last Post: 10th November 2009, 20:54
  3. Replies: 1
    Last Post: 29th September 2009, 19:44
  4. Cancelling Long-running Print/Print Preview
    By ChrisW67 in forum Newbie
    Replies: 4
    Last Post: 16th June 2009, 23:05
  5. Transparent background on QLabel on transparent QWidget
    By codeslicer in forum Qt Programming
    Replies: 1
    Last Post: 13th February 2008, 02:10

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.