diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 index 0000000..260949c --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,257 @@ + + + + + + EnvironmentId + {ba65acc4-67f8-4483-9557-68f8d8f20560} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + 0 + false + true + false + 2 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 6 + true + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + vc64 + vc64 + {244185d3-0e22-42f6-99cc-1b986ffe29c6} + 0 + 0 + 0 + + Debug + 2 + false + + -DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} + 0 + E:\code\OneLevelXmlOpr\build\vc64-Debug + + + + + all + + false + + true + 构建 + CMakeProjectManager.MakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + 构建 + CMakeProjectManager.MakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + Release + 2 + false + + -DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_BUILD_TYPE:STRING=Release +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} + E:\code\OneLevelXmlOpr\build\vc64-Release + + + + + all + + false + + true + CMakeProjectManager.MakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + CMakeProjectManager.MakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + 2 + + + 0 + 部署 + 部署 + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + 0 + true + + 2 + + false + -e cpu-cycles --call-graph "dwarf,4096" -F 250 + OneLevelXmlOpr + CMakeProjectManager.CMakeRunConfiguration.OneLevelXmlOpr + OneLevelXmlOpr + false + true + true + true + E:/code/OneLevelXmlOpr/build/vc64-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/MainWidget.cpp b/MainWidget.cpp index 69bac61..14a08b4 100644 --- a/MainWidget.cpp +++ b/MainWidget.cpp @@ -11,7 +11,7 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget { ui->setupUi(this); - setWindowTitle(u8"OneLevelXmlOpr v1.2.6"); + setWindowTitle(u8"OneLevelXmlOpr v1.2.7"); setWindowIcon(QIcon("://resource/xml.ico")); setMinimumWidth(900); @@ -24,13 +24,20 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget attri_edit_ = new CAttributeEdit(); - ui->edStatus->setEnabled(false); + ui->edStatus->setReadOnly(true); ui->btnSave->setEnabled(false); ui->edAllPage->setEnabled(false); ui->cbCaseSensitive->setChecked(false); - connect(ui->btnRead, &QPushButton::clicked, this, [&]() { read(); }); + connect(ui->btnSelectFile, &QPushButton::clicked, this, [&]() { + QString file = CUtil::select_file(this, u8"请选择xml文件", u8"XML(*.xml);;所有文件 (*)"); + if (file.isEmpty()) { + return; + } + read(file); + }); connect(ui->btnSearch, &QPushButton::clicked, this, [&]() { search(); }); + connect(ui->btnRead, &QPushButton::clicked, this, [&]() { read(ui->edStatus->text().trimmed()); }); connect(ui->btnSave, &QPushButton::clicked, this, [&]() { save(); }); connect(ui->btnExit, &QPushButton::clicked, this, [&]() { QApplication::exit(0); }); connect(ui->btnReset, &QPushButton::clicked, this, &MainWidget::reset); @@ -52,12 +59,17 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget restoreGeometry(settings.value("geometry").toByteArray()); settings.endGroup(); + //QFile qss_file("://qss/lightblue.css"); QFile qss_file("://qss/flatgray.css"); if (qss_file.open(QFile::ReadOnly)) { qApp->setStyleSheet(qss_file.readAll()); } init_menu(); + + ini_.set_work_exe(exe_path_); + base_ = ini_.get_config(); + ui->edStatus->setText(QString::fromLocal8Bit(base_.xml_path.c_str())); } void MainWidget::copy_key() @@ -104,12 +116,24 @@ void MainWidget::set_work_exe(char* path) exe_path_.append(path); } +void MainWidget::show_custom_menu() +{ + if (tab_widget_ == nullptr) { + return; + } + QModelIndexList indexList = tab_widget_->selectionModel()->selectedRows(); + + if (indexList.size() == 1) { + context_menu_->exec(QCursor::pos()); + } +} + void MainWidget::generate_table_widget() { tab_widget_ = new QTableWidget(); tab_widget_->setContextMenuPolicy(Qt::CustomContextMenu); connect(tab_widget_, &QTableWidget::itemChanged, this, [&](QTableWidgetItem* item) { item_changed_handle(item); }); - connect(tab_widget_, &QTableWidget::customContextMenuRequested, this, [&]() { context_menu_->exec(QCursor::pos()); }); + connect(tab_widget_, &QTableWidget::customContextMenuRequested, this, &MainWidget::show_custom_menu); auto config = ini_.get_config(); auto keys = splitString(config.purpose, ","); keys_.clear(); @@ -125,7 +149,7 @@ void MainWidget::generate_table_widget() tab_widget_->setColumnCount(list.size()); tab_widget_->setHorizontalHeaderLabels(list); tab_widget_->setSelectionBehavior(QAbstractItemView::SelectRows); - tab_widget_->setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection); + //tab_widget_->setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection); for (auto i = 0; i < keys.size(); ++i) { tab_widget_->setColumnWidth(i, width_[i]); @@ -193,19 +217,18 @@ void MainWidget::judge_btn_page() } } -void MainWidget::read() +void MainWidget::read(const QString& file_path) { - if (!ini_.set_work_exe(exe_path_)) { + ini_.set_xml_path(file_path.toStdString()); + ui->edStatus->setText(file_path); + + if (!xml_.open(base_.xml_path)) { + CUtil::msg(this, u8"打开xml失败。"); return; } - OprBase base = ini_.get_config(); - if (!xml_.open(base.xml_path)) { - QString status = u8"Open【" + QString::fromStdString(base.xml_path.c_str()) + u8"】Failed."; - return; - } - xml_.set_baseinfo(base); + xml_.set_baseinfo(base_); if (!xml_.parse_xml(vec_)) { - QString status = u8"parse_xml【" + QString::fromStdString(base.xml_path.c_str()) + u8"】Failed."; + CUtil::msg(this, u8"解析xml失败。"); return; } @@ -215,11 +238,10 @@ void MainWidget::read() current_ = vec_; auto_add_ = false; - QString status = u8"Open And Parse【" + QString::fromLocal8Bit(base.xml_path.c_str()) + u8"】Success."; - ui->edStatus->setText(status); - + ui->edStatus->setText(file_path); ui->btnRead->setEnabled(false); ui->btnSave->setEnabled(true); + ui->btnSelectFile->setEnabled(false); } void MainWidget::search() @@ -411,6 +433,8 @@ void MainWidget::insert_one_line(Element_t* ele, int row) if (i == 0) { wgItem->setFlags(wgItem->flags() & ~Qt::ItemIsEditable); + //wgItem->setFlags(wgItem->flags() | Qt::ItemIsUserCheckable); + //wgItem->setCheckState(Qt::Checked); } wgItem->setText(QString(data)); diff --git a/MainWidget.h b/MainWidget.h index cd1f357..9f69df3 100644 --- a/MainWidget.h +++ b/MainWidget.h @@ -30,7 +30,7 @@ public: void push_content(const std::vector& eles, std::size_t page = 1); private: - void read(); + void read(const QString& file_path); void search(); void item_changed_handle(QTableWidgetItem* item); void save(); @@ -43,6 +43,7 @@ private: bool edit_property(Element_t* target, int row); void init_menu(); void ele_update_gui(Element_t* target, int row); + void show_custom_menu(); protected: void closeEvent(QCloseEvent* event); @@ -72,5 +73,6 @@ private: std::size_t cur_page_{1}; std::size_t all_page_{1}; CAttributeEdit* attri_edit_{}; + OprBase base_{}; }; #endif // MAINWIDGET_H diff --git a/MainWidget.ui b/MainWidget.ui index 5bb7175..e84a98c 100644 --- a/MainWidget.ui +++ b/MainWidget.ui @@ -6,16 +6,190 @@ 0 0 - 790 - 847 + 985 + 805 MainWidget - + - + + + 1基本信息 + + + + + + 选择文件 + + + + + + + + + + 加载 + + + + + + + 备份快照 + + + + + + + 保存 + + + + + + + 退出 + + + + + + + + + + 2.操作 + + + + + + 导出选择行 + + + + + + + 导入行 + + + + + + + Qt::Vertical + + + + + + + 仅替换所选 + + + + + + + + + + 替换为 + + + + + + + + + + Qt::Vertical + + + + + + + 搜索区分大小写 + + + + + + + + 0 + 0 + + + + + + + + 搜索 + + + + + + + 重置 + + + + + + + 重新排序 + + + + + + + + + + 3.数据 + + + + + + + 0 + 0 + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -83,105 +257,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 0 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - - - - 区分大小写 - - - - - - - 搜索 - - - - - - - 重置 - - - - - - - - - - - - - - 加载文件 - - - - - - - 保存 - - - - - - - 退出 - - - diff --git a/flatgray.qrc b/flatgray.qrc index 35a2567..85fac3e 100644 --- a/flatgray.qrc +++ b/flatgray.qrc @@ -24,5 +24,29 @@ qss/flatgray/radiobutton_unchecked.png qss/flatgray/radiobutton_unchecked_disable.png qss/flatgray.css + qss/lightblue/add_bottom.png + qss/lightblue/add_left.png + qss/lightblue/add_right.png + qss/lightblue/add_top.png + qss/lightblue/arrow_bottom.png + qss/lightblue/arrow_left.png + qss/lightblue/arrow_right.png + qss/lightblue/arrow_top.png + qss/lightblue/branch_close.png + qss/lightblue/branch_open.png + qss/lightblue/calendar_nextmonth.png + qss/lightblue/calendar_prevmonth.png + qss/lightblue/checkbox_checked.png + qss/lightblue/checkbox_checked_disable.png + qss/lightblue/checkbox_parcial.png + qss/lightblue/checkbox_parcial_disable.png + qss/lightblue/checkbox_unchecked.png + qss/lightblue/checkbox_unchecked_disable.png + qss/lightblue/menu_checked.png + qss/lightblue/radiobutton_checked.png + qss/lightblue/radiobutton_checked_disable.png + qss/lightblue/radiobutton_unchecked.png + qss/lightblue/radiobutton_unchecked_disable.png + qss/lightblue.css diff --git a/public_def.cpp b/public_def.cpp index d28bb52..97086ee 100644 --- a/public_def.cpp +++ b/public_def.cpp @@ -1,5 +1,6 @@ #include "public_def.h" #include +#include std::vector splitString(const std::string& input, const std::string& delimiter) { @@ -37,4 +38,11 @@ bool CUtil::affirm(QWidget* parent, const QString& titile, const QString& conten } else { return true; } -} \ No newline at end of file +} + +QString CUtil::select_file(QWidget* parent, const QString& info, const QString& filter) +{ + QString filePath = + QFileDialog::getOpenFileName(parent, info, QDir::homePath(), filter); + return filePath; +} diff --git a/public_def.h b/public_def.h index 5adc864..c959de7 100644 --- a/public_def.h +++ b/public_def.h @@ -22,6 +22,7 @@ public: public: static void msg(QWidget* parent, const QString& content); static bool affirm(QWidget* parent, const QString& titile, const QString& content); + static QString select_file(QWidget* parent, const QString& info, const QString& filter); }; -#endif \ No newline at end of file +#endif diff --git a/qss/lightblue.css b/qss/lightblue.css new file mode 100644 index 0000000..4928ebd --- /dev/null +++ b/qss/lightblue.css @@ -0,0 +1,694 @@ +QPalette{background:#EAF7FF;}*{outline:0px;color:#386487;} + +QGraphicsView{ +border:1px solid #C0DCF2; +qproperty-backgroundBrush:#EAF7FF; +} + +QWidget[form="true"],QLabel[frameShape="1"],QGraphicsView{ +border:1px solid #C0DCF2; +border-radius:0px; +} + +QWidget[form="bottom"]{ +background:#DEF0FE; +} + +QWidget[form="bottom"] .QFrame{ +border:1px solid #386487; +} + +QWidget[form="bottom"] QLabel,QWidget[form="title"] QLabel{ +border-radius:0px; +color:#386487; +background:none; +border-style:none; +} + +QWidget[form="title"],QWidget[nav="left"],QWidget[nav="top"] QAbstractButton{ +border-style:none; +border-radius:0px; +padding:5px; +color:#386487; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); +} + +QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pressed,QWidget[nav="top"] QAbstractButton:checked{ +border-style:solid; +border-width:0px 0px 2px 0px; +padding:4px 4px 2px 4px; +border-color:#386488; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); +} + +QWidget[nav="left"] QAbstractButton{ +border-radius:0px; +color:#386487; +background:none; +border-style:none; +} + +QWidget[nav="left"] QAbstractButton:hover{ +color:#FFFFFF; +background-color:#386488; +} + +QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{ +color:#386487; +border-style:solid; +border-width:0px 0px 0px 2px; +padding:4px 4px 4px 2px; +border-color:#386488; +background-color:#EAF7FF; +} + +QWidget[video="true"] QLabel{ +color:#386487; +border:1px solid #C0DCF2; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); +} + +QWidget[video="true"] QLabel:focus{ +border:1px solid #386488; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); +} + +QLineEdit:read-only{ +background-color:#DEF0FE; +} + +QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ +border:1px solid #C0DCF2; +border-radius:3px; +padding:2px; +background:none; +selection-background-color:#386488; +selection-color:#FFFFFF; +} + +QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{ +border:1px solid #C0DCF2; +} + +QLineEdit[echoMode="2"]{ +lineedit-password-character:9679; +} + +.QFrame{ +border:1px solid #C0DCF2; +border-radius:3px; +} + +.QGroupBox{ +border:1px solid #C0DCF2; +border-radius:5px; +margin-top:9px; +} + +.QGroupBox::title{ +subcontrol-origin:margin; +position:relative; +left:10px; +} + +.QPushButton,.QToolButton{ +border-style:none; +border:1px solid #C0DCF2; +color:#386487; +padding:5px; +min-height:15px; +border-radius:5px; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); +} + +.QPushButton:hover,.QToolButton:hover{ +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); +} + +.QPushButton:pressed,.QToolButton:pressed{ +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); +} + +.QToolButton::menu-indicator{ +image:None; +} + +QToolButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{ +border-radius:3px; +color:#386487; +padding:3px; +margin:0px; +background:none; +border-style:none; +} + +QToolButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{ +color:#FFFFFF; +margin:1px 1px 2px 1px; +background-color:rgba(51,127,209,230); +} + +QPushButton#btnMenu_Close:hover{ +color:#FFFFFF; +margin:1px 1px 2px 1px; +background-color:rgba(238,0,0,128); +} + +QRadioButton::indicator{ +width:15px; +height:15px; +} + +QRadioButton::indicator::unchecked{ +image:url(:/qss/lightblue/radiobutton_unchecked.png); +} + +QRadioButton::indicator::unchecked:disabled{ +image:url(:/qss/lightblue/radiobutton_unchecked_disable.png); +} + +QRadioButton::indicator::checked{ +image:url(:/qss/lightblue/radiobutton_checked.png); +} + +QRadioButton::indicator::checked:disabled{ +image:url(:/qss/lightblue/radiobutton_checked_disable.png); +} + +QGroupBox::indicator,QTreeView::indicator,QListView::indicator,QTableView::indicator{ +padding:0px 0px 0px 0px; +} + +QCheckBox::indicator,QGroupBox::indicator,QTreeView::indicator,QListView::indicator,QTableView::indicator{ +width:13px; +height:13px; +} + +QCheckBox::indicator:unchecked,QGroupBox::indicator:unchecked,QTreeView::indicator:unchecked,QListView::indicator:unchecked,QTableView::indicator:unchecked{ +image:url(:/qss/lightblue/checkbox_unchecked.png); +} + +QCheckBox::indicator:unchecked:disabled,QGroupBox::indicator:unchecked:disabled,QTreeView::indicator:unchecked:disabled,QListView::indicator:unchecked:disabled,QTableView::indicator:unchecked:disabled{ +image:url(:/qss/lightblue/checkbox_unchecked_disable.png); +} + +QCheckBox::indicator:checked,QGroupBox::indicator:checked,QTreeView::indicator:checked,QListView::indicator:checked,QTableView::indicator:checked{ +image:url(:/qss/lightblue/checkbox_checked.png); +} + +QCheckBox::indicator:checked:disabled,QGroupBox::indicator:checked:disabled,QTreeView::indicator:checked:disabled,QListView::indicator:checked:disabled,QTableView::indicator:checked:disabled{ +image:url(:/qss/lightblue/checkbox_checked_disable.png); +} + +QCheckBox::indicator:indeterminate,QGroupBox::indicator:indeterminate,QTreeView::indicator:indeterminate,QListView::indicator:indeterminate,QTableView::indicator:indeterminate{ +image:url(:/qss/lightblue/checkbox_parcial.png); +} + +QCheckBox::indicator:indeterminate:disabled,QGroupBox::indicator:indeterminate:disabled,QTreeView::indicator:indeterminate:disabled,QListView::indicator:indeterminate:disabled,QTableView::indicator:indeterminate:disabled{ +image:url(:/qss/lightblue/checkbox_parcial_disable.png); +} + +QTimeEdit::up-button,QDateEdit::up-button,QDateTimeEdit::up-button,QDoubleSpinBox::up-button,QSpinBox::up-button{ +image:url(:/qss/lightblue/add_top.png); +width:10px; +height:10px; +padding:2px 5px 0px 0px; +} + +QTimeEdit::down-button,QDateEdit::down-button,QDateTimeEdit::down-button,QDoubleSpinBox::down-button,QSpinBox::down-button{ +image:url(:/qss/lightblue/add_bottom.png); +width:10px; +height:10px; +padding:0px 5px 2px 0px; +} + +QTimeEdit::up-button:pressed,QDateEdit::up-button:pressed,QDateTimeEdit::up-button:pressed,QDoubleSpinBox::up-button:pressed,QSpinBox::up-button:pressed{ +top:-2px; +} + +QTimeEdit::down-button:pressed,QDateEdit::down-button:pressed,QDateTimeEdit::down-button:pressed,QDoubleSpinBox::down-button:pressed,QSpinBox::down-button:pressed,QSpinBox::down-button:pressed{ +bottom:-2px; +} + +QComboBox::down-arrow,QDateEdit[calendarPopup="true"]::down-arrow,QTimeEdit[calendarPopup="true"]::down-arrow,QDateTimeEdit[calendarPopup="true"]::down-arrow{ +image:url(:/qss/lightblue/add_bottom.png); +width:10px; +height:10px; +right:2px; +} + +QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ +subcontrol-origin:padding; +subcontrol-position:top right; +width:15px; +border-left-width:0px; +border-left-style:solid; +border-top-right-radius:3px; +border-bottom-right-radius:3px; +border-left-color:#C0DCF2; +} + +QComboBox::drop-down:on{ +top:1px; +} + +QMenuBar::item{ +color:#386487; +background-color:#DEF0FE; +margin:0px; +padding:3px 10px; +} + +QMenu,QMenuBar,QMenu:disabled,QMenuBar:disabled{ +color:#386487; +background-color:#DEF0FE; +border:1px solid #C0DCF2; +margin:0px; +} + +QMenu::item{ +padding:3px 20px; +} + +QMenu::indicator{ +width:20px; +height:13px; +} + +QMenu::indicator::checked{ +image:url(:/qss/lightblue/menu_checked.png); +} + +QMenu::right-arrow{ +image:url(:/qss/lightblue/arrow_right.png); +width:13px; +height:13px; +padding:0px 3px 0px 0px; +} + +QMenu::item:selected,QMenuBar::item:selected{ +color:#386487; +border:0px solid #C0DCF2; +background:#F2F9FF; +} + +QMenu::separator{ +height:1px; +background:#C0DCF2; +} + +QProgressBar{ +min-height:10px; +background:#DEF0FE; +border-radius:5px; +text-align:center; +border:1px solid #DEF0FE; +} + +QProgressBar:chunk{ +border-radius:5px; +background-color:#C0DCF2; +} + +QSlider::groove:horizontal{ +height:8px; +border-radius:4px; +background:#DEF0FE; +} + +QSlider::add-page:horizontal{ +height:8px; +border-radius:4px; +background:#DEF0FE; +} + +QSlider::sub-page:horizontal{ +height:8px; +border-radius:4px; +background:#C0DCF2; +} + +QSlider::handle:horizontal{ +width:13px; +margin-top:-3px; +margin-bottom:-3px; +border-radius:6px; +background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #EAF7FF,stop:0.8 #C0DCF2); +} + +QSlider::groove:vertical{ +width:8px; +border-radius:4px; +background:#DEF0FE; +} + +QSlider::add-page:vertical{ +width:8px; +border-radius:4px; +background:#C0DCF2; +} + +QSlider::sub-page:vertical{ +width:8px; +border-radius:4px; +background:#DEF0FE; +} + +QSlider::handle:vertical{ +height:14px; +margin-left:-3px; +margin-right:-3px; +border-radius:6px; +background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #EAF7FF,stop:0.8 #C0DCF2); +} + +QScrollBar:horizontal{ +background:#DEF0FE; +padding:0px; +border-radius:6px; +max-height:12px; +} + +QScrollBar::handle:horizontal{ +background:#C0DCF2; +min-width:50px; +border-radius:6px; +} + +QScrollBar::handle:horizontal:hover{ +background:#386488; +} + +QScrollBar::handle:horizontal:pressed{ +background:#386488; +} + +QScrollBar::add-page:horizontal{ +background:none; +} + +QScrollBar::sub-page:horizontal{ +background:none; +} + +QScrollBar::add-line:horizontal{ +background:none; +} + +QScrollBar::sub-line:horizontal{ +background:none; +} + +QScrollBar:vertical{ +background:#DEF0FE; +padding:0px; +border-radius:6px; +max-width:12px; +} + +QScrollBar::handle:vertical{ +background:#C0DCF2; +min-height:50px; +border-radius:6px; +} + +QScrollBar::handle:vertical:hover{ +background:#386488; +} + +QScrollBar::handle:vertical:pressed{ +background:#386488; +} + +QScrollBar::add-page:vertical{ +background:none; +} + +QScrollBar::sub-page:vertical{ +background:none; +} + +QScrollBar::add-line:vertical{ +background:none; +} + +QScrollBar::sub-line:vertical{ +background:none; +} + +QScrollArea{ +border:0px; +} + +QTreeView,QListView,QTableView,QTabWidget::pane{ +border:1px solid #C0DCF2; +selection-background-color:#F2F9FF; +selection-color:#386487; +alternate-background-color:#DAEFFF; +gridline-color:#C0DCF2; +} + +QTreeView::branch:closed:has-children{ +margin:4px; +border-image:url(:/qss/lightblue/branch_open.png); +} + +QTreeView::branch:open:has-children{ +margin:4px; +border-image:url(:/qss/lightblue/branch_close.png); +} + +QTreeView,QListView,QTableView,QSplitter::handle,QTreeView::branch{ +background:#EAF7FF; +} + +QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ +color:#386487; +background:#C0DEF6; +} + +QTableView::item:hover,QListView::item:hover,QTreeView::item:hover,QHeaderView,QHeaderView::section,QTableCornerButton:section{ +color:#386487; +background:#DAEFFF; +} + +QTableView::item,QListView::item,QTreeView::item{ +padding:1px; +margin:0px; +border:0px; +} + +QHeaderView::section,QTableCornerButton:section{ +padding:3px; +margin:0px; +border:1px solid #C0DCF2; +border-left-width:0px; +border-right-width:1px; +border-top-width:0px; +border-bottom-width:1px; +} + +QTabBar::tab{ +border:1px solid #C0DCF2; +color:#386487; +margin:0px; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); +} + +QTabBar::tab:selected{ +border-style:solid; +border-color:#386488; +background:#EAF7FF; +} + +QTabBar::tab:top,QTabBar::tab:bottom{ +padding:3px 8px 3px 8px; +} + +QTabBar::tab:left,QTabBar::tab:right{ +padding:8px 3px 8px 3px; +} + +QTabBar::tab:top:selected{ +border-width:2px 0px 0px 0px; +} + +QTabBar::tab:right:selected{ +border-width:0px 0px 0px 2px; +} + +QTabBar::tab:bottom:selected{ +border-width:0px 0px 2px 0px; +} + +QTabBar::tab:left:selected{ +border-width:0px 2px 0px 0px; +} + +QTabBar::tab:first:top:selected,QTabBar::tab:first:bottom:selected{ +border-left-width:1px; +border-left-color:#C0DCF2; +} + +QTabBar::tab:first:left:selected,QTabBar::tab:first:right:selected{ +border-top-width:1px; +border-top-color:#C0DCF2; +} + +QTabBar::tab:last:top:selected,QTabBar::tab:last:bottom:selected{ +border-right-width:1px; +border-right-color:#C0DCF2; +} + +QTabBar::tab:last:left:selected,QTabBar::tab:last:right:selected{ +border-bottom-width:1px; +border-bottom-color:#C0DCF2; +} + +QStatusBar::item{ +border:0px solid #DEF0FE; +border-radius:3px; +} + +QToolBox::tab,QWidget[form="panel"]{ +padding:3px; +border-radius:5px; +color:#386487; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); +} + +QWidget[flag="paneltitle"]{ +border-bottom-left-radius:0px; +border-bottom-right-radius:0px; +} + +QWidget[flag="panelcontrol"]{ +border-top-width:0px; +border-top-left-radius:0px; +border-top-right-radius:0px; +} + +QToolTip{ +border:0px solid #386487; +padding:1px; +color:#386487; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); +} + +QToolBox::tab:selected{ +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); +} + +QPrintPreviewDialog QToolButton{ +border:0px solid #386487; +border-radius:0px; +margin:0px; +padding:3px; +background:none; +} + +QColorDialog QPushButton,QFileDialog QPushButton{ +min-width:80px; +} + +QToolButton#qt_calendar_prevmonth{ +icon-size:0px; +min-width:20px; +image:url(:/qss/lightblue/calendar_prevmonth.png); +} + +QToolButton#qt_calendar_nextmonth{ +icon-size:0px; +min-width:20px; +image:url(:/qss/lightblue/calendar_nextmonth.png); +} + +QToolButton#qt_calendar_prevmonth,QToolButton#qt_calendar_nextmonth,QToolButton#qt_calendar_monthbutton,QToolButton#qt_calendar_yearbutton{ +border:0px solid #386487; +border-radius:3px; +margin:3px 3px 3px 3px; +padding:3px; +background:none; +} + +QToolButton#qt_calendar_prevmonth:hover,QToolButton#qt_calendar_nextmonth:hover,QToolButton#qt_calendar_monthbutton:hover,QToolButton#qt_calendar_yearbutton:hover,QToolButton#qt_calendar_prevmonth:pressed,QToolButton#qt_calendar_nextmonth:pressed,QToolButton#qt_calendar_monthbutton:pressed,QToolButton#qt_calendar_yearbutton:pressed{ +border:1px solid #C0DCF2; +} + +QCalendarWidget QSpinBox#qt_calendar_yearedit{ +margin:2px; +} + +QCalendarWidget QToolButton::menu-indicator{ +image:None; +} + +QCalendarWidget QTableView{ +border-width:0px; +} + +QCalendarWidget QWidget#qt_calendar_navigationbar{ +border:1px solid #C0DCF2; +border-width:1px 1px 0px 1px; +background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); +} + +QTableView[model="true"]::item{ +padding:0px; +margin:0px; +} + +QTableView QLineEdit,QTableView QComboBox,QTableView QSpinBox,QTableView QDoubleSpinBox,QTableView QDateEdit,QTableView QTimeEdit,QTableView QDateTimeEdit{ +border-width:0px; +border-radius:0px; +} + +QTableView QLineEdit:focus,QTableView QComboBox:focus,QTableView QSpinBox:focus,QTableView QDoubleSpinBox:focus,QTableView QDateEdit:focus,QTableView QTimeEdit:focus,QTableView QDateTimeEdit:focus{ +border-width:0px; +border-radius:0px; +} + +QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ +background:#EAF7FF; +} + +QTabWidget::pane:top{top:-1px;} +QTabWidget::pane:bottom{bottom:-1px;} +QTabWidget::pane:left{right:-1px;} +QTabWidget::pane:right{left:-1px;} + +QDialog,QDial,#QUIWidgetMain{ +background-color:#EAF7FF; +color:#386487; +} + +QDialogButtonBox>QPushButton{ +min-width:50px; +} + +QListView[noborder="true"],QTreeView[noborder="true"],QTabWidget[noborder="true"]::pane{ +border-width:0px; +} + +QToolBar>*,QStatusBar>*{ +margin:2px; +} + +*:disabled,QMenu::item:disabled,QTabBar:tab:disabled,QHeaderView::section:disabled{ +background:#EAF7FF; +border-color:#DEF0FE; +color:#C0DCF2; +} + +QLabel:disabled{ +background:none; +} + +/*TextColor:#386487*/ +/*PanelColor:#EAF7FF*/ +/*BorderColor:#C0DCF2*/ +/*NormalColorStart:#DEF0FE*/ +/*NormalColorEnd:#C0DEF6*/ +/*DarkColorStart:#F2F9FF*/ +/*DarkColorEnd:#DAEFFF*/ +/*HighColor:#386488*/ \ No newline at end of file diff --git a/qss/lightblue/add_bottom.png b/qss/lightblue/add_bottom.png new file mode 100644 index 0000000..99eadb9 Binary files /dev/null and b/qss/lightblue/add_bottom.png differ diff --git a/qss/lightblue/add_left.png b/qss/lightblue/add_left.png new file mode 100644 index 0000000..a7329d3 Binary files /dev/null and b/qss/lightblue/add_left.png differ diff --git a/qss/lightblue/add_right.png b/qss/lightblue/add_right.png new file mode 100644 index 0000000..0c0ef6f Binary files /dev/null and b/qss/lightblue/add_right.png differ diff --git a/qss/lightblue/add_top.png b/qss/lightblue/add_top.png new file mode 100644 index 0000000..911f5b4 Binary files /dev/null and b/qss/lightblue/add_top.png differ diff --git a/qss/lightblue/arrow_bottom.png b/qss/lightblue/arrow_bottom.png new file mode 100644 index 0000000..6dc9f23 Binary files /dev/null and b/qss/lightblue/arrow_bottom.png differ diff --git a/qss/lightblue/arrow_left.png b/qss/lightblue/arrow_left.png new file mode 100644 index 0000000..87171e9 Binary files /dev/null and b/qss/lightblue/arrow_left.png differ diff --git a/qss/lightblue/arrow_right.png b/qss/lightblue/arrow_right.png new file mode 100644 index 0000000..604def6 Binary files /dev/null and b/qss/lightblue/arrow_right.png differ diff --git a/qss/lightblue/arrow_top.png b/qss/lightblue/arrow_top.png new file mode 100644 index 0000000..3c02231 Binary files /dev/null and b/qss/lightblue/arrow_top.png differ diff --git a/qss/lightblue/branch_close.png b/qss/lightblue/branch_close.png new file mode 100644 index 0000000..73492b3 Binary files /dev/null and b/qss/lightblue/branch_close.png differ diff --git a/qss/lightblue/branch_open.png b/qss/lightblue/branch_open.png new file mode 100644 index 0000000..9abd65c Binary files /dev/null and b/qss/lightblue/branch_open.png differ diff --git a/qss/lightblue/calendar_nextmonth.png b/qss/lightblue/calendar_nextmonth.png new file mode 100644 index 0000000..36a453b Binary files /dev/null and b/qss/lightblue/calendar_nextmonth.png differ diff --git a/qss/lightblue/calendar_prevmonth.png b/qss/lightblue/calendar_prevmonth.png new file mode 100644 index 0000000..cce673f Binary files /dev/null and b/qss/lightblue/calendar_prevmonth.png differ diff --git a/qss/lightblue/checkbox_checked.png b/qss/lightblue/checkbox_checked.png new file mode 100644 index 0000000..524d243 Binary files /dev/null and b/qss/lightblue/checkbox_checked.png differ diff --git a/qss/lightblue/checkbox_checked_disable.png b/qss/lightblue/checkbox_checked_disable.png new file mode 100644 index 0000000..de9ece8 Binary files /dev/null and b/qss/lightblue/checkbox_checked_disable.png differ diff --git a/qss/lightblue/checkbox_parcial.png b/qss/lightblue/checkbox_parcial.png new file mode 100644 index 0000000..1990ead Binary files /dev/null and b/qss/lightblue/checkbox_parcial.png differ diff --git a/qss/lightblue/checkbox_parcial_disable.png b/qss/lightblue/checkbox_parcial_disable.png new file mode 100644 index 0000000..cdd3779 Binary files /dev/null and b/qss/lightblue/checkbox_parcial_disable.png differ diff --git a/qss/lightblue/checkbox_unchecked.png b/qss/lightblue/checkbox_unchecked.png new file mode 100644 index 0000000..0f766a4 Binary files /dev/null and b/qss/lightblue/checkbox_unchecked.png differ diff --git a/qss/lightblue/checkbox_unchecked_disable.png b/qss/lightblue/checkbox_unchecked_disable.png new file mode 100644 index 0000000..25c0cdf Binary files /dev/null and b/qss/lightblue/checkbox_unchecked_disable.png differ diff --git a/qss/lightblue/menu_checked.png b/qss/lightblue/menu_checked.png new file mode 100644 index 0000000..bb52701 Binary files /dev/null and b/qss/lightblue/menu_checked.png differ diff --git a/qss/lightblue/radiobutton_checked.png b/qss/lightblue/radiobutton_checked.png new file mode 100644 index 0000000..cd6561d Binary files /dev/null and b/qss/lightblue/radiobutton_checked.png differ diff --git a/qss/lightblue/radiobutton_checked_disable.png b/qss/lightblue/radiobutton_checked_disable.png new file mode 100644 index 0000000..27a6896 Binary files /dev/null and b/qss/lightblue/radiobutton_checked_disable.png differ diff --git a/qss/lightblue/radiobutton_unchecked.png b/qss/lightblue/radiobutton_unchecked.png new file mode 100644 index 0000000..8f0b4fc Binary files /dev/null and b/qss/lightblue/radiobutton_unchecked.png differ diff --git a/qss/lightblue/radiobutton_unchecked_disable.png b/qss/lightblue/radiobutton_unchecked_disable.png new file mode 100644 index 0000000..57c0eb3 Binary files /dev/null and b/qss/lightblue/radiobutton_unchecked_disable.png differ diff --git a/src/config.cpp b/src/config.cpp index bf72ffb..5fa9c8e 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -16,10 +16,18 @@ bool ConfigIni::set_work_exe(const std::string& dir) if (!parse_ini()) { return false; } - return true; } +void ConfigIni::set_xml_path(const std::string& path) +{ + if (ini_.IsEmpty()) { + return ; + } + ini_.SetValue("Basic", "xml_path", path.c_str()); + ini_.SaveFile(ini_path_.c_str()); +} + OprBase ConfigIni::get_config() { return opr_base_; diff --git a/src/config.h b/src/config.h index 8a4e8c2..8e1d33f 100644 --- a/src/config.h +++ b/src/config.h @@ -20,6 +20,7 @@ public: public: bool set_work_exe(const std::string& dir); + void set_xml_path(const std::string& path); OprBase get_config(); private: @@ -31,4 +32,4 @@ private: OprBase opr_base_{}; }; -#endif \ No newline at end of file +#endif diff --git a/src/xml_opr.h b/src/xml_opr.h index 9f50501..4832c2c 100644 --- a/src/xml_opr.h +++ b/src/xml_opr.h @@ -4,7 +4,6 @@ #include #include #include -#include #include "../public_def.h" struct SKeyValue { @@ -43,4 +42,4 @@ private: std::vector keys_{}; }; -#endif \ No newline at end of file +#endif