Results 1 to 5 of 5

Thread: Qt style sheeet: padding and margins + layout

  1. #1
    Join Date
    Sep 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Qt style sheeet: padding and margins + layout

    I have complex widget - in one there 2 other. All internal widgets managed by layout (QGridLayout). I want to adjust its look and feel with CSS like table in attached sample project.

    But updating paddings in runtime cause nothing visible effects.
    Also, margins changes only size of control, but not affects any internal widgets.
    Is seems that CSS adjust only "look" but not "feel" =(

    How could I change CSS'es paddings and margins so it affects all children widgets?
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2009
    Location
    Internet
    Posts
    11
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt style sheeet: padding and margins + layout

    I changed bits of the code... Clean the project then run it. and tell if the problem is still there.
    Attached Files Attached Files

  3. #3
    Join Date
    Sep 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Qt style sheeet: padding and margins + layout

    Yep, it still here. When click on label look to internal label's text - it is not moving (but shoul - on click changed parent's paddings is CSS). Also when changing margins for children labels its text appears outside labels border.
    May be problem in QT version? I'm using 4.6.2? and you? Could you attach release executable file, if in your assmbly all right?

  4. #4
    Join Date
    Nov 2009
    Location
    Internet
    Posts
    11
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt style sheeet: padding and margins + layout

    It seems that it's about your QCssFrame class implementation. It's not a Qt problem. (see the attachment)
    Attached Files Attached Files

  5. #5
    Join Date
    Sep 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Qt style sheeet: padding and margins + layout

    Ok, try this sample. All widgets is qt native, but probles still here.
    Click on button first time to increase padding than resize window. Why text is cut off? Buttons should expand to hold entire text + paddings if layout allow it. Here layout used for entire widget, so it is big enough.
    Same thing with margins (click twice) - VISUAL buttons size is decreased, but you still can click in original bounds of button! And problem with text presented.

    Layout is not resizing when margins or paddings changing, but should.

    Is it still not problem of Qt?
    Attached Files Attached Files
    Last edited by Syntho; 4th June 2010 at 16:53. Reason: updated contents

Similar Threads

  1. Replies: 2
    Last Post: 7th March 2024, 12:40
  2. QLineEdit padding
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 17th September 2008, 22:43
  3. Unwanted padding on QWidget
    By etru1927 in forum Qt Programming
    Replies: 4
    Last Post: 7th August 2008, 07:42
  4. Recursively changing margins/padding
    By ghorwin in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2007, 11:08
  5. QString:: Padding Zeros?
    By Harvey West in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2007, 18:25

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.