mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09:52 +08:00
attachment_list: fix input method issue of VButtonWithWidget's popup widget
This commit is contained in:
parent
1a62ca15e7
commit
81190cd803
@ -15,7 +15,7 @@ extern VConfigManager *g_config;
|
|||||||
extern VMainWindow *g_mainWin;
|
extern VMainWindow *g_mainWin;
|
||||||
|
|
||||||
VAttachmentList::VAttachmentList(QWidget *p_parent)
|
VAttachmentList::VAttachmentList(QWidget *p_parent)
|
||||||
: QWidget(p_parent), m_file(NULL)
|
: QWidget(p_parent), VButtonPopupWidget(this), m_file(NULL)
|
||||||
{
|
{
|
||||||
setupUI();
|
setupUI();
|
||||||
|
|
||||||
@ -617,3 +617,10 @@ void VAttachmentList::checkAttachments()
|
|||||||
updateContent();
|
updateContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VAttachmentList::showEvent(QShowEvent *p_event)
|
||||||
|
{
|
||||||
|
QWidget::showEvent(p_event);
|
||||||
|
|
||||||
|
processShowEvent(p_event);
|
||||||
|
}
|
||||||
|
@ -39,6 +39,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void keyPressEvent(QKeyEvent *p_event) Q_DECL_OVERRIDE;
|
void keyPressEvent(QKeyEvent *p_event) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
void showEvent(QShowEvent *p_event) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addAttachment();
|
void addAttachment();
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
class QDragEnterEvent;
|
class QDragEnterEvent;
|
||||||
class QDropEvent;
|
class QDropEvent;
|
||||||
class QPaintEvent;
|
class QPaintEvent;
|
||||||
|
class QShowEvent;
|
||||||
class VButtonWithWidget;
|
class VButtonWithWidget;
|
||||||
|
|
||||||
// Abstract class for the widget used by VButtonWithWidget.
|
// Abstract class for the widget used by VButtonWithWidget.
|
||||||
@ -16,7 +17,8 @@ class VButtonWithWidget;
|
|||||||
class VButtonPopupWidget
|
class VButtonPopupWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VButtonPopupWidget() : m_btn(NULL)
|
VButtonPopupWidget(QWidget *p_widget)
|
||||||
|
: m_widget(p_widget), m_btn(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +37,17 @@ public:
|
|||||||
return m_btn;
|
return m_btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// **MUST** be called in subclass at the end of showEvent().
|
||||||
|
void processShowEvent(QShowEvent *p_event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(p_event);
|
||||||
|
m_widget->activateWindow();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QWidget *m_widget;
|
||||||
|
|
||||||
VButtonWithWidget *m_btn;
|
VButtonWithWidget *m_btn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user