Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef MYWIDGET_H
- #define MYWIDGET_H
- #include <QDialog>
- #include <QtGui>
- #include <QtCore>
- class MyWidget:public QDialog
- {
- Q_OBJECT
- private:
- QPainter *p;
- public:
- MyWidget(QDialog * obj = 0): QDialog(obj) {p=new QPainter; }
- virtual void paintEvent(QPaintEvent *){
- p->begin(this);
- p->setPen(QPen(Qt::black, 3));
- int n=2000;
- int i=0;
- while(i<2000){
- qreal fAngle = 2 * 3.14 * i / n;
- qreal x = 50 + cos(fAngle) *40;
- qreal y = 50 + sin(fAngle) *40;
- p->drawPoint(QPointF(x, y));
- i++;
- }
- p->end();
- }
- };
- #endif // MYWIDGET_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement