[Qt-interest] draw transparent buttons on top of an opengl graphicsview

Shi Yan billconan at gmail.com
Sat Nov 7 21:40:04 CET 2009


hello guys,

i'm trying to draw some round corner buttons on top of my opengl scene.

i'm following this tutorial
http://doc.trolltech.com/qq/qq26-openglcanvas.html, and the round
corner button is generated with style sheet found here:
http://doc.trolltech.com/4.5/stylesh...-the-box-model

QPushButton {
background-color: red;
border-style: outset;
border-width: 2px;
border-radius: 10px;
border-color: beige;
font: bold 14px;
min-width: 10em;
padding: 6px;
}

the button looks fine if it is a normal widget button, but looks wrong
when i insert it into the graphicsview. it will automatically be
filled with the background color, therefore, the button shape becomes
rectangle. please see the attached image. the first button is how it
looks in the qt designer, but when i put it into a opengl graphics
view, it becomes rectangle (2nd image)

i don't what i can to fix this. i need help. thanks.

the attached pics can be seen here:
http://www.qtcentre.org/forum/f-qt-programming-2/t-draw-transparent-buttons-on-top-of-an-opengl-graphicsview-25466-post121819.html#post121819



More information about the Qt-interest-old mailing list