~cyril-jacquet/plume-creator/devel

« back to all changes in this revision

Viewing changes to src/outliner/outlinerbase.cpp

  • Committer: Cyril Jacquet
  • Date: 2013-12-12 16:28:27 UTC
  • Revision ID: git-v1:53209a150c7c4ad05a79f973c957c621541e0be4
fix huge memory leak from activating spell checker

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
    setFocusPolicy(Qt::WheelFocus);
15
15
 
16
16
 
 
17
this->setAttribute(Qt::WA_DeleteOnClose);
17
18
 
18
 
    spreadsheet = new OutlinerSpreadsheet();
 
19
    spreadsheet = new OutlinerSpreadsheet(this);
19
20
 
20
21
 
21
22
 
47
48
}
48
49
 
49
50
//------------------------------------------------------------------------------------
50
 
 
 
51
OutlinerBase::~OutlinerBase()
 
52
{
 
53
 
 
54
}
 
55
 
 
56
//------------------------------------------------------------------------------------
51
57
void OutlinerBase::saveConfig()
52
58
{
53
59
    QSettings settings;
146
152
 
147
153
 
148
154
 
149
 
    proxy = new OutlinerSpreadheetProxy;
 
155
    proxy = new OutlinerSpreadheetProxy(this);
150
156
    proxy->setHub(hub);
151
157
    proxy->setSourceModel(absTreeModel);
152
158
    connect(absTreeModel, SIGNAL(applySettingsFromDataSignal()), spreadsheet, SLOT(applySettingsFromData()), Qt::UniqueConnection);
158
164
 
159
165
    spreadsheet->setWordWrap(true);
160
166
 
161
 
    OutlinerItemNoteDelegate *noteDelegate = new OutlinerItemNoteDelegate;
 
167
    OutlinerItemNoteDelegate *noteDelegate = new OutlinerItemNoteDelegate(this);
162
168
    noteDelegate->setHub(hub);
163
169
    //spreadsheet->setItemDelegateForColumn(0, delegate); //tree
164
170
    spreadsheet->setItemDelegateForColumn(1, noteDelegate); //syn
165
171
    spreadsheet->setItemDelegateForColumn(2, noteDelegate); //notes
166
172
 
167
 
    OutlinerItemPoVDelegate *povDelegate = new OutlinerItemPoVDelegate;
 
173
    OutlinerItemPoVDelegate *povDelegate = new OutlinerItemPoVDelegate(this);
168
174
    povDelegate->setHub(hub);
169
175
    spreadsheet->setItemDelegateForColumn(3, povDelegate); // Point of View
170
176
 
171
 
    OutlinerItemStatusDelegate *statusDelegate = new OutlinerItemStatusDelegate;
 
177
    OutlinerItemStatusDelegate *statusDelegate = new OutlinerItemStatusDelegate(this);
172
178
    spreadsheet->setItemDelegateForColumn(4, statusDelegate); //status
173
179
    connect(statusDelegate, SIGNAL(finishStatusEdit()), spreadsheet, SLOT(finishStatusEdit()), Qt::UniqueConnection);
174
180
 
234
240
settings.setValue( "spreadsheetState", 0);
235
241
settings.endGroup();
236
242
spreadsheet->parentWidget()->layout()->removeWidget(spreadsheet);
237
 
QHBoxLayout *box = new QHBoxLayout;
 
243
QHBoxLayout *box = new QHBoxLayout(this);
238
244
box->addWidget(spreadsheet);
239
245
delete box;
240
246