?
This commit is contained in:
@@ -11,6 +11,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
manager = new QNetworkAccessManager(this);
|
manager = new QNetworkAccessManager(this);
|
||||||
|
setFixedSize(size());
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@@ -40,16 +41,22 @@ QString MainWindow::sendCommand(QString cmd)
|
|||||||
|
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
request.setUrl("http://" + mAddress + ":80/YamahaRemoteControl/ctrl");
|
request.setUrl("http://" + mAddress + ":80/YamahaRemoteControl/ctrl");
|
||||||
|
request.setRawHeader("Content-Type", "text/xml; charset=UTF-8");
|
||||||
|
request.setRawHeader("Content-Length", QByteArray::number(cmd.size()));
|
||||||
|
|
||||||
|
QNetworkReply *reply = manager->post(request, cmd.toUtf8());
|
||||||
|
|
||||||
|
QEventLoop loop;
|
||||||
|
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||||
|
loop.exec();
|
||||||
|
|
||||||
QNetworkReply *reply = manager->get(request);
|
|
||||||
qDebug() << reply->readAll();
|
qDebug() << reply->readAll();
|
||||||
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void yremote::MainWindow::on_txt_address_textEdited(const QString &arg1)
|
void MainWindow::on_txt_address_textEdited(const QString &arg1)
|
||||||
{
|
{
|
||||||
mAddress = arg1;
|
mAddress = arg1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
<height>168</height>
|
<height>168</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::NoContextMenu</enum>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>yremote</string>
|
<string>yremote</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user