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. QT QVulkanWindow overlay widgets
QtWS25 Last Chance

QT QVulkanWindow overlay widgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.2k 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.
  • J Offline
    J Offline
    JiuShei
    wrote on last edited by JiuShei
    #1

    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?

    jsulmJ 1 Reply Last reply
    0
    • J 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?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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
      0
      • jsulmJ jsulm

        @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.

        J Offline
        J Offline
        JiuShei
        wrote on last edited by
        #3

        @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
        0

        • Login

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