Why I cant debug qml from qt creator? - qt

I installed the last Qt 5.12.2 . Then I open the cmake project via Qt Creator.
First I see a huge count on the intellisence issues: from "udeclared identifies of nullptr" to errors with each type "unknown type name".
The build proceeded successfully and I receive correct binary.
But any breakpoint marked as "Unclaimed breakpoint" and I cant debug any .qml (the .cpp could be debug)
So why it happens and how to debug the QML? (this future is still supported?)
UPDATE: The "QQmlDebuggingEnabler enabler;" and "doc.qt.io/qt-5/qtquick-debugging.html" doesnt helps :(
UPDATE2: #Amfasis -

I created a CMake-based Qt Quick project, and it shown that it supports QML/JS debugging. I checked the CMakeLists.txt, and found one relevant line:
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
So I think if you'd like to debug your CMake-based Qt Quick project, you should also add this line to your CMakeLists.txt.
And don't forget to check on enable QML in the project setting within the sector of debugging setting.

Related

How to permanently disable QML debugger in Qt?

Whenever I make a Qt project, the qmake command includes this parameter:
"CONFIG+=qml_debug"
I never use qml and dont want to manually click three times and ignore the warning every time I generate a new project.
It happened to me in a project. I just added this to the .pro file :
CONFIG -= qml_debug
It seems to work.
You can download Microsoft Visual Studio 2017 Community Edition, it's free to use. And it is not only a great IDE but also it has got Qt support. By downloading Qt plug in for Microsoft Visuals Studio you can create Qt projects and build and debug them...
Everything that you do with Qt Creator and it has got no such problem as yours.
Also if you want to stay with Qt creator, check Projects -> Build & Run -> Run Settings. There is Enable QML setting which mine is disabled. Maybe you can disable it from there.
If not I advice you to check Tools -> Options -> Build & Run and Tools -> Options -> Debuggers. If it can be solved within Qt Creator it must be solved from these places.

Qt error with reMarkable tablet app

I have a reMarkable tablet , which I mostly love except for the lack of linux support (surprising given it is a linux-based OS). However, I've managed to find a version of a linux application that is now unofficial. This github is actually a Qt docker app, but if you look in the code for the 'Dockerfile' you can find where to download the app, which is apparently still on the server even though there's not a link from the main web page. Anyway, I downloaded it and got it mostly working, figuring out a few dependencies based on same Dockerfile code. But, I can't seem to get file dialogs to work, which is the main reason for using the app.
The error I get is:
ERROR: No native FileDialog implementation available.
Qt Labs Platform requires Qt Widgets on this setup.
Add 'QT += widgets' to .pro and create QApplication in main().
I'm not a Qt developer, so I'm lost. I'd love to get this to work. Thanks.
In the .pro file of you project you should add this line QT += widgets
or just add widgets to the line with QT += ...
Qt can use native file dialogs on some platforms, and will fall back to its own implementation if none is available. But that requires that the application is built including the QtWidgets module, and using a QApplication.
If you don't have the source code of the app and a possiblity to rebuild it, there's no chance to fix this from a binary

qbs QML debugging doesn't work

After migration to QBS my QML debugging stopped working.
I made sure that:
I'm building a debug build, C++ debugging works
I've checked "Enable QML Debugging" in qt creator's Project tab
I've even tried to add qbs properties manually Qt.declarative.qmlDebugging:true Qt.quick.qmlDebugging:true
Still QtCreator says:
Some breakpoints cannot be handled by the debugger languages currently active, and will be ignored.
QML debugging works with an old .pro
My system:
Linux archlinux 4.15.7-1-ARCH
QBS 1.10.1
Qt 5.10.1
It's not so clear, but there are TWO checkboxes.
One at the build step, and another one in the run step.
So to get QML Debugging working you have to check both of them.
I missed the one under the "Projects->Run->Debugger settings->Enable QML"
The upcoming 4.6 release of Qt Creator should be smarter about this and auto-enable the checkbox in the run settings if the one in the build settings gets enabled.

Qt Creator won't open CMake C++ Project in OSX

I'm trying to work on an open-source project in Qt Creator on OSX. When I open the CMakeLists.txt like other CMake projects in Qt Creator it doesn't open the project. No folders, source files, not even the CMakeList.txt shows up in Qt Creator, just a completely blank project.
What could cause a project to do this?
Edit: the project opens properly in Ubuntu. It shows the CMakeLists.txt, source files, and everything. It even builds properly when I CMake in the command line on OSX. Qt Creator in OSX just does not open this project properly.
Eit 2: My build settings are completely empty too. There are no General Messages or messages of any kind.
Open your Preferences (Cmd+, on Mac) and go to the Build & Run and then CMake tab, do you see any CMake version listed there? For me, I have to add a manual entry because it doesn't automatically find my CMake. My manual entry is set to /Applications/CMake.app/Contents/bin/cmake so compare that with what you have in your settings.
Then restart Qt Creator and reopen your project. Go to Build & Run again and make sure the Kit you have selected for your project has a CMake Tool set (should be automatic if you have just the one CMake entry listed on the CMake tab).
Background Information
It looks like you are using Qt Creator 4.0. With that version, they changed a number of things related to how CMake projects are handled. When you first open a project, it won't create the build directory if it doesn't exist. Instead, it will run CMake in a temporary directory. This would be shown in the General Messages output pane if you had it open. Once you manually create the output directory as it appears in your project's Build Settings, Qt Creator will switch to running CMake in there instead. There's no indication this is happening apart from what is logged in the General Messages output pane, even if there's a problem with your CMakeLists.txt.
In your case, if there's genuinely nothing appearing in your General Messages output pane and CMake is working fine from the command line, that suggests something may be wrong with your Qt Creator settings.

How to import the QML-Book examples into QT Creator 3.4.0?

How can I import these code examples into QT Creator 3.4.0 ? I tried the available import options but they don't work.
I tried to create an empty QML project and add the rectangle.qml file to it. When I tried to run it, nothing showed up.
The book examples contain files .qmlproject - which seems to be a project descriptor. I wonder if it is somehow possible to import these .qmlproject files into QT Creator, click and run the examples.
I think this link might help in finding the solution : https://forum.qt.io/topic/27525/what-is-qmlproject-file/3 .
Usually I'd say that you should go to File > Open File or Project... and select the .qmlproject and you're done, but support for this type of project file was disabled by default. If you try to do this now (I believe the change is in Creator 3.4), you'll just get an error message about Creator not supporting the mime type of the file, or something. Unfortunately, this is not a very useful error message for a beginner, and it won't tell you how to fix the problem.
If you want to use .qmlproject files in newer versions of Creator, you have to navigate to Help > About Plugins... and enable the QmlProjectManager plugin (it's under the Qt Quick section) by checking the box.
So this is how you should normally open project files in Qt Creator. As for the window not showing up, that's also commonly encountered and can be fixed by making the root item in your scene a Window:
Unlike QQuickView, QQmlApplicationEngine does not automatically create a root window. If you are using visual items from Qt Quick, you will need to place them inside of a Window.
Qt Creator's new project wizard handles this for you when you create a new Qt Quick project, as you saw when you got the "Hello World" window to open in your video. It was when you loaded concepts/rectangle.qml which had a Rectangle as its root item, that it stopped showing up. That QML file was likely used in a project where a QQuickView was displaying it.

Resources