diff --git a/src/EditPatientDialog.cpp b/src/EditPatientDialog.cpp index 30a1c30..ede84b1 100644 --- a/src/EditPatientDialog.cpp +++ b/src/EditPatientDialog.cpp @@ -59,11 +59,9 @@ EditPatientDialog::EditPatientDialog(QWidget* parent, Qt::WindowFlags f) : GUIFo btnSex = new ListBox(this); btnSex->setText(tr("Female")); btnSex->setProperty("idx", 0); - btnSex->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); btnSex->setLayoutDirection(Qt::RightToLeft); btnSex->setObjectName("editvalBtn"); btnSex->setIcon(QIcon(":/icons/arrow-down.png")); - btnSex->setIconSize({ 30, 30 }); btnSex->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); connect(btnSex, &QToolButton::clicked, [=]() { @@ -91,11 +89,9 @@ EditPatientDialog::EditPatientDialog(QWidget* parent, Qt::WindowFlags f) : GUIFo layout->addWidget(lbl_date); btnDate = new ListBox(this); - btnDate->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); btnDate->setLayoutDirection(Qt::RightToLeft); btnDate->setObjectName("editvalBtn"); btnDate->setIcon(QIcon(":/icons/arrow-down.png")); - btnDate->setIconSize({ 30, 30 }); btnDate->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); btnDate->setText("1990-06-15"); connect(btnDate, &QToolButton::clicked, [=]() { diff --git a/src/dialogs/AccountFormDialog.cpp b/src/dialogs/AccountFormDialog.cpp index 3dc84ad..407ab72 100644 --- a/src/dialogs/AccountFormDialog.cpp +++ b/src/dialogs/AccountFormDialog.cpp @@ -104,12 +104,9 @@ void AccountFormDialog::changeSelfPassword() void AccountFormDialog::addButtonPwd(QHBoxLayout* layout) { mBtnPwd = new QToolButton(this); - mBtnPwd->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - mBtnPwd->setObjectName("editvalBtn"); - mBtnPwd->setIcon(QIcon(":/icons/edit.png")); - mBtnPwd->setIconSize({ 30, 30 }); - mBtnPwd->setText(mMode == Self ? tr("Change Password") : tr("Reset Password")); + mBtnPwd->setObjectName("changePwdBtn"); mBtnPwd->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + mBtnPwd->setText(mMode == Self ? tr("Change Password") : tr("Reset Password")); layout->addWidget(mBtnPwd); } @@ -164,12 +161,9 @@ void AccountFormDialog::addTitleLabel(QVBoxLayout* layout) void AccountFormDialog::addSelfModeUI(QHBoxLayout* hlayout) { auto btnLogout = new QToolButton(this); - btnLogout->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - btnLogout->setIcon(QIcon(":/icons/logout.png")); - btnLogout->setIconSize({ 30, 30 }); btnLogout->setText(tr("Logout")); btnLogout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - btnLogout->setObjectName("editvalBtn"); + btnLogout->setObjectName("logoutBtn"); hlayout->addWidget(btnLogout); connect(btnLogout, &QAbstractButton::clicked, [=]() { diff --git a/src/dialogs/GUIMessageDialog.cpp b/src/dialogs/GUIMessageDialog.cpp index 9292018..4cefef2 100644 --- a/src/dialogs/GUIMessageDialog.cpp +++ b/src/dialogs/GUIMessageDialog.cpp @@ -28,12 +28,12 @@ GUIMessageDialog::GUIMessageDialog(QWidget *parent) void GUIMessageDialog::initBaseLayout() { mUI->lblMsg->setVisible(false); mUI->lblProgressIcon->setVisible(false); - mBtnMain->setObjectName("dialogBtn"); + mBtnMain->setObjectName("dialogBtnStop"); mBtnMain->setVisible(false); - mBtnMain->setText("OK"); - mBtnAppend->setObjectName("dialogBtn"); + mBtnMain->setText("Stop"); + mBtnAppend->setObjectName("dialogBtnOK"); mBtnAppend->setVisible(false); - mBtnAppend->setText("Stop"); + mBtnAppend->setText("OK"); auto btnContainer = new QWidget(this); auto hLayout = new QHBoxLayout(btnContainer); hLayout->setMargin(0); @@ -97,7 +97,6 @@ void GUIMessageDialog::startLoading() { LOG_USER_OPERATION(Stop); }); mTimerID = startTimer(100); - mBtnMain->setText("Stop"); mBtnMain->setVisible(true); } @@ -107,10 +106,11 @@ void GUIMessageDialog::showMessage(const QString& msg) { } void GUIMessageDialog::showExitButton() { - mBtnMain->setText("OK"); - mBtnMain->setVisible(true); - disconnect(mBtnMain, nullptr, nullptr, nullptr); - connect(mBtnMain, &QToolButton::clicked, [=](){ + mBtnMain->setVisible(false); + mBtnAppend->setVisible(true); + mBtnAppend->setText(tr("OK")); + disconnect(mBtnAppend, nullptr, nullptr, nullptr); + connect(mBtnAppend, &QToolButton::clicked, [=](){ if (mTimerID != -1){ killTimer(mTimerID); mTimerID = -1; @@ -126,8 +126,8 @@ void GUIMessageDialog::hideMessage() { } void GUIMessageDialog::hideExitButton() { - mBtnMain->setVisible(false); - disconnect(mBtnMain, nullptr, nullptr, nullptr); + mBtnAppend->setVisible(false); + disconnect(mBtnAppend, nullptr, nullptr, nullptr); } void GUIMessageDialog::setOpacity(double opacity) { @@ -141,6 +141,7 @@ void GUIMessageDialog::startPending() { stopPending(); }); mBtnAppend->setText("Next"); + mBtnAppend->setObjectName("dialogBtnOK"); mBtnAppend->setVisible(true); mPending = true; } diff --git a/src/forms/TopBarWidget.cpp b/src/forms/TopBarWidget.cpp index 5aad24e..6bde70d 100644 --- a/src/forms/TopBarWidget.cpp +++ b/src/forms/TopBarWidget.cpp @@ -15,8 +15,6 @@ TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, QHBoxLayout* layout = new QHBoxLayout(this); layout->setMargin(0); QLabel * logo = new QLabel(this); - QPixmap img(":/icons/logo.png"); - logo->setPixmap(img.scaledToHeight(33, Qt::SmoothTransformation)); logo->setObjectName("logo"); layout->addWidget(logo); QLabel * company = new QLabel(this); @@ -28,8 +26,7 @@ TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, spacerLine0->setObjectName("smallSpacer"); layout->addWidget(spacerLine0); QLabel * lbl_msglogo = new QLabel(this); - lbl_msglogo->setObjectName("lbl_msglogo"); - lbl_msglogo->setPixmap(QPixmap(":/icons/msg.png").scaledToHeight(26, Qt::SmoothTransformation)); + lbl_msglogo->setObjectName("msglogo"); layout->addWidget(lbl_msglogo); QWidget* widgetMsg = new QWidget(this); @@ -43,9 +40,9 @@ TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, QLabel* nowDate = new QLabel(this); nowDate->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); QLabel* linkIcon = new QLabel(this); - linkIcon->setPixmap(QPixmap(":/icons/link_g.png").scaledToHeight(22, Qt::SmoothTransformation)); + linkIcon->setObjectName("link"); QLabel* readyIcon = new QLabel(this); - readyIcon->setPixmap(QPixmap(":/icons/ready.png").scaledToHeight(22, Qt::SmoothTransformation)); + readyIcon->setObjectName("ready"); QLabel* lockIcon = new QLabel(this); lockIcon->setText(""); // lockIcon->setPixmap(QPixmap(":/icons/lock.png").scaledToHeight(22,Qt::SmoothTransformation)); diff --git a/src/forms/scan/ScanFormWidget.cpp b/src/forms/scan/ScanFormWidget.cpp index 6d99c62..8cbe4e8 100644 --- a/src/forms/scan/ScanFormWidget.cpp +++ b/src/forms/scan/ScanFormWidget.cpp @@ -93,7 +93,7 @@ void ScanFormWidget::initScanContent() { broadcastWidget->setLayout(viewerLayout); viewerLayout->addWidget(mViewer); contentLayout->addWidget(broadcastWidget); - paramWidget->setObjectName("param_widget"); + paramWidget->setObjectName("paramWidget"); auto paramLayout = new QVBoxLayout(paramWidget); mLblPreview->setText(tr("Preview Parameters")); mLblPreview->setObjectName("parameterTitle"); @@ -177,8 +177,7 @@ void ScanFormWidget::setPreviewing(bool val) { void ScanFormWidget::renderLoading() { setPreviewing(true); uchar c_data[PREVIEW_ROW][PREVIEW_COL]; - for (int i = 0; i < PREVIEW_ROW; i++) { - uchar* data_ptr = c_data[i]; + for (auto data_ptr : c_data) { memset(data_ptr, 0, PREVIEW_COL); } QImage img(c_data[0], PREVIEW_COL, PREVIEW_ROW, QImage::Format_Grayscale8); @@ -203,8 +202,7 @@ void ScanFormWidget::renderPreviewData(const QObject *data) { auto array = (QByteArray*)data; auto raw_dataptr = (uchar*)array->data(); uchar c_data[PREVIEW_ROW][PREVIEW_COL]; - for (int i = 0; i < PREVIEW_ROW; i++) { - uchar* data_ptr = c_data[i]; + for (auto data_ptr : c_data) { memcpy(data_ptr, raw_dataptr, PREVIEW_COL); raw_dataptr += PREVIEW_COL; } @@ -221,7 +219,7 @@ void ScanFormWidget::renderPreviewData(const QObject *data) { font.setBold(true); painter.setFont(font); painter.setPen(pen); - static int borderSpacing = round(((PIXEL_SPACING * (PREVIEW_ROW * 0.5f) - HALF_ROI_WIDTH) * (800.0f / (1.5f * 140.0f)))); + static int borderSpacing = (int)roundf(((PIXEL_SPACING * (PREVIEW_ROW * 0.5f) - HALF_ROI_WIDTH) * (800.0f / (1.5f * 140.0f)))); painter.drawLine(borderSpacing, borderSpacing, borderSpacing, 800 - borderSpacing); painter.drawLine(borderSpacing + 1, borderSpacing, 800 - borderSpacing, borderSpacing); painter.drawLine(borderSpacing + 1, 800 - borderSpacing, 800 - borderSpacing, 800 - borderSpacing); diff --git a/src/forms/select/PatientDetailForm.cpp b/src/forms/select/PatientDetailForm.cpp index 47a475f..7535810 100644 --- a/src/forms/select/PatientDetailForm.cpp +++ b/src/forms/select/PatientDetailForm.cpp @@ -15,9 +15,6 @@ PatientDetailForm::PatientDetailForm(QWidget* parent) : mUI->setupUi(this); mUI->hideBtn->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Preferred); mUI->hideBtn->setObjectName("hideeditBtn"); - mUI->hideBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - mUI->hideBtn->setIcon(QIcon(":/icons/hidearrow.png")); - mUI->hideBtn->setIconSize({30, 30}); mUI->hideBtn->setText(tr(" Hide Panel")); connect(mUI->hideBtn, &QToolButton::clicked, [=](){ emit hideBtnClicked(); diff --git a/src/forms/select/PatientDetailForm.ui b/src/forms/select/PatientDetailForm.ui index e6c5262..ed7be96 100644 --- a/src/forms/select/PatientDetailForm.ui +++ b/src/forms/select/PatientDetailForm.ui @@ -1,152 +1,176 @@ - PatientDetailForm - - - - 0 - 0 - 400 - 466 - - - - Form - - - - - - ... - - - - - - - ID - - - - - - - true - - - true - - - - - - - Name - - - + PatientDetailForm + + + + 0 + 0 + 400 + 466 + + + + Form + + + + 0 + - - - true - - - true - - + + + ... + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 9 + + + + + ID + + - - - Gender - - + + + true + + + true + + - - - true - - - true - - + + + Name + + - - - Date Of Birth - - + + + true + + + true + + - - - true - - - true - - - QAbstractSpinBox::NoButtons - - + + + Gender + + - - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + true + + + true + + - - - Comment - - + + + Date Of Birth + + - - - true - - - true - - + + + true + + + true + + + QAbstractSpinBox::NoButtons + + - + + + + 1 + + + 0 + + + 0 + + + 0 + + + 0 + + + - - - - - ULineEdit - QLineEdit -
components/ULineEdit.h
-
- - UTextEdit - QTextEdit -
components/UTextEdit.h
-
-
- - + + + + Comment + + + + + + + true + + + true + + + +
+
+ + + + +
+
+ + + ULineEdit + QLineEdit +
components/ULineEdit.h
+
+ + UTextEdit + QTextEdit +
components/UTextEdit.h
+
+
+ +
diff --git a/src/forms/select/SelectFormWidget.cpp b/src/forms/select/SelectFormWidget.cpp index c577654..4b9f85b 100644 --- a/src/forms/select/SelectFormWidget.cpp +++ b/src/forms/select/SelectFormWidget.cpp @@ -191,9 +191,6 @@ void SelectFormWidget::initDetailPanel(QHBoxLayout *contentLayout) {// prepare e contentLayout->addWidget(mEditPatForm); auto* btnShowEdit = new VerticalTextToolButton(this); btnShowEdit->setObjectName("showeditBtn"); - btnShowEdit->setIcon(QIcon(":/icons/edit.png")); - btnShowEdit->setIconSize(QSize(30, 30)); - btnShowEdit->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); btnShowEdit->setFixedHeight(225); btnShowEdit->setVerticalText("Patient Detail"); contentLayout->addWidget(btnShowEdit); diff --git a/src/forms/settings/SystemSettingForm.cpp b/src/forms/settings/SystemSettingForm.cpp index 0168197..2097b7e 100644 --- a/src/forms/settings/SystemSettingForm.cpp +++ b/src/forms/settings/SystemSettingForm.cpp @@ -33,10 +33,8 @@ SystemSettingForm::SystemSettingForm(QWidget* parent) mUI->lbl_used->setText(tr("Loading...")); //style init - mUI->btn_dicom->setIcon(QIcon(":/icons/dicomsettings.png")); - mUI->btn_dicom->setIconSize(QSize(80, 80)); - mUI->btn_network->setIcon(QIcon(":/icons/networksettings.png")); - mUI->btn_network->setIconSize(QSize(80, 80)); + mUI->btnDICOM->setObjectName("btnDICOM"); + mUI->btnNetwork->setObjectName("btnNetwork"); mUI->swt_verify->setChecked(true); mUI->lbl_verify->setFixedWidth(100); @@ -100,7 +98,7 @@ SystemSettingForm::SystemSettingForm(QWidget* parent) connect(scanCompleteButton, &ImageSwitch::clicked, [=]() { JsonObject::Instance()->setCompleteNotify(scanCompleteButton->getChecked()); }); - connect(mUI->btn_network, &QToolButton::clicked, [=]() { + connect(mUI->btnNetwork, &QToolButton::clicked, [=]() { GetAdminPsw dialog(this); if (dialog.exec() == QDialog::Accepted) { @@ -111,7 +109,7 @@ SystemSettingForm::SystemSettingForm(QWidget* parent) } }); - connect(mUI->btn_dicom, &QToolButton::clicked, [=]() { + connect(mUI->btnDICOM, &QToolButton::clicked, [=]() { DicomCfgDialog dia(this); dia.setWindowModality(Qt::WindowModal); dia.exec(); diff --git a/src/forms/settings/SystemSettingForm.ui b/src/forms/settings/SystemSettingForm.ui index e167ac7..0fe08de 100644 --- a/src/forms/settings/SystemSettingForm.ui +++ b/src/forms/settings/SystemSettingForm.ui @@ -164,7 +164,7 @@ - + IP @@ -248,7 +248,7 @@ - + DICOM diff --git a/src/stylesheet/Dark2.css b/src/stylesheet/Dark2.css index 7372131..2a4e059 100644 --- a/src/stylesheet/Dark2.css +++ b/src/stylesheet/Dark2.css @@ -1 +1 @@ - * { background-color: #3c3c3c; color: #fcfcfc; margin: 0; font-size: 16px; } /*------Widget------------------------------------*/ /* Global */ QWidget#verSpaceLine { border-right: 1px solid #0078d8; } QWidget#topBottomLine { border-top: 2px solid #0078d8; border-bottom: 2px solid #0078d8; background: transparent; } QWidget#innerWidget { background: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0.0 darkgray, stop: 0.5 lightgray, stop: 1.0 darkgray); border-radius: 20px; border: 5px solid #0078d8; } QWidget#smallSpacer { min-width: 2px; max-width: 2px; margin-top: 6px; margin-bottom: 6px; border-right: 1px solid #0078d8; } QWidget#borderWidget { border: 1px solid white }/* use in Topbar */ QWidget#slidePicker { border: 1px solid #505050; border-radius: 8px }/* use in SlidePickerBox */ /* use in GUIFormBaseDialog */ QWidget#formWidget { font-size: 30px; } /* use in MainWindow */ QWidget#topbarWidget { min-height: 36px; max-height: 36px; } /* use in TabFormWidget */ QWidget#contentWidget { border-top: 1px solid #505050; } /* use in SelectformWidget */ QWidget#patientDetailWidget { min-width: 300px; max-width: 300px; } /* use in AdminSetting */ QWidget#settingContentWidget { border-top: 1px solid #505050; border-bottom: 1px solid #323232; } /* use in ScanFormWidget */ QWidget#commandWidget { min-height: 123px; max-height: 123px; border-top: 1px solid #505050; border-bottom: 1px solid #323232; } QWidget#paramWidget { min-width: 300px; max-width: 300px; border-left: 1px solid #0078d8 } QWidget#broadcastWidget { border: 2px solid #515151; border-radius: 20px; background-color: black } QWidget#PatientInformationForm { min-width: 300px; max-width: 300px; margin-right: 10 } /* use in PatientInfomationForm */ QWidget#patientInfoPanel { border-right: 1px solid #0078d8 } /* use in AccountTableForm*/ QWidget#commandWidgetnoBBorder { min-height: 123px; max-height: 123px; border-top: 1px solid #505050; } /* use in TopBarWidget */ QWidget#statusBarWidget { min-width: 300px; } /* use in PatientDetailForm */ QWidget#editcmdWidget { min-height: 83px; max-height: 83px; } /*------Buttons----------------------------------*/ QPushButton { border: 1px solid #505050; padding-left: 50px; padding-right: 50px; border-radius: 5px; min-height: 28px; max-height: 28px; background: qlineargradient(spread:pad, x1: 0.50, y1: 0, x2: 0.5, y2: 1, stop: 0 #505050, stop: 1 #606060); } /* use in SystemSettingForm */ QPushButton#BigBtn { padding-left: 0px; padding-right: 0px; min-height: 60px; max-height: 60px; min-width: 140px; max-width: 140px; font-size: 20px; font-weight: bold; } /* use in GUIFormBaseDialog */ QPushButton#btnOK { background: #365880; font-weight: bold } QToolButton { border: none; border-radius: 10%; font-size: 26px; background: qlineargradient(spread:pad, x1: 0.5, y1: 0, x2: 0.5, y2: 1.0, stop: 0 #404040, stop: 0.5 #505050, stop: 1.0 #404040); font-weight: Bold; padding: 5px; } QToolButton:disabled { border: none; color: #606060; background: #3c3c3c } QToolButton:hover { background: #505050; } QToolButton:checked { border: 5px solid darkorange; padding: 0; } /* use to call slide picker*/ QToolButton#editvalBtn { min-height: 36px; max-height: 36px; border: none; border-bottom: 1px solid #505050; border-radius: 0; color: grey; } QToolButton#editvalBtn:enabled { background-color: #505050; border-bottom-color: #4a88c7; color: #fcfcfc; } /* panel hide and show button */ QToolButton#showeditBtn { border-top: 1px solid darkgray; border-bottom: 1px solid darkgray; border-left: 1px solid darkgray; border-radius: 0; border-bottom-left-radius: 10px; font-size: 20px; font-weight: normal; background: #505050; } QToolButton#hideeditBtn { border-top: 1px solid darkgray; border-bottom: 1px solid darkgray; border-left: 1px solid darkgray; border-radius: 0; border-top-left-radius: 10px; border-bottom-left-radius: 10px; font-size: 20px; font-weight: normal; background: #505050; } /* use in GUIMessageDialog */ QToolButton#dialogBtn { border: 2px solid #0078d8; border-radius: 10%; font-size: 26px; font-weight: Bold; padding: 5px; } /* protocol buttons*/ QToolButton#sexBtn { min-width: 120px; max-width: 120px; font-size: 20px; padding: 2px; } QToolButton#sexBtn:checked { border: 2px solid darkorange; padding: 0px; } QGroupBox { border: 0px } /*------------------Tab----------------*/ QTabBar::tab { height: 60px; width: 300px; font-size: 25px; background: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0 #505050, stop: 1.0 #333333); border: 2px solid #505050; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; min-width: 8ex; padding: 2px; } QTabBar::tab:selected, QTabBar::tab:hover { border-top: 5px solid #4a88c7; background: #505050; } QTabWidget::pane { margin: 0 } /*-------------------Label------------------*/ QLabel { color: #fcfcfc; font-weight: bold; font-size: 16px; } /* blue line spacer*/ QLabel#endline { border-bottom: 1px solid grey } /* use for side picker */ QLabel#sliderPickerLabel { color: grey; padding: 0; background: #505050; font-weight: normal; font-size: 50px; } QLabel#sliderSpliterLabel { color: white; padding-top: 35px; font-weight: normal; font-size: 50px; } /* use in TopBarWidget */ QLabel#logo { min-width: 30px; max-width: 30px } QLabel#company { min-width: 150px; max-width: 150px; } QLabel#systemMsgBar { min-width: 500px; } /* warn message label */ QLabel#warn { color: #930000; background: transparent; font-size: 20px; } /* dialog title*/ QLabel#title { font-size: 30px; } /* use in AboutWidget */ QLabel#normal { color: #fcfcfc; font-weight: normal; font-size: 16px; } /* use in ScanFormWidget */ QLabel#protocolPanelTitle { font-size: 32px; margin: 0; color: silver } QLabel#parameterTitle,#protocolTitle,#patientTitle{ font-size: 20px; margin: 0; border-bottom: 1px solid silver } QLabel#endSpaceLine { font-size: 20px; margin: 0; border-top: 1px solid #0078d8 } QLabel#placeholder { font-size: 20px; } QWidget#patientInfoPanel QLabel { font-size: 20px; } QWidget#broadcastWidget QLabel { background-color: black } /*------editors----------------------------------*/ QLineEdit { min-height: 36px; max-height: 36px; border: none; border-bottom: 1px solid #505050; color: grey; } QLineEdit:enabled { background-color: #505050; border-bottom-color: #4a88c7; color: #fcfcfc; } QLineEdit#displayLineEdit:disabled { background-color: #3c3c3c; border-bottom-color: #4a88c7; color: #fcfcfc; } QPlainTextEdit { border: 0px } QDateEdit { min-height: 36px; max-height: 36px; border: none; border-bottom: 1px solid #505050; color: grey; border-radius: 3px; } QDateEdit:disabled { background-color: #3c3c3c; border-bottom-color: #4a88c7; color: #fcfcfc; } QTextEdit { border: 1px solid #505050; color: grey; border-radius: 3px; } QTextEdit:enabled { background-color: #505050; border: 1px solid #4a88c7; color: #fcfcfc; } QComboBox { text-align: center; min-height: 36px; max-height: 36px; border: 1px solid #505050 } QComboBox:enabled { background-color: #505050 } /*----------------Table & List View---------------*/ QTableView { border: none; alternate-background-color: #595959; selection-color: #fcfcfc; selection-background-color: #0078d8 } QListView { border: none; margin: 5px; font-weight: bold } QListView::item { background: qlineargradient(spread:pad, x1: 0.5, y1: 0, x2: 0.5, y2: 1.0, stop: 0 #404040, stop: 0.5 #505050, stop: 1.0 #404040); min-height: 30px; border: 1px solid #505050; border-radius: 5px } QListView::item:selected { background: #365880; font-weight: bold; color: #fcfcfc; } QHeaderView::down-arrow { subcontrol-position: center right; image: url(":/icons/arrow-down.png"); padding-right: 8px; } QHeaderView::up-arrow { subcontrol-position: center right; image: url(":/icons/arrow-up.png"); padding-right: 8px; } QHeaderView::section { background-color: #595959; min-height: 50px; max-height: 50px; font-weight: Bold; font-size: 16px; border: 1px solid #323232; } QHeaderView::section:horizontal { border-bottom: 1px solid rgb(0, 170, 255); } QHeaderView::section:vertical { min-height: 36px; max-height: 36px; } /*------Dialog-------------------------------------*/ QDialog#formDialog { border: 3px solid grey; border-radius: 8px } QDialog#MessageDialog QWidget QWidget { background: transparent; color: #3078d8; } QDialog#MessageDialog QWidget QWidget QLabel { font-size: 30px } /* use in LoginWindow */ QFrame#loginFrame { min-width: 700px; max-width: 700px; max-height: 500px; min-height: 500px; border: 1px solid #0078d8; border-radius: 20px; background: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0.0 darkgray, stop: 0.5 gray, stop: 1.0 darkgray); } QDialog#loginForm { background-color: #3c3c3c; color: white; margin: 0; font-size: 16px; } QDialog#loginForm QLabel#title { font-Size: 98px; color: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0.0 darkgray, stop: 0.5 lightgray, stop: 1.0 darkgray); } QDialog#loginForm QLineEdit { min-height: 100px; max-height: 100px; border: 1px solid silver; border-radius: 10px; font-size: 26px; } QDialog#loginForm QLineEdit:enabled { background-color: #515151 } QDialog#loginForm QToolButton#btnlogin { min-height: 100px; max-height: 100px; min-width: 200px; border: 1px solid #505050; border-radius: 10%; font-size: 26px; font-weight: Bold; padding: 5px; } QDialog#loginForm QToolButton#btnlogin:hover { background: #505050; } \ No newline at end of file + * { background-color: #3c3c3c; color: #fcfcfc; margin: 0; font-size: 16px; } /*------Widget------------------------------------*/ /* Global */ QWidget#verSpaceLine { border-right: 1px solid #0078d8; } QWidget#topBottomLine { border-top: 2px solid #0078d8; border-bottom: 2px solid #0078d8; background: transparent; } QWidget#smallSpacer { min-width: 2px; max-width: 2px; margin-top: 6px; margin-bottom: 6px; border-right: 1px solid #0078d8; } /* use in Topbar */ QWidget#borderWidget { border: 1px solid white } /* use in SlidePickerBox */ QWidget#slidePicker { border: 1px solid #505050; border-radius: 8px } /* use in GUIFormBaseDialog */ QWidget#formWidget { font-size: 30px; } /* use in GUIMessageDialog */ QWidget#innerWidget { background: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0.0 darkgray, stop: 0.5 lightgray, stop: 1.0 darkgray); border-radius: 20px; border: 5px solid #0078d8; } /* use in MainWindow */ QWidget#topbarWidget { min-height: 36px; max-height: 36px; } /* use in TabFormWidget */ QWidget#contentWidget { border-top: 1px solid #505050; } /* use in SelectformWidget */ QWidget#patientDetailWidget { min-width: 300px; max-width: 300px; } /* use in AdminSetting */ QWidget#settingContentWidget { border-top: 1px solid #505050; border-bottom: 1px solid #323232; } /* use in ScanFormWidget */ QWidget#commandWidget { min-height: 123px; max-height: 123px; border-top: 1px solid #505050; border-bottom: 1px solid #323232; } QWidget#paramWidget { min-width: 300px; max-width: 300px; border-left: 1px solid #0078d8 } QWidget#broadcastWidget { border: 2px solid #515151; border-radius: 20px; background-color: black } QWidget#PatientInformationForm { min-width: 300px; max-width: 300px; margin-right: 10 } /* use in PatientInfomationForm */ QWidget#patientInfoPanel { border-right: 1px solid #0078d8 } /* use in AccountTableForm*/ QWidget#commandWidgetnoBBorder { min-height: 123px; max-height: 123px; border-top: 1px solid #505050; } /* use in TopBarWidget */ QWidget#statusBarWidget { min-width: 300px; } /* use in PatientDetailForm */ QWidget#editcmdWidget { min-height: 83px; max-height: 83px; } /*------Buttons----------------------------------*/ QPushButton { border: 1px solid #505050; padding-left: 50px; padding-right: 50px; border-radius: 5px; min-height: 28px; max-height: 28px; background: qlineargradient(spread:pad, x1: 0.50, y1: 0, x2: 0.5, y2: 1, stop: 0 #505050, stop: 1 #606060); } /* use in SystemSettingForm */ QPushButton#BigBtn { padding-left: 0px; padding-right: 0px; min-height: 60px; max-height: 60px; min-width: 140px; max-width: 140px; font-size: 20px; font-weight: bold; } /* use in GUIFormBaseDialog */ QPushButton#btnOK { background: #365880; font-weight: bold } QToolButton { border: none; border-radius: 10%; font-size: 26px; background: qlineargradient(spread:pad, x1: 0.5, y1: 0, x2: 0.5, y2: 1.0, stop: 0 #404040, stop: 0.5 #505050, stop: 1.0 #404040); font-weight: Bold; padding: 5px; } QToolButton:disabled { border: none; color: #606060; background: #3c3c3c } QToolButton:hover { background: #505050; } QToolButton:checked { border: 5px solid darkorange; padding: 0; } /* GUIFormBaseDialog button */ GUIFormBaseDialog QToolButton{ min-height: 36px; max-height: 36px; border: none; border-bottom: 1px solid #505050; border-radius: 0; color: grey; qproperty-toolButtonStyle:ToolButtonTextBesideIcon; qproperty-iconSize:30px 30px; } GUIFormBaseDialog QToolButton:enabled { background-color: #505050; border-bottom-color: #4a88c7; color: #fcfcfc; } QToolButton#changePwdBtn{ qproperty-icon:url(":/icons/edit.png"); } QToolButton#logoutBtn{ qproperty-icon:url(":/icons/logout.png"); } /* Patient detail panel hide and show button */ QToolButton#showeditBtn { border-top: 1px solid darkgray; border-bottom: 1px solid darkgray; border-left: 1px solid darkgray; border-radius: 0; border-bottom-left-radius: 10px; font-size: 20px; font-weight: normal; background: #505050; qproperty-toolButtonStyle:ToolButtonTextUnderIcon; qproperty-icon:url(":/icons/edit.png"); qproperty-iconSize:30px 30px; } QToolButton#hideeditBtn { border-top: 1px solid darkgray; border-bottom: 1px solid darkgray; border-left: 1px solid darkgray; border-radius: 0; border-top-left-radius: 10px; border-bottom-left-radius: 10px; font-size: 20px; font-weight: normal; background: #505050; qproperty-toolButtonStyle:ToolButtonTextBesideIcon; qproperty-icon:url(":/icons/hidearrow.png"); qproperty-iconSize:30px 30px; } /* AdminSettingForm button*/ QToolButton#btnDICOM{ qproperty-icon:url(":/icons/dicomsettings.png"); qproperty-iconSize:80px 80px; } QToolButton#btnNetwork{ qproperty-icon:url(":/icons/networksettings.png"); qproperty-iconSize:80px 80px; } /* GUIMessageDialog Button */ GUIMessageDialog QToolButton{ border: 2px solid #0078d8; border-radius: 10%; font-size: 26px; font-weight: Bold; padding: 5px; qproperty-toolButtonStyle:ToolButtonTextBesideIcon; qproperty-iconSize:30px 30px; } QToolButton#dialogBtnOK{ qproperty-icon:url(":/icons/selected_d.png"); } QToolButton#dialogBtnStop{ qproperty-icon:url(":/icons/close_circle_d.png"); } /* protocol buttons*/ QToolButton#sexBtn { min-width: 120px; max-width: 120px; font-size: 20px; padding: 2px; } QToolButton#sexBtn:checked { border: 2px solid darkorange; padding: 0px; } QGroupBox { border: 0px } /*------------------Tab----------------*/ QTabBar::tab { height: 60px; width: 300px; font-size: 25px; background: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0 #505050, stop: 1.0 #333333); border: 2px solid #505050; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; min-width: 8ex; padding: 2px; } QTabBar::tab:selected, QTabBar::tab:hover { border-top: 5px solid #4a88c7; background: #505050; } QTabWidget::pane { margin: 0 } /*-------------------Label------------------*/ QLabel { color: #fcfcfc; font-weight: bold; font-size: 16px; } /* blue line spacer horizon*/ QLabel#endline { border-bottom: 1px solid grey } /* use for side picker */ QLabel#sliderPickerLabel { color: grey; padding: 0; background: #505050; font-weight: normal; font-size: 50px; } QLabel#sliderSpliterLabel { color: white; padding-top: 35px; font-weight: normal; font-size: 50px; } /* use in TopBarWidget */ QLabel#logo { min-width: 30px; max-width: 30px; min-height: 30px; max-height: 30px; qproperty-pixmap:url(":/icons/logo.png"); qproperty-scaledContents:true; } QLabel#msglogo { min-width: 28px; max-width: 28px; min-height: 28px; max-height: 28px; qproperty-pixmap:url(":/icons/msg.png"); qproperty-scaledContents:true; } QLabel#link { min-width: 28px; max-width: 28px; min-height: 28px; max-height: 28px; qproperty-pixmap:url(":/icons/link_g.png"); qproperty-scaledContents:true; } QLabel#ready { min-width: 28px; max-width: 28px; min-height: 28px; max-height: 28px; qproperty-pixmap:url(":/icons/ready.png"); qproperty-scaledContents:true; } QLabel#company { min-width: 150px; max-width: 150px; } QLabel#systemMsgBar { min-width: 500px; } /* warn message label */ QLabel#warn { color: #930000; background: transparent; font-size: 20px; } /* dialog title*/ QLabel#title { font-size: 30px; } /* use in AboutWidget */ QLabel#normal { color: #fcfcfc; font-weight: normal; font-size: 16px; } /* use in ScanFormWidget */ QLabel#protocolPanelTitle { font-size: 32px; margin: 0; color: silver } QLabel#parameterTitle,#protocolTitle,#patientTitle{ font-size: 20px; margin: 0; border-bottom: 1px solid silver } QLabel#endSpaceLine { font-size: 20px; margin: 0; border-top: 1px solid #0078d8 } QLabel#placeholder { font-size: 20px; } QWidget#patientInfoPanel QLabel { font-size: 20px; } QWidget#broadcastWidget QLabel { background-color: black } /*------editors----------------------------------*/ QLineEdit { min-height: 36px; max-height: 36px; border: none; border-bottom: 1px solid #505050; color: grey; } QLineEdit:enabled { background-color: #505050; border-bottom-color: #4a88c7; color: #fcfcfc; } QLineEdit#displayLineEdit:disabled { background-color: #3c3c3c; border-bottom-color: #4a88c7; color: #fcfcfc; } QPlainTextEdit { border: 0px } QDateEdit { min-height: 36px; max-height: 36px; border: none; border-bottom: 1px solid #505050; color: grey; border-radius: 3px; } QDateEdit:disabled { background-color: #3c3c3c; border-bottom-color: #4a88c7; color: #fcfcfc; } QTextEdit { border: 1px solid #505050; color: grey; border-radius: 3px; } QTextEdit:enabled { background-color: #505050; border: 1px solid #4a88c7; color: #fcfcfc; } QComboBox { text-align: center; min-height: 36px; max-height: 36px; border: 1px solid #505050 } QComboBox:enabled { background-color: #505050 } /*----------------Table & List View---------------*/ QTableView { border: none; alternate-background-color: #595959; selection-color: #fcfcfc; selection-background-color: #0078d8 } QListView { border: none; margin: 5px; font-weight: bold } QListView::item { background: qlineargradient(spread:pad, x1: 0.5, y1: 0, x2: 0.5, y2: 1.0, stop: 0 #404040, stop: 0.5 #505050, stop: 1.0 #404040); min-height: 30px; border: 1px solid #505050; border-radius: 5px } QListView::item:selected { background: #365880; font-weight: bold; color: #fcfcfc; } QHeaderView::down-arrow { subcontrol-position: center right; image: url(":/icons/arrow-down.png"); padding-right: 8px; } QHeaderView::up-arrow { subcontrol-position: center right; image: url(":/icons/arrow-up.png"); padding-right: 8px; } QHeaderView::section { background-color: #595959; min-height: 50px; max-height: 50px; font-weight: Bold; font-size: 16px; border: 1px solid #323232; } QHeaderView::section:horizontal { border-bottom: 1px solid rgb(0, 170, 255); } QHeaderView::section:vertical { min-height: 36px; max-height: 36px; } /*------Dialog-------------------------------------*/ QDialog#formDialog { border: 3px solid grey; border-radius: 8px } QDialog#MessageDialog QWidget QWidget { background: transparent; color: #3078d8; } QDialog#MessageDialog QWidget QWidget QLabel { font-size: 30px } /* use in LoginWindow */ QFrame#loginFrame { min-width: 700px; max-width: 700px; max-height: 500px; min-height: 500px; border: 1px solid #0078d8; border-radius: 20px; background: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0.0 darkgray, stop: 0.5 gray, stop: 1.0 darkgray); } QDialog#loginForm { background-color: #3c3c3c; color: white; margin: 0; font-size: 16px; } QDialog#loginForm QLabel#title { font-Size: 98px; color: qlineargradient(x1:0, y1: 0, x2: 0, y2: 1, stop: 0.0 darkgray, stop: 0.5 lightgray, stop: 1.0 darkgray); } QDialog#loginForm QLineEdit { min-height: 100px; max-height: 100px; border: 1px solid silver; border-radius: 10px; font-size: 26px; } QDialog#loginForm QLineEdit:enabled { background-color: #515151 } QDialog#loginForm QToolButton#btnlogin { min-height: 100px; max-height: 100px; min-width: 200px; border: 1px solid #505050; border-radius: 10%; font-size: 26px; font-weight: Bold; padding: 5px; } QDialog#loginForm QToolButton#btnlogin:hover { background: #505050; } \ No newline at end of file diff --git a/src/windows/MainWindow.cpp b/src/windows/MainWindow.cpp index a7a8c97..eaaad44 100644 --- a/src/windows/MainWindow.cpp +++ b/src/windows/MainWindow.cpp @@ -171,26 +171,6 @@ MainWindow::MainWindow(QWidget* aParent) centerWidgetHide(); } -void MainWindow::resetRoleLayout() { - if (User::Current()->isAdmin()) - { - if (mAdminTabIndex == -1) - { - AdminSettingForm* form = new AdminSettingForm(this); - mAdminTabIndex = mTabWidget->addTab(form, tr("Settings")); - } - } - else - { - if (mAdminTabIndex != -1) - { - mTabWidget->removeTab(mAdminTabIndex); - mAdminTabIndex = -1; - } - } - qApp->processEvents(); -} - MainWindow::~MainWindow() { mThread->terminate(); @@ -214,7 +194,7 @@ void MainWindow::loadStyleSheet(const QString& aSheetName) void MainWindow::initializeLayout() { - QVBoxLayout* layout = new QVBoxLayout(mUI->mCentralWidget); + auto layout = new QVBoxLayout(mUI->mCentralWidget); layout->setMargin(0); layout->setSpacing(0); QWidget* topBarWidget = new TopBarWidget(this); @@ -228,11 +208,11 @@ void MainWindow::initializeTabWidget() mTabWidget->setTabPosition(QTabWidget::South); mTabWidget->setContentsMargins(0, 0, 0, 0); - SelectFormWidget* selectForm = new SelectFormWidget(this); + auto selectForm = new SelectFormWidget(this); mTabWidget->addTab(selectForm, tr("Select")); - ScanFormWidget* scanForm = new ScanFormWidget(this); + auto scanForm = new ScanFormWidget(this); mTabWidget->addTab(scanForm, tr("Scan")); - TabFormWidget* verifyForm = new TabFormWidget(this); + auto verifyForm = new TabFormWidget(this); mTabWidget->addTab(verifyForm, tr("Verify")); mTabWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } @@ -271,10 +251,9 @@ bool MainWindow::event(QEvent* aEvent) { return gestureEvent(static_cast(aEvent)); } - return QWidget::event(aEvent); + return QMainWindow::event(aEvent); } - void MainWindow::changeEvent(QEvent* aEvent) { if (aEvent->type() == QEvent::LanguageChange) @@ -285,6 +264,7 @@ void MainWindow::changeEvent(QEvent* aEvent) QWidget::changeEvent(aEvent); } + void MainWindow::keyPressEvent(QKeyEvent *event) { if (event->modifiers()==Qt::ControlModifier &&event->key()==Qt::Key_R){ QFile file("D:\\workdir\\GUI\\src\\stylesheet\\Dark2.css"); @@ -403,6 +383,26 @@ void MainWindow::requestLogin() centerWidgetShow(); } +void MainWindow::resetRoleLayout() { + if (User::Current()->isAdmin()) + { + if (mAdminTabIndex == -1) + { + AdminSettingForm* form = new AdminSettingForm(this); + mAdminTabIndex = mTabWidget->addTab(form, tr("Settings")); + } + } + else + { + if (mAdminTabIndex != -1) + { + mTabWidget->removeTab(mAdminTabIndex); + mAdminTabIndex = -1; + } + } + qApp->processEvents(); +} + //------log out about---------------------------------------------------------- QTextEdit* MainWindow::getEdit()