PDA

View Full Version : Changing form colors and adding skins



srohit24
27th October 2009, 09:04
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

wysota
27th October 2009, 11:51
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.

srohit24
27th October 2009, 13:00
thanks for ur reply.

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

wysota
27th October 2009, 13:23
Either using QPalette or style sheets.

srohit24
27th October 2009, 14:45
i found this link demonstrating the style sheet

http://thesmithfam.org/blog/2009/09/17/qt-stylesheets-button-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?

wysota
27th October 2009, 15:23
I'm sure it will be easier if you just look into the documentation.

srohit24
28th October 2009, 01:58
ok.

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

wysota
28th October 2009, 02:06
What resize button? If you want to forbid resizing a window, you have to make it fixed size (using QWidget::setFixedSize() for example)

srohit24
28th October 2009, 15:17
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?

wysota
28th October 2009, 16:35
Did you try typing in "style sheets" into Qt Assistant?