m_gs = new DocScene(); // derived from QGraphicsScene
// The layout is filled with (many) QLabels created out QPixmaps using
---
gvBackLayout
->addWidget
(QLabel* , ...
);
---
QWidget * backform
= new QWidget;
// In the end a new Widget is created backform->setLayout(gvBackLayout); // and the layout created before
// is assigned to it
m_gpw = m_gs->addWidget(backform); // the newly created widget
// is assigned to the scene
ui.graphicsView->setScene(m_gs); // scene assigned to the view
m_gs = new DocScene(); // derived from QGraphicsScene
QGridLayout *gvBackLayout = new QGridLayout;
// The layout is filled with (many) QLabels created out QPixmaps using
---
gvBackLayout->addWidget(QLabel* , ...);
---
QWidget * backform = new QWidget; // In the end a new Widget is created
backform->setLayout(gvBackLayout); // and the layout created before
// is assigned to it
m_gpw = m_gs->addWidget(backform); // the newly created widget
// is assigned to the scene
ui.graphicsView->setScene(m_gs); // scene assigned to the view
To copy to clipboard, switch view to plain text mode
For reason unknown to me, it looks as if the setting of the layout (gvBackLayout) to the widget (backform) and the addition of the widget to the scene has to be done before the actual entry of the objects in the layout, that is
m_gs = new DocScene(); // derived from QGraphicsScene
QWidget * backform
= new QWidget;
// In the end a new Widget is created backform->setLayout(gvBackLayout); // and the layout created before
// is assigned to it
m_gpw = m_gs->addWidget(backform); // the newly created widget
// is assigned to the scene
// The layout is filled with (many) QLabels created out QPixmaps using
---
gvBackLayout
->addWidget
(QLabel* , ...
);
---
ui.graphicsView->setScene(m_gs); // scene assigned to the view
m_gs = new DocScene(); // derived from QGraphicsScene
QGridLayout *gvBackLayout = new QGridLayout;
QWidget * backform = new QWidget; // In the end a new Widget is created
backform->setLayout(gvBackLayout); // and the layout created before
// is assigned to it
m_gpw = m_gs->addWidget(backform); // the newly created widget
// is assigned to the scene
// The layout is filled with (many) QLabels created out QPixmaps using
---
gvBackLayout->addWidget(QLabel* , ...);
---
ui.graphicsView->setScene(m_gs); // scene assigned to the view
To copy to clipboard, switch view to plain text mode
The only drawback is that the performance on Carbon, in my configuration, are just unacceptable. QtCore in this case apparently allocates a lot of memory for internal use and it takes a lot of time to release it.
With Cocoa the situation is much better, still slower compared to the Windows and Linux versions, but adequate.
I hope it helps.
Bookmarks