Hi

I have a menu bar in the mainwindow application.
One of the action in it is to open the settings page.

My settings page is a different UI form, which is of type dialog. I take inputs in this ui.

Qt Code:
  1. connect(ui->actionSettings, SIGNAL(triggered()), &dlg, SLOT(newdevice()));
To copy to clipboard, switch view to plain text mode 

i tried the above code to trigger the settings page, but it doesnt work

it says dlg is undefined. I have declared the dialog dlg in the newdevice function that takes care of all the opearations in settings.

I try to declare QDialog dlg in the main header file, but the app will just crash if i do that.

Any ideas as to how i can fix it??