Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Desginer Widgets do not show up in a new window.



  • So basically i want to make 2 step confirmation when deleting something. For that the user presses the "delete" Button, which opens up a new window. here is the actual Delete-Button which deletes the information from the database and a cancel button.
    i already followed this guide: https://www.youtube.com/watch?v=tP70B-pdTH0
    this video shows pretty much what i imagined but when the new window opens, it is just an empty space. My buttons and labels are missing.

    my dialog.h which opens the new window is implemented in the mainwindow.cpp like..

    #include <dialog.h>
    ...
    void MainWindow::on_pushButton_delete_window_clicked()
    {
    QDialog dialog;
    dialog.setModal(true);
    dialog.exec();
    }


  • Lifetime Qt Champion

    Hi,

    You are creating a QDialog instance so it's normal that it's "empty".

    Based on your header you seem to have a class named Dialog.

    That's one of the reason it's important to properly name your classes, so you do not make that kind of mistake and you also know what the class is for.

    That said, QMessageBox::question might be enough for your purpose.



  • @SGaist thanks. i will look into the QMessageBox::question first then


Log in to reply