chatgui: detach file drop callbacks before composer child destruction
This commit is contained in:
1 parent
a175129f93
commit
348cd855b9
2 files changed
+12
No files matched your search
@@ -214,6 +214,17 @@ InputBar::InputBar(EmojiPanel *emojiPanel, AudioRecorder *recorder, QWidget *par
|
||||
});
|
||||
}
|
||||
|
||||
/* QWidget уничтожает дочерние viewport после полей InputBar: снимаем callbacks до их уничтожения. */
|
||||
InputBar::~InputBar() {
|
||||
GUI_DEBUG("InputBar: removing file drop targets count=%d", int(m_dropTargets.size()));
|
||||
for (auto* target : m_dropTargets) {
|
||||
target->removeEventFilter(this);
|
||||
disconnect(target, nullptr, this, nullptr);
|
||||
}
|
||||
m_dropTargets.clear();
|
||||
delete m_dropHint.data();
|
||||
}
|
||||
|
||||
/* Qt доставляет drop в viewport, а не в QTextEdit/QListView. Родитель composer принимает drop на кнопках. */
|
||||
void InputBar::installFileDropTarget(QWidget* target) {
|
||||
if (!target || m_dropTargets.contains(target)) return;
|
||||
|
||||
@@ -22,6 +22,7 @@ class InputBar : public QWidget {
|
||||
public:
|
||||
explicit InputBar(EmojiPanel *emojiPanel, AudioRecorder *recorder,
|
||||
QWidget *parent = nullptr);
|
||||
~InputBar() override;
|
||||
|
||||
void setRecordingContext(const QString& mediaDirBase, const QString& channelId);
|
||||
/* Один обработчик URL-drop для composer и viewport истории; отправка остаётся по кнопке/Enter. */
|
||||
|
||||
Reference in new issue
Block a user