mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Handle dive site activation
Connect the view activated signal to send us the index. Removing debug output that I forgot inside it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									534e07399a
								
							
						
					
					
						commit
						317c3de91d
					
				
					 2 changed files with 7 additions and 2 deletions
				
			
		|  | @ -432,13 +432,12 @@ DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent) | |||
| 	view->setFocusProxy(location_line_edit); | ||||
| 
 | ||||
| 	connect(this, &QLineEdit::textEdited, this, &DiveLocationLineEdit::setTemporaryDiveSiteName); | ||||
| 	connect(view, &QAbstractItemView::activated, this, &DiveLocationLineEdit::itemActivated); | ||||
| } | ||||
| 
 | ||||
| bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e) | ||||
| { | ||||
| 	if(e->type() == QEvent::KeyPress) { | ||||
| 		if (view->focusProxy() == this) qDebug() << "Ueh..."; | ||||
| 		else qDebug() << "Nao eh..."; | ||||
| 		QKeyEvent *keyEv = (QKeyEvent*) e; | ||||
| 
 | ||||
| 		qDebug() << view->focusProxy()->objectName(); | ||||
|  | @ -466,6 +465,11 @@ bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e) | |||
| 	return false; | ||||
| } | ||||
| 
 | ||||
| void DiveLocationLineEdit::itemActivated(const QModelIndex& index) | ||||
| { | ||||
| 	qDebug() << "Activated" << index.data(); | ||||
| } | ||||
| 
 | ||||
| void DiveLocationLineEdit::refreshDiveSiteCache() | ||||
| { | ||||
| 	model->resetModel(); | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ public: | |||
| 	void refreshDiveSiteCache(); | ||||
| 	void setTemporaryDiveSiteName(const QString& s); | ||||
| 	bool eventFilter(QObject*, QEvent*); | ||||
| 	void itemActivated(const QModelIndex& index); | ||||
| protected: | ||||
| 	void keyPressEvent(QKeyEvent *ev); | ||||
| 	void showPopup(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue