##// END OF EJS Templates
New data sources system switch complete...
New data sources system switch complete Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1495:9c439b3d7daf
r1495:9c439b3d7daf
Show More
DataSourceWidget.cpp
42 lines | 1.0 KiB | text/x-c | CppLexer
/ gui / src / DataSource / DataSourceWidget.cpp
Alexandre Leroux
Creates the data source widget...
r82 #include <DataSource/DataSourceWidget.h>
#include <ui_DataSourceWidget.h>
New data sources system switch complete...
r1495 #include <DataSource/datasources.h>
#include <SqpApplication.h>
Alexandre Leroux
Creates the data source widget...
r82
Alexandre Leroux
Handles right clicking on the tree of the data sources...
r143
PySide2 bindings + some GUI clean...
r1478 namespace
{
Alexandre Leroux
Creates the data source widget...
r82
/// Number of columns displayed in the tree
const auto TREE_NB_COLUMNS = 1;
/// Header labels for the tree
PySide2 bindings + some GUI clean...
r1478 const auto TREE_HEADER_LABELS = QStringList { QObject::tr("Name") };
Alexandre Leroux
Creates the data source widget...
r82
} // namespace
PySide2 bindings + some GUI clean...
r1478 DataSourceWidget::DataSourceWidget(QWidget* parent)
: QWidget { parent }
, ui { new Ui::DataSourceWidget }
Alexandre Leroux
Creates the data source widget...
r82 {
Alexandre Leroux
(Minor) Extracts ui of DataSourceWidget
r109 ui->setupUi(this);
New data sources system switch complete...
r1495 m_model_proxy.setSourceModel(&(sqpApp->dataSources()));
ui->treeView->setModel(&m_model_proxy);
ui->treeView->setDragEnabled(true);
m_model_proxy.setFilterRole(Qt::ToolTipRole);
m_model_proxy.setRecursiveFilteringEnabled(true);
Alexandre Leroux
Adds line edit as a search box above data source tree
r475
// Connection to filter tree
New data sources system switch complete...
r1495 connect(ui->filterLineEdit, &QLineEdit::textChanged, &m_model_proxy, static_cast<void (QSortFilterProxyModel::*)(const QString&)>(
&QSortFilterProxyModel::setFilterRegExp));
Alexandre Leroux
Updates data sources UI representation (1)...
r1034
Alexandre Leroux
Creates the data source widget...
r82 }
Alexandre Leroux
Implements method to add a data source in the widget...
r83
add missing delete ui
r232 DataSourceWidget::~DataSourceWidget() noexcept
{
delete ui;
}