Skip to content

Qt 6

This is where all Qt 6 related questions belong

827 Topics 4.0k Posts

QtWS: Super Early Bird Tickets Available!

  • OBJECTIVE_SOURCES for cmake/Qt6

    Solved
    2
    0 Votes
    2 Posts
    277 Views
    Christian EhrlicherC

    You just need cmake 3.16 or higher: https://cmake.org/cmake/help/latest/release/3.16.html#languages

  • "enable_if_t" has no member "type"

    Solved
    4
    0 Votes
    4 Posts
    719 Views
    T

    Thank you guys. Problem solved. Added the flag as Chris suggested. It turns out I was also using icpc as my default compiler and that was also giving my trouble.

  • qt project doesnt start

    Unsolved
    2
    0 Votes
    2 Posts
    291 Views
    sierdzioS

    Add Qt libs to LD_LIBRARY_PATH, or install Qt system-wide (distro packages).

  • Announce : AdaStudio-2021 release 07/05/2021 free edition

    Locked Unsolved
    2
    0 Votes
    2 Posts
    199 Views
    J.HilkJ

    Locked, duplicate of
    https://forum.qt.io/topic/126424/announce-adastudio-2021-release-07-05-2021-free-edition

  • Setting up the application information in CMake

    Solved
    4
    1 Votes
    4 Posts
    2k Views
    A

    I think I found the way to do this. We need win.rc on windows and Info.plist on mac, these files tell their OS's what to name the application.

    Windows

    For example, this is what I have (win.rc):

    IDI_ICON1 ICON DISCARDABLE "resources/images/datalogger.ico" 1 VERSIONINFO FILEVERSION 0,0,0,0 PRODUCTVERSION 0,0,0,0 { BLOCK "StringFileInfo" { BLOCK "000004B0" { VALUE "CompanyName", "DataLogger\0" VALUE "FileDescription", "DataLogger\0" VALUE "FileVersion", "git\0" VALUE "OriginalFilename", "datalogger.exe\0" VALUE "ProductName", "DataLogger\0" VALUE "ProductVersion", "git\0" } } BLOCK "VarFileInfo" { VALUE "Translation", 0x0000, 0x04B0 } }

    then I added this filename to CMakeLists.txt before find_package(...) as:

    if (WIN32) set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/win.rc") endif ()

    Finally add this:

    then add

    set(PROJECT_SOURCES main.cpp resources.qrc + ${APP_ICON_RESOURCE_WINDOWS} mainwindow.cpp mainwindow.h mainwindow.ui ) macOS

    I have a file called Info.plist in the root

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeIconFile</key> <string>datalogger.icns</string> <key>CFBundleTypeName</key> <string>DataLogger</string> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>LSIsAppleDefaultForType</key> <true/> </dict> </array> <key>CFBundleIconFile</key> <string>datalogger.icns</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>NSPrincipalClass</key> <string>NSApplication</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleExecutable</key> <string>datalogger</string> <key>NSHumanReadableCopyright</key> <string>Copyright (c) 2021, Akshay Raj Gollahalli</string> <key>CFBundleIdentifier</key> <string>datalogger</string> <key>CFBundleName</key> <string>DataLogger</string> <key>CFBundleShortVersionString</key> <string>3.1.2</string> <key>AppleMagnifiedMode</key> <false/> </dict> </plist>

    In your CMakeList.txt before find_package(...), add:

    if (APPLE) set(MACOSX_BUNDLE_ICON_FILE datalogger.icns) # And the following tells CMake where to find and install the file itself. set(app_icon_macos "resources/images/datalogger.icns") set_source_files_properties(${app_icon_macos} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") endif ()

    then add

    set(PROJECT_SOURCES + MACOSX_BUNDLE main.cpp resources.qrc + ${app_icon_macos} mainwindow.cpp mainwindow.h mainwindow.ui )
  • iOS Build Error QT6 with Qt6_FOUND to FALSE

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    P

    QTBUG-93384 created to track the problem,

    solutions are:

    QT Creator 4.15 release use the 4.15 rc https://www.qt.io/blog/qt-creator-4.15-rc1-released Manually specify the proper configuration options to the prohect, either in the kit cmake settings, or in the project cmake settings (or configure from command line)
    The required configure options are
    -DCMAKE_TOOLCHAIN_FILE:PATH=/Volumes/T3/Dev/qt/official_qt/6.0.3/ios/lib/cmake/Qt6/qt.toolchain.cmake -DCMAKE_OSX_ARCHITECTURES:STRING=arm64
    -DCMAKE_OSX_SYSROOT:STRING=iphoneos in /Volumes/T3/Dev/projects/builds/build-ios_cmake_empty_quick_project_6_0_3-Qt_6_0_3_for_iOS
  • Qt6 Displaying PDF Files

    Unsolved
    2
    0 Votes
    2 Posts
    588 Views
    SGaistS

    Hi and welcome to devnet,

    Based on the Marketplace, I would say not available yet for Qt 6.

    The build instructions are still Qt 5 only. The module will likely return around the same time QtWebEngine for Qt 6 is released.

  • Import Qt5Compat with PySide6 in QML file

    Solved
    3
    0 Votes
    3 Posts
    768 Views
    W

    Well, I guess I'll have to wait for Qt 6.1 or compile it myself ;/

  • New error in Qt

    Unsolved
    2
    0 Votes
    2 Posts
    177 Views
    SGaistS

    Hi,

    Did you add/remove the Q_OBJECT macro from your class declaration ?

    Is this a slot ?

  • How to adjust QComboBox?

    Solved
    4
    0 Votes
    4 Posts
    826 Views
    C

    Thank you. I figure out that I mis-spell QComboBox in the stylesheet and that is main cause of the problem. Eventually, I get the result that I want and this is the code that provides it.
    d52b79c6-4db5-4a5b-b91b-aa79fddbac29-image.png

    ui -> comboBox -> setStyleSheet( "QComboBox{" "background-color: rgb(238,238,238);" "border: 1px solid black;" "border-radius: 25px;" "width: 40;" "height: 50;" "}" "QComboBox::drop-down{" "border-width: 0px;" "margin-left: 0px;" "}" "QComboBox::down-arrow{" "image:url(://Button_Icons/down-arrow.png);" "width: 10px;" "height: 50px;" "}");
  • How to make a template?

    Solved
    11
    0 Votes
    11 Posts
    844 Views
    C

    Thank you! This has been very helpful to me :)

  • GNU GDB debugger Type not recognized problem

    Solved
    4
    0 Votes
    4 Posts
    712 Views
    Z

    Thanks a lot, SGaist

    And forgot to mention I figured out the solution to my problem. I had over-specified 'pythonpath in the 'system variable' of the advanced setting which caused the gdb to be unrecognized. when I removed the pythonpath ("something that separately prioritizes language environment") completely then it detected gdb in cmd and Qt. I hope it will help somebody with the same problem. the partial credit goes to a post in StackOverflow which mentioned gdb won't function if the python environment mistakes the actual path even though both normal path and pythonpath are derived from a single installation and single location (which in my case was the python 3.7 only nothing else). The root thing goes to gdb dependency on python scripting extension as was mentioned in Qt guide of debugger installation.
    Here goes my windows
    error.jpg

    error1.jpg

  • How to plot graph and its value in a tab widget?

    Solved
    2
    0 Votes
    2 Posts
    219 Views
    jsulmJ

    @Beginner_to_code said in How to plot graph and its value in a tab widget?:

    I need to plot a graph

    Take a look at https://doc.qt.io/qt-5/qtcharts-index.html

  • Qt 6 version readiness for using. When?

    Moved Solved
    7
    0 Votes
    7 Posts
    530 Views
    B

    @VRonin thx

  • Qt 6.0.3 QFileIconProvider and High DPI

    Moved Solved
    6
    0 Votes
    6 Posts
    479 Views
    VRoninV

    Is there a platform independent alternative

    See https://forum.qt.io/topic/125967/possible-qt-6-03-bug

    should I switch development to 5.15 for now?

    My personal opinion expressed here: https://forum.qt.io/topic/126005/qt-6-version-readiness-for-using-when

  • TexMaker F1 Problem After Qt6 Install

    Unsolved
    24
    0 Votes
    24 Posts
    3k Views
    O

    @SGaist I am getting back to this problem; however, to do so will mean that I will need to remove Qt and the Qt3D that I painfully installed. I would like to move Ninja and Vulkan so that I will not need to build them, also. I would like to save conan3D which was the conan build directory, but will that not work when I reinstall Qt6? Any advise? I wish there was a workaround to this TexMaker problem.

  • Error building static Qt with msvc2019

    Unsolved
    2
    0 Votes
    2 Posts
    183 Views
    No one has replied
  • Possible Qt 6.03 Bug

    Moved Unsolved
    2
    0 Votes
    2 Posts
    184 Views
    VRoninV

    Bug is confirmed.
    QTBUG-91104 is the general issue being worked, QTBUG-92030 is your specific case.

    If you need a workaround (works in the current dev branch) you can set up a custom theme to hold the icons you want to use.

    See this example on how to setup a custom theme.
    The icons you need to provide are:

    "computer" "user-desktop" "user-trash" "network-workgroup" "drive-harddisk" "folder" "text-x-generic"

    You could use Breeze or Oxygen icons from KDE if you need them

  • QApplication::activeWindow() working incorrectly

    Solved
    8
    0 Votes
    8 Posts
    530 Views
    I

    @Christian-Ehrlicher

    thanks for the help. Your tips helped solve the problem!

  • 0 Votes
    1 Posts
    327 Views
    No one has replied