FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

qt: Suppress error messages "QList index out of range" · gnuplot/gnuplot@a0f2b0f · GitHub

Repository navigation

Commit a0f2b0f

Browse files
authored andcommitted
qt: Suppress error messages "QList index out of range"
In three places gnuplot_qt was appending an element to an existing list by insertiong using an index greater than the current list size. This works but starting with Qt 5.15 an error message is given. Replace with append() or insert(list_size, ...) Bug #2280
1 parent 166dfef commit a0f2b0f

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎src/qtterminal/QtGnuplotScene.cpp‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ void QtGnuplotScene::flushCurrentPointsItem()
167167
void QtGnuplotScene::update_key_box(const QRectF rect)
168168
{
169169
if (m_currentPlotNumber > m_key_boxes.count()) {
170-
// DEBUG Feb 2018 should no longer trigger
171-
// because m_key_box insertion is done in layer code for GEAfterPlot
172-
m_key_boxes.insert(m_currentPlotNumber, QtGnuplotKeybox(rect));
170+
m_key_boxes.insert(m_currentPlotNumber-1, QtGnuplotKeybox(rect));
173171
} else if (m_key_boxes[m_currentPlotNumber-1].isEmpty()) {
174172
// Retain the visible/hidden flag when re-initializing the Keybox
175173
bool tmp = m_key_boxes[m_currentPlotNumber-1].ishidden();
@@ -515,12 +513,12 @@ void QtGnuplotScene::processEvent(QtGnuplotEventType type, QDataStream& in)
515513
if (0 < m_currentPlotNumber && m_currentPlotNumber <= m_key_boxes.count())
516514
newgroup->setVisible( !(m_key_boxes[m_currentPlotNumber-1].ishidden()) );
517515
// Store it in an ordered list so we can toggle it by index
518-
m_plot_group.insert(m_currentPlotNumber, newgroup);
516+
m_plot_group.insert(m_currentPlotNumber-1, newgroup);
519517
}
520518

521519
if (m_currentPlotNumber >= m_key_boxes.count()) {
522520
QRectF empty( QPointF(0,0), QPointF(0,0));
523-
m_key_boxes.insert(m_currentPlotNumber, empty);
521+
m_key_boxes.append(empty);
524522
m_key_boxes[m_currentPlotNumber-1].resetStatus();
525523
}
526524

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL