i use QGraphicsScene and QGraphicsView to scale the child widget. i want to just move the child widget and the main frame will also move it.
this is because the default border like frame is some odd and i want to delete it.
now i can only move the child widget. the scence is fixed.
how to move the scence or view without the border like frame?
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
now something is like this:
ca.PNG
Bookmarks