Ok so i have created my UI with the drag and drop part of Qt and in the Ui i created a "Tab Widget" inside another "Tab Widget". Now, inside the second Tab Widget i created a Frame
My Question is, how do i draw on top of this frame in Qt?
i tried this but no luck at all. Ive tried different ways on going about this, the program runs good but when i go and see if the frame was drawn on, i see nothing...please help me with this, with code example and all. Thanks in advance.
void 2ndMainWindow::paintEvent(QPaintEvent *e)
{
QPainter paint(ui->rightTriangle_frame);
paint.drawEllipse(10,10,100,100);
paint.setPen(Qt::red);
paint.end();
}
The way i finally did it for those others that would like to know
my header file included this under the private slot
Ui::GeometryMainWindow *ui;
QGraphicsScene *scene;
QGraphicsEllipseItem *ellipse;
QGraphicsRectItem *rectangle;
In my .cpp file i did this
ui->setupUi(this);
scene = new QGraphicsScene(this);
ui->graphicsView->setScene(scene);
QBrush redBrush(Qt::red);
QBrush blueBrush(Qt::blue);
QPen blackpen(Qt::black);
blackpen.setWidth(6);
ellipse = scene->addEllipse(10,10,100,100,blackpen,redBrush);