Welcome! Log In Create A New Profile


changing the colors of objects/widgets

Posted by djbass 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
changing the colors of objects/widgets
September 11, 2007 02:52PM
hi guys

how do i change the colors of different objects/widgets/layoouts such as backgroung color or label color etc. i tried using setcolors,set backgroungcolor funtions but i get the error that Qclasses such as QWidget, QLabel, QLCDSlider don't have members of such.

How do is se those color, can anyone pls help.

Re: changing the colors of objects/widgets
September 13, 2007 02:19PM
hi dj, did you load the Qt documentation from the cd? I couldn't have gote by without it, the online version http://doc.trolltech.com/4.1/index.html
heres to QLabels: http://doc.trolltech.com/4.1/qlabel.html

also when in Qide once you've created your object and you put a . after it , it should show you all the available functions for that object type eg :

usernameLabel = new QLabel(tr("Username:"winking smiley);
usernameEdit = new QLineEdit;

now you should get a dropdown with backgroundColor as an available function..( your cursor must be just after the dot, if it isn't remove the dot and type it again then wait)

funny enough i wasn't able to find this function in the class library although its probably a function in one of the inherited classes further up the line

hope that helps . PS sorry i didn't et back to you about the other problem i just haven't had enough time
Re: changing the colors of objects/widgets
September 14, 2007 08:56AM
thanx for the light iva, yes dropdown shows the list of all available members for the QLabel including the setbackgroundColor but it still gives an error : not member function setbackgroundColor exist for class QLabel. or maybe we are not using the paramenters correctly.

Anyway i'll keep on tackling this problem. good luck with your exams.

Sorry, only registered users may post in this forum.

Click here to login