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

Support std::function

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Won't Do
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Shiboken
    • Labels:
      None
    • Platform/s:
      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

          For Gerrit Dashboard: PYSIDE-1241
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              kleint Friedemann Kleint
              Reporter:
              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