"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/commonfrontend/spreadsheet/SpreadsheetView.cpp" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.

SpreadsheetView.cpp  (labplot-2.8.1):SpreadsheetView.cpp  (labplot-2.8.2)
skipping to change at line 2737 skipping to change at line 2737
} }
void SpreadsheetView::showColumnStatistics(bool forAll) { void SpreadsheetView::showColumnStatistics(bool forAll) {
QString dlgTitle(m_spreadsheet->name() + " column statistics"); QString dlgTitle(m_spreadsheet->name() + " column statistics");
QVector<Column*> columns; QVector<Column*> columns;
if (!forAll) if (!forAll)
columns = selectedColumns(); columns = selectedColumns();
else if (forAll) { else if (forAll) {
for (int col = 0; col < m_spreadsheet->columnCount(); ++col) { for (int col = 0; col < m_spreadsheet->columnCount(); ++col) {
if (m_spreadsheet->column(col)->columnMode() == AbstractC olumn::ColumnMode::Numeric) if (m_spreadsheet->column(col)->isNumeric())
columns << m_spreadsheet->column(col); columns << m_spreadsheet->column(col);
} }
} }
auto* dlg = new StatisticsDialog(dlgTitle, columns); auto* dlg = new StatisticsDialog(dlgTitle, columns);
dlg->setModal(true); dlg->setModal(true);
dlg->show(); dlg->show();
QApplication::processEvents(QEventLoop::AllEvents, 0); QApplication::processEvents(QEventLoop::AllEvents, 0);
QTimer::singleShot(0, this, [=] () {dlg->showStatistics();}); QTimer::singleShot(0, this, [=] () {dlg->showStatistics();});
} }
skipping to change at line 3020 skipping to change at line 3020
if (o != Qt::Horizontal) return; if (o != Qt::Horizontal) return;
m_tableView->horizontalHeader()->setStretchLastSection(true); // ugly ha ck (flaw in Qt? Does anyone know a better way?) m_tableView->horizontalHeader()->setStretchLastSection(true); // ugly ha ck (flaw in Qt? Does anyone know a better way?)
m_tableView->horizontalHeader()->updateGeometry(); m_tableView->horizontalHeader()->updateGeometry();
m_tableView->horizontalHeader()->setStretchLastSection(false); // ugly ha ck part 2 m_tableView->horizontalHeader()->setStretchLastSection(false); // ugly ha ck part 2
} }
/*! /*!
selects the column \c column in the speadsheet view . selects the column \c column in the speadsheet view .
*/ */
void SpreadsheetView::selectColumn(int column) { void SpreadsheetView::selectColumn(int column) {
QItemSelection selection(m_model->index(0, column), m_model->index(m_spre const auto& index = m_model->index(0, column);
adsheet->rowCount()-1, column) ); m_tableView->scrollTo(index);
QItemSelection selection(index, m_model->index(m_spreadsheet->rowCount()-
1, column) );
m_suppressSelectionChangedEvent = true; m_suppressSelectionChangedEvent = true;
m_tableView->selectionModel()->select(selection, QItemSelectionModel::Sel ect); m_tableView->selectionModel()->select(selection, QItemSelectionModel::Sel ect);
m_suppressSelectionChangedEvent = false; m_suppressSelectionChangedEvent = false;
} }
/*! /*!
deselects the column \c column in the speadsheet view . deselects the column \c column in the speadsheet view .
*/ */
void SpreadsheetView::deselectColumn(int column) { void SpreadsheetView::deselectColumn(int column) {
QItemSelection selection(m_model->index(0, column), m_model->index(m_spre adsheet->rowCount()-1, column) ); QItemSelection selection(m_model->index(0, column), m_model->index(m_spre adsheet->rowCount()-1, column) );
skipping to change at line 3519 skipping to change at line 3521
if (notEmpty || !skipEmptyRows) { if (notEmpty || !skipEmptyRows) {
for (const auto& s : values) for (const auto& s : values)
out << s; out << s;
out << QLatin1String("\\\\ \n"); out << QLatin1String("\\\\ \n");
if (gridLines) if (gridLines)
out << QLatin1String("\\hline \n" ); out << QLatin1String("\\hline \n" );
rowCount++; rowCount++;
if (rowCount == maxRows) { if (rowCount == maxRows) {
out << endTabularTable; out << endTabularTable;
out << QLatin1String("\\newpage \ n"); out << QLatin1String("\\clearpage \n");
if (captions) if (captions)
if (!captionRemoved) if (!captionRemoved)
textable.removeAt (1); textable.removeAt (1);
for (const auto& s : textable) for (const auto& s : textable)
out << s; out << s;
rowCount = 0; rowCount = 0;
if (!captionRemoved) if (!captionRemoved)
captionRemoved = true; captionRemoved = true;
} }
skipping to change at line 3653 skipping to change at line 3655
if (notEmpty || !skipEmptyRows) { if (notEmpty || !skipEmptyRows) {
for (const auto& s : values) for (const auto& s : values)
out << s; out << s;
out << QLatin1String("\\\\ \n"); out << QLatin1String("\\\\ \n");
if (gridLines) if (gridLines)
out << QLatin1String("\\hline \n"); out << QLatin1String("\\hline \n");
rowCount++; rowCount++;
if (rowCount == maxRows) { if (rowCount == maxRows) {
out << endTabularTable; out << endTabularTable;
out << QLatin1String("\\newpage \n"); out << QLatin1String("\\clearpage \n");
if (captions) if (captions)
if (!captionRemoved) if (!captionRemoved)
textable.removeAt(1); textable.removeAt(1);
for (const auto& s : textable) for (const auto& s : textable)
out << s; out << s;
rowCount = 0; rowCount = 0;
if (!captionRemoved) if (!captionRemoved)
captionRemoved = true; captionRemoved = true;
} }
} }
 End of changes. 4 change blocks. 
5 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)