mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix SEGV on add chart with Qt5
.. and also selects the first chart on the chartbar at startup.
This commit is contained in:
@@ -251,6 +251,12 @@ ChartBar::removeWidget(int index)
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
ChartBar::setCurrentIndex(int index)
|
||||
{
|
||||
clicked(index);
|
||||
}
|
||||
|
||||
void
|
||||
ChartBar::clicked(int index)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public slots:
|
||||
void clicked(int);
|
||||
void removeWidget(int);
|
||||
void setText(int index, QString);
|
||||
//void setCurrentIndex(int index);
|
||||
void setCurrentIndex(int index);
|
||||
void scrollLeft();
|
||||
void scrollRight();
|
||||
void tidy();
|
||||
|
||||
@@ -176,7 +176,9 @@ HomeWindow::addChartFromMenu(QAction*action)
|
||||
}
|
||||
}
|
||||
|
||||
if (id != GcWindowTypes::None) appendChart(id); // called from Context to inset chart
|
||||
if (id != GcWindowTypes::None) {
|
||||
appendChart(id); // called from Context to inset chart
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -281,6 +283,7 @@ HomeWindow::tabSelected(int index)
|
||||
controlStack->setCurrentIndex(index);
|
||||
titleEdit->setText(charts[index]->property("title").toString());
|
||||
tabbed->setCurrentIndex(index);
|
||||
chartbar->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
active = false;
|
||||
@@ -427,7 +430,7 @@ HomeWindow::appendChart(GcWinID id)
|
||||
// returns null if cancelled or closed
|
||||
if (newone) {
|
||||
addChart(newone);
|
||||
newone->show();
|
||||
//newone->show() //Crash on QT5
|
||||
}
|
||||
|
||||
// now wipe it
|
||||
@@ -579,6 +582,7 @@ HomeWindow::addChart(GcWindow* newone)
|
||||
titleEdit->setText("");
|
||||
}
|
||||
|
||||
// select the last tab just added
|
||||
active = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user