Unsolved Graphicsview......frame......layouts
-
Hello... I am creating graphicsview in which i play videos in each graphicview.
1x1.......2x2.........3x3...........4x4........ these are options....
Now I want to add Frame in which I want to add pushbuttons in each graphicsview.
Please help me..Thanks
-
Hi and welcome
Did you try with
http://doc.qt.io/qt-5/qgraphicsproxywidget.htmlQGraphicsProxyWidget* proxyWidget = scene->addWidget(myWidget);
proxyWidget->setFlag(QGraphicsItem::ItemIgnoresTransformations);You could also just put it round the GViews
like in this sample
http://doc.qt.io/qt-5/qtwidgets-graphicsview-chip-example.html -
@mit_cruze
There is QGraphicsGridLayout class available.
Also take a look at this. It's pretty outdated, but i think most of it is still valid and portable.But why are you dependent on the graphicsview framework? You would be better off using QWidgets or even QML.
-
@mrjj this is my code
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QGridLayout *gridLayout = new QGridLayout;
int k=0;
for(int i=0;i<2;i++)
{for (int j=0;j<2;j++) { scene[k] = new QGraphicsView(this->centralWidget()); // k=4 defined in header file gridLayout->addWidget(scene[k],i,j,1,1); /* QGraphicsProxyWidget* proxyWidget = scene->addWidget(); proxyWidget->setFlag(QGraphicsItem::ItemIgnoresTransformations); */ scene[k]->show(); k++; } } ui->frame->setLayout(gridLayout);
}
MainWindow::~MainWindow()
{
delete ui;
}
I am completely new to Qt
How do I do? -
anyone please?
-
@mit_cruze said in Graphicsview......frame......layouts:
anyone please?
you should tell what your problem is.
Currently you are creating a 4x4 grid with graphicsviews...