Hello! I am trying to add suggestions functionality to my QtCerator plugin: When user types search request in the locator there will be a displayed list of suggested search queries based on entered text. Similar as it is done in browsers or search engines. Suggestions are obtained from network as results of GET requests to remote server. For example: QNetworkRequest request; request.setUrl(QUrl::fromUserInput(" https://example.com/user_input?action=suggest")); auto reply = network_manager_.get(request); QObject::connect(reply, &QNetworkReply::readyRead, [&](){ qDebug() << "reply:" << reply->readAll(); });
So as I understand it I should make a network request inside matchesFor() function of my class derived from Core::ILocatorFilter. The first issue is: How and where do I obtain a result of a request to return it to the user? The second is: It seems that QNetworkAccessManager can't process QNetworkRequest created in another thread (QObject: Cannot create children for a parent that is in a different thread. (Parent is QNetworkAccessManager(0x163c4d0), parent's thread is QThread(0x6cc0d0), current thread is QThread(0x28b5810)) I didn't find similar cases in plugins provided with QtCreator so I hope someone can point me in the right direction. Mikhail.
_______________________________________________ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator