Merge branch '2309-0922pm' into 'yhkylin/v101'
pref(ui): 自定义托盘无线密码框色板,覆盖KPasswordEdit默认色板(bug#191685) See merge request kylinos-src/kylin-nm!273
This commit is contained in:
commit
c844a3b539
|
@ -254,6 +254,18 @@ void WlanListItem::keyPressEvent(QKeyEvent *event)
|
||||||
return QFrame::keyPressEvent(event);
|
return QFrame::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WlanListItem::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
QPalette pal = this->palette();
|
||||||
|
if (m_pwdLineEdit != nullptr) {
|
||||||
|
pal.setColor(QPalette::Base, pal.color(QPalette::Base));
|
||||||
|
pal.setColor(QPalette::Text, pal.color(QPalette::Text));
|
||||||
|
m_pwdLineEdit->setPalette(pal);
|
||||||
|
}
|
||||||
|
|
||||||
|
return QWidget::paintEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
void WlanListItem::initWlanUI()
|
void WlanListItem::initWlanUI()
|
||||||
{
|
{
|
||||||
m_hasPwd = (m_wirelessNetItem.m_secuType.isEmpty() || m_wirelessNetItem.m_secuType == "") ? false : true;
|
m_hasPwd = (m_wirelessNetItem.m_secuType.isEmpty() || m_wirelessNetItem.m_secuType == "") ? false : true;
|
||||||
|
@ -281,7 +293,6 @@ void WlanListItem::initWlanUI()
|
||||||
m_pwdLineEdit = new KPasswordEdit(m_pwdFrame);
|
m_pwdLineEdit = new KPasswordEdit(m_pwdFrame);
|
||||||
m_pwdLineEdit->setFixedWidth(LINEEDIT_WIDTH);
|
m_pwdLineEdit->setFixedWidth(LINEEDIT_WIDTH);
|
||||||
m_pwdLineEdit->setProperty("needTranslucent", true);
|
m_pwdLineEdit->setProperty("needTranslucent", true);
|
||||||
// m_pwdLineEdit->setUseCustomPalette(true);
|
|
||||||
m_pwdLineEdit->setClearButtonEnabled(false); //禁用ClearBtn按钮
|
m_pwdLineEdit->setClearButtonEnabled(false); //禁用ClearBtn按钮
|
||||||
m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, true); //打开输入法
|
m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, true); //打开输入法
|
||||||
// m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false);
|
// m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false);
|
||||||
|
|
|
@ -90,6 +90,7 @@ protected:
|
||||||
void leaveEvent(QEvent *event);
|
void leaveEvent(QEvent *event);
|
||||||
bool eventFilter(QObject *watched, QEvent *event);
|
bool eventFilter(QObject *watched, QEvent *event);
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
void paintEvent(QPaintEvent *event);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void itemHeightChanged(const bool isExpanded, const QString &ssid);
|
void itemHeightChanged(const bool isExpanded, const QString &ssid);
|
||||||
|
|
Loading…
Reference in New Issue