QMainWindow fecha logo após show ()
Eu sou novo no Qt (use o Objective-C principalmente), por isso estou preso com um problema provavelmente noob. DeQDialog
janela eu tento abrirQMainWindow
como isso:
this->close();
SQLWindow window;
window.receivePath(path); //Path for the .sqlite file
window.show()
QDialog
fecha e por milissegundos vejo uma nova janela, mas ela também fecha. Abaixo estáQMainWindow
parte:
SQLWindow::SQLWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::SQLWindow)
{
ui->setupUi(this);
this->initialSetup();
}
SQLWindow::~SQLWindow()
{
delete ui;
}
void SQLWindow::initialSetup()
{
ui->tableView->setSortingEnabled(true);
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
}
void SQLWindow::receivePath(QString path)
{
this->openDatabase(path);
}
void SQLWindow::openDatabase(QString path)
{
//Opening database just fine
}