Argument type for Qt signal and slot, does const reference qualifiers matters?

后端 未结 2 1031
自闭症患者
自闭症患者 2020-12-01 10:35

For signal and slot of below type

signals:
    void textChanged(const QString &);

public slots:
    void setText(const QString & text)
2条回答
  •  温柔的废话
    2020-12-01 11:28

    Qt checks a normalized signature, meaning

    Normalization reduces whitespace to a minimum, moves 'const' to the front where appropriate, removes 'const' from value types and replaces const references with values.

提交回复
热议问题