Qt Creator shows nothing for my first 3D project!
-
Hi all,
On my Qt Creator 10 (Qt 6.5) and Windows 10 x64 I'm running this example as my first 3D project.
So created a new QtQuick project and wrote this:import QtQuick import QtQuick.Controls import QtQuick.Window import QtDataVisualization ApplicationWindow { width: 640 height: 480 visible: true title: qsTr("Hello World") Item { width: 640 height: 480 Bars3D { width: parent.width height: parent.height Bar3DSeries { itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" ItemModelBarDataProxy { itemModel: dataModel // Mapping model roles to bar series rows, columns, and values. rowRole: "year" columnRole: "city" valueRole: "expenses" } } } ListModel { id: dataModel ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; } ListElement{ year: "2012"; city: "Rauma"; expenses: "2100"; } ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; } ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; } ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; } ListElement{ year: "2013"; city: "Rauma"; expenses: "1990"; } ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; } ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; } } } }
The program shows nothing and the Application Output window, it writes: ... crashes, and in the Compile Output window, it writes ninja: no work to do.
And when I press F5 to start debugging to see the problem, I get this:What is the problem and how to solve it, please?
-
Hi all,
On my Qt Creator 10 (Qt 6.5) and Windows 10 x64 I'm running this example as my first 3D project.
So created a new QtQuick project and wrote this:import QtQuick import QtQuick.Controls import QtQuick.Window import QtDataVisualization ApplicationWindow { width: 640 height: 480 visible: true title: qsTr("Hello World") Item { width: 640 height: 480 Bars3D { width: parent.width height: parent.height Bar3DSeries { itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" ItemModelBarDataProxy { itemModel: dataModel // Mapping model roles to bar series rows, columns, and values. rowRole: "year" columnRole: "city" valueRole: "expenses" } } } ListModel { id: dataModel ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; } ListElement{ year: "2012"; city: "Rauma"; expenses: "2100"; } ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; } ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; } ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; } ListElement{ year: "2013"; city: "Rauma"; expenses: "1990"; } ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; } ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; } } } }
The program shows nothing and the Application Output window, it writes: ... crashes, and in the Compile Output window, it writes ninja: no work to do.
And when I press F5 to start debugging to see the problem, I get this:What is the problem and how to solve it, please?
@qcoderpro Maybe a stupid question, but do you have OpenGL drivers installed?
-
Hi all,
On my Qt Creator 10 (Qt 6.5) and Windows 10 x64 I'm running this example as my first 3D project.
So created a new QtQuick project and wrote this:import QtQuick import QtQuick.Controls import QtQuick.Window import QtDataVisualization ApplicationWindow { width: 640 height: 480 visible: true title: qsTr("Hello World") Item { width: 640 height: 480 Bars3D { width: parent.width height: parent.height Bar3DSeries { itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" ItemModelBarDataProxy { itemModel: dataModel // Mapping model roles to bar series rows, columns, and values. rowRole: "year" columnRole: "city" valueRole: "expenses" } } } ListModel { id: dataModel ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; } ListElement{ year: "2012"; city: "Rauma"; expenses: "2100"; } ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; } ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; } ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; } ListElement{ year: "2013"; city: "Rauma"; expenses: "1990"; } ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; } ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; } } } }
The program shows nothing and the Application Output window, it writes: ... crashes, and in the Compile Output window, it writes ninja: no work to do.
And when I press F5 to start debugging to see the problem, I get this:What is the problem and how to solve it, please?
@qcoderpro
I recently installed the driver 531.83_geforce_win11_win10_64bit_dch_international (with support to vulkan) for my video card:It has also written in the Manage 3D settings:
...
OpenGL GDI compatibility Auto
OpenGL rendering GPU Auto-select
...
Vulkan/OpenGL present method AutoI don't know if there's any other driver that I need to install. :|
By the way: Qt Creator IDE built-in examples, like Simple Bar Graph works fine!
Is it not very strange? :( -
@qcoderpro
I recently installed the driver 531.83_geforce_win11_win10_64bit_dch_international (with support to vulkan) for my video card:It has also written in the Manage 3D settings:
...
OpenGL GDI compatibility Auto
OpenGL rendering GPU Auto-select
...
Vulkan/OpenGL present method AutoI don't know if there's any other driver that I need to install. :|
By the way: Qt Creator IDE built-in examples, like Simple Bar Graph works fine!
Is it not very strange? :(It's strange indeed. No ideas then, sorry :-(
-
Can you please run that example on your Qt Creator (if you're using Windows) to see if it doesn't work for you either or works?
I'm on Linux but I tried it on a Windows 10 virtual machine (my GPU is nVidia but the VM has an emulated GPU), it compiles, runs and I can see the 3D bar chart. No crashes, no problems show up. I've tried it with Qt 6.4.3.
-
I'm on Linux but I tried it on a Windows 10 virtual machine (my GPU is nVidia but the VM has an emulated GPU), it compiles, runs and I can see the 3D bar chart. No crashes, no problems show up. I've tried it with Qt 6.4.3.
Thanks so much.
My Qt version seems to be the same yoursI will be very thankful if you zip that project and share it on some file sharing website (anyone you like) and I will download and scrutinize it, hopefully to know the reason why I get that problem.
Thanks in advance. -
Thanks so much.
My Qt version seems to be the same yoursI will be very thankful if you zip that project and share it on some file sharing website (anyone you like) and I will download and scrutinize it, hopefully to know the reason why I get that problem.
Thanks in advance.OK so that again points in the direction of OpenGL drivers... but the ones from nVidia are very stable, it would be very unusual for them to cause a crash.
-
OK so that again points in the direction of OpenGL drivers... but the ones from nVidia are very stable, it would be very unusual for them to cause a crash.
Do you also create a project for that example this way?
New Project > Qt Quick Application -> CMake -> Qt 6.4 -> next -> finish
and then without modifyingmain.cpp
orCMakeLists.txt
I paste the content of that example intomain.qml
file:import QtQuick import QtDataVisualization Item { width: 640 height: 480 Rectangle { x: 100; y: 100 width: 200; height: 200 color: "blue" } Bars3D { width: parent.width height: parent.height Bar3DSeries { itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" ItemModelBarDataProxy { itemModel: dataModel // Mapping model roles to bar series rows, columns, and values. rowRole: "year" columnRole: "city" valueRole: "expenses" } } } ListModel { id: dataModel ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; } ListElement{ year: "2012"; city: "Rauma"; expenses: "2100"; } ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; } ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; } ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; } ListElement{ year: "2013"; city: "Rauma"; expenses: "1990"; } ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; } ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; } } }
When I run this, Qt Creator shows nothing but in the Application Output I get the message: ninja: no work to do.
-
Do you also create a project for that example this way?
New Project > Qt Quick Application -> CMake -> Qt 6.4 -> next -> finish
and then without modifyingmain.cpp
orCMakeLists.txt
I paste the content of that example intomain.qml
file:import QtQuick import QtDataVisualization Item { width: 640 height: 480 Rectangle { x: 100; y: 100 width: 200; height: 200 color: "blue" } Bars3D { width: parent.width height: parent.height Bar3DSeries { itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" ItemModelBarDataProxy { itemModel: dataModel // Mapping model roles to bar series rows, columns, and values. rowRole: "year" columnRole: "city" valueRole: "expenses" } } } ListModel { id: dataModel ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; } ListElement{ year: "2012"; city: "Rauma"; expenses: "2100"; } ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; } ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; } ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; } ListElement{ year: "2013"; city: "Rauma"; expenses: "1990"; } ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; } ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; } } }
When I run this, Qt Creator shows nothing but in the Application Output I get the message: ninja: no work to do.
@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
Do you also create a project for that example this way?
New Project > Qt Quick Application -> CMake -> Qt 6.4 -> next -> finishNo. I open the example through Examples section in Qt Creator, then configure it and run.
Welcome -> Examples -> search for that example -> Configure -> Build & Run
-
@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
Do you also create a project for that example this way?
New Project > Qt Quick Application -> CMake -> Qt 6.4 -> next -> finishNo. I open the example through Examples section in Qt Creator, then configure it and run.
Welcome -> Examples -> search for that example -> Configure -> Build & Run
@sierdzio
That's a difference.
That example doesn't exists in the Examples section! If you point to thesimple bar graph
one, yes, it works well for me too. But I need to somehow run the simple example mentioned here for part of my other project.Let's focus on that simple example. How do run it in a project? Please write the steps and I also do the same and then we compare our outputs. I'm sure that way we can be sure if there's a problem with my graphic card or not.
-
@sierdzio
That's a difference.
That example doesn't exists in the Examples section! If you point to thesimple bar graph
one, yes, it works well for me too. But I need to somehow run the simple example mentioned here for part of my other project.Let's focus on that simple example. How do run it in a project? Please write the steps and I also do the same and then we compare our outputs. I'm sure that way we can be sure if there's a problem with my graphic card or not.
OK when I do it your way I get a crash, too.
-
... and the crash is gone when I add this line as first in
main()
:qputenv("QSG_RHI_BACKEND", "opengl");
-
... and the crash is gone when I add this line as first in
main()
:qputenv("QSG_RHI_BACKEND", "opengl");
-
@sierdzio
Even if I add that line inmain.cpp
the result is the same:ninja: no work to do
!
Did you test it using a new QtQuick project or yet something from Examples section?@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
@sierdzio
Even if I add that line inmain.cpp
the result is the same:ninja: no work to do
!
Did you test it using a new QtQuick project or yet something from Examples section?Yes, a new QtQuick project.
ninja: no work to do
Maybe you forgot to save
main.cpp
before building? -
@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
@sierdzio
Even if I add that line inmain.cpp
the result is the same:ninja: no work to do
!
Did you test it using a new QtQuick project or yet something from Examples section?Yes, a new QtQuick project.
ninja: no work to do
Maybe you forgot to save
main.cpp
before building? -
Yes, I save it (many times press ctrl+S), yet no success!
Here's my project in a QML_2.zp file: https://www.dropbox.com/s/m7nnftx9kwic0pf/QML_2.rar?dl=0@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
Yes, I save it (many times press ctrl+S), yet no success!
Here's my project in a QML_2.zp file: https://www.dropbox.com/s/m7nnftx9kwic0pf/QML_2.rar?dl=0BEFORE QGuiApplication!
int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); qputenv("QSG_RHI_BACKEND", "opengl"); // <= WRONG!
-
@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
Yes, I save it (many times press ctrl+S), yet no success!
Here's my project in a QML_2.zp file: https://www.dropbox.com/s/m7nnftx9kwic0pf/QML_2.rar?dl=0BEFORE QGuiApplication!
int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); qputenv("QSG_RHI_BACKEND", "opengl"); // <= WRONG!
Here's my
main.cpp
now:#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { qputenv("QSG_RHI_BACKEND", "opengl"); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(u"qrc:/QML_2/Main.qml"_qs); QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
Saved and ran it again. Yet nothing!
For Build -> clean (project QML_2), I get these:
Issues Window: warning: ninja: build stopped: subcommand failed.
Complie output window: Running steps for project QML_2...
Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build D:/Projects/QML/QML_2/build-QML_2-Desktop_Qt_6_5_0_MinGW_64_bit-Debug --target clean
Cleaning additional files...
Cleaning all built files...
FAILED: clean
C:\Qt\Tools\Ninja\ninja.exe -t clean
Cleaning... ninja: error: remove(appQML_2.exe): Permission denied 20 files.
ninja: build stopped: subcommand failed.
The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited with code 1.Shouldn't I use a
window
instead of anItem
inmain,qml
? -
Here's my
main.cpp
now:#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { qputenv("QSG_RHI_BACKEND", "opengl"); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(u"qrc:/QML_2/Main.qml"_qs); QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
Saved and ran it again. Yet nothing!
For Build -> clean (project QML_2), I get these:
Issues Window: warning: ninja: build stopped: subcommand failed.
Complie output window: Running steps for project QML_2...
Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build D:/Projects/QML/QML_2/build-QML_2-Desktop_Qt_6_5_0_MinGW_64_bit-Debug --target clean
Cleaning additional files...
Cleaning all built files...
FAILED: clean
C:\Qt\Tools\Ninja\ninja.exe -t clean
Cleaning... ninja: error: remove(appQML_2.exe): Permission denied 20 files.
ninja: build stopped: subcommand failed.
The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited with code 1.Shouldn't I use a
window
instead of anItem
inmain,qml
?@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
Cleaning... ninja: error: remove(appQML_2.exe): Permission denied 20 files.
You need to fix your permissions problem.
Shouldn't I use a
window
instead of anItem
inmain,qml
?Yes. Or put that whole Item inside a Window. Both should work fine.
-
@qcoderpro said in Qt Creator shows nothing for my first 3D project!:
Cleaning... ninja: error: remove(appQML_2.exe): Permission denied 20 files.
You need to fix your permissions problem.
Shouldn't I use a
window
instead of anItem
inmain,qml
?Yes. Or put that whole Item inside a Window. Both should work fine.
Yes, using a
Window
instead of thatItem
solved the issue.import QtQuick import QtQuick.Window import QtDataVisualization Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Item { width: 640 height: 480 Bars3D { // ...
I get this output:
And when I move the mouse holding the right-click button, it shows different views of that, like:
Do you get the output with the same quality?
(If possible send a screenshot of the output once you run the project, please. I just like to be sure about my graphics card performance for that project)