Qt图形视图框架(五) 变换

网友投稿 828 2022-11-28

Qt图形视图框架(五) 变换

Qt图形视图框架(五) 变换

变换

#include #include int main(int argc, char *argv[]){ QApplication a(argc, argv); QGraphicsScene scene; QGraphicsView view(&scene); view.setSceneRect(0, 0, 500, 500); auto hello = new QGraphicsSimpleTextItem("Hello"); scene.addItem(hello); //view.rotate(60); //view.translate(100, 100); //hello->setScale(2); //hello->setRotation(30); QTransform t = QTransform::fromScale(2, 4); t.shear(2, 3); auto rect = new QGraphicsRectItem(0, 0, 50, 50); rect->setTransform(t); rect->setPos(100, 100); scene.addItem(rect); view.show(); return a.exec();}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:POJ 2752 Seek the Name, Seek the Fame——kmp
下一篇:SpringBoot拦截器读取流后不能再读取的问题
相关文章

 发表评论

暂时没有评论,来抢沙发吧~