PDA

View Full Version : Drawing



chethana
16th October 2007, 06:59
Hi All,

In my application QMainWindow is Widget . And i have a QFrame or QWidget inside my application. Now i want to draw line inside the qFrame or QWidget...

usually what ever the drawing operation that i am going to perform in the QPaintEvent will perform the drawing in QMainWindow .. But not in QFrame .. How to get control to QFrame or QWidget??

rajesh
16th October 2007, 07:29
you create a new class by drive QWidget and draw your lines in paintEvent.

class myWidget : public QWidget
{
...
protected:
void paintEvent ( QPaintEvent * event );

}


void myWidget::paintEvent ( QPaintEvent * event )
{
// draw your lines here
}

use this myWidget in your MainWindow code in place of QWidget