I9Q251【需求28549】【X】【不重要】【主题制作工坊】窗口透明度滑动条数值输入<30的数字,没有自动变更为30

This commit is contained in:
like 2024-06-17 17:38:16 +08:00
parent fcd41a5011
commit fb90fd86aa
3 changed files with 28 additions and 12 deletions

View File

@ -731,3 +731,18 @@ void addPicWidget::dropEvent(QDropEvent *event)
}
}
}
ShowLineEdit1::ShowLineEdit1(QWidget *parent)
{
}
void ShowLineEdit1::focusOutEvent(QFocusEvent *event)
{
DataCollect::sendGlobalThemeKdkDataAsync(DataCollect::g_TransparencyWidget);
QString value = this->text();
if(value.toInt() < 30){
value = "30";
}
this->setText(value);
}

View File

@ -80,6 +80,16 @@ protected:
};
class ShowLineEdit1 : public ShowLineEdit {
public:
ShowLineEdit1(QWidget *parent = nullptr);
protected:
void focusOutEvent(QFocusEvent *event) override;
};
class EditButton : public QPushButton {
Q_OBJECT

View File

@ -531,7 +531,6 @@ void GlobalThemeWidget::initFilletWidget()
lineedit->setFixedSize(40,36);
lineedit->setValidator(new QIntValidator(0,18,this));
connect(lineedit,&QLineEdit::textChanged,[=](QString value){
DataCollect::sendGlobalThemeKdkDataAsync(DataCollect::g_FilletWidget);
int intValue = value.toInt();
if (intValue < 0) {
@ -545,6 +544,7 @@ void GlobalThemeWidget::initFilletWidget()
m_filletslider->setValue(intValue);
});
connect(lineedit,&ShowLineEdit::editingFinished,[=](){
DataCollect::sendGlobalThemeKdkDataAsync(DataCollect::g_FilletWidget);
QString value = lineedit->text();
if(value.toInt() == 0 && value.length() > 1){
value = "0";
@ -673,7 +673,7 @@ void GlobalThemeWidget::initTransparencyWidget()
m_transparencyslider->setTickInterval(1);
m_transparencyslider->setValue(65);
ShowLineEdit *lineedit = new ShowLineEdit(m_filletwidget);
ShowLineEdit1 *lineedit = new ShowLineEdit1(m_filletwidget);
lineedit->setFixedSize(46,36);
QLabel *showLabel = new QLabel(m_filletwidget);
@ -685,7 +685,7 @@ void GlobalThemeWidget::initTransparencyWidget()
lineedit->setText(QString::number(value));
lineedit->setValidator(new QIntValidator(30,100,this));
connect(lineedit,&QLineEdit::textChanged,[=](QString value){
DataCollect::sendGlobalThemeKdkDataAsync(DataCollect::g_TransparencyWidget);
int intValue = value.toInt();
if (intValue < 30) {
@ -698,15 +698,6 @@ void GlobalThemeWidget::initTransparencyWidget()
}
m_transparencyslider->setValue(intValue);
});
//connect不生效不知道原因
// connect(lineedit,&ShowLineEdit::editingFinished,[=](){
// QString value = lineedit->text();
// if(value.toInt() < 30){
// value = "30";
// }
// lineedit->setText(value);
// m_transparencyslider->setValue(value.toInt());
// });
// showLabel->setText(QString::number(m_transparencyslider->value())+"%");
showLabel->setText("%");