Skip to content
Snippets Groups Projects
Commit 2fb44e27 authored by MelanieCarriere's avatar MelanieCarriere
Browse files

[fix] Fix the spreadsheet columns visibility consistency

Columns visibility was restored only in the first opening of LidarView.
For example :
if you open the spreadsheet (using ctrl-t), hide a specific column,
       close the spreadsheet (using ctrl-t) and reopen it, the column wasn't hide.

This was due to the check on the current object (if it was different thant the previous).
Actually we want to update the column selection everytime the spreadsheet is displayed.
Even if it's the same object or the same frame.
parent 30b0d327
No related branches found
No related tags found
1 merge request!140Fix spreadsheet view
......@@ -164,19 +164,17 @@ void lqSpreadSheetManager::conditionnallyHideColumn(const std::string& condition
//-----------------------------------------------------------------------------
void lqSpreadSheetManager::onSpreadSheetEndRender()
{
// endRender may not be the best signal to use because it will be called at
// each frame whereas we would prefer to update only when the source is
// changed. However I tried pqSpreadSheetView::showing and
// pqSpreadSheetView::viewportUpdated but none worked because column names
// are not yet updated
if (this->getCurrentShownObjectName() != this->lastShownObjectName)
{
conditionnallyHideColumn("Data", "Points_m_XYZ"); // hide dupe of pt coords
conditionnallyHideColumn("TrailingFrame", "Points_m_XYZ");
// Every time the spreadsheet has to be rendered:
// - we hide the column "Points_m_XYZ" because it's too wide.
// - we check which columns have to be displayed (some of them could have been hidden by the user
// We do this every time (not only for each new frame)
// Because if the user opens and closes the spreadsheet on the same frame, it should display the same things.
this->restoreColumnSelection();
}
this->lastShownObjectName = this->getCurrentShownObjectName();
conditionnallyHideColumn("Data", "Points_m_XYZ"); // hide dupe of pt coords
conditionnallyHideColumn("TrailingFrame", "Points_m_XYZ");
this->restoreColumnSelection();
}
//-----------------------------------------------------------------------------
......
......@@ -62,7 +62,6 @@ private:
const std::string& columnName);
void restoreColumnSelection();
std::string getCurrentShownObjectName();
std::string lastShownObjectName = "";
};
#endif // __lqSpreadSheetManager_h
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment