Forum > QT

How to dock forms into a MainForm Window (qt5) under windows?

<< < (2/2)

LeoBruno:
I came in to an issue that is probably a bug.

When a form get's docked, the main form (the dock panel parent), starts to asume the merhods assigned to the docked form Notify events.

For instance.

I inteded to prevent the docked form from closing.
So at the FormCloseQuery event, I assigned the value false to the CanClose var.

Initially I was under the impression that it worked, but when I tryied to close the main form, I couldn't do it.

For testing purposes, I assigned a showmessage, passing Self.Name to see what was going on, and the message showed the name of the main form when it should have showed the name of the parent form. (trying to close the parent form).

Very strange unwanted behaviour.

PascalDragon:

--- Quote from: LeoBruno on August 13, 2022, 01:48:11 am ---For testing purposes, I assigned a showmessage, passing Self.Name to see what was going on, and the message showed the name of the main form when it should have showed the name of the parent form. (trying to close the parent form).
--- End quote ---

From how I read your message both forms are one and the same. Further up you said that the main form is the one containing the TAnchorDockPanel, but now you also mention a parent, but the parent can only be the form containing the TAnchorDockPanel aka the main form. So what is it now? Maybe use class names to avoid confusing instead of saying “the form that contains this” or “the form that is the parent”.

zeljko:
Better create simple project which describes problem (eg MainForm + Panel + Form which should be docked to panel) and attach here so I'll take a look.

Navigation

[0] Message Index

[*] Previous page

Go to full version