Skip to content

General and Desktop

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

    Pinned Locked spam
    29
    3 Votes
    29 Posts
    30k 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.
  • Qt App Preferences Being Restored From A Cached Copy? (QSettings)

    Unsolved
    4
    0 Votes
    4 Posts
    26 Views
    S
    One more observation -- I put a quick look in QSettings.fileName(), and it's the usual preferences plist which is NOT on disk!?! (verified in terminal, not just finder).
  • Can not catch XCB_VISIBILITY_NOTIFY event in Qt6

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • QSoundEffect device selection

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • Concept for analyze several XML messages, sometimes incomplete.

    Unsolved
    3
    0 Votes
    3 Posts
    19 Views
    R
    @SGaist said in Concept for analyze several XML messages, sometimes incomplete.: cumulate the data in a buffer until you have a full message extract the message from the buffer OK, Do you have a good sample?
  • Migrating from QMake to CMake UNICODE definition issue

    Unsolved
    3
    0 Votes
    3 Posts
    32 Views
    Christian EhrlicherC
    -DUNICODE for sure comes from Qt as it was compiled with this switch. Fix your header to not rely on this.
  • Bounding size of QTableView to parent widget

    Unsolved
    8
    0 Votes
    8 Posts
    191 Views
    Christian EhrlicherC
    @vivaat said in Bounding size of QTableView to parent widget: But is it possible to limit such a behavior? Maybe by overriding the mouseMove event.
  • Throwing from QFuture::onFailed()

    Unsolved
    3
    0 Votes
    3 Posts
    37 Views
    A
    "Throwing an exception from a slot invoked by Qt's signal-slot connection mechanism is considered undefined behaviour, unless it is handled within the slot:" See https://doc.qt.io/qt-6/exceptionsafety.html
  • undefined reference errors using QtMultimedia in qt 6.8.3 c++

    Solved
    8
    0 Votes
    8 Posts
    200 Views
    A
    Thanks for the answers. I figured it out for the cmake build system. For anyone who stumbles across a similar problem. I had to edit three lines in CMakeLists.txt, i.e., essentially add the keyword "Multimedia" to them: find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Multimedia) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Multimedia) target_link_libraries(Countdown PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Multimedia) After that compiler and linker do find the corresponding files.
  • MacOS system tray issue

    Unsolved
    6
    0 Votes
    6 Posts
    539 Views
    A
    Hello @Leon.xuan, sorry for long pause. No, I did not solve it, so I moved my system tray menu into Dock-menu -> no problems left.
  • 0 Votes
    8 Posts
    305 Views
    U
    You can use my logic of making rounded corners QWidget: #include "RoundedBox.h" #include <QPainter> #include <QPainterPath> #include <QBitmap> #include <QFontMetrics> RoundedBox::RoundedBox(const QString &txt, QWidget *parent) : QWidget(nullptr), isDarkMode(false), text(txt), useAsToolTip(false) { setWindowFlags(Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint); setAttribute(Qt::WA_TranslucentBackground); setAsToolTip(false); } void RoundedBox::enableDarkMode(bool value) { isDarkMode = value; } void RoundedBox::setAsToolTip(bool value) { useAsToolTip = value; if (useAsToolTip) { setWindowFlag(Qt::ToolTip); updateSizeForText(); } else { setWindowFlag(Qt::Popup); } update(); } void RoundedBox::updateSizeForText() { resize(sizeHint()); } QSize RoundedBox::sizeHint() const { QFont font; font.setPointSize(9); font.setFamily("Segoe UI"); QFontMetrics fm(font); int MAX_W = 400; QSize s = fm.boundingRect(0, 0, MAX_W, 0, Qt::TextWordWrap, text).size(); return QSize(s.width() + 24, s.height() + 12); } void RoundedBox::paintEvent(QPaintEvent *event) { Q_UNUSED(event); // Rounded mask QBitmap bitmap(width(), height()); bitmap.fill(Qt::color0); QPainter maskPainter(&bitmap); maskPainter.setRenderHints(QPainter::Antialiasing); QPainterPath maskPath; maskPath.addRoundedRect(rect(), 6, 6); maskPainter.fillPath(maskPath, Qt::color1); setMask(bitmap); // Colors QColor BG = isDarkMode ? QColor("#2D2D2D") : QColor("#FFFFFF"); QColor BR = isDarkMode ? QColor("#4D4D4D") : QColor("#BDBDBD"); QPainter painter(this); painter.setRenderHints(QPainter::Antialiasing); painter.setBrush(BG); QPen pen(BR); pen.setWidth(1); painter.setPen(pen); QPainterPath path; path.addRoundedRect(rect().adjusted(1.5, 1.5, -1.5, -1.5), 6, 6); painter.drawPath(path); // Text if (useAsToolTip) { QFont font; font.setPointSize(9); font.setFamily("Segoe UI"); painter.setFont(font); painter.setPen(isDarkMode ? QColor("#F0F0F0") : QColor("#000000")); QRect text_area(12, 0, width() - 24, height()); painter.drawText(text_area, Qt::AlignCenter | Qt::TextWordWrap, text); } }
  • Combo box (or equivalent) - "one click" behavior

    Unsolved
    9
    0 Votes
    9 Posts
    234 Views
    jeremy_kJ
    @gbettega said in Combo box (or equivalent) - "one click" behavior: One of the authors also explains how the drop down is immediately hidden after a mouse release event (as in your case), but at the end no conclusive solution exposed to the word. This went off in a tangent that I didn't expect. The intent was move from abstract discussion into a brief code example that cab be tested, and discussed in more concrete terms suggest looking at the implemented item view functionality before overriding lower level mechanisms Yes, the CurrentChanged edit trigger can have unexpected behavior. SelectedClicked is probably easier to work with. That takes one to two clicks (one to select a cell, one to edit the selection) to display the combo box popup, and doesn't appear to have the unintended popup close behavior. Sometimes it fails to create the editor, possibly when interpreting the second click on the newly selected cell as a double click.
  • QMediaPlayer with a video with audio codec mp2 (mp3float) causes major loud distortion

    Unsolved
    2
    0 Votes
    2 Posts
    45 Views
    D
    Also: A problem on both MacOS and Arch Linux.
  • qt-designer options greyed out

    Unsolved
    1
    0 Votes
    1 Posts
    33 Views
    No one has replied
  • QMediaPlayer in 6.6.3

    Unsolved
    2
    0 Votes
    2 Posts
    57 Views
    SGaistS
    Hi and welcome to devnet, Do you expérience the same if you use ffmpeg directly ?
  • Windows deployment extra files

    Unsolved windeployqt deployment
    4
    0 Votes
    4 Posts
    91 Views
    Z
    My app is translatable to a single language so far, not 31 as qtdeployer suggests. Anyway no options to skip collecting all available dlls "just in case" to deploy folder are available in documentations.
  • Can't run a project downloaded from GitHub

    Solved
    3
    0 Votes
    3 Posts
    98 Views
    G
    @Christian-Ehrlicher Thank you. It's fixed.
  • Is it possible to have duplicate in QSet/Hash ?

    Solved qset qhash duplicate
    7
    0 Votes
    7 Posts
    107 Views
    A
    To be honnest, looking more deeply in Qhash than i'v done before, it appered that it was the perfect tool for a bit later. Once my thing is working and I have fixed my own mess, I'll take a look at improving what mess have been made before me.
  • General architectural questions

    Unsolved
    8
    0 Votes
    8 Posts
    280 Views
    JoeCFDJ
    @SGaist It is true. I guess few people would like to do that. We have MQTT, but do not use QMqtt module. There are other ways to implement mqtt with Qt.
  • Where to find qt-opensource-windows-x64-5.15.2.exe for Windows 7?

    Moved Solved
    5
    0 Votes
    5 Posts
    136 Views
    SGaistS
    @garlicbox as already written: the offline installers have not been available for open source users since before 5.15.2. So no.