mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Circles: Fix crash when creating in category where it's not visible
This commit is contained in:
parent
7f7ab9a1bc
commit
484a9ea87e
|
@ -378,9 +378,9 @@ void FriendListWidget::addCircleWidget(FriendWidget* friendWidget)
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget::getInstance()->searchCircle(circleWidget);
|
Widget::getInstance()->searchCircle(circleWidget);
|
||||||
}
|
|
||||||
circleWidget->editName();
|
circleWidget->editName();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FriendListWidget::removeCircleWidget(CircleWidget* widget)
|
void FriendListWidget::removeCircleWidget(CircleWidget* widget)
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,8 +46,23 @@ CroppingLabel::CroppingLabel(QWidget* parent)
|
||||||
| Qt::ImhNoPredictiveText
|
| Qt::ImhNoPredictiveText
|
||||||
| Qt::ImhPreferLatin);
|
| Qt::ImhPreferLatin);
|
||||||
|
|
||||||
|
installEventFilter(this);
|
||||||
|
textEdit->installEventFilter(this);
|
||||||
|
|
||||||
connect(textEdit, &QLineEdit::editingFinished, this, &CroppingLabel::editingFinished);
|
connect(textEdit, &QLineEdit::editingFinished, this, &CroppingLabel::editingFinished);
|
||||||
}
|
}
|
||||||
|
#include <QDebug>
|
||||||
|
bool CroppingLabel::eventFilter(QObject *, QEvent *event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::FocusOut)
|
||||||
|
{
|
||||||
|
qDebug() << "Focus out changed!";
|
||||||
|
textEdit->clearFocus();
|
||||||
|
emit editingFinished();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void CroppingLabel::editBegin()
|
void CroppingLabel::editBegin()
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@ class CroppingLabel : public QLabel
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CroppingLabel(QWidget* parent = 0);
|
explicit CroppingLabel(QWidget* parent = 0);
|
||||||
|
bool eventFilter(QObject *, QEvent *) override;
|
||||||
|
|
||||||
void editBegin();
|
void editBegin();
|
||||||
void setEditable(bool editable);
|
void setEditable(bool editable);
|
||||||
|
@ -37,6 +38,7 @@ public:
|
||||||
void setText(const QString& text);
|
void setText(const QString& text);
|
||||||
QString fullText(); ///< Returns the un-cropped text
|
QString fullText(); ///< Returns the un-cropped text
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void minimizeMaximumWidth();
|
void minimizeMaximumWidth();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user