remove whitespaces in ipaddress field
This commit is contained in:
@@ -42,6 +42,8 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, ConfigFile
|
|||||||
treeWidget->setDisabled(TRUE);
|
treeWidget->setDisabled(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect( lineEdit_ipAddress, SIGNAL( editingFinished ()), this, SLOT( checkIp() ) );
|
||||||
|
|
||||||
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
|
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
|
||||||
connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( saveServerProfile() ) );
|
connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( saveServerProfile() ) );
|
||||||
connect( pushButton_delete, SIGNAL( clicked() ), this, SLOT( deleteServerProfile() ) );
|
connect( pushButton_delete, SIGNAL( clicked() ), this, SLOT( deleteServerProfile() ) );
|
||||||
@@ -278,3 +280,10 @@ void joinNetworkGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {
|
|||||||
// std::cout << "key" << event->key();
|
// std::cout << "key" << event->key();
|
||||||
if (event->key() == 16777220) { pushButton_connect->click(); } //ENTER
|
if (event->key() == 16777220) { pushButton_connect->click(); } //ENTER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void joinNetworkGameDialogImpl::checkIp() {
|
||||||
|
|
||||||
|
//remove whitespaces
|
||||||
|
QString tmp = lineEdit_ipAddress->text();
|
||||||
|
lineEdit_ipAddress->setText(tmp.remove(" "));
|
||||||
|
}
|
||||||
@@ -48,6 +48,7 @@ public slots:
|
|||||||
void saveServerProfile();
|
void saveServerProfile();
|
||||||
void deleteServerProfile();
|
void deleteServerProfile();
|
||||||
void keyPressEvent ( QKeyEvent * event );
|
void keyPressEvent ( QKeyEvent * event );
|
||||||
|
void checkIp();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user