示例#1
0
void Dialog::onButtonBoxClicked(QAbstractButton* button)
{
    QDialogButtonBox::StandardButton butt = m_ui->buttonBox->standardButton(button);

    if (butt == QDialogButtonBox::Close) {
        QApplication::quit();
    } else if (butt == QDialogButtonBox::Reset) {
        m_ui->textEdit->clear();
    } else if (butt == QDialogButtonBox::Ok) {
        sendPacketToServer();
    }
}
示例#2
0
/**
 * @brief MapClient::sendMessageToServer sends a message to the server containing the action to
 * execute
 * @param msg message to be sent
 * @param code action associated to the message
 */
void MapClient::sendMessageToServer(const QString& msg, quint16 code) {
    Message message(msg);
    TargetCode target = TargetCode::MAP_SERVER;

    sendPacketToServer(code, (quint16) target, message);
}