Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example: Qt (qmake) #753

Closed
jjpark78 opened this issue Jan 16, 2021 · 3 comments
Closed

Example: Qt (qmake) #753

jjpark78 opened this issue Jan 16, 2021 · 3 comments
Labels

Comments

@jjpark78
Copy link

Observed behavior

when using ccls load a project generated from qt-creator, ccls report error where is not

image

ccls report QObject::connect is no matching function for call. but other vscode or qt-creator don't report such thing.

Expected behavior

do not report error

Steps to reproduce

  1. using qt-creator generate some boilerplate project from template
  2. load that project with ccls configured vim or emacs
  3. at main.cpp QObject::connect function has a error from lsp

System information

  • ccls version: (installed with brew) stable 0.20201219 (bottled), HEAD
  • clang version: 11.0.0
  • OS: MacOS Big Sur 11.1
  • Editor: Doom Emacs
  • Language client (and version): LSP
@jjpark78 jjpark78 changed the title ccls and qt (QObject:connect) has some issue ccls and qt (QObject::connect) has some issue Jan 16, 2021
@MaskRay
Copy link
Owner

MaskRay commented Jan 16, 2021

You need to specify some -I. Please include the textual program.

// a.cc
#include <QGuiApplication>
#include <QQmlApplicationEngine>

int main(int argc, char *argv[]) {
  QGuiApplication app(argc, argv);
  QQmlApplicationEngine engine;
  const QUrl url(QStringLiteral("qrc:/main.qml"));

  QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app,
                   [url](QObject *obj, const QUrl &objUrl) {
                   }, Qt::QueuedConnection);
  engine.load(url);
  return app.exec();
}
# Debian: sudo apt install qtbase5-dev qtdeclarative5-dev

git init
qmake -project
qmake
# Append QT += qml

bear -- make
nvim a.cc  # :CocStart, works fine

@MaskRay MaskRay closed this as completed Jan 16, 2021
@MaskRay MaskRay changed the title ccls and qt (QObject::connect) has some issue Example: Qt (qmake) Jan 16, 2021
@jjpark78
Copy link
Author

yes. in linux no problem.

macos and ccls + clang looks like have some issue but i think it can be solved with some additional configuration which is i dont know.
(vscode on macos has no issue like this)

@MJAS1
Copy link

MJAS1 commented Aug 8, 2021

I have this same exact problem. Running the example above did not work in my Fedora 34 with ccls-0.20201219. After some digging, I found this related problem: #750. I tried building ccls from source and it fixed the problem. Probably related to ccls and clang version mismatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants