문제

taking into account that I have a static VALUE which is already defined in a header file (that contains other defined static values) as follow:

#defined VALUE  2

I would like to update the VALUE by passing the text taken from a QComboBox to the #defined in mainwindow.cpp, so, I am using the following line:

#defined VALUE ui->QComboBoc->currentText();

but is not working, what exactly I did wrong ?

도움이 되었습니까?

해결책

I suggest you learn about the C++ preprocessor, VALUE is fixed at compile time. You will have to replace it with a global static variable, or even better fix your architecture.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top