Skip to content

Commit

Permalink
tab order improved
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPFrey committed May 13, 2022
1 parent 17c764d commit 14bc40c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/gui/ViewportControl.cc
Expand Up @@ -178,3 +178,22 @@ void ViewportControl::requestResize(){

resizeMutex.unlock();
}

bool ViewportControl::focusNextPrevChild(bool next){
QWidget::focusNextPrevChild(next);

bool bChildHasFocus=false;
for(auto child : QObject::findChildren<QWidget*>()){
if(child->hasFocus()){
bChildHasFocus=true;
}
}
if(! bChildHasFocus){
if(next){
spinBoxWidth->setFocus();
}else{
doubleSpinBox_fov->setFocus();
}
}
return true;
}
1 change: 1 addition & 0 deletions src/gui/ViewportControl.h
Expand Up @@ -34,6 +34,7 @@ private slots:

protected:
void resizeEvent(QResizeEvent *event) override;
bool focusNextPrevChild(bool next) override;

private:
MainWindow *mainWindow;
Expand Down
13 changes: 13 additions & 0 deletions src/gui/ViewportControl.ui
Expand Up @@ -186,6 +186,19 @@
</property>
</action>
</widget>
<tabstops>
<tabstop>spinBoxWidth</tabstop>
<tabstop>spinBoxHeight</tabstop>
<tabstop>checkBoxAspecRatioLock</tabstop>
<tabstop>doubleSpinBox_tx</tabstop>
<tabstop>doubleSpinBox_ty</tabstop>
<tabstop>doubleSpinBox_tz</tabstop>
<tabstop>doubleSpinBox_rx</tabstop>
<tabstop>doubleSpinBox_ry</tabstop>
<tabstop>doubleSpinBox_rz</tabstop>
<tabstop>doubleSpinBox_d</tabstop>
<tabstop>doubleSpinBox_fov</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

0 comments on commit 14bc40c

Please sign in to comment.