Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1241

Support std::function

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.15.0
    • Shiboken
    • None
    • All

    Description

      Qt uses std::function in a number of places (5.15)

      // src/corelib/io/qprocess.h
        typedef std::function<void(CreateProcessArguments *)> CreateProcessArgumentModifier;
        CreateProcessArgumentModifier createProcessArgumentsModifier() const;
        void setCreateProcessArgumentsModifier(CreateProcessArgumentModifier modifier);
      
      // src/corelib/thread/qrunnable.h
        static QRunnable *create(std::function<void()> functionToRun);
      
      // src/corelib/thread/qthreadpool.h:
        void start(std::function<void()> functionToRun, int priority = 0);
        bool tryStart(std::function<void()> functionToRun);
      
      // src/widgets/dialogs/qfiledialog.h
        static void getOpenFileContent(const QString &nameFilter, const std::function<void(const QString &, const QByteArray &)> &fileContentsReady);
      
      // src/oauth/qabstractoauth.h
        typedef std::function<void(Stage, QVariantMap*)> ModifyParametersFunction;
        ModifyParametersFunction modifyParametersFunction() const;
        void setModifyParametersFunction(const ModifyParametersFunction &modifyParametersFunction);
      
      // src/remoteobjects/qremoteobjectnode.h
        typedef std::function<void (QUrl)> RemoteObjectSchemaHandler;
        void registerExternalSchema(const QString &schema, RemoteObjectSchemaHandler handler);
        typedef std::function<bool(const QString &, const QString &)> RemoteObjectNameFilter;
        bool proxy(const QUrl &registryUrl, const QUrl &hostUrl={},
                   RemoteObjectNameFilter filter=[](const QString &, const QString &) {return true; });
        bool reverseProxy(RemoteObjectNameFilter filter=[](const QString &, const QString &) {return true; });
      
      // src/plugins/sensors/android/sensoreventqueue.h
        using Function = std::function<void()>;
        explicit FunctionEvent(const Function &function)
      
      // src/serialbus/qcanbusdevice.h
        void setResetControllerFunction(std::function<void()> resetter);
        void setCanBusStatusGetter(std::function<CanBusStatus()> busStatusGetter);
      
      // core/api/qwebenginecookiestore.h
        void setCookieFilter(const std::function<bool(const FilterRequest &)> &filterCallback);
        void setCookieFilter(std::function<bool(const FilterRequest &)> &&filterCallback);
        void setCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl());
      
      // webenginewidgets/api/qwebengineprofile.h:
        void setNotificationPresenter(std::function<void(std::unique_ptr<QWebEngineNotification>)> notificationPresenter);
      

      and class QWebEngineCallback, which is a sort of replacement.

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes