<QOverload>プロキシページ

関数

auto qConstOverload(T memberFunctionPointer)
auto qNonConstOverload(T memberFunctionPointer)
auto qOverload(T functionPointer)

関数のドキュメント

template <typename T> auto qConstOverload(T memberFunctionPointer)

定数メンバ関数へのmemberFunctionPointer ポインタを返す:

    struct Foo {
        void overloadedFunction(int, const QString &);
        void overloadedFunction(int, const QString &) const;
    };
    ... qConstOverload<int, const QString &>(&Foo::overloadedFunction)
    ... qNonConstOverload<int, const QString &>(&Foo::overloadedFunction)

qOverloadqNonConstOverload 、および文字列ベースとファンクタベースの接続の違いも参照のこと

template <typename T> auto qNonConstOverload(T memberFunctionPointer)

定数でないメンバ関数へのmemberFunctionPointer ポインタを返す:

    struct Foo {
        void overloadedFunction(int, const QString &);
        void overloadedFunction(int, const QString &) const;
    };
    ... qConstOverload<int, const QString &>(&Foo::overloadedFunction)
    ... qNonConstOverload<int, const QString &>(&Foo::overloadedFunction)

qOverload 、qNonConstOverload、文字列ベースとファンクタベースの接続の違いも参照のこと

template <typename T> auto qOverload(T functionPointer)

オーバーロードされた関数へのポインタを返します。templateパラメータは関数の引数型のリストである。functionPointer は(メンバ)関数へのポインタである:

    struct Foo {
        void overloadedFunction();
        void overloadedFunction(int, const QString &);
    };
    ... qOverload<>(&Foo::overloadedFunction)
    ... qOverload<int, const QString &>(&Foo::overloadedFunction)

メンバ関数も const-オーバーロードされている場合は、qConstOverloadqNonConstOverload を使用する必要があります。

qConstOverload()、qNonConstOverload()、文字列ベース接続とファンクタ・ベース接続の違いも参照のこと

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.