开发者

QRegExpValidator parameters

开发者 https://www.devze.com 2023-02-25 19:10 出处:网络
If I write the following: QValidator *validator = new QRegExpValidator(regExp, this); What does this mean here? 开发者_如何学PythonWhat is it referring to? If I don\'t use it what effect will occur

If I write the following:

QValidator *validator = new QRegExpValidator(regExp, this);

What does this mean here? 开发者_如何学PythonWhat is it referring to? If I don't use it what effect will occur?


this is a pointer to the current class where validator is declared in.

its there to let QRegExpValidator know who is the parent of validator so whenever the parent is deleted, so as validator. this way you dont need to delete it manually.

More about the this pointer, see here

0

精彩评论

暂无评论...
验证码 换一张
取 消