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

QEvent::ThemeChange event get's emitted twice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6.3
    • GUI: Look'n'Feel
    • None
    • macOS, Windows

    Description

      Just by creating a new widgets or qtquickapp, you can register an eventFilter and catch the eventType, and you will see you will always get it twice in a row for every theme change.

       

      Here is a small example:

      // MainWindow.h
          bool eventFilter(QObject *obj, QEvent *event) override {
              if (event->type() == QEvent::ThemeChange) {
                  qDebug() << QGuiApplication::styleHints()->colorScheme();
                  return true;
              }
              return QObject::eventFilter(obj, event);
          }; 
      
      //main.cpp
          QApplication a(argc, argv);
          MainWindow w;
          a.installEventFilter(&w);
          w.show();
          return a.exec();

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            markostanke Marko Stanojevic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes