File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -44,23 +44,9 @@ OpenAiService::OpenAiService(QObject* parent) : QObject(parent) {
4444 // Forward declaration to avoid circular dependency
4545 class QOwnNotesMarkdownTextEdit ;
4646
47- // Get the active editor using QMetaObject since we can't include the header
48- QObject* activeEditorObj = nullptr ;
49- QMetaObject::invokeMethod (
50- nullptr ,
51- []() -> QObject* {
52- // Access the static method through the class name
53- // We need to get QOwnNotesMarkdownTextEdit::getActiveEditorForAutocomplete()
54- // but we can't call it directly due to circular includes
55- // So we'll use a different approach - store it in QApplication
56- return qApp->property (" activeAutocompleteEditor" ).value <QObject*>();
57- },
58- Qt::DirectConnection, Q_RETURN_ARG (QObject*, activeEditorObj));
59-
60- if (!activeEditorObj) {
61- // Try to get from application property
62- activeEditorObj = qApp->property (" activeAutocompleteEditor" ).value <QObject*>();
63- }
47+ // Get the active editor from the application property
48+ // We can't use QMetaObject::invokeMethod with lambdas in Qt5
49+ QObject* activeEditorObj = qApp->property (" activeAutocompleteEditor" ).value <QObject*>();
6450
6551 if (activeEditorObj) {
6652 qDebug () << " *** Calling onAiAutocompleteCompleted on active editor:"
You can’t perform that action at this time.
0 commit comments