mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bugfix: implement focusChild() of VMdTab and VHtmlTab to fix focus issue
This commit is contained in:
parent
a8c76d6742
commit
a44259e66c
@ -71,7 +71,7 @@ protected:
|
|||||||
void wheelEvent(QWheelEvent *p_event) Q_DECL_OVERRIDE;
|
void wheelEvent(QWheelEvent *p_event) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
// Called when VEditTab get focus. Should focus the proper child widget.
|
// Called when VEditTab get focus. Should focus the proper child widget.
|
||||||
virtual void focusChild() {}
|
virtual void focusChild() = 0;
|
||||||
|
|
||||||
// Called to zoom in/out content.
|
// Called to zoom in/out content.
|
||||||
virtual void zoom(bool p_zoomIn, qreal p_step = 0.25) = 0;
|
virtual void zoom(bool p_zoomIn, qreal p_step = 0.25) = 0;
|
||||||
|
@ -244,3 +244,7 @@ void VHtmlTab::zoom(bool /* p_zoomIn */, qreal /* p_step */)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VHtmlTab::focusChild()
|
||||||
|
{
|
||||||
|
m_editor->setFocus();
|
||||||
|
}
|
||||||
|
@ -76,6 +76,9 @@ private:
|
|||||||
// Called to zoom in/out content.
|
// Called to zoom in/out content.
|
||||||
void zoom(bool p_zoomIn, qreal p_step = 0.25) Q_DECL_OVERRIDE;
|
void zoom(bool p_zoomIn, qreal p_step = 0.25) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
// Focus the proper child widget.
|
||||||
|
void focusChild() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
VEdit *m_editor;
|
VEdit *m_editor;
|
||||||
};
|
};
|
||||||
#endif // VHTMLTAB_H
|
#endif // VHTMLTAB_H
|
||||||
|
@ -704,3 +704,8 @@ MarkdownConverterType VMdTab::getMarkdownConverterType() const
|
|||||||
{
|
{
|
||||||
return m_mdConType;
|
return m_mdConType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VMdTab::focusChild()
|
||||||
|
{
|
||||||
|
m_stacks->currentWidget()->setFocus();
|
||||||
|
}
|
||||||
|
@ -120,6 +120,9 @@ private:
|
|||||||
// Zoom Web View.
|
// Zoom Web View.
|
||||||
void zoomWebPage(bool p_zoomIn, qreal p_step = 0.25);
|
void zoomWebPage(bool p_zoomIn, qreal p_step = 0.25);
|
||||||
|
|
||||||
|
// Focus the proper child widget.
|
||||||
|
void focusChild() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
VEdit *m_editor;
|
VEdit *m_editor;
|
||||||
VWebView *m_webViewer;
|
VWebView *m_webViewer;
|
||||||
VDocument *m_document;
|
VDocument *m_document;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user