mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Implement the context menu a different way
It seems that this is the way this is supposed to be done - instead of manually looking at what kind of click we get, Qt decides when to create a context menu for us - this way things like the Windows Menu button will work automagically. As an example I also implemented the "remove dive from trip" functionality, which exposes some other bugs (like the fact that the dive that isn't part of a trip ends up being sorted at the very end of the dive list). This commit contains a "testSlot" implementation to remind me how to figure out which dive / trip we are on. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
235833b93e
commit
cd7488491f
2 changed files with 43 additions and 9 deletions
|
|
@ -28,21 +28,25 @@ public:
|
|||
bool eventFilter(QObject* , QEvent* );
|
||||
void unselectDives();
|
||||
void selectDive(struct dive *, bool scrollto = false);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
|
||||
public slots:
|
||||
void toggleColumnVisibilityByIndex();
|
||||
void reloadHeaderActions();
|
||||
void headerClicked(int);
|
||||
void showSearchEdit();
|
||||
void removeFromTrip();
|
||||
void testSlot();
|
||||
|
||||
Q_SIGNALS:
|
||||
void currentDiveChanged(int divenr);
|
||||
|
||||
private:
|
||||
bool mouseClickSelection;
|
||||
int currentHeaderClicked;
|
||||
DiveTripModel::Layout currentLayout;
|
||||
QLineEdit *searchBox;
|
||||
QModelIndex contextMenuIndex;
|
||||
};
|
||||
|
||||
#endif // DIVELISTVIEW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue