C++ (Qt) QPixmap Pixmap(10, 10); QPainter Painter(Pixmap); Painter.fillRect(Pixmap.rect(), Qt::green); // GREEN 10*10 Painter.fillRect(QRect(0,0,1,10), Qt::red); // RED 1*10 + GREEN 9*10 painter.drawPixmap(QRect(1,0,9,10), *pixmap, QRect(0,0,9,10)); // QT BUG
C++ (Qt) QPixmap Pixmap(10, 10); QPainter Painter(Pixmap); Painter.fillRect(Pixmap.rect(), Qt::green); // GREEN 10*10 Painter.fillRect(QRect(0,0,1,10), Qt::red); // RED 1*10 + GREEN 9*10 Painter.drawPixmap(QRect(1,0,9,10), *Pixmap, QRect(0,0,9,10)); // QT BUG
C++ (Qt)QPixmap Pixmap(10, 10);if (1) { QPainter Painter(Pixmap); Painter.fillRect(Pixmap.rect(), Qt::green); // GREEN 10*10 Painter.fillRect(QRect(0,0,1,10), Qt::red); // RED 1*10 + GREEN 9*10}painter.drawPixmap(QRect(1,0,9,10), *pixmap, QRect(0,0,9,10)); // QT BUG
C++ (Qt) QPixmap Pixmap(10, 10); QPainter Painter(Pixmap); Painter.fillRect(Pixmap.rect(), Qt::green); // заливаем квадрат 10х10 зеленым - ясно Painter.fillRect(QRect(0,0,1,10), Qt::red); // слева рисуем вертикальную красную полосу в 1 пиксель Painter.drawPixmap(QRect(1,0,9,10), *Pixmap, QRect(0,0,9,10)); // ???
void Widget::paintEvent ( QPaintEvent * ) { QPixmap pm(10, 10); if (1) { QPainter painter(&pm); painter.fillRect(QRect(0, 0, 10, 10), Qt::green); painter.fillRect(QRect(0, 0, 1, 10), Qt::red); painter.drawPixmap(QRect(1, 0, 9, 10), pm, QRect(0, 0, 9, 10)); } QPainter painter(this); painter.drawPixmap(QRect(0, 0, 10, 10), pm, QRect(0, 0, 10, 10));}
...