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. works in Rectangle but not in Dialog at the first run
QtWS25 Last Chance

works in Rectangle but not in Dialog at the first run

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 2 Posters 1.9k 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.
  • Y Offline
    Y Offline
    Ying
    wrote on last edited by Ying
    #1

    I am writing an application with the main window and some pop out dialogs. there is one dialog that has a model content created by python loaded in it. When I run the application at the first time. that dialog shows improperly with all the mess. When I rerun the application for the second time, third time and so on, it just works perfectly. the mess only happens at the first time to run the program. However, when I use the rectangle instead of the dialog for my application. it just works fine for every time. but I really think the dialog looks better and professional in my application. what happens for this situation? what's the difference between dialog and rectangle? any idea about it? Thanks in advance

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Ying Hi
      What is shown improperly in Dialog ?

      157

      Y 1 Reply Last reply
      1
      • p3c0P p3c0

        @Ying Hi
        What is shown improperly in Dialog ?

        Y Offline
        Y Offline
        Ying
        wrote on last edited by
        #3

        @p3c0 I suppose to have a list loaded from a model generated by python fill the whole dialog. for improper display, the whole list display in the bottom area of the dialog, but I can use the scroll bar to drag up the list. However, it looks so strange

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @Ying Can you post the code ?

          157

          Y 2 Replies Last reply
          1
          • p3c0P p3c0

            @Ying Can you post the code ?

            Y Offline
            Y Offline
            Ying
            wrote on last edited by p3c0
            #5

            @p3c0
            here is the code for that dialog

            import QtQuick 2.3
            import QtQuick.Controls 1.2
            import QtQuick.Controls.Styles 1.2
            import QtQuick.Layouts 1.1
            import QtQuick.Window 2.0
            import QtQuick.Dialogs 1.2
            
            Dialog
            {
                id: base;
                title:"Full Settings"
                width: 800
                height: 600
                visible:false
                TabView {
                    anchors.fill: parent
                    anchors.margins: 8
                    Tab {
                        title: "General"
                        GeneralTab{ }
                    }
                    Tab {
                        title: "Infill"
                        InfillTab{ }
                    }
                    Tab {
                        title: "Speed"
                        SpeedTab{ }
                    }
                    Tab {
                        title: "Support"
                        SupportTab{ }
                    }
                    Tab {
                        title: "Build Plate"
                        BuildplateTab{ }
                    }
                    Tab {
                        title: "Retractions"
                        RetractionTab{ }
                    }
                    Tab {
                        title: "Cooling"
                        CoolingTab{ }
                    }
                    Tab {
                        title: "More.."
                        MoreTab{ }
                    }
                }
            }
            
            1 Reply Last reply
            0
            • p3c0P p3c0

              @Ying Can you post the code ?

              Y Offline
              Y Offline
              Ying
              wrote on last edited by
              #6

              @p3c0 even if I change the tab order like switch the infill tab and general tab. the improper display always shows in the first tab, so I dont think there is something wrong in these Tabs

              1 Reply Last reply
              0
              • p3c0P Offline
                p3c0P Offline
                p3c0
                Moderators
                wrote on last edited by
                #7

                @Ying Where is the ListView loaded ?

                but I can use the scroll bar to drag up the list.

                Scrollbars of the ListView ? Is it that blank data is filled for initial rows ?

                157

                Y 1 Reply Last reply
                1
                • p3c0P p3c0

                  @Ying Where is the ListView loaded ?

                  but I can use the scroll bar to drag up the list.

                  Scrollbars of the ListView ? Is it that blank data is filled for initial rows ?

                  Y Offline
                  Y Offline
                  Ying
                  wrote on last edited by
                  #8

                  @p3c0 there is a ScrollView in each tab, and ListView is the child of the ScrollView, and the model is loaded in the ListView

                  1 Reply Last reply
                  0
                  • p3c0P Offline
                    p3c0P Offline
                    p3c0
                    Moderators
                    wrote on last edited by
                    #9

                    @Ying Well sorry, unfortunately its difficult to say about what might be the cause. Its really strange that it works after the first time inside Dialog. Does this model depends upon some data which is only available after first time ? But then it should have also affected the Item. If possible can you post a minimal example which can reproduce this problem ?

                    157

                    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