Hi All,

I am updating some existing code and need to close a qDialog that is opened with show(). But when I try to connect to slots, close(), hide() finished(), etc. I get the error
error C2039: 'closeEvent' : is not a member of 'QObject'

Is it possible to close a dialog box without subclassing? Everything is already working and I don't want to re-write the code.

I have a ui QDialog file created with designer holding multiple widgets. When I press my button it opens a modeless dialog window. All I want to add is that when I press another button it will close the dialog, or hide I don't really care. I can close it using the X button, but want to be able to close it when the user does something in the code that renders the dialog no longer valid,

The actual code is large, but here is what I am trying to do. Hope it helps.

Qt Code:
  1. in MyApp.h
  2. #include ui_fullSizeImage.h"
  3. #include "ui_myapp.h"
  4. ...
  5. Ui::MyApp m_ui;
  6. Ui::FullSizeDialog m_fullSizeDialog
  7.  
  8.  
  9. in MyApp.cpp which is a QMainWindow class
  10.  
  11. m_ui.setupUi(this);
  12. m_fullSizeDialog.setupUi(new QDialog(this, Qt::WindowMaximizeButtonHint));
  13.  
  14. // show dialog
  15. connect(m_ui.m_fullScreenButton,
  16. SIGNAL(clicked()),
  17. m_fullSizeDialog.m_dialogWidget->parent(),
  18. SLOT(show()));
To copy to clipboard, switch view to plain text mode 

And I want to add

Qt Code:
  1. // close dialog, wont compile.
  2. connect(m_ui.m_fullScreenCloseButton,
  3. SIGNAL(clicked()),
  4. m_fullSizeDialog.m_dialogWidget->parent(),
  5. SLOT(close()));
To copy to clipboard, switch view to plain text mode 

Thanks for your help