i use QGraphicsScene and QGraphicsView to scale the child widget. now i want to move the child widget like the border frame, not just in the QGraphicsView.please help me how to do this?
my code is:
QASelectFrame
::QASelectFrame(QWidget *parent
) : QFrame(parent
), ui
(new Ui
::QASelectFrame){
ui->setupUi(this);
m_scene->addWidget(this);
//m_view->setFrameShape(QFrame::NoFrame);
m_view->setStyleSheet("border: 0px");
m_view->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_view->setContentsMargins(QMargins());
// title area
setTitleText(tr("Selector"));
}
QASelectFrame::QASelectFrame(QWidget *parent) : QFrame(parent), ui(new Ui::QASelectFrame)
{
ui->setupUi(this);
m_scene = new QGraphicsScene;
m_scene->addWidget(this);
m_view = new QGraphicsView(m_scene);
//m_view->setFrameShape(QFrame::NoFrame);
m_view->setStyleSheet("border: 0px");
m_view->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_view->setContentsMargins(QMargins());
// title area
setTitleText(tr("Selector"));
}
To copy to clipboard, switch view to plain text mode
progress like :
ca.PNG
Bookmarks