开发者

QRegExpValidator parameters

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜