Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • List placeholder

    Unsolved
    5
    0 Votes
    5 Posts
    476 Views
    Chris KawaC
    @equeim viewport() is a documented API, so it's not an implementation detail, but you're doing a lot of work that is not really needed. You can simply subclass the listview and draw the text there, e.g. void MyListView::paintEvent(QPaintEvent* evt) { QListView::paintEvent(evt); if (!model() || model()->rowCount() == 0) { QPainter p(viewport()); p.drawText(rect(), Qt::AlignCenter, "No items"); } }
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    26 Views
    No one has replied
  • Audio capabilities of Qt...? Musician not a coder...

    Unsolved
    2
    0 Votes
    2 Posts
    211 Views
    SGaistS
    Hi and welcome to devnet, The QtMultimedia module is rather geared towards playback and recording but nothing as advanced as what you are looking for. That said, it should support pcm playback. One application you could take a look at is kdenlive. It's a video editor that might contain some of the things you need.
  • Floating point exception (core dumped)

    Unsolved
    3
    0 Votes
    3 Posts
    383 Views
    T
    gdb --args ./flash_toolGNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git Copyright (C) 2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./flash_tool... (gdb) run Starting program: /home/torsar/Downloads/SP_Flash_Tool_Selector_exe_Linux_v1.2228.00.100/SP_Flash_Tool_V5/flash_tool This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.ubuntu.com Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. Downloading separate debug info for ./libflashtool.so Downloading separate debug info for ./libflashtoolEx.so Downloading separate debug info for ./libsla_challenge.so Downloading separate debug info for /lib/x86_64-linux-gnu/libstdc++.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libgcc_s.so.1 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Downloading separate debug info for /lib/x86_64-linux-gnu/libXrender.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libfontconfig.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libfreetype.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libz.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libXext.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libX11.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libgthread-2.0.so.0 Downloading separate debug info for /lib/x86_64-linux-gnu/libgthread-2.0.so.0 Downloading separate debug info for /lib/x86_64-linux-gnu/libglib-2.0.so.0 Downloading separate debug info for /home/torsar/Downloads/SP_Flash_Tool_Selector_exe_Linux_v1.2228.00.100/SP_Flash_Tool_V5/lib/libpng12.so.0 Downloading separate debug info for /lib/x86_64-linux-gnu/libgobject-2.0.so.0 Downloading separate debug info for /lib/x86_64-linux-gnu/libSM.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libICE.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libexpat.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libbz2.so.1.0 Downloading separate debug info for /lib/x86_64-linux-gnu/libpng16.so.16 Downloading separate debug info for /lib/x86_64-linux-gnu/libbrotlidec.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libbrotlidec.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libxcb.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libffi.so.8 Downloading separate debug info for /lib/x86_64-linux-gnu/libuuid.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libbsd.so.0 Downloading separate debug info for /lib/x86_64-linux-gnu/libbrotlicommon.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libXau.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libXdmcp.so.6 Downloading separate debug info for /lib/x86_64-linux-gnu/libmd.so.0 Downloading separate debug info for ./libflashtool.v1.so Downloading separate debug info for /lib/x86_64-linux-gnu/libXrandr.so.2 Downloading separate debug info for /lib/x86_64-linux-gnu/libXfixes.so Downloading separate debug info for /lib/x86_64-linux-gnu/libXcursor.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libXinerama.so.1 Downloading separate debug info for /lib/x86_64-linux-gnu/libXi.so sysname:Linux nodename:torsar-desktop release:6.8.0-55-generic version:#57-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 23:42:21 UTC 2025 machine:x86_64 domainame:(none) cur_kernel_version = 6.8.0 Program received signal SIGFPE, Arithmetic exception. 0x00007ffff371d568 in QFontEngineFT::averageCharWidth() const () from lib/libQtGui.so.4 (gdb) bt #0 0x00007ffff371d568 in QFontEngineFT::averageCharWidth() const () at lib/libQtGui.so.4 #1 0x00007ffff3648648 in ??? () at lib/libQtGui.so.4 #2 0x00007ffff365800a in QFontMetrics::averageCharWidth() const () at lib/libQtGui.so.4 #3 0x00007ffff3850c16 in ??? () at lib/libQtGui.so.4 #4 0x00007ffff38511e1 in QLabel::minimumSizeHint() const () at lib/libQtGui.so.4 #5 0x00007ffff3851293 in QLabel::sizeHint() const () at lib/libQtGui.so.4 #6 0x00007ffff343b2d0 in QWidgetItemV2::updateCacheIfNecessary() const () at lib/libQtGui.so.4 #7 0x00007ffff343b5ab in QWidgetItemV2::maximumSize() const () at lib/libQtGui.so.4 #8 0x00007ffff3414153 in ??? () at lib/libQtGui.so.4 #9 0x00007ffff341533a in QBoxLayout::maximumSize() const () at lib/libQtGui.so.4 #10 0x00007ffff3414153 in ??? () at lib/libQtGui.so.4 #11 0x00007ffff3415366 in QBoxLayout::minimumSize() const () at lib/libQtGui.so.4 #12 0x00007ffff342fd65 in ??? () at lib/libQtGui.so.4 #13 0x00007ffff3430835 in ??? () at lib/libQtGui.so.4 #14 0x00007ffff3430ae2 in ??? () at lib/libQtGui.so.4 #15 0x00007ffff3430b37 in QGridLayout::sizeHint() const () at lib/libQtGui.so.4 #16 0x00007ffff3436dc2 in QLayout::totalSizeHint() const () at lib/libQtGui.so.4 #17 0x00007ffff344ec30 in QWidget::sizeHint() const () at lib/libQtGui.so.4 #18 0x00007ffff384af34 in QFrame::sizeHint() const () at lib/libQtGui.so.4 #19 0x00007ffff343b2d0 in QWidgetItemV2::updateCacheIfNecessary() const () at lib/libQtGui.so.4 #20 0x00007ffff343b60b in QWidgetItemV2::minimumSize() const () at lib/libQtGui.so.4 #21 0x00007ffff342fd65 in ??? () at lib/libQtGui.so.4 #22 0x00007ffff3430835 in ??? () at lib/libQtGui.so.4 #23 0x00007ffff3430ae2 in ??? () at lib/libQtGui.so.4 #24 0x00007ffff3430b37 in QGridLayout::sizeHint() const () at lib/libQtGui.so.4 #25 0x00007ffff3436dc2 in QLayout::totalSizeHint() const () at lib/libQtGui.so.4 #26 0x00007ffff344ec30 in QWidget::sizeHint() const () at lib/libQtGui.so.4 #27 0x00007ffff343b2d0 in QWidgetItemV2::updateCacheIfNecessary() const () at lib/libQtGui.so.4 #28 0x00007ffff343b60b in QWidgetItemV2::minimumSize() const () at lib/libQtGui.so.4 #29 0x00007ffff342fd65 in ??? () at lib/libQtGui.so.4 #30 0x00007ffff3430835 in ??? () at lib/libQtGui.so.4 #31 0x00007ffff3430912 in ??? () at lib/libQtGui.so.4 #32 0x00007ffff3430967 in QGridLayout::minimumSize() const () at lib/libQtGui.so.4 #33 0x00007ffff342fd65 in ??? () at lib/libQtGui.so.4 #34 0x00007ffff3430835 in ??? () at lib/libQtGui.so.4 #35 0x00007ffff3430912 in ??? () at lib/libQtGui.so.4 #36 0x00007ffff3430967 in QGridLayout::minimumSize() const () at lib/libQtGui.so.4 #37 0x00007ffff3436f9a in QLayout::totalMinimumSize() const () at lib/libQtGui.so.4 #38 0x00007ffff344ebf0 in QWidget::minimumSizeHint() const () at lib/libQtGui.so.4 #39 0x00007ffff3439263 in qSmartMinSize(QWidget const*) () at lib/libQtGui.so.4 #40 0x00007ffff3444cfa in QStackedLayout::minimumSize() const () at lib/libQtGui.so.4 #41 0x00007ffff3436f9a in QLayout::totalMinimumSize() const () at lib/libQtGui.so.4 #42 0x00007ffff344ebf0 in QWidget::minimumSizeHint() const () at lib/libQtGui.so.4 #43 0x00007ffff3439263 in qSmartMinSize(QWidget const*) () at lib/libQtGui.so.4 --Type <RET> for more, q to quit, c to continue without paging--c #44 0x00007ffff38ae03b in ??? () at lib/libQtGui.so.4 #45 0x00007ffff38af711 in ??? () at lib/libQtGui.so.4 #46 0x00000000004953d4 in Ui_OptionDialog::setupUi(QDialog*) () #47 0x00000000004879a6 in OptionDialog::OptionDialog(QWidget*, MainWindow*) () #48 0x000000000045005f in MainWindow::MainWindow(QWidget*) () #49 0x000000000041eabf in main ()
  • TLS Initialization Failed on MacOS in Deployed Application

    Unsolved
    10
    0 Votes
    10 Posts
    745 Views
    jeremy_kJ
    @imikejackson said in TLS Initialization Failed on MacOS in Deployed Application: I guess it would be handy to know exactly which OpenSSL library is trying to be loaded via DLOpen(). The environment variable QT_DEBUG_PLUGINS is a good first step for debugging any dynamic library use by Qt-using applications. I ran a quick test program with TLS support on a mac, and found the output to be under-informative. It's still my first suggestion. Setting DYLD_PRINT_SEARCHING resulted in more useful information, for this case, about attempts to locate libssl and others. For example: dyld[24496]: find path "/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib" dyld[24496]: possible path(original path): "/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib" dyld[24496]: found: dylib-from-disk: "/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib" The man -S 1 dyld suggests several other environment variables to try.
  • Qt Quick with cmake fails on Linux

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    S
    I also encountered this message and found very little online, just wanted to share some links for future readers in case it saves them some time. It was quite strange since the documentation for qt_generate_deploy_app_script states This command was introduced in Qt 6.3.. IMHO the version here should be 6.5, since the command was released in preview mode during 6.3 and 6.4 with limited support and a changing interface It looks like the call to find_package in OPs cmake requests Qt 6.4, and from what I can tell qt_generate_deploy_app_script added support for the OUTPUT_SCRIPT parameter in QtCore 6.5. qt_generate_deploy_app_script was in preview mode during Qt 6.4, and only supported Windows and OSX. https://doc.qt.io/archives/qt-6.4/qt-generate-deploy-app-script.html If you're on either of those platforms and want to use Qt 6.4, you might try the FILENAME_VARIABLE instead. I can't speak from experience using this on 6.4 since I'm on Linux. I installed Qt on Ubuntu 24.04 with sudo apt install qt6-base-dev which provided Qt 6.4.2. You can check the Qt version cmake found with the Qt6Core_VERSION variable. message(STATUS "Found Qt6: ${Qt6Core_VERSION}") Qt 6.5 however supports Windows / Mac / Linux and the OUTPUT_SCRIPT parameter. https://doc.qt.io/qt-6.5/qt-generate-deploy-app-script.html
  • macdeployqt: How to include extra libraries

    Unsolved
    3
    0 Votes
    3 Posts
    331 Views
    I
    I build on MacOS 13 and 14 (latest of each) using the latest Xcode for each of those respective systems. Here is the help for macdeployqt. I'm using Qt 6.6, 6.7 and 6.8 for testing. The logic inside of macdeployqt (and the others for the other operating systems) starts with the executable inside the .app package which it draws is dependencies from. Adds in some bits for Qt's own plugins (based on which Qt libraries the executable is linked to. That leaves your own custom plugins out-in-the-cold. 1085:[mjackson@octane:packaging]% /Users/Shared/NX_SDK/Qt/6.7.3/macos/bin/macdeployqt --help Usage: macdeployqt app-bundle [options] Options: -verbose=<0-3> : 0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug -no-plugins : Skip plugin deployment -dmg : Create a .dmg disk image -no-strip : Don't run 'strip' on the binaries -use-debug-libs : Deploy with debug versions of frameworks and plugins (implies -no-strip) -executable=<path> : Let the given executable use the deployed frameworks too -qmldir=<path> : Scan for QML imports in the given path -qmlimport=<path> : Add the given path to the QML module search locations -always-overwrite : Copy files even if the target file exists -codesign=<ident> : Run codesign with the given identity on all executables -hardened-runtime : Enable Hardened Runtime when code signing -timestamp : Include a secure timestamp when code signing (requires internet connection) -sign-for-notarization=<ident>: Activate the necessary options for notarization (requires internet connection) -appstore-compliant : Skip deployment of components that use private API -libpath=<path> : Add the given path to the library search path -fs=<filesystem> : Set the filesystem used for the .dmg disk image (defaults to HFS+) macdeployqt takes an application bundle as input and makes it self-contained by copying in the Qt frameworks and plugins that the application uses. Plugins related to a framework are copied in with the framework. The accessibility, image formats, and text codec plugins are always copied, unless "-no-plugins" is specified. Qt plugins may use private API and will cause the app to be rejected from the Mac App store. MacDeployQt will print a warning when known incompatible plugins are deployed. Use -appstore-compliant to skip these plugins. Currently two SQL plugins are known to be incompatible: qsqlodbc and qsqlpsql. See the "Deploying Applications on OS X" topic in the documentation for more information about deployment on OS X.
  • QtableWidget header background color

    Solved
    4
    0 Votes
    4 Posts
    337 Views
    A
    Solution is here : self.tableWidget.setStyleSheet("""QTableCornerButton::section { background-color: 'transparent'}""") self.tableWidget.setCornerButtonEnabled(False) thanks again @JonB
  • Missing touch events in QWidget

    Unsolved
    4
    0 Votes
    4 Posts
    483 Views
    E
    After further testing, I don't think this is a hardware issue. Most of the time, this happens (the remaining touch is lost after the second finger touch is released), but it doesn't happen every time. What I can see is that every time it does happen, the still touching finger reports "Stationary" in the same event as the initially released finger is brought back to touching the screen. I.e., the final two lines in the log: 2 QEventPoint::Pressed 1 QEventPoint::Stationary Every time the remaining finger is NOT lost, the second line there reported "Updated" or "Released" depending on how fast I was with lifting the finger. Is there something in the Qt touch event handler that might cause this problem only when the touch point for the second finger is reported as "Stationary" in the same event as the first finger is reported as "Pressed"?
  • QFileDialog::DontConfirmOverwrite doesn't seem to work

    Unsolved
    4
    0 Votes
    4 Posts
    326 Views
    JonBJ
    @gabello306 So the implication is: By default it's using your native windowing system and I presume either that does not support the "suppress overwrite" warning or the Qt call to it is not right. I don't know which. If you use DontUseNativeDialog that uses Qt code and correctly suppresses the warning. But the style will be quite different from the native dialog. You don't like it, and I don't know how much you can restyle it. It won't look the same as the native one.
  • Horizontal text in QTabWidget

    Solved
    25
    0 Votes
    25 Posts
    16k Views
    SGaistS
    Hi, Please provide a minimal runnable script that shows your issue.
  • ssl handshake failed in ubuntu

    Unsolved
    6
    0 Votes
    6 Posts
    513 Views
    SGaistS
    Hi, The version of Qt Creator (and the Qt it was built with) has nothing to do with the Qt version you are currently using. Note that if you use a recent version of a Linux distribution you will likely get a more recent version of Qt 5.15 so you would be better off using that one to develop your application.
  • Passing data to a new window class.

    Moved Solved
    6
    0 Votes
    6 Posts
    550 Views
    D
    @Pl45m4 Thank you for your feedback. I will give it a try.
  • Qt msvc doesn't work for C++ or Python

    Unsolved
    3
    0 Votes
    3 Posts
    473 Views
    D
    @jsulm Full error message: C:\Users\dot\PycharmProjects\Bujo\venv\Scripts\python.exe C:/Users/dot/PycharmProjects/Bujo/main.py Traceback (most recent call last): File "C:\Users\dot\PycharmProjects\Bujo\main.py", line 2, in <module> from PyQt6.QtWebEngineWidgets import QWebEngineView ImportError: DLL load failed while importing QtWebEngineWidgets: Can't find procedure Process finished with exit code 1 I use msvc to build. Pycharm has venv that I installed a day before I wrote here. After installing MS VStudio I noticed that it didn't add anythin to win env vars Path so I added manualy: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx86\x64
  • #ifdef QT_DEBUG always true

    Solved
    7
    0 Votes
    7 Posts
    648 Views
    S
    @Axel-Spoerl Thank you for your feedback! I understand the importance of properly quoting and linking sources, and I'll make sure to follow this guideline in the future. Regarding code formatting, I appreciate the suggestion. I'will use the correct formatting to make my code snippets clearer and more readable for everyone. Thanks again for the guidance
  • getSingletonInstance() for singletons in QML

    Unsolved
    2
    0 Votes
    2 Posts
    194 Views
    S
    The function getSingletonInstance() is not a built-in Qt function. It is likely a custom function that the code author created to provide a singleton instance of the SingletonForeign class. A singleton is a design pattern that ensures that a class has only one instance and provides a global point of access to that instance. The getSingletonInstance() function in this context is probably used to retrieve or create the single instance of the SingletonForeign class. Here’s an example of how you can define the getSingletonInstance() function for a singleton class: Step 1: Define the SingletonForeign class class SingletonForeign { public: static SingletonForeign* getSingletonInstance() { if (s_singletonInstance == nullptr) { s_singletonInstance = new SingletonForeign(); } return s_singletonInstance; } static void cleanup() { delete s_singletonInstance; s_singletonInstance = nullptr; } private: SingletonForeign() {} // Static member to hold the single instance static SingletonForeign* s_singletonInstance; }; SingletonForeign* SingletonForeign::s_singletonInstance = nullptr; Step 2: Use the getSingletonInstance() method in your main code In your case, you would use getSingletonInstance() to get the singleton instance of SingletonForeign: SingletonForeign::s_singletonInstance = SingletonForeign::getSingletonInstance(); QQmlApplicationEngine engine; engine.loadFromModule("MyModule", "Main");
  • Visual artifact on QListWidget, underline appears below the first selectable item

    Unsolved
    3
    0 Votes
    3 Posts
    263 Views
    L
    @Axel-Spoerl Arch Linux, and Qt version 6.8.2
  • 0 Votes
    15 Posts
    1k Views
    C
    @nicker-player said in how to read and wtrite the xls and xlsx files on the qt?are there any libs that could support these formats of files: QAxBase::setControl: requested control Excel.Application could not be instantiated Is Excel installed on the machine you are running this on?
  • Qt 5.9.7 compilation with support for OpenSSL3.x

    Unsolved
    6
    0 Votes
    6 Posts
    586 Views
    SGaistS
    Hi, This bug report to a gist that explains what to do. Note that this is for 5.15 further ajustements might be needed since your are on 5.9.
  • 0 Votes
    1 Posts
    204 Views
    No one has replied