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(this, &DialogHistory::ShowHistoryTool, doc, &VPattern::ShowHistoryTool);
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor); connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory); connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
connect(doc, &VPattern::ChangedActivPP, this, &DialogHistory::UpdateHistory);
ShowPoint(); ShowPoint();
} }
@ -183,7 +182,7 @@ void DialogHistory::FillTable()
} }
} }
ui->tableWidget->setRowCount(count);//Real row count ui->tableWidget->setRowCount(count);//Real row count
if (history->size()>0) if (count>0)
{ {
cursorRow = currentRow; cursorRow = currentRow;
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0); 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 = new DialogHistory(pattern, doc, this);
dialogHistory->setWindowFlags(Qt::Window); dialogHistory->setWindowFlags(Qt::Window);
connect(this, &MainWindow::RefreshHistory, dialogHistory, &DialogHistory::UpdateHistory);
connect(dialogHistory, &DialogHistory::DialogClosed, this, &MainWindow::ClosedActionHistory); connect(dialogHistory, &DialogHistory::DialogClosed, this, &MainWindow::ClosedActionHistory);
dialogHistory->show(); dialogHistory->show();
} }
@ -2392,6 +2393,7 @@ void MainWindow::ChangePP(int index, bool zoomBestFit)
{ {
doc->ChangeActivPP(comboBoxDraws->itemText(index)); doc->ChangeActivPP(comboBoxDraws->itemText(index));
doc->setCurrentData(); doc->setCurrentData();
emit RefreshHistory();
if (drawMode) if (drawMode)
{ {
ArrowTool(); ArrowTool();

View File

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