wait for backend c++ in qml









up vote
0
down vote

favorite












I have a qml frontend and c++ backend.

User enters numbers in frontend and the program send it to the backend.

Then it resend the answer to qml and qml show it.



But I have a problem:

When I run the program the qml doesn't wait for backend value and when a person enter number, it shows undefined number, before backend read numbers.



How can I impel the qml item to wait until backend sends response (just qml items who showing the answer)



Update:



I have a connection block like this :



Connections 
target: receiver
onSendToQml:
properyExample = "c"






When i change a propery in block ( on send to qml ) program crashed .
How can fix it ? i receive my backend variable in it but i can't enter it
to a property .










share|improve this question



















  • 5




    Signals/Slots maybe
    – Redanium
    Nov 9 at 12:47






  • 1




    UI should be prepared for this scenario. For example you should show a loading icon or a spinner in QML until result is available.
    – Marek R
    Nov 9 at 12:54






  • 1




    You can create properties in the c++ backend and use it from qml frontend. There is a good documentation about this: doc.qt.io/qt-5/qtqml-cppintegration-topic.html
    – Peter
    Nov 9 at 13:02










  • i integrated the file . i have a function in backend but qml has all thread but i want out a part of qml from thread . can you write a example a qml file receive a number then send to c++ and then qml show the answer ? my problem is qml not wait to run backend and show answer before running the backend function . tnx
    – Ngelo.simon
    Nov 9 at 15:56










  • see the update , it's my main problem
    – Ngelo.simon
    Nov 9 at 17:08














up vote
0
down vote

favorite












I have a qml frontend and c++ backend.

User enters numbers in frontend and the program send it to the backend.

Then it resend the answer to qml and qml show it.



But I have a problem:

When I run the program the qml doesn't wait for backend value and when a person enter number, it shows undefined number, before backend read numbers.



How can I impel the qml item to wait until backend sends response (just qml items who showing the answer)



Update:



I have a connection block like this :



Connections 
target: receiver
onSendToQml:
properyExample = "c"






When i change a propery in block ( on send to qml ) program crashed .
How can fix it ? i receive my backend variable in it but i can't enter it
to a property .










share|improve this question



















  • 5




    Signals/Slots maybe
    – Redanium
    Nov 9 at 12:47






  • 1




    UI should be prepared for this scenario. For example you should show a loading icon or a spinner in QML until result is available.
    – Marek R
    Nov 9 at 12:54






  • 1




    You can create properties in the c++ backend and use it from qml frontend. There is a good documentation about this: doc.qt.io/qt-5/qtqml-cppintegration-topic.html
    – Peter
    Nov 9 at 13:02










  • i integrated the file . i have a function in backend but qml has all thread but i want out a part of qml from thread . can you write a example a qml file receive a number then send to c++ and then qml show the answer ? my problem is qml not wait to run backend and show answer before running the backend function . tnx
    – Ngelo.simon
    Nov 9 at 15:56










  • see the update , it's my main problem
    – Ngelo.simon
    Nov 9 at 17:08












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a qml frontend and c++ backend.

User enters numbers in frontend and the program send it to the backend.

Then it resend the answer to qml and qml show it.



But I have a problem:

When I run the program the qml doesn't wait for backend value and when a person enter number, it shows undefined number, before backend read numbers.



How can I impel the qml item to wait until backend sends response (just qml items who showing the answer)



Update:



I have a connection block like this :



Connections 
target: receiver
onSendToQml:
properyExample = "c"






When i change a propery in block ( on send to qml ) program crashed .
How can fix it ? i receive my backend variable in it but i can't enter it
to a property .










share|improve this question















I have a qml frontend and c++ backend.

User enters numbers in frontend and the program send it to the backend.

Then it resend the answer to qml and qml show it.



But I have a problem:

When I run the program the qml doesn't wait for backend value and when a person enter number, it shows undefined number, before backend read numbers.



How can I impel the qml item to wait until backend sends response (just qml items who showing the answer)



Update:



I have a connection block like this :



Connections 
target: receiver
onSendToQml:
properyExample = "c"






When i change a propery in block ( on send to qml ) program crashed .
How can fix it ? i receive my backend variable in it but i can't enter it
to a property .







c++ qt qml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 17:07

























asked Nov 9 at 12:45









Ngelo.simon

11




11







  • 5




    Signals/Slots maybe
    – Redanium
    Nov 9 at 12:47






  • 1




    UI should be prepared for this scenario. For example you should show a loading icon or a spinner in QML until result is available.
    – Marek R
    Nov 9 at 12:54






  • 1




    You can create properties in the c++ backend and use it from qml frontend. There is a good documentation about this: doc.qt.io/qt-5/qtqml-cppintegration-topic.html
    – Peter
    Nov 9 at 13:02










  • i integrated the file . i have a function in backend but qml has all thread but i want out a part of qml from thread . can you write a example a qml file receive a number then send to c++ and then qml show the answer ? my problem is qml not wait to run backend and show answer before running the backend function . tnx
    – Ngelo.simon
    Nov 9 at 15:56










  • see the update , it's my main problem
    – Ngelo.simon
    Nov 9 at 17:08












  • 5




    Signals/Slots maybe
    – Redanium
    Nov 9 at 12:47






  • 1




    UI should be prepared for this scenario. For example you should show a loading icon or a spinner in QML until result is available.
    – Marek R
    Nov 9 at 12:54






  • 1




    You can create properties in the c++ backend and use it from qml frontend. There is a good documentation about this: doc.qt.io/qt-5/qtqml-cppintegration-topic.html
    – Peter
    Nov 9 at 13:02










  • i integrated the file . i have a function in backend but qml has all thread but i want out a part of qml from thread . can you write a example a qml file receive a number then send to c++ and then qml show the answer ? my problem is qml not wait to run backend and show answer before running the backend function . tnx
    – Ngelo.simon
    Nov 9 at 15:56










  • see the update , it's my main problem
    – Ngelo.simon
    Nov 9 at 17:08







5




5




Signals/Slots maybe
– Redanium
Nov 9 at 12:47




Signals/Slots maybe
– Redanium
Nov 9 at 12:47




1




1




UI should be prepared for this scenario. For example you should show a loading icon or a spinner in QML until result is available.
– Marek R
Nov 9 at 12:54




UI should be prepared for this scenario. For example you should show a loading icon or a spinner in QML until result is available.
– Marek R
Nov 9 at 12:54




1




1




You can create properties in the c++ backend and use it from qml frontend. There is a good documentation about this: doc.qt.io/qt-5/qtqml-cppintegration-topic.html
– Peter
Nov 9 at 13:02




You can create properties in the c++ backend and use it from qml frontend. There is a good documentation about this: doc.qt.io/qt-5/qtqml-cppintegration-topic.html
– Peter
Nov 9 at 13:02












i integrated the file . i have a function in backend but qml has all thread but i want out a part of qml from thread . can you write a example a qml file receive a number then send to c++ and then qml show the answer ? my problem is qml not wait to run backend and show answer before running the backend function . tnx
– Ngelo.simon
Nov 9 at 15:56




i integrated the file . i have a function in backend but qml has all thread but i want out a part of qml from thread . can you write a example a qml file receive a number then send to c++ and then qml show the answer ? my problem is qml not wait to run backend and show answer before running the backend function . tnx
– Ngelo.simon
Nov 9 at 15:56












see the update , it's my main problem
– Ngelo.simon
Nov 9 at 17:08




see the update , it's my main problem
– Ngelo.simon
Nov 9 at 17:08

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225971%2fwait-for-backend-c-in-qml%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225971%2fwait-for-backend-c-in-qml%23new-answer', 'question_page');

);

Post as a guest














































































Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo