Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.6k Posts
  • Issue with Qt6 QML Module Target Path and CMake Warning

    Unsolved
    1
    0 Votes
    1 Posts
    55 Views
    No one has replied
  • Getting "qt.qpa.mime: Retrying to obtain clipboard" in the console output

    Unsolved
    2
    0 Votes
    2 Posts
    58 Views
    jeremy_kJ
    There are a few open bug reports that might be relevant. https://bugreports.qt.io/browse/QTBUG-130316 https://bugreports.qt.io/browse/QTBUG-97930
  • QListWidget with checkboxes - checking more than one row at a time

    Unsolved
    14
    0 Votes
    14 Posts
    236 Views
    jeremy_kJ
    @Jackmill said in QListWidget with checkboxes - checking more than one row at a time: @jeremy_k said in QListWidget with checkboxes - checking more than one row at a time: A flag or list of indexes to be modified could accomplish the same goal while leaving view management intact. How might I do this? I'm having trouble thinking of a way to call setData without causing an endless loop. void onDataChanged(const QModelIndex topLeft, const QModelIndex bottomRight, const QList<int> &roles) { static bool updating = false; if (roles.contains(ItemDataRole::CheckStateRole) && !updating) { updating = true; auto value = topLeft.data(ItemDataRole::CheckStateRole); for (auto index : selectionModel.selectedIndexes()) model->setData(index, ItemDataRole::CheckStateRole, value); updating = false; } } The code could also disconnect this (and only this) slot from the signal prior to the loop, and reconnect it at the end.
  • Qt OPC UA callMethod

    Unsolved
    1
    0 Votes
    1 Posts
    36 Views
    No one has replied
  • Install third party shared libraries with QT's cmake deployment API

    Unsolved
    1
    0 Votes
    1 Posts
    37 Views
    No one has replied
  • qt unit test build error: The "XmlPeek" task failed unexpectedly

    Unsolved
    2
    0 Votes
    2 Posts
    54 Views
    SGaistS
    Hi, Does your test contain any actual code ? If so, try to empty it to see if it is still failing.
  • How C++ 20 Setup for Qt creator ?

    Solved
    3
    0 Votes
    3 Posts
    88 Views
    DervishD
    @cristian-adam Thanks, it works. Sorry I am new to all this.
  • Qt6 CMake qt_add_resources with LANG why does order matter ?

    Unsolved
    5
    0 Votes
    5 Posts
    159 Views
    F
    @SGaist Yes of course, I've put a minimal compilable project to reproduce the issue on github: qt_cmake_localized_resources_issue
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    36 Views
    No one has replied
  • python script integration with QT Desktop software

    Unsolved
    5
    0 Votes
    5 Posts
    138 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
    125 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
    309 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
    265 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
    353 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
    121 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
    376 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
    311 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(); } }
  • 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
    148 Views
    C
    Bump... Still an issue for me as well.