Skip to content

Qt Development

Everything development. From desktop and mobile to cloud. Games, tools, 3rd party libraries. Everything.
144.4k Topics 723.7k Posts
Qt 6.11 is out! See what's new in the release blog

Subcategories


  • This is where all the desktop OS and general Qt questions belong.
    84k 460k
    84k Topics
    460k Posts
    Chris KawaC
    This [&] means you're capturing local variables by reference, like Stop and startstop (unless that one is global). By the time the action is triggered this local variable no longer exists, so calling setText(Stop) is using garbage and crashes your app. If startstop is also a local variable then calling any fnction on it inside that lambda will also crash your app, as it becomes garbage too. To fix this you can capture the variable by value instead. Use [Stop] to capture that particular variable or [=] to capture anything used automatically. QString Stop("Stop"); QObject::connect(startstop, &QAction::triggered, this, [=]{ startstop->setText(Stop); }); You can also put the string inside the lambda: QObject::connect(startstop, &QAction::triggered, this, [startstop] { QString Stop("Stop"); startstop->setText(Stop); });
  • Looking for The Bling Thing(tm)? Post here!
    20k 78k
    20k Topics
    78k Posts
    A
    Hello, i am using Qt 6.11 Qt Quick android project on Windows 10 PC. AndroidManifest: <?xml version="1.0"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.qtproject.example.appRoboX" android:installLocation="auto" android:versionCode="1" android:versionName="1.0"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" android:required="true" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" /> <uses-feature android:name="android.hardware.opengl" android:required="true" /> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" /> <application android:name="org.qtproject.qt.android.bindings.QtApplication" android:hardwareAccelerated="true" android:label="RoboX" android:allowBackup="true" android:resizeableActivity="true" android:theme="@style/AppTheme" android:icon="@mipmap/ic_launcher"> <uses-native-library android:name="libOpenCL.so"/> <activity android:name="org.qtproject.example.appRoboX.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:label="RoboX" android:launchMode="singleTop" android:screenOrientation="landscape" android:exported="true" android:theme="@style/AppTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <meta-data android:name="android.app.lib_name" android:value="appRoboX" /> </activity> </application> </manifest> QtActivity.java: package org.qtproject.example.appRoboX; import android.os.Bundle; import android.content.Intent; import android.util.Log; import androidx.annotation.NonNull; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.os.Build; import androidx.core.view.WindowCompat; public class QtActivity extends org.qtproject.qt.android.bindings.QtActivity { private static final String TAG = "QtActivity"; private void makeFullScreen() { Window window = getWindow(); if (window != null) { window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); window.getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN ); } } private void setCutoutMode() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { WindowManager.LayoutParams params = getWindow().getAttributes(); params.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; getWindow().setAttributes(params); } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCutoutMode(); makeFullScreen(); Log.d(TAG, "QtActivity onCreate"); } } Style.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="@android:style/Theme.Black.NoTitleBar.Fullscreen"> <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> <item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">true</item> </style> </resources> Main.qml: ApplicationWindow { id: mainWindow visible: true width: Screen.width height: Screen.height visibility: Window.FullScreen flags: Qt.Window | Qt.ExpandedClientAreaHint | Qt.NoTitleBarBackgroundHint color: "black" ... if (Qt.platform.os === "android") { mainWindow.showFullScreen() mainWindow.visibility = Window.FullScreen } } I am not able to activate cutof screen mode. If i set up it manually in Settings-Display->Cutoff it works fine. My question is how to programmatically setup Edge-to-Edge mode?
  • The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
    14k 63k
    14k Topics
    63k Posts
    B
    Hello all! Trying to find correct way for detecting TextInput at the bottom for using it with resize by keyboard on iOS and Android devices. Is there any solutions for it? Is there any working examples? Or could someone describe possible way to solve it?
  • This is a discussion space for

    • for audio / video playback and recording
    • media formats and codecs
    • camera and screen sharing functionality
    51 222
    51 Topics
    222 Posts
    V
    I have been having this same issue with my Bluetooth headset not being detected
  • Have a question about Qt Creator, our cross-platform IDE, or any of the other tools? Ask here!
    8k 36k
    8k Topics
    36k Posts
    cristian-adamC
    Thank you for posting this. Qt Creator 19.0.2 has a CMake find package dependency provider that checks to see if Qt packages are missing, and if so, then you can get an Issue with a link to automagically install the missing Qt component. But there is an issue when a Qt component has a dependency on other Qt components that might have missing dependencies. I have tried a Qt Widgets "Hello World" with missing system dev packages. With Qt Creator 19.0.2 and a Qt SDK Qt 6.11.1 I get this in General Messages: [cmake] Running /snap/bin/cmake -S /home/cristian/Projects/C++/HelloQtWidgets -B /home/cristian/Projects/C++/HelloQtWidgets/build/Desktop_Qt_6_11_1-Debug -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON -DCMAKE_CXX_COMPILER:FILEPATH=/usr/lib/ccache/aarch64-linux-gnu-g++-13 -DCMAKE_C_COMPILER:FILEPATH=/usr/lib/ccache/aarch64-linux-gnu-gcc-13 -DCMAKE_GENERATOR:STRING=Ninja -DCMAKE_MAKE_PROGRAM:STRING=/usr/bin/ninja -DCMAKE_PREFIX_PATH:PATH=/home/cristian/Qt/6.11.1/gcc_arm64 -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/home/cristian/Projects/C++/HelloQtWidgets/build/Desktop_Qt_6_11_1-Debug/.qtcreator/cmake-helper/qtcreator-project.cmake -DQT_CREATOR_ENABLE_MAINTENANCE_TOOL_PROVIDER:BOOL=ON -DQT_CREATOR_ENABLE_PACKAGE_MANAGER_SETUP:BOOL=ON -DQT_ENABLE_QML_DEBUG:BOOL=ON -DQT_QMAKE_EXECUTABLE:FILEPATH=/home/cristian/Qt/6.11.1/gcc_arm64/bin/qmake in /home/cristian/Projects/C++/HelloQtWidgets/build/Desktop_Qt_6_11_1-Debug. [cmake] -- The CXX compiler identification is GNU 13.3.0 [cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - done [cmake] -- Check for working CXX compiler: /usr/lib/ccache/aarch64-linux-gnu-g++-13 - skipped [cmake] -- Detecting CXX compile features [cmake] -- Detecting CXX compile features - done [cmake] -- Performing Test HAVE_STDATOMIC [cmake] -- Performing Test HAVE_STDATOMIC - Success [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] CMake Warning at build/Desktop_Qt_6_11_1-Debug/.qtcreator/cmake-helper/maintenance_tool_provider.cmake:190 (message): [cmake] Qt packages are missing: 6.11.1, gcc_arm64, qt.qt6.6111.linux_gcc_arm64 [cmake] [cmake] If you are using the Qt Online Installer, check the Issues view in Qt [cmake] Creator for a link that installs the missing component. [cmake] Call Stack (most recent call first): [cmake] build/Desktop_Qt_6_11_1-Debug/.qtcreator/cmake-helper/maintenance_tool_provider.cmake:241 (qt_maintenance_tool_install) [cmake] CMakeLists.txt:4 (find_package) [cmake] [cmake] [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] CMake Error at build/Desktop_Qt_6_11_1-Debug/.qtcreator/cmake-helper/maintenance_tool_provider.cmake:252 (find_package): [cmake] Found package configuration file: [cmake] [cmake] /home/cristian/Qt/6.11.1/gcc_arm64/lib/cmake/Qt6/Qt6Config.cmake [cmake] [cmake] but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT [cmake] FOUND. Reason given by package: [cmake] [cmake] Failed to find required Qt component "Widgets". [cmake] [cmake] Expected Config file at [cmake] "/home/cristian/Qt/6.11.1/gcc_arm64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake" [cmake] exists [cmake] [cmake] [cmake] [cmake] Configuring with --debug-find-pkg=Qt6Widgets might reveal details why the [cmake] package was not found. [cmake] [cmake] Configuring with -DQT_DEBUG_FIND_PACKAGE=ON will print the values of some [cmake] of the path variables that find_package uses to try and find the package. [cmake] [cmake] Call Stack (most recent call first): [cmake] CMakeLists.txt:4 (find_package) [cmake] [cmake] [cmake] CMake Error at CMakeLists.txt:4 (find_package): [cmake] Could not find a configuration file for package "Qt6" that is compatible [cmake] with requested version "6.5". [cmake] [cmake] The following configuration files were considered but not accepted: [cmake] [cmake] /home/cristian/Qt/6.11.1/gcc_arm64/lib/cmake/Qt6/Qt6Config.cmake, version: unknown [cmake] The version found is not compatible with the version requested. [cmake] [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] [cmake] The command "/snap/bin/cmake -S /home/cristian/Projects/C++/HelloQtWidgets -B /home/cristian/Projects/C++/HelloQtWidgets/build/Desktop_Qt_6_11_1-Debug -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON -DCMAKE_CXX_COMPILER:FILEPATH=/usr/lib/ccache/aarch64-linux-gnu-g++-13 -DCMAKE_C_COMPILER:FILEPATH=/usr/lib/ccache/aarch64-linux-gnu-gcc-13 -DCMAKE_GENERATOR:STRING=Ninja -DCMAKE_MAKE_PROGRAM:STRING=/usr/bin/ninja -DCMAKE_PREFIX_PATH:PATH=/home/cristian/Qt/6.11.1/gcc_arm64 -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/home/cristian/Projects/C++/HelloQtWidgets/build/Desktop_Qt_6_11_1-Debug/.qtcreator/cmake-helper/qtcreator-project.cmake -DQT_CREATOR_ENABLE_MAINTENANCE_TOOL_PROVIDER:BOOL=ON -DQT_CREATOR_ENABLE_PACKAGE_MANAGER_SETUP:BOOL=ON -DQT_ENABLE_QML_DEBUG:BOOL=ON -DQT_QMAKE_EXECUTABLE:FILEPATH=/home/cristian/Qt/6.11.1/gcc_arm64/bin/qmake" terminated with exit code 1. [cmake] [cmake] Elapsed time: 00:01. which gives a hint that something with OpenGL is missing. The dependency provider can be skipped by using -DQT_CREATOR_ENABLE_MAINTENANCE_TOOL_PROVIDER:BOOL=OFF, which could help in the case that this mechanism has bugs.
  • Your Qt just doesn't want to build? Your compiler can't find the libs? Here's where you find comfort and understanding. And help.
    10k 51k
    10k Topics
    51k Posts
    Axel SpoerlA
    Hi and welcome to the Qt forum, please specify which example/application you are referring to.
  • What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
    875 4k
    875 Topics
    4k Posts
    K
    Okay, thank you for your efforts. I will close this issue now as "Not possible to support legacy hardware with a Qt6.8 Setup". Minimum requirements: Direct3D11 or GLSL best regards, kevin_d
  • Discussions and questions on QtWebEngine
    1k 4k
    1k Topics
    4k Posts
    T
    @SGaist the cross compilation of the libraries fixed the prob
  • You're using Qt with other languages than C++, eh? Post here!
    870 3k
    870 Topics
    3k Posts
    PedromixP
    New version QtJambi 6.11.1 is available now πŸŽ‰. For all who want to create smart UIsπŸš€ in Java or Kotlin based upon the latest Qt release. https://www.qtjambi.io/ [image: 95a6c11a-f7b2-4a9c-8325-ccfc9c93b3ec.png]
  • For discussion and questions about Qt for Python (PySide & Shiboken)

    3k 15k
    3k Topics
    15k Posts
    SGaistS
    It's a question of object lifetime or rather garbage collection. I have got hit by this one some years ago.
  • Specific issues when using Qt for WebAssembly

    465 2k
    465 Topics
    2k Posts
    Joe von HabsburgJ
    You can try this : QNetworkAccessManager _manager; _manager.setAutoDeleteReplies(true);
  • Discussions and questions about Qt Quick Ultralite and using Qt on microcontrollers in general

    156 476
    156 Topics
    476 Posts
    G
    I am working on a Qt for MCUs application and currently using OTF font files with the Static font engine. The font quality is good with OTF, but internal flash usage becomes very high. When I use FMP fonts, flash usage is low, but some glyphs do not render properly. Any guidance on the correct approach to move OTF font storage to external memory would be very helpful. Thank you.
  • Combining Qt with 3rd party libraries or components? Ask here!
    1k 6k
    1k Topics
    6k Posts
    C
    @SGaist Thank you! Sadly I don't know anything about reverse engineering the protocol. I'm just a diecut designer for scrapbooking. I've tried the alternative softwares and they're missing things that I'm used to designing with. This is such a great machine and I didn't want to have to buy a Cricut or Silhouette. I was just hoping to find some sort of patch for this software so that it would stop giving me the check usb connection error code. Thank you for your time!!
  • The forum for discussing the Qt Digital Advertising Platform

    16 41
    16 Topics
    41 Posts
    E
    @nayka Can I use QtDigitalAdvertising on PC applications? Or is it only allowed for use on Android or iOS mobile devices?
  • For discussion and questions about Qt Insight

    11 20
    11 Topics
    20 Posts
    jsulmJ
    @Alejandro_qt_ Here is an example how to build qtbase module: https://stackoverflow.com/questions/50022325/building-qt-module-from-source