Skip to content

Qt Development

Everything development. From desktop and mobile to cloud. Games, tools, 3rd party libraries. Everything.
144.6k Topics 723.2k Posts

Subcategories


  • This is where all the desktop OS and general Qt questions belong.
    83k 457k
    83k Topics
    457k Posts
    E
    hi, did you manage to solve the problem? I am writing a similar program, trying to make something like a read-only terminal out of QTextBrowser
  • The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
    14k 63k
    14k Topics
    63k Posts
    O
    I recently started learning about both Qt and Android development so forgive me if I say some nonsense. Issue Not being able to display a notification permission request dialog Context Today, I was using the project example Qt Android Notifier and I saw that no notifications were being displayed in certain devices. I discovered that since Android API level >= 33 (Tiramisu), you are required to prompt the user for notification permissions. I tried that implementing that and I found out that there are 2 main approaches when dealing with Android permissions in Qt. Through QtAndroidPrivate Through JNI main.cpp void requestNotificationPermission() { // QNativeInterface::QAndroidApplication::sdkVersion() if (QtAndroidPrivate::androidSdkVersion() < __ANDROID_API_T__) { return; } QFuture<QtAndroidPrivate::PermissionResult> future = QtAndroidPrivate::requestPermission("android.permission.POST_NOTIFICATIONS"); future.then([](const QtAndroidPrivate::PermissionResult &result) { if (result == QtAndroidPrivate::Authorized) { qDebug() << "Permission granted!"; } else { qDebug() << "Permission denied!"; } }); // I was obviously toggling between each mode so that no permission requests collisions were made. // QJniObject::callStaticMethod<void>( // "org/qtproject/example/androidnotifier/NotificationClient", // "requestNotificationPermission", // "(Landroid/content/Context;)V", // QNativeInterface::QAndroidApplication::context() // ); } NotificationClient.java public static void requestNotificationPermission(Context context) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { return; } if (context.checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED) { return; } if (!(context instanceof Activity)) { return; } Activity activity = (Activity) context; activity.requestPermissions( new String[]{ Manifest.permission.POST_NOTIFICATIONS }, NotificationClient.PERMISSION_REQUEST_CODE ); } Neither of the 2 methods shown above worked: QtAndroidPrivate crashed the application with a null reference error when trying to deal and resolving the QFuture promise F/libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x28 in tid 5071 (androidnotifier), pid 5071 (androidnotifier) F/DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** F/DEBUG : Build fingerprint: 'Android/sdk_phone64_x86_64/emulator64_x86_64:13/TE1A.220922.034/10940250:userdebug/test-keys' F/DEBUG : Revision: '0' F/DEBUG : ABI: 'x86_64' F/DEBUG : Timestamp: 2025-08-20 23:47:54.569231408+0200 F/DEBUG : Process uptime: 1s F/DEBUG : Cmdline: org.qtproject.example.androidnotifier F/DEBUG : pid: 5071, tid: 5071, name: androidnotifier >>> org.qtproject.example.androidnotifier <<< F/DEBUG : uid: 10127 F/DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000028 F/DEBUG : Cause: null pointer dereference F/DEBUG : rax 0000000000000028 rbx 0000706fc20dc758 rcx 0000000000000000 rdx 0000000000000000 F/DEBUG : r8 0000000000000002 r9 0000000000000000 r10 000000006fcb80e0 r11 0000706ea52d3450 F/DEBUG : r12 0000000000000002 r13 0000000000000000 r14 0000706f220e57b0 r15 00007ffffb3e7540 F/DEBUG : rdi 0000000000000028 rsi 0000000000000000 F/DEBUG : rbp 00007ffffb3e7140 rsp 00007ffffb3e7140 rip 0000706ef8dea18c F/DEBUG : backtrace: F/DEBUG : #00 pc 000000000002718c /data/app/~~thsWNG65e5GbVX_FLODyKQ==/org.qtproject.example.androidnotifier-DV2qLTB0YskNF1ggOrjb3Q==/lib/x86_64/libandroidnotifier_x86_64.so (QtPrivate::ResultItem::isVector() const+12) (BuildId: dd90d4c066b32994da3cba3a347167fb7779cd88) F/DEBUG : #01 pc 000000000002bdf0 /data/app/~~thsWNG65e5GbVX_FLODyKQ==/org.qtproject.example.androidnotifier-DV2qLTB0YskNF1ggOrjb3Q==/lib/x86_64/libandroidnotifier_x86_64.so (QtAndroidPrivate::PermissionResult const* QtPrivate::ResultIteratorBase::pointer<QtAndroidPrivate::PermissionResult>() const+32) (BuildId: dd90d4c066b32994da3cba3a347167fb7779cd88) JNI did not crash the application but it never displayed the notification popup and instead I always got this warning in the console. W/libandroidnotifier_arm64-v8a.so: Found no valid pending permission request for request code 1001 For reference, the 1001 request code is what the variable NotificationClient.PERMISSION_REQUEST_CODE holds. Cause What was actually causing the problem was targetSdkVersion. I saw that my application was using a targetSdkVersion of 31 with the following log that I added into the NotificationClient.java class. Log.d("MyTag", "targetSdkVersion: " + activity.getApplicationInfo().targetSdkVersion); I was not really concerned about that at first because from what I read,
  • Looking for The Bling Thing(tm)? Post here!
    20k 78k
    20k Topics
    78k Posts
    idlefrogI
    I'm trying to do the business card example. Using anchors, I'm trying to show two rows of text, the 'name', and 'address'. But both are on top of each other: import QtQuick Window { width: height*1.586 height: 480 visible: true title: qsTr("Business Card") component ContactInfo: QtObject { property string name property string address } ContactInfo { id: myContactInfo name: "Ms Just Lost" address: "Candy Cane Lane" } Rectangle{ id: name anchors.top: parent.top anchors.left: parent.left Text{ text: myContactInfo.name font.pointSize: 30 } } Rectangle{ id:address anchors.top: name.bottom anchors.left: name.left Text{ text: myContactInfo.address font.pointSize: 15 } } } Why does this not work? The Rectangle 'name' is in position top left of the parent. The Rectangle 'address' be below the 'name' rectangle. Guess I'm looking for some hints rather than any given solution. Why is this wrong?
  • Have a question about Qt Creator, our cross-platform IDE, or any of the other tools? Ask here!
    8k 35k
    8k Topics
    35k Posts
    C
    I know this is an old thread, but someone might find this helpful: (Qt Creator 17 on Mac) Press Cmd+T for the selection dialog. Once it pops up, hold Cmd and press T to cycle through your open projects. Release Cmd and the selected project is activated and the dialog disappears. Note: The dialog has three columns Project, Deploy, Run. For the above to work the column Project has to be active (dark selection field there). It looks like that each time you start Qt Creator the active column will be Deploy. In that case just click once a project name or use arrow keys to activate the Project column, and from that time it should work again (until you quit Qt Creator).
  • 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
    Qt 5.15 isn't supported anymore, just to begin with ;-) MimeTypeDatabaseOriginalSize is a static constexpr, the absence of which suggests that somehow configure has flipped FEATURE_mimetype to OFF. Probably a dependency has been added after 5.14. Please check the configure output for more information. Please also try Qt 6 (at least 6.5, better 6.9) and see if it still happens.
  • What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
    874 4k
    874 Topics
    4k Posts
    M
    Hi everyone, I'm currently working on a small hobby project inspired by "Totally Accurate Battle Simulator" but adapted for mobile devices using Qt 6 and QML. The working title is TABS Pocket Edition — it's just a fun prototype to test ragdoll physics, AI pathfinding, and multiplayer sync in a mobile context. One challenge I'm facing right now is optimizing the physics simulation when multiple ragdoll entities are colliding in close proximity. On some devices, the frame rate drops significantly once there are more than ~20 active units. So far, I've tried: Reducing the physics tick rate from 60Hz to 30Hz. Switching from per-bone collision to simplified capsule colliders. Disabling physics for off-screen units. These help a bit, but large battles still cause spikes. My questions: Has anyone implemented ragdoll physics efficiently in Qt/QML for mobile? Is there a way to offload part of the simulation or use a hybrid approach between keyframe animation and real physics? If anyone wants to see the current prototype in action, I've uploaded a playable build here: https://modhello.com/tabs-pocket-edition Thanks in advance for any tips!
  • Questions about Qt WebKit and related topics? Post here!
    2k 6k
    2k Topics
    6k Posts
    JonBJ
    @Vbrg So in a word Qt only offers integrated browser with chromium/Qt web engine.
  • Discussions and questions on QtWebEngine
    1k 4k
    1k Topics
    4k Posts
    SGaistS
    @Wenzhi-Wang hi and welcome to devnet, Are you also trying to use the MinGW kit with the MSVC version of WebEngine ?
  • You're using Qt with other languages than C++, eh? Post here!
    865 3k
    865 Topics
    3k Posts
    PedromixP
    Brand new release QtJambi 6.9.1 is out now🥂. Create sophisticated Java apps for Desktop and Mobile or refactor your legacy code using Qt as UI framework! https://www.qtjambi.io [image: cb78556c-b761-467b-b005-119e3643175c.png]
  • Combining Qt with 3rd party libraries or components? Ask here!
    1k 6k
    1k Topics
    6k Posts
    S
    you shoule choose Quick Scenes> Items. [image: 171d9f7c-ca85-4766-9747-fde06ca3a995.png]
  • For discussion and questions about Qt for Python (PySide & Shiboken)

    3k 15k
    3k Topics
    15k Posts
    A
    @SGaist said in Need some help migrating code from PySide2 to PySide6 (SideFX decided to update): Hi and welcome to devnet, I think you are looking for QGuiApplication.screenAt. QApplication is a subclass so you can directly use it with it. Thanks for the advice, I will go give it a look to see what I can do with this. Thanks for the suggestion.
  • Specific issues when using Qt for WebAssembly

    457 2k
    457 Topics
    2k Posts
    E
    check https://forum.qt.io/post/775817
  • Discussions and questions about Qt Quick Ultralite and using Qt on microcontrollers in general

    142 445
    142 Topics
    445 Posts
    jsulmJ
    @Vishal-Biradar said in Code is getting reset.: But after certain period code is resting means display is getting off again restart Do you mean your app is crashing? The OS is restarting? Please say exactly what happens. Regarding your code: using an endless loop in an event driven application is a no-go...
  • The forum for discussing the Qt Digital Advertising Platform

    18 41
    18 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

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