Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, July 2007
Layout background color....


Message 1 in thread

Hi

How do I set specifically any layout background color ( may be blue
color) ? I do not see any API which does this.

Thanks in advance.


Regards
Vidya.


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

--
 [ signature omitted ] 

Message 2 in thread

May b u may try

void abcd::polish(QPalette &palette)
{
QColor beige(163, 193, 243);
.
.
.
palette.setBrush(QPalette::Base, beige);
.
.
.
}

and use

 QApplication::setStyle(new abcd);  

in the main class. Hope this helps

Regards,
@Ritzz

vidyadhara.talya@xxxxxxxxx wrote: 
Hi

How do I set specifically any layout background color ( may be blue
color) ? I do not see any API which does this.

Thanks in advance.


Regards
Vidya.


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

--
 [ signature omitted ] 
Message 3 in thread

On 10.07.07 16:37:42, vidyadhara.talya@xxxxxxxxx wrote:
> 
> Hi
> 
> How do I set specifically any layout background color ( may be blue
> color) ? I do not see any API which does this.

You don't set a background color on the layout. Layouts don't paint. Set
a color on the widget that contains the layout. See QPalette for the way
of changing colors.

Andreas

-- 
 [ signature omitted ] 

Message 4 in thread

Hi Andreas

Thanks for the info.

Let me give the context in which I want it here:

I have a grid layout on which I have widgets in each cell, You can take
these individual widgets as pushbuttons. Well, setting the color of push
buttons is pretty easy and that I have already done. Now coming to the
grid layout, when ever I give a spacing in between the cells of the grid
layout, I end up having space in a different color (may be light grey -
default color) in the grid layout. I have a requirement in the
application where in the color of the spacing can be set. In a nutshell,
it like giving some user defined background color to the grid layout.

How do I mimic this ?

Thanks in advance.

Regards
Vidya. 

-----Original Message-----
From: Andreas Pakulat [mailto:apaku@xxxxxx] 
Sent: Tuesday, July 10, 2007 5:05 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Layout background color....

On 10.07.07 16:37:42, vidyadhara.talya@xxxxxxxxx wrote:
> 
> Hi
> 
> How do I set specifically any layout background color ( may be blue
> color) ? I do not see any API which does this.

You don't set a background color on the layout. Layouts don't paint. Set
a color on the widget that contains the layout. See QPalette for the way
of changing colors.

Andreas

--
 [ signature omitted ] 

Message 5 in thread

On 11.07.07 09:31:56, vidyadhara.talya@xxxxxxxxx wrote:
> 
> Hi Andreas
> 
> Thanks for the info.
> 
> Let me give the context in which I want it here:
> 
> I have a grid layout on which I have widgets in each cell, You can take
> these individual widgets as pushbuttons. Well, setting the color of push
> buttons is pretty easy and that I have already done. Now coming to the
> grid layout, when ever I give a spacing in between the cells of the grid
> layout, I end up having space in a different color (may be light grey -
> default color) in the grid layout. I have a requirement in the
> application where in the color of the spacing can be set. In a nutshell,
> it like giving some user defined background color to the grid layout.
> 
> How do I mimic this ?

as I said: Set the background color on the widget which contains the
layout. 

Andreas

-- 
 [ signature omitted ] 

Message 6 in thread

 

-----Original Message-----
From: Prateek Tiwari 
Sent: Wednesday, July 11, 2007 10:33 AM
To: 'vidyadhara.talya@xxxxxxxxx'
Subject: RE: Layout background color....

Maybe you can give a background color to the parent widget on which u
are setting the layout.

-----Original Message-----
From: vidyadhara.talya@xxxxxxxxx [mailto:vidyadhara.talya@xxxxxxxxx]
Sent: Wednesday, July 11, 2007 9:32 AM
To: apaku@xxxxxx; qt-interest@xxxxxxxxxxxxx
Subject: RE: Layout background color....


Hi Andreas

Thanks for the info.

Let me give the context in which I want it here:

I have a grid layout on which I have widgets in each cell, You can take
these individual widgets as pushbuttons. Well, setting the color of push
buttons is pretty easy and that I have already done. Now coming to the
grid layout, when ever I give a spacing in between the cells of the grid
layout, I end up having space in a different color (may be light grey -
default color) in the grid layout. I have a requirement in the
application where in the color of the spacing can be set. In a nutshell,
it like giving some user defined background color to the grid layout.

How do I mimic this ?

Thanks in advance.

Regards
Vidya. 

-----Original Message-----
From: Andreas Pakulat [mailto:apaku@xxxxxx]
Sent: Tuesday, July 10, 2007 5:05 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Layout background color....

On 10.07.07 16:37:42, vidyadhara.talya@xxxxxxxxx wrote:
> 
> Hi
> 
> How do I set specifically any layout background color ( may be blue
> color) ? I do not see any API which does this.

You don't set a background color on the layout. Layouts don't paint. Set
a color on the widget that contains the layout. See QPalette for the way
of changing colors.

Andreas

--
 [ signature omitted ] 

Message 7 in thread

Thanks Prateek

This works. Infact, I did the same stuff initially it did not work. Once
I cleaned up the code, it started working.

Regards
Vidya. 

-----Original Message-----
From: Prateek Tiwari [mailto:ptiwari@xxxxxxxxxxx] 
Sent: Wednesday, July 11, 2007 10:33 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: FW: Layout background color....

 

-----Original Message-----
From: Prateek Tiwari
Sent: Wednesday, July 11, 2007 10:33 AM
To: 'vidyadhara.talya@xxxxxxxxx'
Subject: RE: Layout background color....

Maybe you can give a background color to the parent widget on which u
are setting the layout.

-----Original Message-----
From: vidyadhara.talya@xxxxxxxxx [mailto:vidyadhara.talya@xxxxxxxxx]
Sent: Wednesday, July 11, 2007 9:32 AM
To: apaku@xxxxxx; qt-interest@xxxxxxxxxxxxx
Subject: RE: Layout background color....


Hi Andreas

Thanks for the info.

Let me give the context in which I want it here:

I have a grid layout on which I have widgets in each cell, You can take
these individual widgets as pushbuttons. Well, setting the color of push
buttons is pretty easy and that I have already done. Now coming to the
grid layout, when ever I give a spacing in between the cells of the grid
layout, I end up having space in a different color (may be light grey -
default color) in the grid layout. I have a requirement in the
application where in the color of the spacing can be set. In a nutshell,
it like giving some user defined background color to the grid layout.

How do I mimic this ?

Thanks in advance.

Regards
Vidya. 

-----Original Message-----
From: Andreas Pakulat [mailto:apaku@xxxxxx]
Sent: Tuesday, July 10, 2007 5:05 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Layout background color....

On 10.07.07 16:37:42, vidyadhara.talya@xxxxxxxxx wrote:
> 
> Hi
> 
> How do I set specifically any layout background color ( may be blue
> color) ? I do not see any API which does this.

You don't set a background color on the layout. Layouts don't paint. Set
a color on the widget that contains the layout. See QPalette for the way
of changing colors.

Andreas

--
 [ signature omitted ]