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

QWidget modal, exec



  • hi,

    first.. i can't use QDialog,

    i have to use QWidget

    just, i want to use MYQWidget as modal

    MYQWidget have QButton.

    First, i call QWidget by using raise() and Clicking the button calls exec.

    is there any idea for this problem?



  • @koahnig

    hi koahnig, thank you for your apply

    I tried to inherit qdialog as your advice. but i have to use QWidget

    so

    i try mutiple inheritance QWidget and QDialog but it has some problem(QObject, QPaintDevice).

    There was a problem creating the object.

    so

    i use Eventloop. it is perfectly work i want.

    first show QWidget, loop.exec() together then if press button call loop.exit()



  • @minjunkim

    There are a couple of QDialog examples to show how to use QDialog. Typically this is giving a lot of hints on use of QDialog.

    In order to give you advice for your specific issue, you need to give some code snippets explaining what you try to do and where the problem might be.



  • @koahnig

    hi koahnig, thank you for your apply

    I tried to inherit qdialog as your advice. but i have to use QWidget

    so

    i try mutiple inheritance QWidget and QDialog but it has some problem(QObject, QPaintDevice).

    There was a problem creating the object.

    so

    i use Eventloop. it is perfectly work i want.

    first show QWidget, loop.exec() together then if press button call loop.exit()



  • @minjunkim

    QDialog inherits already QWidget. So no need to inherit again

    0_1540283814448_b647530a-233c-4ae7-88f6-f1b0758ea492-image.png


Log in to reply