Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-25991

Changing currentIndex of QStackedWidget when native widget exist will cause crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.0.0 Beta 1
    • None
    • Windows 7 MSVC2010
    • 3892ccaca7d16ba056bf7c91cc15522bcf3754a3

    Description

      Following code can be used to reproduce the problem:

      Run application

      then click the tab 2

      #include <QtWidgets>
      
      class TabWidget:public QTabWidget
      {
      public:
          TabWidget(QWidget* parent=0)
              :QTabWidget(parent)
          {
              addTab(new QPushButton("Test"), "1");
      
              QPushButton * btn = new QPushButton("Test2");
              btn->setAttribute(Qt::WA_NativeWindow);
              addTab(btn, "2");
          }
      };
      
      int main(int argc, char** argv)
      {
          QApplication a(argc, argv);
          TabWidget w;
          w.show();
          return a.exec();
      }
      

      We will get

      ASSERT: "widget->isVisible() && widget->updatesEnabled()" in file kernel\qwidgetbackingstore.cpp, line 474
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dbzhang800 debao zhang
            dbzhang800 debao zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes