优化plot 轴标签字体

This commit is contained in:
徐海 2026-03-26 17:01:04 +08:00
parent 20f3375742
commit d95c1d9caa
3 changed files with 19 additions and 6 deletions

View File

@ -63,8 +63,15 @@ void EnergyCountPlotView::setupPlot()
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(_plot->canvas());
canvas->setFrameStyle(QFrame::NoFrame);
_plot->setAxisTitle(QwtPlot::xBottom, QString(QStringLiteral(u"能量(KeV)")));
_plot->setAxisTitle(QwtPlot::yLeft, QString(QStringLiteral(u"计数")));
QFont font = this->font();
font.setBold(false);
QwtText energy_label = QStringLiteral(u"能量(KeV)");
energy_label.setFont(font);
QwtText count_label = QStringLiteral(u"计数");
count_label.setFont(font);
_plot->setAxisTitle(QwtPlot::xBottom, energy_label);
_plot->setAxisTitle(QwtPlot::yLeft, count_label);
// set axis auto scale
_plot->setAxisAutoScale(QwtPlot::xBottom, true);
_plot->setAxisAutoScale(QwtPlot::yLeft, true);

View File

@ -166,7 +166,6 @@ void MainWindow::initAction()
count_task->SetEveryChannelCountResultDir(every_ch_count_dir);
count_task->SetFinishedNotifier(project_list_model, "onChannelAddressCountProcessFinished", project_model->GetProjectName());
count_task->StartTask();
auto coincidence_process_task = new DataProcessWorkPool::CoincidenceEventAnalysisTask;
coincidence_process_task->SetFinishedNotifier(project_list_model, "onCoincidenceProcessFinished", project_model->GetProjectName());
coincidence_process_task->StartTask();
@ -188,7 +187,6 @@ void MainWindow::initAction()
if (model->LoadProjectModel(filename)) {
ProjectList::Instance()->AddProjectModel(model);
}
});
connect(ui->action_save_measurement_analysis, &QAction::triggered, [](){
MeasureAnalysisProjectModel* project_model = ProjectList::Instance()->GetCurrentProjectModel();
@ -261,6 +259,7 @@ void MainWindow::initAction()
}
if ( !view_exist ) {
ads::CDockWidget* dock_widget = new ads::CDockWidget(view->GetViewName());
view->setMinimumSize(320, 280);
dock_widget->setWidget(view);
dock_widget->setMinimumSizeHintMode(ads::CDockWidget::MinimumSizeHintFromContent);
if (view->IsDeleteOnClose()) {

View File

@ -158,8 +158,15 @@ void ParticleCountPlotView::setupPlot()
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(_plot->canvas());
canvas->setFrameStyle(QFrame::NoFrame);
_plot->setAxisTitle(QwtPlot::xBottom, QString(QStringLiteral(u"道址")));
_plot->setAxisTitle(QwtPlot::yLeft, QString(QStringLiteral(u"计数")));
QFont font = this->font();
font.setBold(false);
QwtText addr_label = QStringLiteral(u"道址");
addr_label.setFont(font);
QwtText count_label = QStringLiteral(u"计数");
count_label.setFont(font);
_plot->setAxisTitle(QwtPlot::xBottom, addr_label);
_plot->setAxisTitle(QwtPlot::yLeft, count_label);
// set axis auto scale
_plot->setAxisAutoScale(QwtPlot::xBottom, true);
_plot->setAxisAutoScale(QwtPlot::yLeft, true);