1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-26 15:54:15 +01:00

LP-434 uavobjectbrowser: expand less when filtering

This commit is contained in:
Philippe Renon 2016-10-12 22:00:56 +02:00
parent 33188bd78e
commit e7eda529f8
2 changed files with 9 additions and 14 deletions

View File

@ -27,22 +27,19 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "uavobjectbrowserwidget.h"
#include "ui_uavobjectbrowser.h"
#include "ui_viewoptions.h"
#include "uavobjecttreemodel.h"
#include "browseritemdelegate.h"
#include "treeitem.h"
#include "ui_uavobjectbrowser.h"
#include "ui_viewoptions.h"
#include "uavobjectmanager.h"
#include <QStringList>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <QComboBox>
#include <QtCore/QDebug>
#include <QItemEditorFactory>
#include "extensionsystem/pluginmanager.h"
#include "utils/mustache.h"
#include <QDebug>
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent)
{
m_viewoptionsDialog = new QDialog(this);
@ -403,14 +400,14 @@ void UAVObjectBrowserWidget::updateDescription()
}
/**
* @brief UAVObjectBrowserWidget::searchTextChanged Looks for matching text in the UAVO fields
* @brief UAVObjectBrowserWidget::searchLineChanged Looks for matching text in the UAVO fields
*/
void UAVObjectBrowserWidget::searchLineChanged(QString searchText)
{
m_modelProxy->setFilterRegExp(QRegExp(searchText, Qt::CaseInsensitive, QRegExp::FixedString));
if (!searchText.isEmpty()) {
m_browser->treeView->expandAll();
int depth = m_viewoptions->cbCategorized->isChecked() ? 2 : 1;
m_browser->treeView->expandToDepth(depth);
} else {
m_browser->treeView->collapseAll();
}

View File

@ -35,8 +35,6 @@
#include "objectpersistence.h"
#include <QWidget>
#include <QTreeView>
#include <QKeyEvent>
#include <QSortFilterProxyModel>
class QPushButton;