focus + enter-event
This commit is contained in:
@@ -219,6 +219,18 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>lineEdit_ipAddress</tabstop>
|
||||||
|
<tabstop>lineEdit_password</tabstop>
|
||||||
|
<tabstop>lineEdit_3</tabstop>
|
||||||
|
<tabstop>spinBox_port</tabstop>
|
||||||
|
<tabstop>checkBox_ipv6</tabstop>
|
||||||
|
<tabstop>treeWidget</tabstop>
|
||||||
|
<tabstop>pushButton_2</tabstop>
|
||||||
|
<tabstop>pushButton_5</tabstop>
|
||||||
|
<tabstop>pushButton_connect</tabstop>
|
||||||
|
<tabstop>pushButton_close</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
@@ -228,8 +240,8 @@
|
|||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel" >
|
||||||
<x>79</x>
|
<x>376</x>
|
||||||
<y>145</y>
|
<y>447</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel" >
|
||||||
<x>33</x>
|
<x>33</x>
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent)
|
|||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
lineEdit_ipAddress->setFocus();
|
||||||
|
|
||||||
|
|
||||||
|
// QShortcut *connectKey = new QShortcut(QKeySequence(Qt::Key_Enter), this);
|
||||||
|
// connect( connectKey, SIGNAL(activated() ), pushButton_connect, SLOT( click() ) );
|
||||||
|
|
||||||
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
|
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -35,3 +41,11 @@ void joinNetworkGameDialogImpl::startClient() {
|
|||||||
|
|
||||||
// TODO: Check input values!
|
// TODO: Check input values!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void joinNetworkGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||||
|
|
||||||
|
// std::cout << "key" << event->key();
|
||||||
|
|
||||||
|
if (event->key() == 16777220) { pushButton_connect->click(); } //ENTER
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void startClient();
|
void startClient();
|
||||||
|
void keyPressEvent ( QKeyEvent * event );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user