works in Rectangle but not in Dialog at the first run



  • 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


  • Moderators

    @Ying Hi
    What is shown improperly in Dialog ?



  • @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


  • Moderators

    @Ying Can you post the code ?



  • @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{ }
            }
        }
    }
    


  • @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


  • Moderators

    @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 ?



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


  • Moderators

    @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 ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.