BPS C++ API  2.24.4
bpstreeview.h
Go to the documentation of this file.
1 
4 #ifndef BPSTREEVIEW_H
5 #define BPSTREEVIEW_H
6 
7 #include "bpsgui_global.h"
8 #include <QTreeView>
9 
10 class BpsTable;
11 
22 {
23  Q_OBJECT
25 
26 public:
27 
31  BpsTreeView(QWidget * aParent = nullptr);
32 
33  virtual ~BpsTreeView();
34 
38  virtual QSize sizeHint() const;
39 
44  void setSizeHint(const QSize& aSize);
45 
49  virtual QList<int> tabColumns() const;
50 
57  void setTabColumns(const QList<int>& aTabColumns);
58 
64  void setTabColumns(BpsTable* aTable);
65 
70 
75  void restoreHeaderState(const QVariant& aData);
76 
81  void setDragMoveEnabled(bool aEnable);
82 
87  void setDragCopyEnabled(bool aEnable);
88 
89 signals:
90 
95  void focusInOutEvent(bool aFocusIn);
96 
102  void contextMenuRequested(const QPoint& aPosition, const QModelIndex& aIndex);
103 
109  void currentItemChanged(const QModelIndex &aCurrent, const QModelIndex& aPrevious);
110 
118  void dataGotChanged(const QModelIndex& aTopLeft, const QModelIndex& aBottomRight);
119 
121 protected:
122  virtual void focusInEvent(QFocusEvent* aEvent);
123  virtual void focusOutEvent (QFocusEvent* aEvent);
124  virtual void contextMenuEvent(QContextMenuEvent* aEvent);
125  virtual void keyPressEvent(QKeyEvent* aEvent);
126  virtual void mousePressEvent(QMouseEvent* aEvent);
127  virtual QModelIndex moveCursor(CursorAction aCursorAction, Qt::KeyboardModifiers aModifiers);
128 
129 protected slots:
130  virtual void currentChanged(const QModelIndex& aCurrent, const QModelIndex& aPrevious);
131  virtual void dataChanged(const QModelIndex& aTopLeft, const QModelIndex& aBottomRight);
133 };
134 
135 #endif // BPSTABLEVIEW_H
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
Public include file for BPS GUI library macros.
#define BPSGUI_EXPORT
Declare class an import from the shared library.
Definition: bpsgui_global.h:22
Database table descriptor.
Definition: bpstable.h:19
This class adds some convenience to QTreeView:
Definition: bpstreeview.h:22
void dataGotChanged(const QModelIndex &aTopLeft, const QModelIndex &aBottomRight)
This signal is emitted when item data are changed in the model.
QVariant saveHeaderState()
void setTabColumns(BpsTable *aTable)
Define the list of tab columns when editing.
virtual QSize sizeHint() const
void setDragCopyEnabled(bool aEnable)
Enable drag/drop copying of items (Ctrl pressed).
void restoreHeaderState(const QVariant &aData)
Restores the header state from settings.
void currentItemChanged(const QModelIndex &aCurrent, const QModelIndex &aPrevious)
This signal is emitted when the current item changes.
void contextMenuRequested(const QPoint &aPosition, const QModelIndex &aIndex)
This signal is emitted when a context menu is requested on a item.
virtual QList< int > tabColumns() const
BpsTreeView(QWidget *aParent=nullptr)
void setTabColumns(const QList< int > &aTabColumns)
Define the list of tab columns when editing.
void setSizeHint(const QSize &aSize)
Define the size hint.
void focusInOutEvent(bool aFocusIn)
This signal is emitted when the widget gets or loses the focus.
void setDragMoveEnabled(bool aEnable)
Enable drag/drop moving of items.
virtual void focusInEvent(QFocusEvent *event) override
virtual void focusOutEvent(QFocusEvent *event) override
virtual void contextMenuEvent(QContextMenuEvent *e) override
typedef KeyboardModifiers
virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous) override
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles) override
virtual void keyPressEvent(QKeyEvent *event) override
virtual void mousePressEvent(QMouseEvent *event) override
virtual QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override