mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59: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;
|
||||
|
||||
VAttachmentList::VAttachmentList(QWidget *p_parent)
|
||||
: QWidget(p_parent), m_file(NULL)
|
||||
: QWidget(p_parent), VButtonPopupWidget(this), m_file(NULL)
|
||||
{
|
||||
setupUI();
|
||||
|
||||
@ -617,3 +617,10 @@ void VAttachmentList::checkAttachments()
|
||||
updateContent();
|
||||
}
|
||||
}
|
||||
|
||||
void VAttachmentList::showEvent(QShowEvent *p_event)
|
||||
{
|
||||
QWidget::showEvent(p_event);
|
||||
|
||||
processShowEvent(p_event);
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ public:
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *p_event) Q_DECL_OVERRIDE;
|
||||
|
||||
void showEvent(QShowEvent *p_event) Q_DECL_OVERRIDE;
|
||||
|
||||
private slots:
|
||||
void addAttachment();
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
class QDragEnterEvent;
|
||||
class QDropEvent;
|
||||
class QPaintEvent;
|
||||
class QShowEvent;
|
||||
class VButtonWithWidget;
|
||||
|
||||
// Abstract class for the widget used by VButtonWithWidget.
|
||||
@ -16,7 +17,8 @@ class VButtonWithWidget;
|
||||
class VButtonPopupWidget
|
||||
{
|
||||
public:
|
||||
VButtonPopupWidget() : m_btn(NULL)
|
||||
VButtonPopupWidget(QWidget *p_widget)
|
||||
: m_widget(p_widget), m_btn(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -35,7 +37,17 @@ public:
|
||||
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:
|
||||
QWidget *m_widget;
|
||||
|
||||
VButtonWithWidget *m_btn;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user