Fix UserOperationLog crash problem.
This commit is contained in:
@@ -105,6 +105,11 @@ void SlidePickerBox::mouseReleaseEvent(QMouseEvent *ev) {
|
||||
}
|
||||
|
||||
void SlidePickerBox::adjustPosition() const {
|
||||
if(mSelectedLbl == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSelectedLbl->geometry().center().y() != LABEL_CENTER_Y)
|
||||
{
|
||||
//选择完毕,选中项回归正位
|
||||
@@ -140,7 +145,10 @@ void SlidePickerBox::setItems(const QStringList& itemsList) {
|
||||
lbl->move(p);
|
||||
}
|
||||
mSelectedIndex = mLabels.count() - 1;
|
||||
if(!mItems.isEmpty())
|
||||
{
|
||||
setSelectedValue(this->mItems.last());
|
||||
}
|
||||
}
|
||||
|
||||
QString SlidePickerBox::getSelectedValue() {
|
||||
@@ -198,8 +206,11 @@ void SlidePickerBox::setSelectedValue(const QString& val) {
|
||||
mLabels[i]->setStyleSheet("background:transparent");
|
||||
|
||||
}
|
||||
if(mSelectedIndex >= 0)
|
||||
{
|
||||
mSelectedLbl = mLabels[mSelectedIndex];
|
||||
mLabels[mSelectedIndex]->setStyleSheet("color:white");
|
||||
}
|
||||
adjustPosition();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user