Results 1 to 10 of 10

Thread: Changing form colors and adding skins

  1. #1
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default Changing form colors and adding skins

    Hi

    I am working on a project that deals with a form as the primary source of information.

    I want to know if i can change the color of the form or even better add a new skin to the form?

    I have small window to display. If the user resizes the window all the line edits and the button will not be alligned. how can i solve this?
    I have used the layouts to place the line edits and buttons in it

    thanks

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

    Default Re: Changing form colors and adding skins

    Quote Originally Posted by srohit24 View Post
    I want to know if i can change the color of the form or even better add a new skin to the form?
    Yes, you can.

    I have small window to display. If the user resizes the window all the line edits and the button will not be alligned. how can i solve this?
    I have used the layouts to place the line edits and buttons in it
    But you didn't apply the layout to the whole window. Remove all your layouts, click on the form so that no other objects are selected and choose the grid layout from the toolbar.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default Re: Changing form colors and adding skins

    thanks for ur reply.

    can u let me know how i can add a image as the background for the form?

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

    Default Re: Changing form colors and adding skins

    Either using QPalette or style sheets.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default Re: Changing form colors and adding skins

    i found this link demonstrating the style sheet

    http://thesmithfam.org/blog/2009/09/...-bar-tutorial/

    When I added the code to my ui, nothing happaned.

    can u explain how I can add a background image to the form?

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

    Default Re: Changing form colors and adding skins

    I'm sure it will be easier if you just look into the documentation.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default Re: Changing form colors and adding skins

    ok.

    is there anyway by which i can disable the resize button of the whole form?

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

    Default Re: Changing form colors and adding skins

    What resize button? If you want to forbid resizing a window, you have to make it fixed size (using QWidget::setFixedSize() for example)
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default Re: Changing form colors and adding skins

    thanks mate. the setFixedSize solved my problem.

    I have read the documentation avout the style sheets and palettas.

    Is there a sample example in Qt Assistant or anywhere else so that I can look at the code as well as the working of style sheets or palettes for better understanding?

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

    Default Re: Changing form colors and adding skins

    Did you try typing in "style sheets" into Qt Assistant?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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.