Use Listbox instead of BigBtn.

This commit is contained in:
Krad
2022-07-14 16:56:20 +08:00
parent 4fd34dca1e
commit 87880f1ca0
6 changed files with 1006 additions and 350 deletions

View File

@@ -59,9 +59,6 @@ EditPatientDialog::EditPatientDialog(QWidget* parent, Qt::WindowFlags f) : GUIFo
btnSex = new ListBox(this);
btnSex->setText(tr("Female"));
btnSex->setProperty("idx", 0);
btnSex->setLayoutDirection(Qt::RightToLeft);
btnSex->setObjectName("editvalBtn");
btnSex->setIcon(QIcon(":/icons/arrow-down.png"));
btnSex->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(btnSex, &QToolButton::clicked, [=]() {
@@ -89,9 +86,6 @@ EditPatientDialog::EditPatientDialog(QWidget* parent, Qt::WindowFlags f) : GUIFo
layout->addWidget(lbl_date);
btnDate = new ListBox(this);
btnDate->setLayoutDirection(Qt::RightToLeft);
btnDate->setObjectName("editvalBtn");
btnDate->setIcon(QIcon(":/icons/arrow-down.png"));
btnDate->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
btnDate->setText("1990-06-15");
connect(btnDate, &QToolButton::clicked, [=]() {

View File

@@ -8,7 +8,8 @@
#include <QStylePainter>
ListBox::ListBox(QWidget *parent) : QToolButton(parent) {
this->setLayoutDirection(Qt::RightToLeft);
this->setObjectName("ListBox");
}
void ListBox::paintEvent(QPaintEvent *e) {

View File

@@ -14,6 +14,7 @@
#include "utilities/Locker.h"
#include "utilities/LanguageSwitcher.h"
#include "components/ULineEdit.h"
#include "components/ListBox.h"
GeneralForm::GeneralForm(QWidget* aParent)
: QWidget(aParent)
@@ -28,7 +29,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
QLabel* languageLabel = new QLabel(tr("Language"));
lanHeaderLayout->addWidget(languageLabel);
QPushButton* btnLan = new QPushButton(lanHeader);
QToolButton* btnLan = new ListBox(lanHeader);
lanHeaderLayout->addWidget(btnLan);
lanHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));

View File

@@ -13,6 +13,7 @@
#include "event/EventCenter.h"
#include "device/DeviceManager.h"
#include "json/cmdhelper.h"
#include "components/ListBox.h"
SystemSettingForm::SystemSettingForm(QWidget* parent)
: QWidget(parent)
@@ -40,9 +41,9 @@ SystemSettingForm::SystemSettingForm(QWidget* parent)
//data init
mUI->btnPro->setText(JsonObject::Instance()->defaultProtocal());
mUI->btnPro->setObjectName("BigBtn");
mUI->btnPro->setObjectName("ListBox");
mUI->btnFlt->setText(JsonObject::Instance()->defaultFilter());
mUI->btnFlt->setObjectName("BigBtn");
mUI->btnFlt->setObjectName("ListBox");
QGridLayout* gridLayout = (QGridLayout*)mUI->block10->layout();
auto scanConfirmButton = new ImageSwitch(this);

View File

@@ -33,25 +33,6 @@
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="btnPro">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
@@ -134,6 +115,25 @@
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="ListBox" name="btnPro">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -207,7 +207,7 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnFlt">
<widget class="ListBox" name="btnFlt">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -341,6 +341,12 @@
<header location="global">components/BatteryWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ListBox</class>
<extends>QToolButton</extends>
<header location="global">components/ListBox.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

File diff suppressed because one or more lines are too long