Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Graphicsview......frame......layouts
Forum Updated to NodeBB v4.3 + New Features

Graphicsview......frame......layouts

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mit_cruzeM Offline
    mit_cruzeM Offline
    mit_cruze
    wrote on last edited by
    #1

    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

    raven-worxR 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome
      Did you try with
      http://doc.qt.io/qt-5/qgraphicsproxywidget.html

      QGraphicsProxyWidget* 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_cruzeM 1 Reply Last reply
      0
      • mit_cruzeM mit_cruze

        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

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #3

        @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.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        3
        • mrjjM mrjj

          Hi and welcome
          Did you try with
          http://doc.qt.io/qt-5/qgraphicsproxywidget.html

          QGraphicsProxyWidget* 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_cruzeM Offline
          mit_cruzeM Offline
          mit_cruze
          wrote on last edited by
          #4

          @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?

          1 Reply Last reply
          0
          • mit_cruzeM Offline
            mit_cruzeM Offline
            mit_cruze
            wrote on last edited by
            #5

            anyone please?

            raven-worxR 1 Reply Last reply
            0
            • mit_cruzeM mit_cruze

              anyone please?

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @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...

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved