Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QT QVulkanWindow overlay widgets

    General and Desktop
    2
    3
    826
    Loading More Posts
    • 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.
    • J
      JiuShei last edited by JiuShei

      0
      down vote
      favorite

      I'm searching a way to draw any QT widget overlay on QVulkanWindow. I cannot find solution. Child/parent hierarchy and QT flags don't bring expected behaviour. Is it possible to draw QT widgets on the top of QVulkanWindow?

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @JiuShei last edited by

        @JiuShei said in QT QVulkanWindow overlay widgets:

        QVulkanWindow

        What exactly does not work? QVulkanWindow is a QWindow - you should be able to use it as any other window.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        J 1 Reply Last reply Reply Quote 0
        • J
          JiuShei @jsulm last edited by

          @jsulm said in QT QVulkanWindow overlay widgets:

          ndow - you should be able to use it as any other window.

          I've tried the following but e.g. QLabel always draws behind of QVulkanWindow

          1. attempt to create QWidget and Vulkan window from one parent QWidget
          auto widget = new QWidget;
          widget->resize(m_default_width, m_default_height);
          widget->show();
          
          
          m_label = new QLabel("text.", widget);
          m_label->show();
          
          m_vulkan_window = std::make_shared<WSQVulkanWindow>(this);
          
          m_vulkan_window->setVulkanInstance(&m_qt_vk_instance);
          
          m_vulkan_window->show();
          
          auto wrapper = QWidget::createWindowContainer(m_vulkan_window.get(), widget);
          
          wrapper->resize(m_default_width, m_default_height);
          
          wrapper->show();
          
          1. Added the following flags
          m_label->setAttribute(Qt::WA_NoSystemBackground);
          m_label->setAttribute(Qt::WA_TranslucentBackground);
          m_label->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::CoverWindow);
          

          Label is shown on top of vulkan window but it doesn't follow vulkan window position

          1. Attempt to add QWidget::createWindowContainer of VulkanWindow and QLabel widget to one parent widget with QGridLayout or QVBoxLayout.

          It has no effect

          1. Create QVulkanWindow with parent newwidget->windowHandle() with following creation QLabel widget on newwidget parent

          2. Create new QWindow with parent QVulkanWindow. After that create widget from QWindow and create child QLabel for mentioned widget.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post