示例#1
0
SEXP
qt_qsetTransform_QGraphicsView(SEXP v,
			       SEXP xscale,
			       SEXP yscale,
			       SEXP rotate,
			       SEXP translate)
{
    QGraphicsView *view = unwrapQObject(v, QGraphicsView);
    // shear ( qreal sh, qreal sv )
    view->scale(REAL(xscale)[0], REAL(yscale)[0]);
    view->rotate(REAL(rotate)[0]);
    view->translate(REAL(translate)[0], REAL(translate)[1]);
    return R_NilValue;
}
示例#2
0
MainWindow::MainWindow() {
    scene = new QGraphicsScene();
    QVBoxLayout *mainLayout = new QVBoxLayout();
    QGraphicsView *view = new QGraphicsView(scene);
    view->rotate(180);
    mainLayout->addWidget(view);
    QWidget *box = new QWidget();
    box->setLayout(mainLayout);
    setCentralWidget(box);
    pen = QPen(QBrush(Qt::black), 1);
    QRect rect = QApplication::desktop()->screenGeometry();
    scene->setSceneRect(rect);
    resolution=QPoint(rect.bottomRight());
}