mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Change globe position when mouse over dive site
When the mouse moves over the dive site list, the globe should show the current one under the mouse. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a5d2003e3a
commit
6633ab302d
3 changed files with 7 additions and 0 deletions
|
@ -380,9 +380,11 @@ DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent) : QLineEdit(parent),
|
||||||
view->installEventFilter(this);
|
view->installEventFilter(this);
|
||||||
view->setFocusPolicy(Qt::NoFocus);
|
view->setFocusPolicy(Qt::NoFocus);
|
||||||
view->setFocusProxy(this);
|
view->setFocusProxy(this);
|
||||||
|
view->setMouseTracking(true);
|
||||||
|
|
||||||
connect(this, &QLineEdit::textEdited, this, &DiveLocationLineEdit::setTemporaryDiveSiteName);
|
connect(this, &QLineEdit::textEdited, this, &DiveLocationLineEdit::setTemporaryDiveSiteName);
|
||||||
connect(view, &QAbstractItemView::activated, this, &DiveLocationLineEdit::itemActivated);
|
connect(view, &QAbstractItemView::activated, this, &DiveLocationLineEdit::itemActivated);
|
||||||
|
connect(view, &QAbstractItemView::entered, this, &DiveLocationLineEdit::entered);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
|
bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
|
||||||
|
|
|
@ -86,8 +86,10 @@ public:
|
||||||
DiveSiteType currDiveSiteType() const;
|
DiveSiteType currDiveSiteType() const;
|
||||||
uint32_t currDiveSiteUuid() const;
|
uint32_t currDiveSiteUuid() const;
|
||||||
void fixPopupPosition();
|
void fixPopupPosition();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void diveSiteSelected(uint32_t uuid);
|
void diveSiteSelected(uint32_t uuid);
|
||||||
|
void entered(const QModelIndex& index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent(QKeyEvent *ev);
|
void keyPressEvent(QKeyEvent *ev);
|
||||||
|
|
|
@ -56,6 +56,9 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
closeMessage();
|
closeMessage();
|
||||||
|
|
||||||
connect(ui.editDiveSiteButton, SIGNAL(clicked()), MainWindow::instance(), SIGNAL(startDiveSiteEdit()));
|
connect(ui.editDiveSiteButton, SIGNAL(clicked()), MainWindow::instance(), SIGNAL(startDiveSiteEdit()));
|
||||||
|
#ifndef NO_MARBLE
|
||||||
|
connect(ui.location, &DiveLocationLineEdit::entered, GlobeGPS::instance(), &GlobeGPS::centerOnIndex);
|
||||||
|
#endif
|
||||||
|
|
||||||
QAction *action = new QAction(tr("Apply changes"), this);
|
QAction *action = new QAction(tr("Apply changes"), this);
|
||||||
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
|
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue