File: TulipTableWidgetColumnSelectionWidget.h

package info (click to toggle)
tulip 3.7.0dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 39,428 kB
  • sloc: cpp: 231,403; php: 11,023; python: 1,128; sh: 671; yacc: 522; makefile: 315; xml: 63; lex: 55
file content (63 lines) | stat: -rwxr-xr-x 1,746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef TULIPTABLEWIDGETCOLUMNSELECTIONWIDGET_H
#define TULIPTABLEWIDGETCOLUMNSELECTIONWIDGET_H

#include <QtGui/QWidget>
#include <QtCore/QRegExp>
namespace Ui {
class TableColumnSelectionWidget;
}

class TulipTableWidgetColumnSelectionModel;

/**
  * @brief Widget used to display and hide columns in a Tulip table widget.
  **/
class TulipTableWidgetColumnSelectionWidget : public QWidget {
  Q_OBJECT

public:
  explicit TulipTableWidgetColumnSelectionWidget(QWidget *parent = 0);
  ~TulipTableWidgetColumnSelectionWidget();
  /**
  * @brief Set the column selection model. Do not delete models it's up to the creator of the model to destruct it.
    *
    **/
  void setColumnSelectionModel(TulipTableWidgetColumnSelectionModel* model);

private slots:

  /**
    * @brief Check or uncheck all properties.
    **/
  void checkUncheckAllStateChanged(int state);
  /**
    * @brief The selection is updated so update the check state of the button
    **/
  void updateCheckUncheckAllButtonState();

  void showVisualProperties();
  void showDataProperties();

  void showCustomPatternProperties(const QString& pattern);

  void showContextMenu(const QPoint& position);

  void showSelectedColumns();
  void showOnlySelectedColumns();
  void hideSelectedColumns();
  void createNewColumn();
  void copyColumn();
  void deleteSelectedColumns();

private:
  Ui::TableColumnSelectionWidget *ui;
  TulipTableWidgetColumnSelectionModel *_tableColumnModel;

  /**
    * @brief Display all the columns with a name that match (or not) the given regexp.
    * @param match Tell if the columns must match or not the regexp to be shown.
    **/
  void selectColumns(const QRegExp& regExp,bool match);
};

#endif // TULIPTABLEWIDGETCOLUMNSELECTIONWIDGET_H