Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Performance of QPainter?

    Unsolved
    9
    0 Votes
    9 Posts
    3k Views
    GrecKoG
    @F_Mehmood Since they don't use the same concepts, it depends on your usage of the QGraphicsView framework. There's no 1-to-1 porting guide, if you do lots of complex drawing with polygons or curves it will be tricky. If you are using basic shapes and controls it can be simple. QQuickPaintedItem is not hardware accelerated. QQuickRhiItem but more complex, you might not have to use it and could maybe just use existing Items. Do you have a screenshot of your application (or a similar one)? A drawing/description would also do.
  • How do i use macdeployqt

    Unsolved
    3
    0 Votes
    3 Posts
    303 Views
    S
    I just recently posted the script we are using to deploy for macOS: https://forum.qt.io/post/821037 Maybe that helps.
  • QAudioDecoder more definitive error?

    Solved
    3
    0 Votes
    3 Posts
    272 Views
    D
    yeah bummer. looks like QMediaPlayer is the only way to get the answer
  • QProtobuf failed on nested data

    Unsolved
    3
    0 Votes
    3 Posts
    318 Views
    D
    @SGaist thank you for the welcoming :D I've prepared a project that can be used to reproduce the problem or check my settings; I think that can be clearer. https://github.com/mstefanini/QtProtobufNestedCrash The pattern used in the protobuf is most likely supported by the C# and Erlang libraries, not the Qt implementation. I'm trying only to understand if I've set something wrong and fix it accordingly. Thank you in advance :)
  • Inheriting without Inheriting the Ui, how?

    Solved
    4
    0 Votes
    4 Posts
    340 Views
    S
    Yeah, I think that's what I got to do.
  • How to set vertical QProgressBar width ?

    Solved
    2
    0 Votes
    2 Posts
    168 Views
    Pl45m4P
    @sonichy The easiest way is to use Stylesheet https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qprogressbar
  • Cannot find Oracle::OCI when using statically built Qt

    Unsolved
    9
    0 Votes
    9 Posts
    858 Views
    Y
    @SGaist Hi, the following CMakeLists.txt is minimal, just add sql module in find_package() and target_link_libraries() based on the default CMakeLists.txt template of Qt Creator cmake_minimum_required(VERSION 3.16) project(QtTest VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 6.5 REQUIRED COMPONENTS Quick Sql) qt_standard_project_setup(REQUIRES 6.5) qt_add_executable(appQtTest main.cpp ) qt_add_qml_module(appQtTest URI QtTest VERSION 1.0 QML_FILES Main.qml ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appQtTest PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appQtTest MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) target_link_libraries(appQtTest PRIVATE Qt6::Quick Qt6::Sql ) include(GNUInstallDirs) install(TARGETS appQtTest BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
  • Can't init repository for Qt 6.8.1

    Unsolved
    2
    0 Votes
    2 Posts
    283 Views
    SGaistS
    Hi, Likely a network issue, did you try again in between ?
  • QSocketNotifier: socket notifiers cannot be enabled from another thread

    Unsolved
    8
    0 Votes
    8 Posts
    714 Views
    JonBJ
    @bxrs What "while" loop? You won't have one. No blocking, no waiting! The asynchronous way of doing things is: send your data to device, put a slot on readyRead(), accumulate whatever is received into a (member variable, so it persists) buffer (you must not assume one call will receive 1024 bytes or whatever, Qt only guarantees you will get 1 or more bytes when readyRead() is called), check to see if 1024 bytes or whatever for a "complete message". If so, remove the 1024/message bytes from the "pending" buffer, emit your own signal (like messageReceived(bytes)) with that data, attach a slot to do whatever on completed signal. That is how we do asynchronous stuff without blocking or using a thread.
  • qt6 qt creator acceptTouchEvents on x11 ubuntu

    Solved
    19
    0 Votes
    19 Posts
    2k Views
    gfxxG
    seems real solution is to obligate QT6 to use Xinput2 install by default on modern ubuntu/mint SO. For these you must use "qputenv" command in your main. The exact command can share more late ... not remember and not avaiable now. ..... update ... THE MAGIC ROW !!!! qputenv("QT_XCB_NO_XI2", "0"); // Ensure Qt uses XInput2 for touch input
  • How to find Directory Size?

    Unsolved
    5
    0 Votes
    5 Posts
    4k Views
    7
    Hi @helsouri ! Take a look at usages here https://doc.qt.io/qt-6/qdiriterator.html They told After construction, the iterator is located before the first directory entry So the proper code is QDirIterator it("c:/vlc", QDirIterator::Subdirectories); qint64 total = 0; while (it.hasNext()) { it.next(); // check if entry is file if(it.fileInfo().isFile()) { total += it.fileInfo().size(); } } qDebug() << "size" << total;
  • Why does QProcess fail to open the shortcut key exe?

    Solved
    4
    0 Votes
    4 Posts
    323 Views
    JonBJ
    @mirro I thought Windows requires that shortcuts end in .lnk, but apparently not? What happens if you try to launch that shortcut by typing in its full path directly into Command Prompt? Depending on that, maybe Windows requires shortcuts to be launched/invoked through its shell wrapper?
  • Problem with loading resources from qrc file

    Unsolved
    5
    0 Votes
    5 Posts
    426 Views
    C
    @SirMarcin As Bonnie says. I had this problem while doing a course at least a year ago now. It turned out that the template was incomplete for the version of Qt I had installed. The previous version worked fine so I was able to copy the template from an older version and then it all worked.
  • border-color property does not work on custom stylesheet

    Unsolved
    4
    0 Votes
    4 Posts
    395 Views
    M
    @Bonnie said in border-color property does not work on custom stylesheet: @Mark81 You need to write the full border style: You're right. I didn't understand this from the docs! Out of curiosity, to test the Light style I added this line: QGuiApplication::styleHints()->setColorScheme(Qt::ColorScheme::Light); but the theme is still dark (as per my system settings). The docs (here) state I can set an explicit color scheme. Is there anything else I should set? I'm aware it is slightly offtopic, but it is useful to test the stylesheet in different scenarios.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    61 Views
  • How to install compiler that is native ARM but emits Intel instructions?

    Unsolved
    8
    0 Votes
    8 Posts
    958 Views
    D
    does anyone have any advice here?
  • Widgets (Drawn with QPaintEvent / QPainter) Randomly Stop Updating

    Unsolved
    4
    0 Votes
    4 Posts
    377 Views
    Axel SpoerlA
    I think it's worth to bite the bullet. If it's really a bug in Qt (which I actually doubt), it's fairly unlikely that it will be fixed in 5.15. That's different for Qt 6 though.
  • Got VNC platform plugin working on Qt 5

    vnc qt 5
    11
    1 Votes
    11 Posts
    19k Views
    M
    For those who find this via web search, the port can be set via a … drum roll … port=INTEGER parameter, as in #!/bin/sh export QT_QPA_PLATFORM=vnc:size=480x300:addr=127.0.0.1:port=$(expr 5900 + ${SCREEN:-1}) export QT_PLUGIN_PATH=/usr/lib/qt/plugins here="$(dirname "$0")" exec "${here}"/gui.real
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • how to make the tablewidget cost less time?

    Unsolved
    5
    0 Votes
    5 Posts
    462 Views
    S
    For a QTableWidget you have to create the widget for every cell in the table view. This can take quite some time (depending on the number of rows and columns). The QTableView manages the individual widgets for the cells differently. Simply speaking, it just shows the widgets that are visible and reuses them when scrolling. This is why QTableView is the better choice for a lot of data. However, you are saying that you have only 100 rows. If it is only a hand full of columns 2 seconds might be a little long (though 100 rows by 10 columns would already be 1000 widgets). Do you have a single call to the database to fetch the data? Or are you querying one row at a time?