DataSourceWidget.h
42 lines
| 1.1 KiB
| text/x-c
|
CLexer
|
r82 | #ifndef SCIQLOP_DATASOURCEWIDGET_H | ||
#define SCIQLOP_DATASOURCEWIDGET_H | ||||
#include <QWidget> | ||||
|
r109 | namespace Ui { | ||
class DataSourceWidget; | ||||
r861 | } // namespace Ui | |||
|
r109 | |||
|
r82 | class DataSourceItem; | ||
/** | ||||
* @brief The DataSourceWidget handles the graphical representation (as a tree) of the data sources | ||||
* attached to SciQlop. | ||||
*/ | ||||
class DataSourceWidget : public QWidget { | ||||
Q_OBJECT | ||||
public: | ||||
explicit DataSourceWidget(QWidget *parent = 0); | ||||
r235 | virtual ~DataSourceWidget() noexcept; | |||
|
r82 | |||
|
r83 | public slots: | ||
/** | ||||
* Adds a data source. An item associated to the data source is created and then added to the | ||||
* representation tree | ||||
|
r92 | * @param dataSource the data source to add. The pointer has to be not null | ||
|
r83 | */ | ||
|
r92 | void addDataSource(DataSourceItem *dataSource) noexcept; | ||
|
r83 | |||
|
r82 | private: | ||
|
r109 | Ui::DataSourceWidget *ui; | ||
|
r143 | |||
private slots: | ||||
|
r475 | /// Slot called when the filtering text has changed | ||
void filterChanged(const QString &text) noexcept; | ||||
|
r143 | /// Slot called when right clicking on an item in the tree (displays a menu) | ||
void onTreeMenuRequested(const QPoint &pos) noexcept; | ||||
|
r82 | }; | ||
#endif // SCIQLOP_DATASOURCEWIDGET_H | ||||