Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-4180

Widgets in a QGraphicsProxyWidget jump in layout on Mac Carbon.

    XMLWordPrintable

Details

    • macOS

    Description

      QWidgets via QGraphicsWidgetProxy do not layout properly on Carbon.
      On almost every load one of the widgets in the layout will jump positions after about a second.
      On Cocoa the widgets stay still (as expected)

      #include <QtGui>

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);

      QWidget *panel = new QWidget();
      QVBoxLayout *layout = new QVBoxLayout(panel);
      panel->resize(600,600);

      layout->addWidget(new QLabel("Run this a couple of times under Carbon and Cocoa, in Cocoa the proxys do not move."));

      QGraphicsScene *scene = new QGraphicsScene(panel);
      QGraphicsView *view = new QGraphicsView(scene);
      layout->addWidget(view);

      QLineEdit *lineEdit1 = new QLineEdit("edit 1 is going to hide now.");
      QGraphicsProxyWidget *item1 = new QGraphicsProxyWidget();
      item1->setWidget(lineEdit1);
      item1->setPos(10, 10);
      scene->addItem(item1);

      QLineEdit *lineEdit2 = new QLineEdit("edit 2");
      QGraphicsProxyWidget *item2 = new QGraphicsProxyWidget();
      item2->setWidget(lineEdit2);
      item2->setPos(10, 40);
      scene->addItem(item2);

      QSlider *slider = new QSlider(Qt::Horizontal);
      QGraphicsProxyWidget *item3 = new QGraphicsProxyWidget();
      item3->setWidget(slider);
      item3->setPos(10, 70);
      scene->addItem(item3);

      panel->show();
      return app.exec();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            dettman Dean Dettman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes