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

Qt-interest Archive, December 2006
Menu Customization


Message 1 in thread

Hi,
 
I create a popup menu like this:
 
QMenu * menu = new QMenu(widget);

QPalette menuPalette(QColor(255,240,219));

menu->setPalette(menuPalette);

menu->addAction(QIcon("btn_conference.png"),"First");

menu->addSeparator();

menu->addAction(QIcon("btn_conference.png"),"Second");

I want to change color of seperator to white and when a menu item is
selected(mouse over) i want to change the background color(which on
Windows is Blue).

Thanks in advance.

--
 [ signature omitted ] 

Message 2 in thread

QPalette::Text sets the disabled text color
QPalette::buttonText sets the inactive text color
QPalette::HighlightText sets the active (highlighted) color

QPallette::Highlight sets the background hightlighted color
QPallette::Button sets the background inactive color

QPallette::dark sets the shaded color
QPallette::light sets the box color

Scott
> -----Original Message-----
> From: Jaya Meghani [mailto:Jaya.Meghani@xxxxxxxxxx]
> Sent: Wednesday, December 20, 2006 11:45 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Menu Customization
> 
> Hi,
> 
> I create a popup menu like this:
> 
> QMenu * menu = new QMenu(widget);
> 
> QPalette menuPalette(QColor(255,240,219));
> 
> menu->setPalette(menuPalette);
> 
> menu->addAction(QIcon("btn_conference.png"),"First");
> 
> menu->addSeparator();
> 
> menu->addAction(QIcon("btn_conference.png"),"Second");
> 
> I want to change color of seperator to white and when a menu item is
> selected(mouse over) i want to change the background color(which on
> Windows is Blue).
> 
> Thanks in advance.
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ]