Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 3 Votes
    29 Posts
    34k Views
    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.
  • QScatterSeries + QChartView scaling issue

    Solved 3 days ago
    0 Votes
    2 Posts
    29 Views
    Maybe there is a more elegant solution out there but after some more digging I ended up implementing a simple min/max call here for each axis which is working fine. //Axis margins int x = 5; int y = 5; //X axis margin axisX->setMin(axisX->min().addDays(-x)); axisX->setMax(axisX->max().addDays(x)); //Y axis margin axisY->setMin(axisY->min()-y); axisY->setMax(axisY->max()+y);
  • How do I check for Shift + Tab?

    Unsolved about 4 hours ago
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • 0 Votes
    5 Posts
    34 Views
    @bobthebuilder said in Qt::BlockingQueuedConnection not blocking, according to thread sanitizer: Is there a chance this is a false positive with LLVM's thread sanitizer? That's possible. I created a complete* example from the second snippet above, which behaves correctly in ad hoc testing. It would be interested to know if tsan also complains about it. #include <QCoreApplication> #include <QTimer> #include <QThread> #include <QDebug> #include <chrono> auto copySleep = std::chrono::milliseconds(100); auto genSleep = std::chrono::milliseconds(1); class WorkerObject: public QObject { Q_OBJECT public slots: void processData() { static unsigned int index = 0; qDebug() << "create start " << ++index; emit dataCreated(index); qDebug() << "create end " << index; } signals: void dataCreated(unsigned int index); }; class MainWidget: public QObject { Q_OBJECT public: QThread m_worker_thread; WorkerObject m_worker_object; QTimer t; MainWidget() { m_worker_object.moveToThread(&m_worker_thread); t.setInterval(genSleep); t.start(); t.callOnTimeout(&m_worker_object, &WorkerObject::processData); QObject::connect(&m_worker_object, &WorkerObject::dataCreated, this, &MainWidget::copyData, Qt::BlockingQueuedConnection); m_worker_thread.start(); } public slots: void copyData(unsigned int index) { qDebug() << " copy start" << index; QThread::sleep(copySleep); qDebug() << " copy end " << index; } }; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); MainWidget mw; return a.exec(); } #include "main.moc" * Minus standard Qt development environment and project file
  • 0 Votes
    1 Posts
    17 Views
    No one has replied
  • How to create delegates that are always editable?

    Unsolved 11 days ago
    0 Votes
    6 Posts
    105 Views
    It still means that you will have a hundred of widgets at least depending on how you implement your editor opened all the time. That still burns resources for not much benefit.
  • 0 Votes
    2 Posts
    33 Views
    Hi, You should provide a minimal reproducer example so people will be able to try on their machine. Qt version as well as OS should be provided.
  • 0 Votes
    2 Posts
    28 Views
    Hi, What type of "QWidget" are you using? Is that - "QMdiSubWindow" ?
  • 0 Votes
    4 Posts
    53 Views
    Great ! Since you have it working now, please mark the thread as solved using the "Topic Tool" button or the three dotted menu beside the answer you deem correct so other forum users may know a solution has been found :-)
  • Don't play mp3

    Unsolved 2 days ago
    0 Votes
    5 Posts
    145 Views
    try the following to see if it works or not QT_MEDIA_BACKEND=gstreamer ./your_application I guess you are using Qt6 and its default backend is FFmpeg. And check if you have installed FFmpeg. Multimedia module in Qt5 uses gstreamer.
  • 0 Votes
    5 Posts
    55 Views
    Define the correct include dirs for you libraries with target_include_directories and simply link them to your executable. Then cmake is doing the rest for you automatically.
  • This topic is deleted!

    Unsolved about 17 hours ago
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Right click not working in form designer

    Unsolved 14 May 2024, 16:31
    0 Votes
    15 Posts
    1k Views
    It seems that this is still an issue in Qt Creator/Designer, version 17.0.0 on Linux Ubuntu 22.04. I can select multiple controls in the designer, but I can only add them to a layout in the Object Inspector because right-clicking on the selected controls shows no context menu. (Edit: I'm not sure if this happens all the time or only under special circumstances -- will try to set up a small test.) Has anyone submitted a bug report about this yet?
  • Qlipper not working: 'std::bad_alloc'

    Unsolved about 24 hours ago
    0 Votes
    3 Posts
    40 Views
    Thanks! Is there maybe another Qt clipboard manager I can use under LXQt, in case I can't fix Qlipper?
  • How to force a style sheet recalculation

    18 Oct 2010, 09:26
    0 Votes
    21 Posts
    28k Views
    @ogoffart you're my hero, I had discovered a weird effect on Qt6.9.1 (and later also on some older Qt6 versions), sending an empty or invalid string to setStyleSheet() didn't always clear the previously set stylesheet, but your proposed solution perfectly works, always! Thanks man!
  • 0 Votes
    7 Posts
    419 Views
    AFAIK, qml uses QSettings under the hood so it should behave in the same fashion. Damn... I remember experiencing these caching issues while developing but not how I "fixed" it...
  • 0 Votes
    2 Posts
    54 Views
    No one has replied
  • 0 Votes
    4 Posts
    122 Views
    As you said I don't think QSinglePointEvent::exclusivePointGrabber is what you need. That leaves you with having to write platform specific solution for each platform you want to support. You could also try to upstream that to Qt if you want, I think that it makes sense to have APIs for that. Some related issues: https://bugreports.qt.io/browse/QTBUG-113795 and https://bugreports.qt.io/browse/QTBUG-116493
  • QWidget with graphicseffect and render method

    Unsolved 4 days ago
    0 Votes
    4 Posts
    77 Views
    @denistu After I read the source code, I found that when a widget with QGraphicsEffect executes the render method, the internal call to QGraphicsEffect's draw method will call the sourceWidget's render method again. However, there's an internal judgment in the render method that causes the sourceWidget to return. So, you can see that using the target widget's render method directly doesn't work. So, all we have to do is figure out a way to call the widget's render method indirectly.We can set a container widget as the parent widget for the widget and just call the container widget's render method. That'll execute the render methods of all child widgets.I hope this helps. void QWidget::render(QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags) { .... Q_D(QWidget); const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter; const QRegion toBePainted = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags) : sourceRegion; if (toBePainted.isEmpty()) return; if (!d->extra) d->createExtra(); d->extra->inRenderWithPainter = true; .... } https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/kernel/qwidget.cpp#n5316 QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset, QGraphicsEffect::PixmapPadMode mode) const { .... // call render() again, so would retrun and the pixmap is only transpant with nothings. m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren); .... } https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/kernel/qwidget.cpp#n6040
  • How to make Widget always show in QTableView

    Solved 2 days ago
    0 Votes
    2 Posts
    39 Views
    i got it!! tableview->openPersistentEditor(model->index(0,0); tableview->openPersistentEditor(model->index(0,1); tableview->openPersistentEditor(model->index(0,2); tableview->openPersistentEditor(model->index(0,3);