PDA

View Full Version : Does PE_PaneButtonTool menas QStyleOptionToolButton?



1111
17th February 2009, 14:09
Hi all,

I would like to redraw some elements in my GUI application and I took a look at ArthurStyle example that comes with Qt4. So I'm trying to catch event of drawing button (QToolButton) on tool bar (QToolBar) and redraw it according ArthurStyle example.

In function drawPrimitive() I can easily catch time when I need to redraw QToolButton, I assume it happens when incoming value equal PE_PanelButtonTool. So then I need to (according example) cast another incoming element (QStyleOption) into QStyleOptionToolButton. However, casting fail, but I cannot understand why.

In ArthurStyle example, it is shown how to redraw QPushButton. Mechanism is the same: catch incoming value PE_PanelPushButtonCommand, cast another incoming value from QStyleOption into QStyleOptionButton and redraw it. In my case I tries to case value into every available QStyleOption* types, but they all failed.

Can some one give me a tip how to redraw button on toolbat?