In the following code segment from dialog.cpp, the push button saveFolderPB gives the error "not declared in this scope". WHY? I have no idea. I have a simple dialog with a few buttons using on_object_triger private slots, which all work correctly. In the slot shown in the code snipped all I am doing is trying to enable another push button. Why is the button widget not declared in scope? It is public in ui_dialog.h, which is included as shown in the snipped - and it was put there by QCreator. I thought all class member variables are accessible by all class non-static member methods.
Qt Code:
  1. #include "dialog.h"
  2. #include "ui_dialog.h"
  3. #include <QFileDialog>
  4. #include <iostream>
  5. ....
  6.  
  7. void Dialog::on_QFXSourcePB_pressed()
  8. {
  9. // Display file selection dialog.
  10. QString selfilter = "QFX (*.qfx)";
  11. QString inFileName = QFileDialog::getOpenFileName(
  12. this,
  13. "Select .qfx file.",
  14. "C:\\users\\Mike\\Desktop",
  15. "All files (*.*);; QFX (*.qfx)", &selfilter);
  16.  
  17. if (!inFileName.isEmpty()){
  18. saveFolderPB.setEnabled(); // NOT DECLARED IN THIS SCOPE !!
  19. QFXreader reader;
  20. reader.readQFX(inFileName, qfxInfo, qifTL);
  21. }
  22.  
  23. }
To copy to clipboard, switch view to plain text mode