Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • How to Resolve the QMediaPlayer Resource Error?

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    Y
    See also: https://bugreports.qt.io/browse/QTBUG-110708 https://bugreports.qt.io/browse/QTBUG-111910 Qt 6.5.1 may be sufficient to resolve the bug.
  • How to overlay transparent areas on a video widget

    Unsolved
    3
    0 Votes
    3 Posts
    534 Views
    Q
    @jsulm not work when they have same parent #pragma once #include <QWidget> #include <QQuickWidget> #include "VideoWidget.h" #include "OpenGLWidget.h" class MyWidget: public QWidget { public: MyWidget(QWidget *parent); void SetSubWidget(); }; #include "Mywidget.h" MyWidget::MyWidget(QWidget* parent) : QWidget(parent) { this->setGeometry(0,0, 1920, 1080); this->setWindowFlags(Qt::FramelessWindowHint); QPalette palette; palette.setColor(QPalette::Window, Qt::GlobalColor::black); this->setAutoFillBackground(true); this->setPalette(palette); this->show(); } void MyWidget::SetSubWidget() { VideoWidget* videoWidget = new VideoWidget(this); videoWidget->setGeometry(0, 0, 512, 384); QPalette palette1; palette1.setColor(QPalette::Window, Qt::GlobalColor::red); videoWidget->setAutoFillBackground(true); videoWidget->setPalette(palette1); videoWidget->show(); // not work QWidget* transparentWidget1 = new QWidget(this); transparentWidget1->setGeometry(0, 0, 100, 100); transparentWidget1->show(); // work QWidget* transparentWidget2 = new QWidget(nullptr); transparentWidget2->setAttribute(Qt::WA_TranslucentBackground, true); transparentWidget2->setWindowFlags(Qt::FramelessWindowHint); transparentWidget2->setGeometry(100, 100, 100, 100); transparentWidget2->show(); // work QWidget* transparentWidget3 = new QWidget(videoWidget); transparentWidget3->setGeometry(200, 200, 100, 100); transparentWidget3->show(); } #pragma once #include <QWidget> #include <mpv/client.h> class VideoWidget : public QWidget { Q_OBJECT public: VideoWidget(QWidget* parent); private: mpv_handle* mpv; }; #include "VideoWidget.h" VideoWidget::VideoWidget(QWidget* parent) :QWidget(parent) { mpv = mpv_create(); if (!mpv) { qDebug() << "could not create mpv context"; throw std::runtime_error("could not create mpv context"); } int64_t wid = this->winId(); mpv_set_property(mpv, "wid", MPV_FORMAT_INT64, &wid); qDebug() << "wid is " << wid; mpv_set_property_string(mpv, "hwdec", "auto"); mpv_set_property_string(mpv, "loop-file", "inf"); if (mpv_initialize(mpv) < 0) { qDebug() << "could not initialize mpv context"; throw std::runtime_error("could not initialize mpv context"); } const char* args[] = { "loadfile", "4k_60.mp4", NULL }; mpv_command_async(mpv, 0, args); } #include <QWidget> #include "Mywidget.h" #include <QApplication> #include <QTimer> int main(int argc, char *argv[]) { QApplication app(argc, argv); MyWidget *mywidget = new MyWidget(nullptr); QTimer::singleShot(2000, mywidget, [&]() { mywidget->SetSubWidget(); }); return app.exec();; } [image: 1710fca3-7a84-4b57-a4e0-403fbe919762.png]
  • Error when importing QJsonDocument

    Unsolved
    3
    0 Votes
    3 Posts
    446 Views
    C
    @Creaperdown said in Error when importing QJsonDocument: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' Googling the error message gives a range of similar messages. The general theme seems to be that older clang and libstdc++ (13) versions clash. See https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1918839.html for example.
  • Qt5 Windows program can't find a procedure entry point

    Solved
    4
    0 Votes
    4 Posts
    939 Views
    R
    @ChrisW67 Solved. Turns out it was using the wrong version of libstdc++-6.dll; used the one that came with qt, and that didn't have the "throw_bad_array_new_length" entry point. Used the one that came with mingw, and that fixed it.
  • FullScreen prevents showing the sub menu bar

    Unsolved widget fullscreen menubar
    6
    0 Votes
    6 Posts
    2k Views
    H
    Same problem here with QPushButton's menu. Qt 5.14.1, Mingw, Windows 10, Windows 11. and some interest thing is that when I use an application to record my screen, it's showing the menu!!!!!! (checked the video of screen), but I can't see when interacting :|
  • QMenu turns invisible when switch monitors on Win10

    Unsolved
    2
    0 Votes
    2 Posts
    182 Views
    SGaistS
    Hi, Qt 5.12.0 being old and obsolete, the first thing to do would be to test with a more recent version either the latest 5.15 or Qt 6.
  • Move a class that inherits from QObject with all it objects members to QThread

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    Pl45m4P
    @Lior said in Move a class that inherits from QObject with all it objects members to QThread: the worker is act as object when it get the the event and i not fully understend the relation between qthread and signal-slot mechanisem. It's explained in the article linked by @jsulm here as well as in the documentation pages here https://doc.qt.io/qt-6/threads-qobject.html#signals-and-slots-across-threads and when object is created its owner is the thread it created it. Therefore you move it and make members a child of the moved object or create them later after your object was moved
  • QPushButton border color

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    JonBJ
    @Grand_Titan I think you have a problem. Elements have an in-built style. As soon as you place any CSS on them they lose this, that's why you see it look so different. You may find you can only change that in code (QStyle, QPalette), not via CSS.
  • Open new windows that needs to be closed to use others

    Solved
    3
    0 Votes
    3 Posts
    194 Views
    A
    @jsulm Thanks, you gave me anyway the correct suggestion: the modal property of a window.
  • Compiler Flags in SUBDIR

    Solved
    3
    0 Votes
    3 Posts
    209 Views
    R
    @jsulm Thanks! In MakeFile we see -O2 -MD CXXFLAGS = -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -O2 -MD -std:c++17 -utf-8 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc $(DEFINES)
  • 0 Votes
    8 Posts
    905 Views
    Q
    @ChrisW67 If you overlay a transparent widget on top of the MPVWidget, you will notice that you see the background color of the MVPWidget instead of the video. I believe this is for the same reason as the immediate display of the video's background when using hide(). [image: 48735235-13b2-4d75-a8ec-88e575a81d3d.png] [image: 7d5439dc-94b3-4a73-9dfa-08269b744cba.png]
  • QML- Datetime conversion to different timezones

    Unsolved
    1
    1 Votes
    1 Posts
    198 Views
    No one has replied
  • QSS issue about QComboBox

    Solved
    7
    0 Votes
    7 Posts
    481 Views
    S
    @sierdzio OK, thanks again. I will mark this question solved.
  • Changes are not shown

    Unsolved
    2
    0 Votes
    2 Posts
    148 Views
    jsulmJ
    @Kronam Usually it should work. Try rebuild instead of build.
  • Qt Application Plugins with the same interface

    Unsolved
    12
    0 Votes
    12 Posts
    785 Views
    W
    @SamiV123 this is a very good point. I will consider avoiding plugins at all costs. Maybe it is a better idea to forget about the launcher application and just make separate applications.
  • This topic is deleted!

    Solved
    2
    0 Votes
    2 Posts
    20 Views
  • QOpenGLWidget doesn't work with QQuickWidget

    Solved
    3
    1 Votes
    3 Posts
    1k Views
    ?
    @Ioneater Thank you for your information. I just created dummy QQuickWindow and called setGraphicsApi as you suggested. By calling graphicsApi before creating the first QQuickWidget, my problem has been solved. I also found a straightforward method not using dummy QQuickWindow by setting the QSG_RHI_BACKEND environment variable. Have a nice day.
  • QThread signal-slot or zeromq is better for multiply connection to same Thread

    Unsolved
    4
    0 Votes
    4 Posts
    423 Views
    SGaistS
    @RahibeMeryem said in QThread signal-slot or zeromq is better for multiply connection to same Thread: @SGaist 25 fps two stream and 2Mp mp4 What exactly does that mean ? You seem to have more that two streams. Also, what are the properties of these streams and what are you using to read them in your Qt application ? Somehow signal slots mechanism looks stuck.. I can post full cod eif you needed No, if anything post a minimal compilable application that shows the behaviour.
  • Could not load the Qt platform plugin "xcb

    Unsolved
    4
    0 Votes
    4 Posts
    14k Views
    L
    @Stecco Thanks stecco, I was unable to run the latest versions of qtcreator and after running your suggestion (sudo apt-get install -qq libglu1-mesa-dev libx11-xcb-dev '^libxcb*') everything got solved.
  • This topic is deleted!

    Unsolved
    7
    0 Votes
    7 Posts
    40 Views