qt里设置控件的旋转、转移、缩放等

#include "widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    this->setMinimumSize (800,800);
    this->pushButton = new QPushButton();

    this->pushButton->setFixedSize (100,30);

    this->pushButton->showFullScreen();
    this->pushButton->setStyleSheet ("background-color : red");

    QGraphicsScene* pScene = new QGraphicsScene(this);
    pScene->addWidget (this->pushButton);
    QGraphicsView* pView = new QGraphicsView(pScene, this);
    pView->setFixedSize (100,50);
    pView->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
    pView->rotate(90);

}

Widget::~Widget()
{
}

发布了144 篇原创文章 · 获赞 77 · 访问量 538万+

猜你喜欢

转载自blog.csdn.net/wtl1992/article/details/102651920