Re: [Interest] QML MenuBar : works with PySide2 but not c++ ?

2021-06-02 Thread Nicholas Yue
I copied the qml loading code from another working example, I was just testing a change in the QML content. I'd have to dig further about the lambda MenuBar.pro === QT += quick CONFIG += c++11 # The following define makes your compiler emit warnings if you use # any Qt feature that has

Re: [Interest] QML MenuBar : works with PySide2 but not c++ ?

2021-06-02 Thread Tony Rietwyk
Hi Nicholas, The short answer is because your C++ is doing completely different things to the python code.  :O) I'm not sure about using QML.  Have you included the qml file as a resource correctly to access via qrc:?  You aren't checking the result of the engine.load.  Also, why is the lamb

[Interest] QML MenuBar : works with PySide2 but not c++ ?

2021-06-02 Thread Nicholas Yue
Hi, I am learning about QML. I would like to find out why the PySide2 loading of the QML file results in a visible window but the C++ one does not. The compiled application runs but no window is displayed. MenuBar.qml === import QtQuick 2.4 import QtQuick.Controls 2.13 ApplicationWi

Re: [Interest] QNetworkReply lambdas?

2021-06-02 Thread Jason H
After playing with this for the day, here's what I got: // Application code     struct FileResource {         QString endpoint;         QString sql;         std::function func;     };     QList fileResources = {         {             "images",             "SELECT filename FROM images WHERE sync

Re: [Interest] QNetworkReply lambdas?

2021-06-02 Thread Jason H
  Yeah, we're both convergently evolving to the same thing. :-) I've used a similar approach to yours in the past with the success and fail handlers (just in JS though). I don't know that my current attempt will be superior.   If I were you... I would try with a variation of what I proposed (as

Re: [Interest] QNetworkReply lambdas?

2021-06-02 Thread Jérôme Godbout
Hi, might help, this won’t answer you question directly but might give some helper idea to ease the pain. What we did is a wrapper around QNetworkAccessManager class call RequestManager that own a QNetworkManager. It expose the following methods: QNetworkReply* postRequest(QNetworkRequest& requ

[Interest] QNetworkReply lambdas?

2021-06-02 Thread Jason H
I'm trying to figure out a more flexible way to do QNetworkReply. Ideally this would be through some async/await but I don't think Qt is "there" yet. (C++20 defines async/await, but there is not a library yet, and even Qt6 doesn't target C++20). So the callback lambda handler looks like the best

Re: [Interest] Can't JSON.stringify an object in QML

2021-06-02 Thread Jason H
> Sent: Tuesday, June 01, 2021 at 9:22 PM > From: "Tony Rietwyk" > To: interest@qt-project.org > Subject: Re: [Interest] Can't JSON.stringify an object in QML > > HI Jason, > > I'm pretty sure this is NOT valid JSON: > >{"that": "other": {} } > > Either the value and comma for "that" is miss

Re: [Interest] QML defining an object property

2021-06-02 Thread Alexander Dyagilev
Thanks. On 6/1/2021 10:52 AM, Pierre-Yves Siret wrote: Le lun. 31 mai 2021 à 19:59, Alexander Dyagilev > a écrit : Hello, Am I right that this is not possible in QML? readonlypropertyvarmainTbImg:{     up:"some string", up_check:"some another