Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • How to reconnect signal to slot after object change?

    Unsolved
    2
    0 Votes
    2 Posts
    202 Views
    Christian EhrlicherC
    @Rozerchik said in How to reconnect signal to slot after object change?: So, will it be right like this? Yes
  • QT6 Can't read the OUT parameter from MYSQL Database

    Solved
    6
    0 Votes
    6 Posts
    510 Views
    R
    @Christian-Ehrlicher thank You very much
  • :-1: error: gstreamer-1.0 development package not found

    Solved
    13
    0 Votes
    13 Posts
    3k Views
    V
    @SGaist thank you..
  • Preserve windows 10 style

    Unsolved
    4
    1 Votes
    4 Posts
    394 Views
    S
    @ChrisW67 https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute I don't do so much windows dev these days but I seem to recall you could also control this with those manifest files.
  • QTreeView how to support move action?

    Unsolved
    17
    0 Votes
    17 Posts
    1k Views
    S
    @JonB Yes but i can't get it to work by handling the methodes in the model directly. Instead i may gonna do this by accesing the model trough my QTreeView Drag and Drop Events. This seems way easier to me. void ViewLayerList::dragMoveEvent(QDragMoveEvent *event) { QTreeView::dragMoveEvent(event); QModelIndex belowIndex; // Überprüfen Sie die Position des Drop-Indikators QAbstractItemView::DropIndicatorPosition position = dropIndicatorPosition(); // Bestimmen Sie das Aussehen des Drop-Indikators basierend auf seiner Position switch (position) { case QAbstractItemView::AboveItem: case QAbstractItemView::BelowItem: qDebug() << "Drop AboveItem or BelowItem"; DropOnItem = false; // Holen Sie sich den QModelIndex des Elements unterhalb der aktuellen Position belowIndex = indexAt(event->position().toPoint() + QPoint(0, 1)); if (belowIndex.isValid()) { // Holen Sie sich die Zeile des Elements RowBelowDropPositon = belowIndex.row(); qDebug() << "Row of item below: " << RowBelowDropPositon; } //AN AI HIER BEKOMME ICH IMMER EIN VERBOTEN SCHILD UND KANN ES NICHT DROPPEN event->acceptProposedAction(); break; case QAbstractItemView::OnItem: qDebug() << "Drop OnItem"; DropOnItem = true; break; case QAbstractItemView::OnViewport: qDebug() << "Drop OnViewport"; break; } } void ViewLayerList::dropEvent(QDropEvent *event) { if(DropOnItem == false){ } QTreeView::dropEvent(event); } But i don't know if it has many downsides compared to doing this in the model directly. Thats what my question was to @SGaist
  • 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
    503 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
    427 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
    909 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
    176 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
    189 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
    200 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
    863 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
    192 Views
    No one has replied
  • QSS issue about QComboBox

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

    Unsolved
    2
    0 Votes
    2 Posts
    142 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
    752 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.