Message Dialog error on SetGeometry.

  • I have a Message Dialog with several StandardButtons, and I get an error:
    setGeometry: Attempt to set a size (354x87) violating the constraints(354x162 - 16777215x16777215) on window QQuickWindow/''.

    That dont happen on the other MessageDialogs with only one button.

    Any suggestions?

    width: app.width/5;
    height: app.height/5;
    icon: StandardIcon.Warning;
    title: qsTr("Warning!");
    text: qsTr("Do you want to start a new project? All your translations will be deleted in the work file window.");
    standardButtons: StandardButton.Cancel | StandardButton.Yes | StandardButton.No | StandardButton.Save;

        onAccepted: {
                app.saved = true;

    // app.quitBool = true;
    else if(app.madeList && !app.savedAsBool)
    fileNameMust = masterResource.fileName;;
    onYes: {
    englishTxt.text = "";
    langInput.text = "";

        onNo: close();
        onRejected: console.log("Canceled");


  • Qt Champions 2017

    Is the messageDialog is within some QML Layout ? What are the constraints inside the layout ? What are constraints of object with id - app ?

    Program above looks simple enough and should not cause issue like this.

  • Thanks for reply.

    Yes. The message dialog is inside an applicationWindow called app.
    Heres how app looks like at the beginning:

    ApplicationWindow {
    title: qsTr("TransEd");
    width: 1200;
    height: 800;
    minimumHeight: 400;
    minimumWidth: 600;

    //all of my code, including the messageDialog.


  • Hi, any luck on this?
    I'm facing the same issue using Qt 5.3.2. The same code had no problem in Qt 5.2.1, but now the dialog window seems to hang on Windows. If I move the window a bit, then it suddenly refreshes, and I may click the buttons.

    On 5.2.1, the window looked much nicer as well.

    I have searched, but could not find a bugreport mentioning this.

Log in to reply