Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWidget subclass setSurfaceType(...)
Forum Updated to NodeBB v4.3 + New Features

QWidget subclass setSurfaceType(...)

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 559 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • EntropySinkE Offline
    EntropySinkE Offline
    EntropySink
    wrote on last edited by
    #1

    I'd like to do Vulkan things in a widget that lives within a designer-composed, uic-generated ui.
    This hits (apparent) problems along each path I have considered;

    • uic doesn't allow me to inject a QWidget::createWindowContainer()-created object among its generated boilerplate code, and
    • I haven't (yet?) found a way for a subclass of QWidget to influence the QSurface::SurfaceType of its window.
      • I have tried (not exhaustively) to windowHandle()->setSurfaceType(QSurface::VulkanSurface) at a few different possibilities inside my subclass, but I'm absolutely sure I'm not holding it right. In bipolar fits, it keeps doing either nothing at all, or blowing up violently.

    It seems I'm missing something trivial; any ideas?

    (I also suspect that I am deeply misunderstanding what a QWindow really is; probably mentally typecasting it into an X11 window in order to imagine that each QWidget will have its own private, impervious rectangle to act within.)

    1 Reply Last reply
    0
    • EntropySinkE Offline
      EntropySinkE Offline
      EntropySink
      wrote on last edited by
      #2

      Sometimes just asking the question brings the answer.
      I added a plain QWidget 'receptacle' in the .ui, then in my own mainwindow code I foist a layout on it holding my vulkan-equipped subwidget.

        ui_->setupUi(this);
        auto* vw = new QVulkanWindow{};
        ...
        auto* layout = new QVBoxLayout{};
        layout->addWidget(QWidget::createWindowContainer(vw));
        ui_->receptacle->setLayout(layout);
      
      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved