Program is crashing if open dialog history and change current pattern piece.

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-29 10:26:12 +02:00
parent c6afb63fb7
commit dd6eb522f8
3 changed files with 4 additions and 2 deletions

View file

@ -57,7 +57,6 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
connect(this, &DialogHistory::ShowHistoryTool, doc, &VPattern::ShowHistoryTool);
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
connect(doc, &VPattern::ChangedActivPP, this, &DialogHistory::UpdateHistory);
ShowPoint();
}
@ -183,7 +182,7 @@ void DialogHistory::FillTable()
}
}
ui->tableWidget->setRowCount(count);//Real row count
if (history->size()>0)
if (count>0)
{
cursorRow = currentRow;
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);

View file

@ -1744,6 +1744,7 @@ void MainWindow::ActionHistory(bool checked)
{
dialogHistory = new DialogHistory(pattern, doc, this);
dialogHistory->setWindowFlags(Qt::Window);
connect(this, &MainWindow::RefreshHistory, dialogHistory, &DialogHistory::UpdateHistory);
connect(dialogHistory, &DialogHistory::DialogClosed, this, &MainWindow::ClosedActionHistory);
dialogHistory->show();
}
@ -2392,6 +2393,7 @@ void MainWindow::ChangePP(int index, bool zoomBestFit)
{
doc->ChangeActivPP(comboBoxDraws->itemText(index));
doc->setCurrentData();
emit RefreshHistory();
if (drawMode)
{
ArrowTool();

View file

@ -133,6 +133,7 @@ signals:
* @param description pattern description.
*/
void ModelChosen(QVector<VItem*> listDetails, const QString &curFile, const QString &description);
void RefreshHistory();
protected:
virtual void keyPressEvent(QKeyEvent *event);
virtual void showEvent(QShowEvent *event);