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

QQmlFileSelector::get returns nullptr after setting url interceptor

    XMLWordPrintable

Details

    Description

      Following code (mode is Debug, so Q_ASSERT is not no-op) works fine, but should not:

      struct UrlInterceptor
              : QQmlAbstractUrlInterceptor
      {
      
          QUrl intercept(const QUrl & url, DataType type) Q_DECL_OVERRIDE
          {
              Q_UNUSED(type);
              return url;
          }
      
      };
      
      // main:
      
          QQmlApplicationEngine engine;
      
          QPointer qmlFileSelector = QQmlFileSelector::get(&engine);
          Q_CHECK_PTR(qmlFileSelector);
          engine.setUrlInterceptor(new (std::nothrow) UrlInterceptor);
          Q_CHECK_PTR(qmlFileSelector);
          Q_ASSERT(!QQmlFileSelector::get(&engine)); // !!!

       Compiler is GCC 7.2.0 (CMAKE_CXX_STANDARD 17), system - Ubuntu 16.04.3.

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            tomilovanatoliy Anatoliy Tomilov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes