mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-22 12:39:59 +01:00
Bug fix, segfault when print with a folio list.
Fix memory leak too git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3061 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -35,10 +35,6 @@ DiagramFolioList::DiagramFolioList( QETProject *project, QObject *parent) : Diag
|
|||||||
else
|
else
|
||||||
id = 0;
|
id = 0;
|
||||||
|
|
||||||
clear();
|
|
||||||
list_lines_.clear();
|
|
||||||
list_rectangles_.clear();
|
|
||||||
|
|
||||||
qreal width = border_and_titleblock.columnsTotalWidth();
|
qreal width = border_and_titleblock.columnsTotalWidth();
|
||||||
qreal height = border_and_titleblock.rowsTotalHeight();
|
qreal height = border_and_titleblock.rowsTotalHeight();
|
||||||
|
|
||||||
@@ -57,6 +53,8 @@ DiagramFolioList::DiagramFolioList( QETProject *project, QObject *parent) : Diag
|
|||||||
*/
|
*/
|
||||||
DiagramFolioList::~DiagramFolioList()
|
DiagramFolioList::~DiagramFolioList()
|
||||||
{
|
{
|
||||||
|
qDeleteAll (list_lines_);
|
||||||
|
qDeleteAll (list_rectangles_);
|
||||||
int folioSheetQty = project() -> getFolioSheetsQuantity();
|
int folioSheetQty = project() -> getFolioSheetsQuantity();
|
||||||
if (folioSheetQty > 0)
|
if (folioSheetQty > 0)
|
||||||
project() -> setFolioSheetsQuantity(folioSheetQty-1);
|
project() -> setFolioSheetsQuantity(folioSheetQty-1);
|
||||||
@@ -94,8 +92,13 @@ void DiagramFolioList::drawBackground(QPainter *p, const QRectF &r)
|
|||||||
// If the sheet size has changed since last paint, then clear the scene and re-draw the grid.
|
// If the sheet size has changed since last paint, then clear the scene and re-draw the grid.
|
||||||
if (sheetRectangle != row_RectBorder) {
|
if (sheetRectangle != row_RectBorder) {
|
||||||
sheetRectangle = row_RectBorder;
|
sheetRectangle = row_RectBorder;
|
||||||
clear();
|
foreach(QGraphicsItem *qgi, items()) {
|
||||||
|
removeItem(qgi);
|
||||||
|
qgiManager().release(qgi);
|
||||||
|
}
|
||||||
|
qDeleteAll (list_lines_);
|
||||||
list_lines_.clear();
|
list_lines_.clear();
|
||||||
|
qDeleteAll (list_rectangles_);
|
||||||
list_rectangles_.clear();
|
list_rectangles_.clear();
|
||||||
buildGrid(row_RectBorder,30,2,colWidths);
|
buildGrid(row_RectBorder,30,2,colWidths);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user