Results 1 to 3 of 3

Thread: Creating QLabel dynamically of size equal to screen size!!!

  1. #1
    Join Date
    Jan 2013
    Location
    Bangalore, India
    Posts
    36
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question Creating QLabel dynamically of size equal to screen size!!!

    Hello Everyone,

    I just want to know how can I create a Qlabel dynamically of size equal to the screen size?. I wanted to display a video in that label, but the size should be of screen size.

    Thanks in advance

    jakr13

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Creating QLabel dynamically of size equal to screen size!!!

    QScreen, QDesktopWidget, and QApplication::desktop() will provide you the information you need to set the QLabel size. If you create the QLabel without a parent, then it will be a top-level widget.

    No, I will not give you example code.

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

    Kryzon (8th October 2015)

  4. #3
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Creating QLabel dynamically of size equal to screen size!!!

    you can use QWidget::showFullScreen(). //then to close this we need to use Alt+F4
    Alternatively, if you would use QVideoWidget for playing video, this class also has similar functionality for showing full screen.
    Thanks :-)

Similar Threads

  1. Replies: 3
    Last Post: 7th July 2011, 13:07
  2. How to set QWizard size equal for all its pages
    By kalos80 in forum Qt Programming
    Replies: 0
    Last Post: 9th June 2009, 10:00
  3. Replies: 1
    Last Post: 2nd August 2008, 16:46
  4. adjust font size to QLabel-size
    By hunsrus in forum Qt Programming
    Replies: 0
    Last Post: 9th July 2008, 15:33
  5. Dynamically changing QGroupBox size
    By T4ng10r in forum Qt Programming
    Replies: 5
    Last Post: 30th March 2007, 16:02

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.