Here is my code
previewArea = new PreviewArea(this);
previewArea->setWidgetResizable(true);
previewWidget = new PreviewWidget(previewArea);
pLay->setMargin(10);
pLay->addWidget(previewWidget);
previewArea->setLayout(pLay);
previewArea->setWidget(previewWidget);
previewArea = new PreviewArea(this);
previewArea->setWidgetResizable(true);
previewWidget = new PreviewWidget(previewArea);
QVBoxLayout *pLay = new QVBoxLayout(previewArea->viewport());
pLay->setMargin(10);
pLay->addWidget(previewWidget);
previewArea->setLayout(pLay);
previewArea->setWidget(previewWidget);
To copy to clipboard, switch view to plain text mode
With the above code, when I close the window that contains the area, my application crashes. I think the crash has some thing to do with QVBoxLayout *pLay = new QVBoxLayout(previewArea->viewport());
The next option
previewArea = new PreviewArea(this);
previewArea->setWidgetResizable(true);
previewWidget = new PreviewWidget(onlyCurr,cd,previewArea);
pLay->setMargin(10);
pLay->addWidget(previewWidget);
previewArea->setLayout(pLay);
previewArea->setWidget(previewWidget);
previewArea = new PreviewArea(this);
previewArea->setWidgetResizable(true);
previewWidget = new PreviewWidget(onlyCurr,cd,previewArea);
QVBoxLayout *pLay = new QVBoxLayout();
pLay->setMargin(10);
pLay->addWidget(previewWidget);
previewArea->setLayout(pLay);
previewArea->setWidget(previewWidget);
To copy to clipboard, switch view to plain text mode
The above code is also not working. But this is not crashing the application.
Thanks for your help.
Bookmarks