Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

converting qwindow to qwidget crashes



  • Hi All,
    I'm trying to convert a qwindow to qwidget, but the program crashes on converting between both, here is my code. I'm trying to convert a subclass from qwindow to qwidget. but it crashes.

    int main(int ac, char **av)
    {
        QApplication app(ac, av);
    
        Window view;
      
        QWidget *container = QWidget::createWindowContainer(&view);
    
        container->setFocusPolicy(Qt::TabFocus);

  • Lifetime Qt Champion

    Hi,

    Do you mean it crashes when calling setFocusPolicy ?


Log in to reply