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.
  • QListWidget with checkboxes - checking more than one row at a time

    Unsolved
    2
    0 Votes
    2 Posts
    32 Views
    Kent-DorfmanK
    You don't mention the mouse/keyboard sequence you use to attempt multi-select. so, as remedial as it sounds, that is my first question.
  • Getting "qt.qpa.mime: Retrying to obtain clipboard" in the console output

    Unsolved
    1
    0 Votes
    1 Posts
    22 Views
    No one has replied
  • QGraphicsView::mousePressEvent not triggering

    Unsolved
    6
    0 Votes
    6 Posts
    64 Views
    JonBJ
    @james-b-s I don't know whether or why this would differ from Windows to some Linux window manager, or whether there is anything different in the Qt implementation, but maybe in Linux WM the mouse release event is going to the context menu?
  • qt unit test build error: The "XmlPeek" task failed unexpectedly

    Unsolved
    2
    0 Votes
    2 Posts
    29 Views
    SGaistS
    Hi, Does your test contain any actual code ? If so, try to empty it to see if it is still failing.
  • Trying to load a frame of widgets using a shared pointer

    Unsolved
    2
    0 Votes
    2 Posts
    36 Views
    Christian EhrlicherC
    @leinad said in Trying to load a frame of widgets using a shared pointer: Would you know how I can fix this Pass the nacked pointer with .get() and wonder why it crashes as soon as your shared pointer goes out of scope. in other words - don't use a shared pointer for QObjects.
  • How C++ 20 Setup for Qt creator ?

    Solved
    3
    0 Votes
    3 Posts
    44 Views
    DervishD
    @cristian-adam Thanks, it works. Sorry I am new to all this.
  • license

    Unsolved
    2
    0 Votes
    2 Posts
    40 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".
  • Qt6 CMake qt_add_resources with LANG why does order matter ?

    Unsolved
    5
    0 Votes
    5 Posts
    117 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
    35 Views
    No one has replied
  • python script integration with QT Desktop software

    Unsolved
    5
    0 Votes
    5 Posts
    97 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
    97 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
    302 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
    189 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
    230 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
    88 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
    367 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
    272 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
    75 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.