![]() |
Re: [Qt] Functions cannot access objects defined in the same class .. ! Possibly a bug ?
Code:
((MainWindow*)parent())->someFunctionDefinedInMainWindow(); Secondly, you're writing c++ code, not c - so use the c++ casts or your Qt favourite cast like: Code:
MainWindow* myWindow = qobject_cast<MainWindow*>(someObject); Code:
void Canvas::refreshFoldersList(QString inputPath) Please be also aware of passing your this pointer from your class' constructor. This may lead to problems when using derived classes. (The this pointer points to a memory fragment of the class whose constructor you are in. This means in your MainWindow::MainWindow(), this points to the vtable of MainWindow. In QMainWindow::QMainWindow(), this points to the vtable of QMainWindow. In every other function except constructors and destructors the this pointer always points to the vtable of your derived class - MainWindow in your case.) |
Re: [Qt] Functions cannot access objects defined in the same class .. ! Possibly a bug ?
And yet again the intricacies of C++ are there to trip you.
|
All times are GMT. The time now is 11:10. |
vBulletin® Version 3.8.8