PDA

View Full Version : draw transparent buttons on top of an opengl graphicsview



billconan
7th November 2009, 20:38
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/stylesheet-examples.html#customizing-a-qpushbutton-using-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.:crying: