Skip to content
  • 144k Topics
    720k Posts
    T
    Hi there, I've been trying to run a simple Wayland compositor in Qt C++, but I have an issue where trying to display surfaces results in nothing being displayed on the window. The code I'm using is below: #include <QtWaylandCompositor/QWaylandCompositor> #include <QtWaylandCompositor/QWaylandClient> #include <QtWaylandCompositor/QWaylandSurface> #include <QtWaylandCompositor/QWaylandXdgShell> #include <QtWaylandCompositor/QWaylandWlShell> #include <QtWaylandCompositor/QWaylandIviApplication> #include <QtWaylandCompositor/QWaylandIviSurface> #include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine(&app); QQuickWindow *window = new QQuickWindow(); window->setWidth(1024); window->setHeight(768); QWaylandQuickShellSurfaceItem *surface_item = new QWaylandQuickShellSurfaceItem(); surface_item->setParentItem(window->contentItem()); surface_item->setSize(QSizeF(800, 480)); QList<QWaylandShellSurface*> surfaces; QWaylandCompositor compositor; QWaylandOutput output(&compositor, window); output.setSizeFollowsWindow(true); QWaylandOutputMode mode(window->size(), 60000); // 60 Hz output.addMode(mode, true); compositor.setDefaultOutput(&output); QWaylandXdgShell xdgShell(&compositor); QWaylandWlShell wlShell(&compositor); QWaylandIviApplication iviApp(&compositor); QObject::connect(&xdgShell, &QWaylandXdgShell::toplevelCreated, [&surfaces, window, surface_item](QWaylandXdgToplevel *toplevel, QWaylandXdgSurface *xdgSurface) { qDebug() << "XDG Toplevel created:" << toplevel; qDebug() << "XDG Surface created:" << xdgSurface; QWaylandShellSurface *shellSurface = qobject_cast<QWaylandShellSurface *>(xdgSurface); surfaces.append(shellSurface); surface_item->setShellSurface(shellSurface); }); QObject::connect(&wlShell, &QWaylandWlShell::wlShellSurfaceCreated, [&surfaces, window, surface_item](QWaylandWlShellSurface *wlShellSurface) { QWaylandShellSurface *shellSurface = qobject_cast<QWaylandShellSurface *>(wlShellSurface); surfaces.append(shellSurface); surface_item->setShellSurface(shellSurface); }); QObject::connect(&iviApp, &QWaylandIviApplication::iviSurfaceCreated, [&surfaces, window, surface_item](QWaylandIviSurface *iviSurface) { QWaylandShellSurface *shellSurface = qobject_cast<QWaylandShellSurface *>(iviSurface); surfaces.append(shellSurface); surface_item->setShellSurface(shellSurface); }); QObject::connect(&compositor, &QWaylandCompositor::surfaceCreated, [&engine, window](QWaylandSurface *surface) { qDebug() << "Surface created:" << surface; }); compositor.addExtension(&xdgShell); compositor.addExtension(&wlShell); compositor.addExtension(&iviApp); compositor.create(); window->show(); return app.exec(); } I used the minimal QML implementation as the example for the C++ code, yet it works in QML but not C++. Any hep would be appreciated!
  • Jobs, project showcases, announcements - anything that isn't directly development
    4k 23k
    4k Topics
    23k Posts
    RokeJulianLockhartR
    @asterwyx, what was the response? I ask per forum.qt.io/post/833884.
  • Everything related to designing and design tools

    129 392
    129 Topics
    392 Posts
    J
    Using QT Designer might be the simpler route if the main goal is to keep the workflow smooth with Python. QT Design Studio projects often need manual adjustments before they run properly under PySide6.
  • Everything related to the QA Tools

    86 230
    86 Topics
    230 Posts
    M
    Ah, perfect. Will try this on Monday. Thanks for the link and have a nice weekend!
  • Everything related to learning Qt.

    390 2k
    390 Topics
    2k Posts
    Ash_QtA
    Hey @RahmanTaleshi, please reach out to academy@qt.io if you have not already, and we will get this sorted. We are aware of some issues we are not investigating with challenge enrolments.
  • 2k Topics
    13k Posts
    lukas_kosinskiL
    Hi @Mystery. Although your topic is quite old, I thought it made sense to comment on it, as this is a question that many ask themselves, and the Qt website doesn't provide an answer. Of course, it's not their role. I am going to answer this question as someone deeply involved in medical device software development - most of the time with Qt. We're ISO 13485 (medtech software) certified and often participate in or solely create documentation according to the IEC 62304 standard. Actually, this is somehow connected to the recently introduced EU CRA, because SBoMs will be basically a standard not only for medical apps. It's important to know that Qt on its own isn't certified. Some tools, like Qt Safe Renderer, are. BUT, Qt does a lot of jobs to ensure their software is of the highest quality, which is very useful for SoUP documentation. They do professional issues management, track changes, have static code analysis and unit tests so you can include it all in your documentation. What we usually do for dependencies (whether they are Qt modules or anything else) is: SBoM (Software Bill of Materials) - a detailed inventory that lists all your components (both internal and external) and their dependencies that make up the entire system. This is now required by the FDA in electronic format (like CycloneDX) as well! Vulnerabilities assessment - practically speaking, an Excel table where you go through the known vulnerabilities of the components and you assess whether they can do harm to your device. It all depends on what kind and what class of device it is. You can have two types of vulnerabilities -> cybersecurity ones and functional ones. All of them can be exploited if you are not careful. I will not focus on Quality Assurance and Validation of your internal components - code you write on your own, but rather on the dependencies. More specifically the modules you mentioned. Generally speaking, those are GUI modules so the risk is rather limited, but you have to assess them anyway. In your SBoM you might want to document: Dependency name Its supplire Version Hash (not necessarily) Software level of support End-of-support date License You can also go extra and explain what's the purpose of the particular dependency, but SBoM is not a place for that. It's probably to be done in Software Detailed Design documents. [image: c6a4f89d-540d-4dad-83de-e7fee3adde20.png] Then assessment: Component | Version | Vulnerability | Discovery method (you can, for example go over Qt's Gerrit or public vulnerabilities trackers like NVD, CISA KEV etc) | Applicability | Potential effects (if applicable) | Dangerous situation (if applicable) | Method of control (if applicable) | Evaluation (Detectability, Severity, Probability) | Recommended actions. Hope my answer is not overwhelming. I've tried to be as high-level and practical as possible without going into too many details. There is a lot of other work to be done around it, like the plan to handle vulnerabilities, but it's probably not a topic for this forum. In practice, all medical documentations really differ company to company. I wrote once about Software of Unknown Provenance in Medical Devices.
  • 4k Topics
    18k Posts
    C
    [image: dc2880e7-0937-4483-91de-5cc6b1e0664b.png] 项目升级QT6后启动 ASSERT failure in class QFactoryLoader *__cdecl QtGlobalStatic::ApplicationHolder<struct `anonymous namespace'::Q_QAS_qtlsbLoader>::pointer(void) noexcept(false): "The application static was used without a QCoreApplication instance", file C:/Users/qt/work/qt/qtbase/src/corelib/kernel/qapplicationstatic.h, line 59 这是什么原因造成
  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k 10k
    1k Topics
    10k Posts
    RokeJulianLockhartR
    At my.qt.io/support/request/00785015, I've since asked for this to be remediated for my account. However, because I expect this to recur, I've also filed qt-project.atlassian.net/browse/QTWEBSITE-1261.