Esempio n. 1
0
    public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) {
        (void)(item);
        (void)(widget);

        QPoint point(0, 0);
        QColor farbe(0, 0, 0);
        int iter = 0;

        for(int i = 0; i < model->getBreite(); i++) {
            for(int j = 0; j < model->getHoehe(); j++) {
                iter = model->getIterationZuPunkt(i, j);

                point.setX(i);
                point.setY(j);

                setColourForIteration(farbe, iter);
                painter->setPen(farbe);
                painter->drawPoint(point);
            }
        }
    }
Esempio n. 2
0
 public: Grafik(Mandelbrot *model) {
     this->model = model;
     farbenMaske = farbenMasken[0];
     setBoundingRect(0, 0, model->getBreite() - 2, model->getHoehe() - 2);
 }