#include "selectcodedlg.h" #include "ui_selectcodedlg.h" SelectCodeDlg::SelectCodeDlg(QWidget *parent) : QDialog(parent), ui(new Ui::SelectCodeDlg) { ui->setupUi(this); applyStyleSheet(); } SelectCodeDlg::~SelectCodeDlg() { delete ui; } void SelectCodeDlg::applyStyleSheet() { QString styleSheet = R"( QTabWidget { border: none; background-color: #7B838E; } QTabWidget::tab-bar { background-color: #7B838E; alignment: left; height: 80px; margin: 0; } QTabBar { background-color: #7B838E; border: none; width: 100%; min-width: 100%; height: 80px; padding: 0; } QTabBar::tab { width: 140px; height: 80px; font-size: 16px; font-weight: bold; color: #000000; border: none; border-top-left-radius: 10px; border-top-right-radius: 10px; alignment: center bottom; padding-top: 0; } QTabBar::tab { margin-left: 10px; margin-top: 10px; } QTabBar::tab:!selected { background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #6E757F, stop:1 #96A0A9); border: 2px solid #63535D; border-bottom: none; position: relative; bottom: 0px; } QTabBar::tab:selected { background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #95B2D4, stop:1 #F0F0F0); border: none; position: relative; bottom: 0px; } QTabWidget::pane { border: none; background-color: #f0f0f0; top: -12px; } QWidget#buttonWidget { background-color: #95989D; } QPushButton#closeBtn { background-color: #E6F7FF; border: 1px solid #87CEEB; border-radius: 4px; font-size: 24px; color: #228B22; } QPushButton#closeBtn:hover { background-color: #D1E9FF; } QPushButton#closeBtn:pressed { background-color: #BAE7FF; } QLabel { font-size: 18px; color: #000000; font-weight: 500; } QCheckBox { font-size: 18px; color: #000000; font-weight:500; } QCheckBox::indicator { width: 18px; height: 18px; border: 1px solid #96A0A9; border-radius: 10px; background-color: #ffffff; } QCheckBox::indicator:checked { background-color: #95B2D4; border-color: #95B2D4; image: url(:/Demo/image/select.png); } QPushButton { background-color: #5396C1; color: #ffffff; border: 1px solid #000000; border-radius: 3px; font-size: 18px; font-weight:500; } QPushButton:hover { background-color: #5396C1; } QPushButton:disabled { background-color: #7C828E; color: #606060; border-color: #808080; } QWidget#fileTab, QWidget#extraTab, QWidget#settingsTab, QWidget#serviceTab { background-color: #E3E7EC; } )"; this->setStyleSheet(styleSheet); } void SelectCodeDlg::on_btn_cancel_clicked() { emit sig_cancelEdit(); this->close(); } void SelectCodeDlg::on_btn_QRCode_clicked() { emit sig_editQRCode(); this->close(); } void SelectCodeDlg::on_btn_barCode_clicked() { emit sig_editBarCode(); this->close(); }