Skip to content

Qt 6

This is where all Qt 6 related questions belong

816 Topics 3.9k Posts
QtWS25 Call for Papers
  • CMake QT Creator Problems

    Moved Unsolved
    4
    0 Votes
    4 Posts
    601 Views
    Christian EhrlicherC

    @bdahl said in CMake QT Creator Problems:

    and also compiled QT with this

    You compiled Qt by yourself? So you should know where qmake is and either add the directory to your PATH or point cmake to it (best with cmake-gui). I would prefer the former.

  • Detect Qt version with CMake

    Unsolved
    2
    0 Votes
    2 Posts
    443 Views
    VRoninV

    @Jonas-Kvinge said in Detect Qt version with CMake:

    it does the opposite, it finds Qt 5 first

    I tested on windows and it actually finds the first one as listed in PATH. It's anyway a terrible idea to have multiple versions of Qt added to PATH at the same time

  • installing Qt 6.2.0 Preview

    Unsolved
    3
    0 Votes
    3 Posts
    262 Views
    kkoehneK

    This is unfortunately a known issue with the current 6.2 snapshots, see https://bugreports.qt.io/browse/QTBUG-93707 .

  • How to build qtquickcontols2, qtsvg, qtwebsockets?

    Unsolved
    8
    0 Votes
    8 Posts
    699 Views
    L

    You can download prebuilt
    Qt 6.1.0 modules for Windows, Linux (Unix) is available from Google drive https://drive.google.com/folderview?id=0B2QuZLoe-yiPbmNQRl83M1dTRVE&usp=sharing

    [Warning: Download binaries from unknown sources at your own risk ~SGaist]

  • 0 Votes
    3 Posts
    241 Views
    L

    You can download prebuilt Qt-6.1.0 for win64 and x86-64 from AdaStudio-2021

    Google drive https://drive.google.com/folderview?id=0B2QuZLoe-yiPbmNQRl83M1dTRVE&usp=sharing

    [Warning: Download binaries from unknown sources at your own risk ~kshegunov]

  • 0 Votes
    1 Posts
    670 Views
    No one has replied
  • 0 Votes
    17 Posts
    928 Views
    R

    @VRonin just reported it here https://bugreports.qt.io/browse/QTBUG-93731

    Thank you everyone for your help.

  • 0 Votes
    3 Posts
    426 Views
    D

    @Christian-Ehrlicher yes, looks like it compiles better without -DQT_NO_EXCEPTIONS=1

    reported the bug: https://bugreports.qt.io/browse/QTBUG-93739

  • Compiler errors while building QT 6.1.0 for Windows

    Moved Solved
    3
    0 Votes
    3 Posts
    623 Views
    D

    @Christian-Ehrlicher I compile QT by myself because I prefer QT with -DQT_NO_EXCEPTIONS=1, it disables try/catch block surrounding QThread's loop.

    I removed MinGW from the PATH and looks like it started to build.

  • OBJECTIVE_SOURCES for cmake/Qt6

    Solved
    2
    0 Votes
    2 Posts
    257 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
    630 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
    256 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
    176 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
    541 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
    715 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
    170 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
    788 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
    745 Views
    C

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