Lazarus

Programming => Widgetset => QT => Topic started by: zamtmn on July 06, 2013, 07:29:21 am

Title: How to show a scrollbar on the TForm?
Post by: zamtmn on July 06, 2013, 07:29:21 am
How to show a scrollbar on the form?
Code: [Select]
procedure TForm1._oncreate(Sender: TObject);
begin
  self.VertScrollBar.Range:=1000;
end;
Works in GTK2, but does not work in qt
Title: Re: How to show a scrollbar on the TForm?
Post by: BigChimp on July 06, 2013, 08:02:18 am
Have you checked the Lazarus restriction browser to see if the LCL does support that on qt?
Title: Re: How to show a scrollbar on the TForm?
Post by: zeljko on July 06, 2013, 09:04:43 am
How to show a scrollbar on the form?
Code: [Select]
procedure TForm1._oncreate(Sender: TObject);
begin
  self.VertScrollBar.Range:=1000;
end;
Works in GTK2, but does not work in qt

No way atm. I must implement QAbstractScroll area for central widget on the form for that purpose.
Title: Re: How to show a scrollbar on the TForm?
Post by: zamtmn on July 06, 2013, 08:39:03 pm
>>BigChimp
No, I did not find there it

>>zeljko
This will be corrected, or will remain and need to do some other mechanism to scroll in my application?
Title: Re: How to show a scrollbar on the TForm?
Post by: taazz on July 06, 2013, 09:34:17 pm
I don't know if this will work on qt but have tried something stupid like

1) creat a Tshape with pen.style = psclear and brush.style := bsclear
2) Set Form.AutoScroll := true;
3) Set Shape1 Top := 3000, widht := 0; height := 0; left :=0 or 2000 for an horizintal bar too.

Title: Re: How to show a scrollbar on the TForm?
Post by: Blaazen on July 06, 2013, 09:54:06 pm
I tested and no, it does not work with qt. But works well with Gtk2.
Title: Re: How to show a scrollbar on the TForm?
Post by: zamtmn on July 06, 2013, 09:55:37 pm
No, does not work, scrollbars do not appear
Title: Re: How to show a scrollbar on the TForm?
Post by: taazz on July 06, 2013, 10:44:26 pm
Sorry I have no more ideas just one more reason not to use QT for now.
Title: Re: How to show a scrollbar on the TForm?
Post by: zeljko on July 07, 2013, 11:22:53 am
>>BigChimp
No, I did not find there it

>>zeljko
This will be corrected, or will remain and need to do some other mechanism to scroll in my application?

Yes it will be corrected, but do not expect it soon since I'm going to holidays in 2 weeks, and won't do anything about it before september/october. Workaround: add TScrollBox as child of form (alClient), put your controls there and then do whatever with your scrollbars.
Title: Re: How to show a scrollbar on the TForm?
Post by: zeljko on July 07, 2013, 11:23:11 am
Sorry I have no more ideas just one more reason not to use QT for now.

And what are other reasons ?
Title: Re: How to show a scrollbar on the TForm?
Post by: taazz on July 07, 2013, 12:12:30 pm
From the top of my head QT does not support MyVar := Form1.canvas.pixels[x,y]; It can't return data back, from 4 and up it doesn't support form2.popupparent := Form1; witch forces form2 to always stay on top of form1 regardless of focus .....

Oh well I can't think anything else now, need cofeee......
Title: Re: How to show a scrollbar on the TForm?
Post by: zamtmn on July 07, 2013, 08:48:31 pm
I create report http://bugs.freepascal.org/view.php?id=24715
taazz
I look at the development of GTK3 and WINDOWS8 and I think that only KDE@QT is right desktop for PC. QT need to use and develop
Title: Re: How to show a scrollbar on the TForm?
Post by: taazz on July 07, 2013, 09:30:06 pm
Desktop environments come and go, widget sets are what we use. even on windows I can completely replace explorer as the desktop environment if need it be.
Don't get me wrong I like QT I find it powerful enough to use it but not enough to drop win32 yet and compared with GTK it has its strong points if it could give more attention to basic functionality I wouldn't even think of using gtk.
Title: Re: How to show a scrollbar on the TForm?
Post by: zeljko on July 08, 2013, 08:02:12 am
From the top of my head QT does not support MyVar := Form1.canvas.pixels[x,y]; It can't return data back, from 4 and up it doesn't support form2.popupparent := Form1; witch forces form2 to always stay on top of form1 regardless of focus .....

Oh well I can't think anything else now, need cofeee......

Actually, DCGetPixel() works under qt (which is used by Canvas.Pixels[x, y] but only if bitmap is selected into device context.
Pls. open an issue about it and attach example which does not work.
TinyPortal © 2005-2018