ControlLayout: Allow removing search bar's focus
This commit is contained in:
@@ -110,6 +110,9 @@ public:
|
||||
void setGeometry(const QRect &rect) override;
|
||||
QSize sizeHint() const override;
|
||||
QLayoutItem *takeAt(int index) override;
|
||||
//! remove focus from QLineEdit search bar
|
||||
//! this may be useful if the mouse is outside the layout
|
||||
void removeFocusFromSearchBar();
|
||||
|
||||
private slots:
|
||||
void onTextChanged(const QString&);
|
||||
|
||||
@@ -71,6 +71,8 @@ protected:
|
||||
|
||||
void removeControl(const QString &key);
|
||||
|
||||
void removeFocusFromSearchBar();
|
||||
|
||||
private:
|
||||
class LinkedModelGroup* m_model;
|
||||
|
||||
|
||||
@@ -177,6 +177,11 @@ QLayoutItem *ControlLayout::takeAt(int index)
|
||||
return (itr == m_itemMap.end()) ? nullptr : m_itemMap.take(itr.key());
|
||||
}
|
||||
|
||||
void ControlLayout::removeFocusFromSearchBar()
|
||||
{
|
||||
m_searchBar->clearFocus();
|
||||
}
|
||||
|
||||
Qt::Orientations ControlLayout::expandingDirections() const
|
||||
{
|
||||
return Qt::Orientations();
|
||||
|
||||
@@ -142,6 +142,14 @@ void LinkedModelGroupView::removeControl(const QString& key)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void LinkedModelGroupView::removeFocusFromSearchBar()
|
||||
{
|
||||
m_layout->removeFocusFromSearchBar();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
LinkedModelGroupsViewBase
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user