Results 1 to 6 of 6

Thread: (qt4 & xp) qlabel as background in designer

  1. #1
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default (qt4 & xp) qlabel as background in designer

    I read in the forum that to set the background of a form in designer the QLabel can be used.
    It does but then I do not see my other controls that are behind the QLabel.

    How can I tell designer that the Qlabel should be behind and that the controls should be in front ?
    Last edited by incapacitant; 5th March 2006 at 10:32. Reason: cannot find a way to change thread to designer

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: (qt4 & xp) qlabel as background in designer

    Hmm... It's not a good idea to use QLabel for this. Who told you that? You can set a pixmap as a background of a widget directly using QWidget's methods.

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

    incapacitant (5th March 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: (qt4 & xp) qlabel as background in designer

    Well yes I can use the code rather than designer but this makes the layout complicated since I have to compile several times to obtain a good layout for the other controls.
    Does this mean that if a background is needed for a form Designer is useless ?

    This was not the case in QT3.
    What is the designer based way to have a background as an image ?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: (qt4 & xp) qlabel as background in designer

    It's not useless. Why? Just change its palette int the constructor when you subclass your form.

  6. #5
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: (qt4 & xp) qlabel as background in designer

    As you say I can set the background in the constructor, but then I do not benefit from Designer to position my other controls.
    I then have to set their position by several iterations in the code rather than in designer.
    That's why i wonder how to do all in designer :
    - set the background
    - position the various controls over the background.

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: (qt4 & xp) qlabel as background in designer

    Quote Originally Posted by incapacitant
    As you say I can set the background in the constructor, but then I do not benefit from Designer to position my other controls.
    I then have to set their position by several iterations in the code rather than in designer.
    That's why i wonder how to do all in designer :
    - set the background
    - position the various controls over the background.
    You should do the other way round. First position all the widgets and then apply a background. Remember that you can apply a part of the background to each one of them, so it shouldn't be hard.

    Of course, it's a pitty we can't set non-colour palette items in designer.

  8. The following user says thank you to wysota for this useful post:

    incapacitant (5th March 2006)

Similar Threads

  1. Replies: 3
    Last Post: 17th July 2008, 07:43
  2. QLabel ScaledContents ignored by style sheet?
    By WinchellChung in forum Newbie
    Replies: 3
    Last Post: 27th February 2008, 14:50
  3. Dynamically changing QLabel background colour
    By T4ng10r in forum Qt Programming
    Replies: 19
    Last Post: 19th April 2007, 12:47
  4. QLabel background color
    By munna in forum Newbie
    Replies: 3
    Last Post: 1st May 2006, 15:36
  5. Replies: 1
    Last Post: 5th April 2006, 16:44

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.