Skip to content

Qt Development

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

Subcategories


  • This is where all the desktop OS and general Qt questions belong.
    82k Topics
    451k Posts
    I

    @Khamza It is quite hard to tell. The piece of code you pasted has several issues unfortunately, and it would very hard to say what the exact cause it without the whole thing to reproduce.

    I'll say that the most pressing problem in the code is that you are using values that are in document coordinates (which is what the rectangle that QAbstractTextDocumentLayout::blockBoundingRect returns is in) to calculate parameters for a QPainter which works in viewport coordinates. These are not the same, especially when there are scroll bars shown, and in my experience the main cause of issues around scrolling.

    That said, it wouldn't explain the text itself just disappearing when scrolling back up; I'd expect it to just be garbled. First try to comment out your paintEvent to see if text is drawn correctly at the expected positions when scrolling back and forth - perhaps something in the formats isn't right. Otherwise, please post a complete yet minimal project that reproduces the problems you see.

  • The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
    14k Topics
    62k Posts
    piervalliP

    I thought it is transparent for us.

    in this section https://developer.android.com/guide/practices/page-sizes?hl=en

    ...
    If your app uses any native code, then you should rebuild your app with support for 16 KB devices. If you are unsure if your app uses native code, you can use the APK Analyzer to identify whether any native code is present and then check the alignment of ELF segments for any shared libraries that you find.

    ..

    But I don't understand if it is mandary where devices are page size 16KB.

  • Looking for The Bling Thing(tm)? Post here!
    20k Topics
    76k Posts
    M

    @dheerendra Amazing🥳!It works,but why could not it run correctly before?I think thery are similar,just a little different.Is the problem on the order of the property?🧐

  • Have a question about Qt Creator, our cross-platform IDE, or any of the other tools? Ask here!
    7k Topics
    34k Posts
    C

    me too !

    image.png

    image.png

  • 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 Topics
    50k Posts
    DriftwoodD

    I installed Qt just minutes ago, created a small app, and it won't run. Right out of the box, Qt is broken. I've made zero changes to anything, and it's broken. Here is the Message output in full:

    [cmake] Running /home/floyd/Qt/Tools/CMake/bin/cmake -S /media/floyd/TOSHIBA/QtPythonProjects/Diary -B /media/floyd/TOSHIBA/QtPythonProjects/Diary/build/Desktop_Qt_6_8_1-Debug -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/media/floyd/TOSHIBA/QtPythonProjects/Diary/build/Desktop_Qt_6_8_1-Debug/.qtc/package-manager/auto-setup.cmake -DCMAKE_GENERATOR:STRING=Ninja -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/x86_64-linux-gnu-g++ -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG -DCMAKE_PREFIX_PATH:PATH=/home/floyd/Qt/6.8.1/gcc_64 -DCMAKE_BUILD_TYPE:STRING=Debug -DQT_QMAKE_EXECUTABLE:FILEPATH=/home/floyd/Qt/6.8.1/gcc_64/bin/qmake in /media/floyd/TOSHIBA/QtPythonProjects/Diary/build/Desktop_Qt_6_8_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/bin/x86_64-linux-gnu-g++ - skipped [cmake] -- Detecting CXX compile features [cmake] -- Detecting CXX compile features - done [cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD [cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success [cmake] -- Found Threads: TRUE [cmake] -- Performing Test HAVE_STDATOMIC [cmake] -- Performing Test HAVE_STDATOMIC - Success [cmake] -- Found WrapAtomic: TRUE [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 WrapOpenGL (missing: WrapOpenGL_FOUND) [cmake] CMake Warning at /home/floyd/Qt/Tools/CMake/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package): [cmake] Found package configuration file: [cmake] [cmake] /home/floyd/Qt/6.8.1/gcc_64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake [cmake] [cmake] but it set Qt6Gui_FOUND to FALSE so package "Qt6Gui" is considered to be [cmake] NOT FOUND. Reason given by package: [cmake] [cmake] Qt6Gui could not be found because dependency WrapOpenGL could not be found. [cmake] [cmake] Configuring with --debug-find-pkg=WrapOpenGL 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] /home/floyd/Qt/6.8.1/gcc_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:143 (find_dependency) [cmake] /home/floyd/Qt/6.8.1/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsDependencies.cmake:43 (_qt_internal_find_qt_dependencies) [cmake] /home/floyd/Qt/6.8.1/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake:43 (include) [cmake] /home/floyd/Qt/6.8.1/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:181 (find_package) [cmake] CMakeLists.txt:13 (find_package) [cmake] [cmake] [cmake] CMake Warning at /home/floyd/Qt/6.8.1/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:181 (find_package): [cmake] Found package configuration file: [cmake] [cmake] /home/floyd/Qt/6.8.1/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake [cmake] [cmake] but it set Qt6Widgets_FOUND to FALSE so package "Qt6Widgets" is considered [cmake] to be NOT FOUND. Reason given by package: [cmake] [cmake] Qt6Widgets could not be found because dependency Qt6Gui could not be found. [cmake] [cmake] Configuring with --debug-find-pkg=Qt6Gui 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:13 (find_package) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] CMake Error at CMakeLists.txt:13 (find_package): [cmake] Found package configuration file: [cmake] [cmake] /home/floyd/Qt/6.8.1/gcc_64/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/floyd/Qt/6.8.1/gcc_64/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] [cmake] [cmake] [cmake] The command "/home/floyd/Qt/Tools/CMake/bin/cmake -S /media/floyd/TOSHIBA/QtPythonProjects/Diary -B /media/floyd/TOSHIBA/QtPythonProjects/Diary/build/Desktop_Qt_6_8_1-Debug -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/media/floyd/TOSHIBA/QtPythonProjects/Diary/build/Desktop_Qt_6_8_1-Debug/.qtc/package-manager/auto-setup.cmake -DCMAKE_GENERATOR:STRING=Ninja -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/x86_64-linux-gnu-g++ -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG -DCMAKE_PREFIX_PATH:PATH=/home/floyd/Qt/6.8.1/gcc_64 -DCMAKE_BUILD_TYPE:STRING=Debug -DQT_QMAKE_EXECUTABLE:FILEPATH=/home/floyd/Qt/6.8.1/gcc_64/bin/qmake" terminated with exit code 1. [cmake] [cmake] Elapsed time: 00:08.

    I don't know how to fix this because I didn't do anything but install it. Again, I made no changes to Qt. These issues you see, they're right out-of-the-box . I'd like to get this straightened out, but I don't know how. Not sure why a fresh install would be broken in such a fashion as this.!

    This is what I have installed:
    Screenshot from 2024-12-19 10-58-07.png

  • What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
    844 Topics
    4k Posts
    D

    Thank you @Christian-Ehrlicher it worked!
    Could it be considered as a bug? (I would expect the cmake files of Qt to link openGL as I'm using Qt6::OpenGL)

  • Questions about Qt WebKit and related topics? Post here!
    2k Topics
    6k Posts
    Christian EhrlicherC

    Since gcc13 was not yet out when Qt4.8.7 was released some now stricter c++ requirements are in place. you have to fix them by yourself. There error message is clear here - you need a virtual dtor - add it.

  • Discussions and questions on QtWebEngine
    1k Topics
    4k Posts
    jsulmJ

    @cobook said in Using Spotify Web SDK in Qt6:

    Python3 is already installed in my labtop,

    Is Python in PATH when you're calling configure? And I guess configure does not you any of your virtual environments and will not find html5lib there.

  • You're using Qt with other languages than C++, eh? Post here!
    856 Topics
    3k Posts
    PedromixP

    Next version of QtJambi is out now: 6.8.1. Download binaries on Maven Repository and find sources here: https://github.com/OmixVisualization/qtjambi/tree/v6.8.1
    QtJambi_release.png

  • Combining Qt with 3rd party libraries or components? Ask here!
    1k Topics
    6k Posts
    A

    Hi Slandino, I started working a few days ago on a project to mix Qt and flutter. I have already some working code, but it's using offscreen buffers (my final objective is to make a plugin to have a flutter layer in OBS) so I've not even looked on how to render to a window context. But the code may still work for you. I've commited the mess of code I wrote so far to https://github.com/hefsoftware/temp_qt_flutter (it compiles on windows, at least for me). Hope it will give you some help.

  • For discussion and questions about Qt for Python (PySide & Shiboken)

    3k Topics
    14k Posts
    jsulmJ

    @ktechhydle If you enter "qt6 QWindow OpenGL" in Google first result is: https://doc.qt.io/qt-6/qtopengl-openglwindow-example.html

  • Specific issues when using Qt for WebAssembly

    437 Topics
    2k Posts
    R

    Strange, I know for a fact that QNetworkAccessManager works on wasm, so you may want to use that instead.

  • Discussions and questions about Qt Quick Ultralite and using Qt on microcontrollers in general

    132 Topics
    445 Posts
    SGaistS

    @IBO_GO in which language did you write your HAL ?

    Because if it's either C or C++ you can use that as any other library. If not, then please give more details about what you already have, in which language, etc.

  • The forum for discussing the Qt Digital Advertising Platform

    16 Topics
    40 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

    9 Topics
    12 Posts
    vicnguyenV

    Qt Insight 1.9 has been released. Qt Insight has new additions to the funnels and filters, allowing you to make deeper discoveries about your application usage. Two different funnel analytics, finer-grained geographic filtering options for regions, and many smaller improvements and bug fixes will enhance your insight.

    Read more details in the 1.9 release blog post.

  • Forum general guide

    Pinned
    22
    13 Votes
    22 Posts
    17k Views
    kshegunovK

    @Nils-A said in Forum general guide:

    @AnneRanch seriously? That's five years ago, four years before you joined.

    Nor is it relevant to your question.

    @AnneRanch said in Forum general guide:

    This in not the place to make sermons or trying to push your social opinions.
    Here is a "how to " borrowed form another site

    This isn't "another site", this site has a code of conduct, which's been established, reviewed and approved by a number of people and it certainly isn't under debate in this thread. If you have a specific complaint about a specific person/post bring it to the attention of the moderators directly by flagging it/them.