Skip to content

QML: Fix Accidental Hiding of Main Window#12860

Closed
HTRamsey wants to merge 1 commit intomavlink:masterfrom
HTRamsey:dev-window-hide
Closed

QML: Fix Accidental Hiding of Main Window#12860
HTRamsey wants to merge 1 commit intomavlink:masterfrom
HTRamsey:dev-window-hide

Conversation

@HTRamsey
Copy link
Collaborator

Fix #12858

@HTRamsey
Copy link
Collaborator Author

@rubenp02 @DonLakeFlyer FYI

@rubenp02
Copy link
Contributor

Thank you! This was my bad.

@HTRamsey
Copy link
Collaborator Author

This one was tough because it wasn't what I was looking for at all. I'm not sure I actually understand how a Connections object changes the namespace to the mainwindow

@rubenp02
Copy link
Contributor

rubenp02 commented May 16, 2025

I'm not sure I actually understand how a Connections object changes the namespace to the mainwindow

AFAIK it's a child of its target.

@rubenp02
Copy link
Contributor

rubenp02 commented May 16, 2025

Might be a problem here as well, although I guess in this case it would just make the QML engine complain about the multiVehicleManager not having a property called "visible". Not 100% sure.

Coming to think of it, that entire Connections block is probably redundant because gotoLocationItem already becomes invisible under that same condition and fwdFlightGotoMapCircle has its visibility tied to it.

@DonLakeFlyer
Copy link
Collaborator

Hah, I was just hitting this debugging the usb pull crash. Wondering what the hell was going on!

@DonLakeFlyer
Copy link
Collaborator

I deal with this in my usb disconnect fix

@DonLakeFlyer
Copy link
Collaborator

For me, removing this:

       Connections {
            target: QGroundControl.multiVehicleManager
            function onActiveVehicleChanged(activeVehicle) {
                if (!activeVehicle) {
                    visible = false
                }
            }
        }

Isn't fixing the main window hide problem. No idea why...

@HTRamsey
Copy link
Collaborator Author

@DonLakeFlyer that one hides the flyview or something, the one with gotoLocationItem.hide() was hiding the whole window

@DonLakeFlyer
Copy link
Collaborator

@rubenp02 Not quite sure about whether both of the Connections blocks for null activeVehicle were added by you. If so, was there a reason why? Do you find a case which didn't work. There is already other code which tracks the _activeVehicle going away which works fine. I removed both blocks and tested that the goto location item goes away correctly. Did you see something different?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QGC crashes after disconnecting USB [Release V5.0]

3 participants