Properties of the Qmainwindow don’t work
I created a qt gui application. added...
@QMainWindow.setDisabled(false);@ to the mainwindow.cpp file
ran it and got the error... mainwindow.cpp:9: error: expected unqualified-id before '.' token.
I am trying to test out some of the properties of the Qmainwindow but they do not work. what i am doing wrong?
int main(int argc, char *argv)
QApplication a(argc, argv);
MainWindow::MainWindow(QWidget *parent) :
Actually it's not about Qt. It's about C++.
Try to replace it with:
Or simply with:
if i wanted to use qmainwindow.setDisabled(false); in a different function outside of MainWindow::MainWindow that what would i use then?
Seems like you're totally new to C++ and OOP in general.
Try to read some tutorials on C++ programming.
yes I am fairly new to c++. I understand conditional statements and a bit of functions. thank you for your help.
setDisabled is a method of the class QWidget and there fore also for each derived class.
If you are inside the class (so inside the derived classes members) you can directly call it. If you are outside (or want to call it for another object) you have to use the target object as selector: