Skip to content

Qt Creator and other tools

Have a question about Qt Creator, our cross-platform IDE, or any of the other tools? Ask here!
7.6k Topics 35.5k Posts
  • new project has lots of semantic error

    Unsolved
    5
    0 Votes
    5 Posts
    688 Views
    C
    @JRaith The easiest solution you could go with, is to create a new widgets project, and just get the code you need from this project to replicate it. And if this is not your original code, you missed getting a ui file, most likely called mainwindow.ui.
  • QtCreator: How to start building multiple cmake sub-projects?

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    A
    @Asperamanca Solved. Screen resolution was too small for the details window, so it didn't allow me to open it, apparently.
  • Creator 10.0.0 giving seemingly false warning

    Solved
    3
    0 Votes
    3 Posts
    385 Views
    mzimmersM
    @cristian-adam thanks. FYI: there's a bug in 6.5.0 that (won't affect most people) which causes the multimedia module not to be included in a static Qt build. The workaround is to include the languages as I showed above. EDIT: Updated to 10.0.1; doesn't seem to be happening anymore.
  • Issues flagged in QtCreator

    Moved Unsolved
    6
    0 Votes
    6 Posts
    746 Views
    N
    @JonB Could not find anything that says "clang code completer", but I did find an item in the preferences->Text Editor->Display that says "Line Annotations", which was on. I turned that off. the long explanations for the 'errors' in the code text editor window went away, but the errors are still flagged with red circle on the left, and in the issues pane. Again, in spite of all, the code runs OK! And, on days that are prime numbers or when the phase of the moon is just right, these 'errors' are not flagged. Tongue in cheek there, I have no idea why this happens sometimes and not others.
  • How to change makefile ?

    Unsolved
    3
    0 Votes
    3 Posts
    352 Views
    A
    @JoeCFD Thanks. will do.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Designer configurations

    Unsolved
    2
    0 Votes
    2 Posts
    220 Views
    JonBJ
    @Perdrix The "Profile" configuration is for building your app for profiling --- instrumentation/timing analysis --- and this requires different compile or link options. Creator allows you to build & run for profiling. Under Linux this uses the perf tool. I have no idea what it might or might not do under Windows/MSVC.
  • Qt creator with copilot or tabnine

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    S
    Are there instructions to install the plugin for the QT 11 snapshot? For me I did the following. Installed the QT 11 build from download.qt.io https://download.qt.io/snapshots/qtcreator/11.0/11.0.0-beta1/ I used 1175 After install Help -> About plugins Scrolled down and checked both copilot and gitlab Clicked on copilot Clicked install plugin For source path found the .dll in qt's path C:\Qt\qtcreator-11.0.0-beta1\lib\qtcreator\plugins Clicked copilot.dll then open Clicked next Left User plugin selected Clicked next It wanted to install to an odd location for me without a folder so I had to create the 10.0.82 folder by hand at this location C:\Users\USERNAME\AppData\Local\QtProject\QtCreator\plugins It failed if I didn't create the folder. Then click Finished I did have to get the coplit.vim agent.js to be able to sign in after install.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • More parse madness

    Solved
    3
    0 Votes
    3 Posts
    363 Views
    P
    @Paul-Colby Sorry for being a bit slow. The file is /usr/include/bits/waitstatus.h (on CentOS 7.9). What are the values of __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIAN? A bit tricky. If I open waitstatus.h then that block declaring 'union wait' is greyed out due to an "#ifdef __USE_BSD" block. I can't say that I have much confidence that what I see in the GUI corresponds to what the code parser is doing. But here we go, This gets included from /usr/include/stdlib.h. #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H /* XPG requires a few symbols from <sys/wait.h> being defined. */ # include <bits/waitflags.h> # include <bits/waitstatus.h> features.h says that _GNU_SOURCE is defined. F2 can't find where that gets defined. bits/endian.h has #define __BYTE_ORDER __LITTLE_ENDIAN And endian.h has #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __PDP_ENDIAN 3412 /* This file defines `__BYTE_ORDER' for the particular machine. */ #include <bits/endian.h> I can't see anywhere that we are redefining these. Ah ha! I just found the problem. Since this is an "imported existing project" the Creator "files" and "includes" are simply whatever got found in the filesystem. In particular "includes" bears almost no resemblance to what the compiler sees in terms of "-I" arguments. We have a copy of boost in our repo, and "include/boost/predef/other" includes another "endian.h" I presume that the code parser was picking that one up rather than the one in /usr/include. Why boost couldn't have called the file "boost_endian.h" is beyond me. After commenting out the path in "includes" things are a little bit better. Now, why can't it find omp.h? Adding the include path to my GCC build in "includes" seems to have fixed that. Now I'm just getting failures due to our bad code. Stuff like C++ incompatibilities with C and overloads hiding base virual functions.
  • Designer Generated header invoking default ctor

    Unsolved
    6
    0 Votes
    6 Posts
    491 Views
    S
    @Perdrix said in Designer Generated header invoking default ctor: I think the assumption is that as QTabWidget::addTab will reparent the control it's OK to use a default ctor! Layouts will reparent its items to the layout's widget. This works at least if the layout is first created and assigned to a widget and then addWidget(...) is called. addWidget will reparent the widget. Not sure if this also works if you first add widgets to a layout and then assign the layout to a widget. If I write this kind of code by hand (instead of using the designer) I purposefully leave out the parent when I create widgets because it is not necessary (and more to type...).
  • What does the "Global include" check box do

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    S
    The C++ standard is more vague about the meaning of <> vs "". It just states that "" might search additional directories before falling back to the same directories as <>. It is implementation dependent what the differences between <> and "" are. Sure, there is a convention to use <> for the STL and maybe 3rd party libraries and "" for your own. But, I have never heard of the description "global header". Nevertheless, I don't know of any better single word to describe this. The only obvious difference between the two (according to the standard) is the different characters/tokens used.
  • Designer not listing slots in sub-classed controls

    Unsolved
    3
    0 Votes
    3 Posts
    256 Views
    Chris KawaC
    @Perdrix Promotion is for simple replacement of type when generating the C++ code. It does not expose your custom type to the editor i.e. signals, slots, properties etc. If you want a full support for custom type you have to create a designer plugin. Don't hack the .ui file manually. This may work now and silently break at any time in the future, as it's not a supported feature.
  • LUpdate not adding entry to .ts file

    Unsolved
    6
    0 Votes
    6 Posts
    609 Views
    Paul ColbyP
    @Perdrix said in LUpdate not adding entry to .ts file: and running lupdate the .ts file still has no entry for that translation :( Interesting. This looks like a pretty clear lupdate bug to me, where lupdate is failing on the cast of the n argument. For example, this doesn't work for me: auto strText = QCoreApplication::translate( "LiveEngine", "Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n", "IDS_LOG_REGISTERRESULTS", static_cast<int>(123) ///< This breaks lupdate? ) .arg(QString::fromWCharArray(nullptr)) .arg(0.01, 0, 'f', 2) .arg(0.02, 0, 'f', 2); And this does't work either: auto strText = QCoreApplication::translate( "LiveEngine", "Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n", "IDS_LOG_REGISTERRESULTS", (int)123 ///< This breaks lupdate also? ) .arg(QString::fromWCharArray(nullptr)) .arg(0.01, 0, 'f', 2) .arg(0.02, 0, 'f', 2); But this works fine (for lupdate ... I wouldn't execute the code itself ;) auto strText = QCoreApplication::translate( "LiveEngine", "Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n", "IDS_LOG_REGISTERRESULTS", 123 ) .arg(QString::fromWCharArray(nullptr)) .arg(0.01, 0, 'f', 2) .arg(0.02, 0, 'f', 2); And this works also: const int size = 123; auto strText = QCoreApplication::translate( "LiveEngine", "Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n", "IDS_LOG_REGISTERRESULTS", size ) .arg(QString::fromWCharArray(nullptr)) .arg(0.01, 0, 'f', 2) .arg(0.02, 0, 'f', 2); So I would suggest you convert your lfi.m_vStars.size() to int as a separate statement, and then report this as a bug over at https://bugreports.qt.io/ (or I can report it, if you don't get around to it) Cheers.
  • How can I add a QButtonGroup in Designer?

    Solved
    3
    0 Votes
    3 Posts
    850 Views
    PerdrixP
    @JonB Nice one - my google fu obviously failed me!
  • How to add a QScrollArea as a tab in a QTabWidget

    Unsolved
    4
    0 Votes
    4 Posts
    586 Views
    M
    @Perdrix said in How to add a QScrollArea as a tab in a QTabWidget: If I add a scroll area to the QWidget, I'm offered no way to set a layout on the QWidget It is possible but it is counter-intuitive :) add the scroll area to the tab widget right-clic on the tab widget and choose Lay out-> Lay out horizontal or vertical
  • win11 qt6.5 构建报错,之前有装其他版本的Qt,但卸载了

    Moved Unsolved
    5
    0 Votes
    5 Posts
    891 Views
    cristian-adamC
    If you try to run C:\Qt\Tools\mingw1120_64\bin\g++.exe --version from a Terminal do you get the following text: C:\Qt\Tools\mingw1120_64\bin $ g++ --version g++ (x86_64-posix-seh-rev3, Built by MinGW-W64 project) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • Qt Creator: How to pass ninja arguments?

    Solved
    3
    0 Votes
    3 Posts
    464 Views
    A
    @jsulm After a second try (clean project) it actually works by adding them in the "Tool arguments" text box
  • How to open PDF files per link in Qt5-Assistant-Help?

    Unsolved pdf qt assistant
    2
    1 Votes
    2 Posts
    712 Views
    S
    @SemP I have the exact same issue. Still looking for an answer. I tried using ‘file://‘ in my html href on PDFs, but it tries to open the PDF in a text editor. Older versions of Assistant had a PDF tab in preferences with a default PDF viewer configurable field, but not in this one… Still looking for a solution… I might start an http server and use http://localhost/pdffile.pdf because it will open http links in a web browser.
  • Info.plist for CMake examples contain QMAKE fields

    Unsolved
    2
    0 Votes
    2 Posts
    305 Views
    JKSHJ
    Hi, and welcome! @dankrol said in Info.plist for CMake examples contain QMAKE fields: In Qt 6 the included examples use CMAKE. However... the Info.plist file still has QMAKE fields, which prevents it from being installed on an iOS device. This is a bug in the example code. Would you be willing to open a bug report at https://bugreports.qt.io/ ? (Note: If you navigate to the example folder, you can still load the .pro file instead of the CMakeLists.txt file. This one should deploy correctly)