Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Reporting inappropriate content on the forums

    Pinned Locked spam
    29
    3 Votes
    29 Posts
    34k Views
    A
    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.
  • license

    Unsolved
    2
    0 Votes
    2 Posts
    20 Views
    P
    Here's the starting point: https://www.qt.io/qt-licensing "Every person using Qt needs to comply with either Open Source License (GPL and LGPL) or Qt Commercial License".
  • qt unit test build error: The "XmlPeek" task failed unexpectedly

    Unsolved
    1
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • Qt6 CMake qt_add_resources with LANG why does order matter ?

    Unsolved
    5
    0 Votes
    5 Posts
    94 Views
    F
    @SGaist Yes of course, I've put a minimal compilable project to reproduce the issue on github: qt_cmake_localized_resources_issue
  • QTextDocument don't print images with QPrinter

    Unsolved qtextdocument textarea qimage richtext qprinter
    1
    0 Votes
    1 Posts
    25 Views
    No one has replied
  • python script integration with QT Desktop software

    Unsolved
    5
    0 Votes
    5 Posts
    81 Views
    S
    @JonB I found a good solution: pythonqt https://github.com/MeVisLab/pythonqt
  • How to preserve QScrollArea scrollbar position when window is maximized and restored?

    Unsolved
    4
    0 Votes
    4 Posts
    86 Views
    Z
    Use signal for parent of QScrollArea: windowStateChanged(Qt::WindowState windowState) and save/restore parameters for QScrollArea
  • cmake install of Qt build does not install debug artifacts

    Solved
    3
    0 Votes
    3 Posts
    297 Views
    A
    Having just come across this specific problem, it should be mentioned in the documentation here: https://doc.qt.io/qt-6/windows-building.html And if there's a cmake command line equivalent, then definitely here where the "-debug-and-release" is called out. https://doc.qt.io/qt-6/configure-options.html
  • How do I check for Shift + Tab?

    Unsolved
    9
    0 Votes
    9 Posts
    166 Views
    SGaistS
    It's not a mapping from multiple keys to one. These are just special values for that specific enum that will end up creating the sequence corresponding to the right platform specific version of the short-cut.
  • Does QPrintDialog open the system print dialog?

    Unsolved qprintdialog native dialog
    4
    0 Votes
    4 Posts
    1k Views
    RokeJulianLockhartR
    @stevej, see post/529035: On Windows and macOS, the native print dialog is used, which means that some QWidget and QDialog properties set on the dialog won't be respected. I can confirm on Linux that it utilises its own modal. I don't believe that a portal exists for this yet.
  • 0 Votes
    5 Posts
    218 Views
    Pl45m4P
    @johnzhou721 said in How Should One Register Standard QActions in the Menu Bar to Perform the Appropriate Action?: are those edit actions usually not present if there’s multiple line edits then? The shortcut is pretty much the same as pressing Ctrl + X. What else do you want to "cut"? If there is nothing to which you can apply "cut", nothing happens. Same as if you just press Ctrl + X without selecting some file/text.
  • Include large resources using Visual Studio?

    Unsolved
    3
    0 Votes
    3 Posts
    79 Views
    T
    @Christian-Ehrlicher QT VS Tools is automatically including .qrc files, so I'm not using qt_add_resources. Also, I'm not using CMAKE.
  • Signal QLowEnergyController::connected/disconnected is not emitted in Qt 6.7

    Unsolved
    5
    0 Votes
    5 Posts
    358 Views
    A
    I've encountered the same. But this time on iOS, whereby the stateChanged signal stays stuck in ConnectedState, even if the central device disconnects.
  • Don't play mp3

    Solved
    12
    0 Votes
    12 Posts
    256 Views
    M
    it's work with vlc #pragma once #include <QObject> #include <vlc/vlc.h> #include <QString> #include <QUrl> #include <QTimer> class VlcAudioPlayer : public QObject { Q_OBJECT public: explicit VlcAudioPlayer(QObject* parent = nullptr); ~VlcAudioPlayer(); // Запустить воспроизведение аудиофайла по локальному пути bool play(const QString& filePath); // Остановить воспроизведение void stop(); // Проверить, играет ли сейчас аудио bool isPlaying() const; signals: void started(); void stopped(); void finished(); private slots: void checkPlayback(); private: libvlc_instance_t* m_instance = nullptr; libvlc_media_player_t* m_mediaPlayer = nullptr; QTimer m_timer; }; #include "VlcAudioPlayer.h" #include <QDebug> VlcAudioPlayer::VlcAudioPlayer(QObject* parent) : QObject(parent) { const char* args[] = { "--no-xlib" }; m_instance = libvlc_new(1, args); if (!m_instance) { qWarning() << "Failed to create libVLC instance"; } m_mediaPlayer = nullptr; // Таймер для проверки состояния воспроизведения connect(&m_timer, &QTimer::timeout, this, &VlcAudioPlayer::checkPlayback); m_timer.setInterval(200); // проверять каждые 200 мс } VlcAudioPlayer::~VlcAudioPlayer() { if (m_mediaPlayer) { libvlc_media_player_stop(m_mediaPlayer); libvlc_media_player_release(m_mediaPlayer); } if (m_instance) { libvlc_release(m_instance); } } bool VlcAudioPlayer::play(const QString& filePath) { if (!m_instance) { qWarning() << "libVLC instance is null"; return false; } // Если уже играет, остановим if (isPlaying()) { stop(); } // Преобразуем путь в URI QUrl url = QUrl::fromLocalFile(filePath); QString uri = url.toString(); libvlc_media_t* media = libvlc_media_new_location(m_instance, uri.toUtf8().constData()); if (!media) { qWarning() << "Failed to create media from URI:" << uri; return false; } if (m_mediaPlayer) { libvlc_media_player_stop(m_mediaPlayer); libvlc_media_player_release(m_mediaPlayer); m_mediaPlayer = nullptr; } m_mediaPlayer = libvlc_media_player_new_from_media(media); libvlc_media_release(media); if (!m_mediaPlayer) { qWarning() << "Failed to create media player"; return false; } if (libvlc_media_player_play(m_mediaPlayer) != 0) { qWarning() << "Failed to start playback"; libvlc_media_player_release(m_mediaPlayer); m_mediaPlayer = nullptr; return false; } emit started(); m_timer.start(); return true; } void VlcAudioPlayer::stop() { if (m_mediaPlayer && isPlaying()) { libvlc_media_player_stop(m_mediaPlayer); emit stopped(); } m_timer.stop(); } bool VlcAudioPlayer::isPlaying() const { if (!m_mediaPlayer) return false; return libvlc_media_player_is_playing(m_mediaPlayer) != 0; } void VlcAudioPlayer::checkPlayback() { if (!m_mediaPlayer) { m_timer.stop(); return; } if (!isPlaying()) { m_timer.stop(); emit finished(); } }
  • Using ASM (x86) with Qt on MacOS with CMake. How?

    Unsolved
    2
    0 Votes
    2 Posts
    69 Views
    I
    @bogong said in Using ASM (x86) with Qt on MacOS with CMake. How?: What is missing by me? That the error messages imply that you try to use x86 assembly but your compilation is targeting arm64 (hence the assembler's complaints about the eax register not existing; and you getting offered ARM mnemonics like movz, probably in response to you trying to use the movl mnemonic which is x86 only). Make sure you target only x86_64 in your build (in CMake, you have CMAKE_OSX_ARCHITECTURES). Or if you want to target ARM, you need to use ARM assembly code which is completely different to x86 assembly. If you are building universal binaries, then you need to write a different version of the inline assembly block for each architecture, and direct to the correct one with preprocessor macros. May I ask why you think you need inline assembly? There is quite possibly an easier approach.
  • Segmentation fault when exiting when linked against Qt 6.9.1

    Solved
    36
    0 Votes
    36 Posts
    3k Views
    Axel SpoerlA
    Thanks @JonB for notifying! The dock widget implementation has some obvious limitations, like e.g. permissions: You can limit allowed main window dock areas, but not the permission to dock on a floating dock. You can’t merge floating docks. That said, we’ll have to take a deeper look and come up with a solid concept for a quick control equivalent. My guess is a year or so. I’ll update this thread in case we have a Jira ticket for input and discussion. In the meanwhile feel free to post ideas here!
  • QVulkanWindow freezes until swapchain recreation on macOS

    Unsolved
    2
    0 Votes
    2 Posts
    138 Views
    C
    Bump... Still an issue for me as well.
  • How to set colors for LineSeries in QtGraphs using C++

    Unsolved
    1
    0 Votes
    1 Posts
    35 Views
    No one has replied
  • 0 Votes
    5 Posts
    186 Views
    EndrII 0E
    thanks, @GrecKo You sent issue is matched with my.
  • QVulkanWindow freezes until window resize on macOS only

    Unsolved
    5
    1 Votes
    5 Posts
    449 Views
    C
    I am experiencing the same issue.. Did you ever find a way to make it work?