What does *= mean in a .pro file?

2019-02-24 08:26发布

问题:

I'm trying to build qtdemo on Windows and I've almost done it, but there is a problem with qtquick examples. I think it begins in qtdemo.pro file, in this part:

contains(QT_CONFIG, quick1) {
    QT += quick1
} else {
    DEFINES *= QT_NO_DECLARATIVE
}

It always set QT_NO_DECLARATIVE, so the program throws an error and does not run the example. I was searching what does it mean '*=' operator but I couldn't find it anywhere. Does someone know? They always said about += and -= but *= is not mentioned at all...

回答1:

From the docs:

The *= operator adds a value to the list of values in a variable, but only if it is not already present. This prevents values from being included many times in a variable.