Почему не меняется толщина круга при нажатии на кнопку?paint.hКод:#ifndef PAINT_H#define PAINT_H#include class QPushButton;class PaintBoard : public QDialog{Q_OBJECTpublic:PaintBoard(QWidge t *parent = 0);void paintEvent(QPaintEvent *event);signals
rivate slots: void cpaint();private:QPushButton *rbutton;};#endifpaint.cppКод:#include #include "paint.h"PaintBoard::PaintBoard(QWid get *parent) : QDialog(parent){ rbutton = new QPushButton(tr("gav")); QHBoxLayout *bottom = new QHBoxLayout; bottom->addWidget(rbutton); setLayout(bottom);connect(rbutton, SIGNAL(clicked()), this, SLOT(cpaint())); }void PaintBoard:
aintEvent(QPaintEvent *event){ QPainter painter(this); painter.drawEllipse(10, 10, 20, 20);}void PaintBoard::cpaint(){QPainter painter(this);painter.setPen(QPen(Qt::bl ack, 9, Qt::SolidLine, Qt::RoundCap));// painter.drawEllipse(10, 10, 90, 90);update();}main.cppКод:#include #include #include "paint.h"int main(int argc, char **argv) {QApplication app(argc, argv); PaintBoard *form = new PaintBoard; form->show(); return app.exec();}