overload with methods that don't use QString#64
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds std::string-based overloads to LogosAPIClient to make the client API easier to call from non-Qt code by converting std::string inputs to QString internally.
Changes:
- Added
invokeRemoteMethod(...)overloads that acceptstd::stringforobjectName/methodNameand forward to existingQStringoverloads. - Added an
onEvent(...)overload that acceptsstd::stringforeventNameand forwards to the existingQStringoverload.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+92
to
+103
| // std::string overloads — thin wrappers that convert internally | ||
| QVariant invokeRemoteMethod(const std::string& objectName, const std::string& methodName, | ||
| const QVariantList& args = QVariantList(), Timeout timeout = Timeout()) | ||
| { return invokeRemoteMethod(QString::fromStdString(objectName), QString::fromStdString(methodName), args, timeout); } | ||
|
|
||
| QVariant invokeRemoteMethod(const std::string& objectName, const std::string& methodName, | ||
| const QVariant& arg, Timeout timeout = Timeout()) | ||
| { return invokeRemoteMethod(QString::fromStdString(objectName), QString::fromStdString(methodName), arg, timeout); } | ||
|
|
||
| QVariant invokeRemoteMethod(const std::string& objectName, const std::string& methodName, | ||
| const QVariant& arg1, const QVariant& arg2, Timeout timeout = Timeout()) | ||
| { return invokeRemoteMethod(QString::fromStdString(objectName), QString::fromStdString(methodName), arg1, arg2, timeout); } |
Comment on lines
+105
to
+107
| void onEvent(LogosObject* originObject, const std::string& eventName, | ||
| std::function<void(const QString&, const QVariantList&)> callback) | ||
| { onEvent(originObject, QString::fromStdString(eventName), callback); } |
| QVariant invokeRemoteMethod(const std::string& objectName, const std::string& methodName, | ||
| const QVariant& arg1, const QVariant& arg2, Timeout timeout = Timeout()) | ||
| { return invokeRemoteMethod(QString::fromStdString(objectName), QString::fromStdString(methodName), arg1, arg2, timeout); } | ||
|
|
e0e524d to
1c5559f
Compare
overload with method that don't use QString overload with method that don't use QString overload with method that don't use QString overload with method that don't use QString
1c5559f to
45fae08
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.