qpainter

Coordinate scaling causes too large font sizes in QPainter::drawText

I'm working on simple 2D visualization module for MD simulation code. What I'm trying to do is drawing positions of simulated molecules using: myPainter.drawEllipse(myQPoint,myRx,myRy) And that part works pretty good on my visualization widget. The thing that happened to be a problem is writing text which should represent each molecu...

Draw with QPainter

Hello, I need draw with QPainter, but when i try to do it not in void paintEvent(QPaintEvent *) I catch error: QPainter::setPen: Painter not active QPainter::setBrush: Painter not active Can i use qpainter not in void paintEvent(QPaintEvent *) ? Thank you. ...

painting by mouse click in qt

Hello, I have a class Square based in QWidget, it's game board consisting of rectangles 8x8. I draw this rectangles in my widget in: void Square::paintEvent(QPaintEvent *) Now i must click on some rectangle and in this rectangle must draw ellipse. I try: void Square::mousePressEvent(QMouseEvent *e) { if (e->button() == Qt::LeftB...