PDA

View Full Version : Qt Creator Wrong yellow underlined with constructor



danjiun
14th February 2016, 23:16
Hi my friends.
I want to ask if this is problem of Qt Creator. (I use Qt Creator 3.5.0 opensource based on Qt 5.5.0, and use C++11)
I write a next code :


int c = 0;
for(int a=0;a<m_s;a++) {
for(int b=0;b<m_s;b++) {
m_substCodeToPair[c] = std::pair<int,int>(a,b);
c++;
}
}
}

pair appear with a yellow-green underline, and if i move my mouse there it tell me "Too few arguments"
If a compile, it compile fine, but Qt Creator always underline there.
What i can do in order to remove this warning underline ?
Daniel

danjiun
19th February 2016, 05:21
Nobody answer.
So i think it is a bug of Qt Creator.
I resolve this in other way, instead of


m_substCodeToPair[c] = std::pair<int,int>(a,b);

i can write


m_substCodeToPair[c] = std::make_pair(a,b);

and now i not see any underline.
I write this, for a case some other people use this std classes with Qt.
Anyway QPair works at expected with Qt Creator.
Daniel