How to check that Qwidget exist
Like in title how to check that child class from QWidget exist?
when i try something like that it break application end throw error
void MainWindow::slotAddLoginData() {
if(!addLoginData) {
addLoginData = new AddLoginData(this);
connect(this, SIGNAL(setEnabledALDbtnOK(bool)),
addLoginData, SLOT开发者_运维技巧(btnOkEnabled(bool)));
}
addLoginData->show();
addLoginData->activateWindow();
}
It looks like addLoginData
is not initialised
As others have said, addLoginData isn't initialized. You can't do this:
if(!addLoginData) { ... }
Unless you initialize addLoginData to 0. So, as Georg said, initialize it, except make that..
MainWindow::MainWindow() : addLoginData(0)
(note the "0")
One possibility would be that you have not initialized addLoginData
. Use something like this in that case:
MainWindow::MainWindow()
: addLoginData()
// ...
{
// ...
}
精彩评论