I9Q251【需求28549】【X】【不重要】【主题制作工坊】窗口透明度滑动条数值输入<30的数字,没有自动变更为30
This commit is contained in:
parent
fcd41a5011
commit
fb90fd86aa
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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("%");
|
||||
|
|
Loading…
Reference in New Issue