Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.0k Topics 453.8k Posts
  • 3 Votes
    29 Posts
    29k Views

    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible.

    Thanks for reporting this.

  • 0 Votes
    2 Posts
    5 Views

    Hi,

    I would recommend following the instructions shown in Qt's documentation.

  • How to use QtPDF with MinGW + cmake ?

    Unsolved a day ago
    0 Votes
    6 Posts
    68 Views

    @JonB https://bugreports.qt.io/browse/QTBUG-135100

  • QProcess language

    Solved 15 days ago
    0 Votes
    10 Posts
    170 Views

    @sonichy
    You perhaps ought make your Creator environment mirror your target deployment/run environment.
    QProcess is not doing anything special, process inherits environment of how/where Qt program is running.

  • 0 Votes
    5 Posts
    43 Views

    @Antonius In the settings dialog of the start page, add two user defined repositories:
    https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_613
    https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_613_src_doc_examples
    (If you are using mirrors, you can replace the address with mirror site)
    Press OK and try adding components again.

    P.S. This only works when the old files are still on the repositories server.

  • 0 Votes
    7 Posts
    107 Views

    @l3u_ Then you already know where the source code is. You can check by yourself.

    P.S. I won't worry much about the private header.
    First, the APIs in this header file haven't been changed from Qt5.0 till current Qt6.9.
    Second, even the public headers have also been changed a lot, so what if the private header changes .

  • 0 Votes
    1 Posts
    10 Views
    No one has replied
  • 0 Votes
    15 Posts
    104 Views

    So I managed to resolve the issue:
    First of all, following error

    QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers:

    indicates, that in the install directory plugins/sqldrivers and its contents is missing.
    This is usually detected by windeployqt.exe.
    If this is not the case adding --include-plugins qsqlpsql as argument to windeployqt.exe solves the issue.
    qsqlpsql is for PostgreSQL.

    This resulted in following output when running the app:

    Client >>> WARNING: QSqlDatabase: QPSQL driver not loaded Client >>> WARNING: QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQL

    Which means, that the PostgreSQL runtime was not installed correctly. To solve this I simply did

    find_package(PostgreSQL) list(GET PostgreSQL_INCLUDE_DIRS 0 PSQLINCLUDEDIR) install(FILES ${PSQLINCLUDEDIR}/../bin/libcrypto-3-x64.dll DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ${PSQLINCLUDEDIR}/../bin/libssl-3-x64.dll DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ${PSQLINCLUDEDIR}/../bin/libpq.dll DESTINATION ${CMAKE_INSTALL_BINDIR})
  • 0 Votes
    6 Posts
    992 Views

    @SGaist Thanks! Thats will be the solution!

  • 0 Votes
    6 Posts
    83 Views

    @django-Reinhard said in my project crashes and I don't understand why:

    for the most stupid response ever

    Please read and follow https://forum.qt.io/topic/113070/qt-code-of-conduct
    @aha_1980 , like most other people here, is helping voluntarily and writing such responses is not welcome here. You did not even mention that debugger is crashing in your first post...

  • 0 Votes
    2 Posts
    29 Views

    a) Yes. Build Qt6 yourself and link the ICU version you want
    b) The prebuilt Qt6 on windows is not built with ICU support
    You can get the building flags from https://wiki.qt.io/Qt_6.8_Tools_and_Versions
    I had replied in this thread about how to build Qt6Core only with ICU support on Windows, you may take that as a reference.

  • 0 Votes
    8 Posts
    194 Views

    Thanks for testing it!

    I'm running this on macOS Sequoia 15.3.2 with Qt 6.8.2, using Apple Clang 16.0.0. The issue is consistently reproducible on my setup. This might be a macOS-specific issue.

    Would it make sense to report this on Qt's bug tracker (bugreports.qt.io)?

  • 0 Votes
    20 Posts
    16k Views

    10 years later, but it was an issue for me too. So here's the simple solution, the QLocale() default constructor returns the current application settings, so the following returns the current application language as a string:

    QLocale::languageToString ( QLocale().language() )

  • 0 Votes
    6 Posts
    95 Views

    @SGaist

    Okay, so the labels default to the QAbstractBarSeries::LabelsPosition::LabelsCenter, where center is defined as the middle of the bar numerically, not the middle of the bar as rendered:

    Original range is 2500 to 4400.

    Here's how it looks with range 1100 to 3200:

    d7b9127d-d02c-4c54-8d61-567203bc51cb-image.png

    If I call series->setLabelsPosition(QAbstractBarSeries::LabelsPosition::LabelsInsideEnd), and restore the range, I get:

    143c3499-4c7d-4f97-a844-6ba8dfa9c1da-image.png

    Long story short, the labels were there, but rendered off-screen.

  • 1 Votes
    7 Posts
    208 Views

    Then it is also true that windeployqt used to place it correctly, and no longer does. Resulting in broken deployments and literal hours of debugging.

  • 0 Votes
    13 Posts
    2k Views

    @lion-zhang Welcome to the forum. Instead of reviving a very old topic with no clear problem statement relating to a long deprecated version of Qt , it would be more effective if you start your own topic. Make sure to specify which version of Qt you are using, on what operating system, what exactly are you doing (ideally with some sample code) and what is the performance issue you are experiencing (CPU, memory leaking, etc).

  • 0 Votes
    13 Posts
    316 Views

    @jsulm Thanks to you, the problem was solved.

  • 0 Votes
    5 Posts
    126 Views

    Hi @zeroflagnet,

    please test again, it should work. I've just started canbusutil twice on Linux: ./canbusutil virtualcan tcp://127.0.0.1:<port>/can0 -l and got the following output when connecting to the two servers via the can example:

    ./canbusutil virtualcan tcp://127.0.0.1:35468/can0 -l qt.canbus.plugins.virtualcan: Server [0x7fdd9e22f520] started and listening on port 35468. qt.canbus.plugins.virtualcan: Server [0x7fdd9e22f520] client connected. qt.canbus.plugins.virtualcan: Client [0x5577461f6c00] socket connected. qt.canbus.plugins.virtualcan: Server [0x7fdd9e22f520] client connected. 456 [3] 98 76 54 456 [3] 98 76 54

    and

    ./canbusutil virtualcan tcp://127.0.0.1:35469/can0 -l qt.canbus.plugins.virtualcan: Server [0x7fb97228c520] started and listening on port 35469. qt.canbus.plugins.virtualcan: Server [0x7fb97228c520] client connected. qt.canbus.plugins.virtualcan: Client [0x56534f1c1c00] socket connected. qt.canbus.plugins.virtualcan: Server [0x7fb97228c520] client connected. 123 [3] 45 67 89 123 [3] 45 67 89

    Do you have an good Tutorial for compiling only one Plugin?

    You can just get the qtserialbus source [1] for your Qt version, open the CMakeLists.txt in QtCreator, assign the correct Kit and compile the module. Afterwards, copy the new plugin DLL into your Qt installation.

    Where ther resons (to much load in the Connection/Network, instabile Connections/to big latency) for constrainig it to 2?

    My goal was to have an universal virtual CAN plugin, and did not think it would be used in production.

    Now that you ask for it, I've created a patch to change that: https://codereview.qt-project.org/c/qt/qtserialbus/+/632813

    Are 10 channels enough for you?

    Regards

    [1] for example, from git: git://code.qt.io/qt/qtserialbus.git

  • Qt for msvc problem

    Unsolved a day ago
    0 Votes
    3 Posts
    77 Views

    @JonB said in Qt for msvc problem:

    does it go wrong if you replace the QWebEngineView with something else,

    If I replace it with QWidget it works fine. But I need QWebEngine.

    How can I show you any debugger info when as soon as I run it in debug (cLion) it freezes entire system. Only hard reboot works. It doesn't show any messages before it.

    Its very confusing. I've been trying to set up qt with msvc for a long timen now. I've gone thru many iteration of cmakelist code before it started compiling. Last thing that happened before crashing system was that it was comppiling. Cmake nor Clion showed any error. On bebug I got messages of missing dll's QWidgets, QCore etc. I copied them to project's build foder. After that it started to crash. Moreover it crashes when I put the same code into new files in new project (without copeying dll's).

  • Retrieving data from QModelIndex

    Unsolved 2 days ago
    0 Votes
    6 Posts
    91 Views

    @Gandalf404
    I will try once again. There are two calls you can use to access data at a row/column:

    If you already have a QModelIndex for the desired row/column the shortest code you can use to read the data is index.data(). If you do not have a QModelIndex but have the desired row/column in some variables you can use model.data(row, column).

    If you have a desired QModelIndex index the following three expressions all return the same value:

    index.model()->index(index.row(), index.column()).data() index.model()->data(index) index.data()

    Which of these would you like to type into your code? There is nothing wrong with 1, but it is longer, and a tiny, tiny bit less efficient, than the totally equivalent 2. And similarly for 2 compared to 3. So I would choose 3.

    If you do not have a QModelIndex already to hand, but you know the row and column numbers you want, you could either create a QModelIndex index(row, column) in one statement and then use one the above in the following statement or you could use approach 1 something like:

    partId = model->data(someRow, 0); kitId = model->data(someRow, 1); partName = model->data(someRow, 2); ...

    If --- and I don't know whether this is you case, but it might be --- you write a function which is passed, say, the QModelIndex index (or const QModelIndex &index) of one cell, like the partId (leftmost column 0) of some row and you wish to access the other columns in that row you might write

    kitId = index.model()->index(index.row(), 1).data();

    Or, if you want to shorten this one, there is also a QModelIndex QModelIndex::siblingAtColumn(int column) const method, so

    kitId = index.siblingAtColumn(1).data();

    None of this makes a big difference which way you write it. No matter which approach you take the code will take relatively much longer fetching the data (the actual data() call in each case) from somewhere in the model than the bit of code fiddling with index.