Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Message Dialog error on SetGeometry.
Forum Update on Monday, May 27th 2025

Message Dialog error on SetGeometry.

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skammers
    wrote on 4 Jul 2014, 09:15 last edited by
    #1

    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?

    @
    MessageDialog{
    id:newProject;
    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: {
            if(app.savedAsBool){
                app.saved = true;
    

    // app.quitBool = true;
    masterResource.saveTranslation(saveAsFile.saveFileName);
    }
    else if(app.madeList && !app.savedAsBool)
    {
    fileNameMust = masterResource.fileName;
    warningSave.open();
    }
    else{
    noListDialog.open();
    }
    }
    onYes: {
    englishTxt.text = "";
    langInput.text = "";
    masterResource.clearTranslations();
    }

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

    @

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 4 Jul 2014, 17:55 last edited by
      #2

      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.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • S Offline
        S Offline
        skammers
        wrote on 7 Jul 2014, 05:39 last edited by
        #3

        Thanks for reply.

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

        @
        ApplicationWindow {
        id:app
        visible:true;
        title: qsTr("TransEd");
        width: 1200;
        height: 800;
        minimumHeight: 400;
        minimumWidth: 600;

        //all of my code, including the messageDialog.
        }

        @

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tomasl
          wrote on 26 Sept 2014, 10:00 last edited by
          #4

          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.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved