Forum > QT

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

(1/2) > >>

LeoBruno:
Hi:

I want the main form to be a container for children forms.

I'm trying to achieve this using the following code:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    if not (Assigned(FViewPermissoesModulos)) then      FViewPermissoesModulos := TViewAtributoProjetoPermissoesModulos.Create(Self);     FViewPermissoesModulos.Dock(panel1, panel1.ClientRect);    FViewPermissoesModulos.BorderStyle := bsNone;    FViewPermissoesModulos.Align := alClient;    FViewPermissoesModulos.Show;   
It´s not working:

1 - The form is not docked to the panel1
2 - The created form has the border with the close icon

How can I achieve the goal?

thank's

LeoBruno:
Tryied with


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---     if not (Assigned(FViewPermissoesModulos)) then      FViewPermissoesModulos := TViewAtributoProjetoPermissoesModulos.Create(Self);     FViewPermissoesModulos.ManualDock(panel1);    FViewPermissoesModulos.BorderStyle := bsNone;    FViewPermissoesModulos.Align := alClient;    FViewPermissoesModulos.Show;   
it also didn't work

zamtmn:
Dock to TAnchorDockPanel?
see https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/37165 there is an example there

LeoBruno:
Thnak you for the answer.

It worked.



--- Quote from: zamtmn on August 10, 2022, 07:33:15 pm ---Dock to TAnchorDockPanel?
see https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/37165 there is an example there

--- End quote ---

LeoBruno:
Just to be clear, because someone might need this...

The following code works with win32 widget, just doesn't work with qt5


--- Quote from: LeoBruno on August 10, 2022, 06:29:46 pm ---Tryied with


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---     if not (Assigned(FViewPermissoesModulos)) then      FViewPermissoesModulos := TViewAtributoProjetoPermissoesModulos.Create(Self);     FViewPermissoesModulos.ManualDock(panel1);    FViewPermissoesModulos.BorderStyle := bsNone;    FViewPermissoesModulos.Align := alClient;    FViewPermissoesModulos.Show;   
it also didn't work

--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version