{
settings->setValue("ipcasa","192.168.1.8");
if (settings->contains("ipcasa"))
{
ip = settings->value("ipcasa").toString();
}else {
qDebug() << "insert your Ip";
emit statusChanged(" You must insert to Ip");
client = new ClientResearch(ip,6547);
connect(client, &ClientResearch::hasReadSome, this, &Backend::receivedSomething);
connect(client, &ClientResearch::statusChanged, this, &Backend::setStatus);
// FIXME change this connection to the new syntax
//connect data to source database
connect(client, &ClientResearch::sendRiparazione, this ,&Backend::recivedRiparazione);
}
Backend::Backend(QObject *parent) : QObject(parent)
{
settings = new QSettings("$HOME/.config/MySoft.ini",QSettings::IniFormat);
settings->setValue("ipcasa","192.168.1.8");
if (settings->contains("ipcasa"))
{
ip = settings->value("ipcasa").toString();
}else {
qDebug() << "insert your Ip";
emit statusChanged(" You must insert to Ip");
client = new ClientResearch(ip,6547);
connect(client, &ClientResearch::hasReadSome, this, &Backend::receivedSomething);
connect(client, &ClientResearch::statusChanged, this, &Backend::setStatus);
// FIXME change this connection to the new syntax
connect(client->tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(gotError(QAbstractSocket::SocketError)));
//connect data to source database
connect(client, &ClientResearch::sendRiparazione, this ,&Backend::recivedRiparazione);
}
To copy to clipboard, switch view to plain text mode
ApplicationWindow {
id: window
width: 500
height: 500
visible:true
Backend{
id: backend
onStatusChanged: {
messageDialog.text = newStatus
messageDialog.setVisible(true);
}
}
MessageDialog{
id: messageDialog
title: "Attention"
onAccepted: {
console.log("message for insert ip start.")
// Qt.quit()
}
// Component.onCompleted: visible = true
}
ApplicationWindow {
id: window
width: 500
height: 500
visible:true
Backend{
id: backend
onStatusChanged: {
messageDialog.text = newStatus
messageDialog.setVisible(true);
}
}
MessageDialog{
id: messageDialog
title: "Attention"
onAccepted: {
console.log("message for insert ip start.")
// Qt.quit()
}
// Component.onCompleted: visible = true
}
To copy to clipboard, switch view to plain text mode
Bookmarks