modified listwgt
This commit is contained in:
parent
02ad3dbe4b
commit
06358b4bca
@ -26,6 +26,11 @@ CurvePanel::CurvePanel(int index, const QString& filePath, QWidget* parent)
|
||||
CurvePanel::CurvePanel(int index, std::shared_ptr<FileEntryCurve> fileEntry, QWidget* parent)
|
||||
: DataPanel(index, fileEntry, parent)
|
||||
{
|
||||
m_iXMin = 0;
|
||||
m_iXMax = 0;
|
||||
m_iYMax = 0;
|
||||
m_iYMin = 0;
|
||||
|
||||
if (fileEntry) {
|
||||
LOG_INFO("Created CurvePanel {} for chart: {}", index, fileEntry->GetName().toStdString());
|
||||
// Override the title with chart name
|
||||
@ -49,9 +54,9 @@ void CurvePanel::RefreshPanel()
|
||||
OnDataPanelUpdated(fileEntry);
|
||||
}
|
||||
|
||||
if (IsValid()) {
|
||||
UpdateCurveDisplay();
|
||||
}
|
||||
//if (IsValid()) {
|
||||
// UpdateCurveDisplay();
|
||||
//}
|
||||
|
||||
LOG_INFO("Refreshed CurvePanel {}", GetIndex());
|
||||
}
|
||||
@ -291,7 +296,6 @@ void CurvePanel::UpdateCurveDisplay()
|
||||
void CurvePanel::InitUI()
|
||||
{
|
||||
initQChartView();
|
||||
|
||||
}
|
||||
|
||||
QString CurvePanel::GetTypeDisplayName() const
|
||||
@ -325,7 +329,11 @@ void CurvePanel::initQChartView() {
|
||||
}
|
||||
|
||||
void CurvePanel::OnDataPanelUpdated(FileEntryCurve* fileEntry) {
|
||||
int a = 0;
|
||||
FileEntryCurve::ChartProperties prop = fileEntry->GetChartProperties();
|
||||
|
||||
updateTitleAxis(prop.xTitle, prop.yTitle);
|
||||
updateMinMaxX(prop.xMin, prop.xMax, prop.xCount);
|
||||
updateMinMaxY(prop.yMin, prop.yMax, prop.yCount);
|
||||
}
|
||||
|
||||
void CurvePanel::updateTitleAxis(const QString & xTitle, const QString & yTitle)
|
||||
|
||||
@ -61,7 +61,7 @@ void DataPanel::InitUI()
|
||||
// layout->addWidget(infoLabel);
|
||||
// setLayout(layout);
|
||||
|
||||
RefreshPanel();
|
||||
//RefreshPanel();
|
||||
}
|
||||
|
||||
QString DataPanel::GenerateTitle()
|
||||
|
||||
@ -87,6 +87,7 @@ public:
|
||||
virtual void InitUI();
|
||||
|
||||
bool IsValid() const { return fileEntry_ != nullptr; }
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Panel close signal
|
||||
@ -100,8 +101,6 @@ protected:
|
||||
*/
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Generate panel title
|
||||
* @return Generated title
|
||||
|
||||
@ -193,12 +193,11 @@ DataPanel* DataPanelManager::CreateDataPanel(FileEntryType fileType, const QStri
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//panel->InitUI();
|
||||
|
||||
auto fileEntries = currentWorkspace_->GetFileEntries(fileType);
|
||||
if (index < fileEntries.size()) {
|
||||
panel->SetFileEntry(fileEntries[index]);
|
||||
panel->InitUI();
|
||||
panel->RefreshPanel();
|
||||
}
|
||||
|
||||
dockWidget->setWidget(panel);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user