PDA

View Full Version : QGraphicsView move child associate the border like frame



satan_ljc
15th December 2018, 10:03
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 = 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::ScrollBarAlwaysOf f);
m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff) ;
//m_view->setContentsMargins(QMargins());

// title area
setTitleText(tr("Selector"));
}


now something is like this:

12986

satan_ljc
17th December 2018, 12:18
can any one help me , please