修改样式

This commit is contained in:
徐海 2026-03-31 09:49:58 +08:00
parent f5c61d6940
commit adc67aac77
7 changed files with 25 additions and 41 deletions

Binary file not shown.

View File

@ -9,10 +9,11 @@ BusyIndicator::BusyIndicator(QWidget* parent)
setAttribute(Qt::WA_TransparentForMouseEvents);
QLabel* icon = new QLabel;
icon->resize(80, 80);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
icon->setSizePolicy(sizePolicy);
// icon->setMaximumSize(80, 80);
// QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
// icon->setSizePolicy(sizePolicy);
_busy_movie = new QMovie(":gif/BusyIndicator.gif"); // 转圈 GIF
_busy_movie->setScaledSize(QSize(50, 50));
icon->setMovie(_busy_movie);
_busy_movie->start();
QLabel* text = new QLabel(QStringLiteral(u"加载数据中......"));
@ -26,14 +27,14 @@ BusyIndicator::BusyIndicator(QWidget* parent)
void BusyIndicator::Start()
{
// _busy_movie->start();
_busy_movie->start();
this->setVisible(true);
this->update();
}
void BusyIndicator::Stop()
{
// _busy_movie->stop();
_busy_movie->stop();
this->setVisible(false);
this->update();
}

View File

@ -304,18 +304,15 @@ void MainWindow::initAction()
}
}
});
/*
connect(_tree_measure_analysis, &MeasureAnalysisTree::TreeWidget::newMeasureAnalysisProject, new_measurement_analysis_handler);
*/
}
void MainWindow::applyStyleSheet()
{
#ifdef ENABLE_DEBUG
QString style_file_path = "D:/Workspace/EnergySpectrumAnalyerProject/EnergySpectrumAnalyer/style/stylesheet/";
#else
// #ifdef ENABLE_DEBUG
// QString style_file_path = "D:/Workspace/EnergySpectrumAnalyerProject/EnergySpectrumAnalyer/style/stylesheet/";
// #else
QString style_file_path = ":/stylesheet/";
#endif
// #endif
QFile file_stylesheet_default(style_file_path + "default.qss");
if (file_stylesheet_default.open(QFile::ReadOnly)) {
const QString& str_stylesheet_default = file_stylesheet_default.readAll();
@ -357,6 +354,12 @@ void MainWindow::closeProject(const QString& project_name)
}
}
void MainWindow::showEvent(QShowEvent *event)
{
QMainWindow::showEvent(event);
this->applyStyleSheet();
}
void MainWindow::closeEvent(QCloseEvent* event)
{
QList<MeasureAnalysisProjectModel *> models = ProjectList::Instance()->GetProjectModels();

View File

@ -53,6 +53,7 @@ signals:
void newProject(const QString &project_name);
protected:
virtual void showEvent(QShowEvent* event) override;
virtual void closeEvent(QCloseEvent* event) override;
private:

View File

@ -155,9 +155,6 @@ void ParticleTimeDifferenceView::loadDataFromFile()
x_max = bin_max;
if ( y_max < count )
y_max = count;
// if ( _max_diff <= bin ) {
// break;
// }
}
_histogram->setData(new QwtIntervalSeriesData(samples));
_plot->SetAxisInitRange(QwtPlot::xBottom, 0.0f, _x_max);

View File

@ -1,4 +1,4 @@
/*
QwtPlot {
background-color: white;
}
@ -12,18 +12,18 @@ QPlainTextEdit {
}
QTreeView::item:selected:active{
color: black;
background: #7bbfea;
color: white;
background: #0078d4;
}
QTreeView::item:selected:!active {
color: black;
background: #7bbfea;
background: white;
}
QTableView {
selection-color: black;
selection-background-color: #7bbfea;
selection-color: white;
selection-background-color: #0078d4;
}
QTableView QTableCornerButton::section {
@ -44,8 +44,7 @@ QHeaderView::section {
border-top: 0px;
}
QHeaderView::section:checked
{
QHeaderView::section {
font-weight: normal;
}
@ -91,21 +90,5 @@ QScrollBar::add-page {
QScrollBar::sub-page {
background: rgba(0, 0, 0, 0);
}
*/
/*
QTreeView[Checkable="false"]::indicator:unchecked {
background: blue;
}
QTreeView[Checkable="false"]::indicator:checked {
background: blue;
}
QTreeView[Checkable="true"]::unchecked {
background: red; }
QTreeView[Checkable="true"]::checked {
background: green;
}
*/

View File

@ -1,4 +1,4 @@
/*
ads--CDockContainerWidget ads--CDockSplitter::handle {
background: #2a5caa;
}
@ -10,4 +10,3 @@ ads--CDockSplitter::handle:horizontal {
ads--CDockSplitter::handle:vertical {
height: 1px;
}
*/