Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2007-06

QStyleOption

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Павел Ишенин

Hello, Qt-Lazarus mail list

I am writing this mail here since I cannot get any answer from Den Jean about 2 weeks and I think it is probably problems with delivering or spam filters.

In 1.30 version of bindings we have QStyleOption and descendants, but we have no getters and setters for various QStyleOption properties. Without them we cannot use that classes.

At this moment I need this setters:
- QStyleOptionButton_setButtonFeatures
- QStyleOption_setState
- QStyleOption_setRect

Best regards,
Paul Ishenin.

zeljko
to Павел Ишенин
????? ?????? wrote 14 lines
Hello, Qt-Lazarus mail list I am writing this mail here since I cannot get any answer from Den Jean about 2 weeks and I think it is probably problems with delivering or spam filters. In 1.30 version of bindings we have QStyleOption and descendants, but we have no getters and setters for various QStyleOption properties. Without them we cannot use that classes. At this moment I need this setters: - QStyleOptionButton_setButtonFeatures - QStyleOption_setState - QStyleOption_setRect

hm...there's no public "getters" and "setters" for QStyleOptionXXX, they are used just to describe drawing parameters of come control eg. Button.

zeljko

Павел Ишенин
to zeljko
zeljko wrote 22 lines
On Sunday 03 June 2007 18:12, ????? ?????? wrote: > Hello, Qt-Lazarus mail list > > I am writing this mail here since I cannot get any answer from Den Jean > about 2 weeks and I think it is probably problems with delivering or > spam filters. > > In 1.30 version of bindings we have QStyleOption and descendants, but we > have no getters and setters for various QStyleOption properties. Without > them we cannot use that classes. > > At this moment I need this setters: > - QStyleOptionButton_setButtonFeatures > - QStyleOption_setState > - QStyleOption_setRect > hm...there's no public "getters" and "setters" for QStyleOptionXXX, they are used just to describe drawing parameters of come control eg. Button.

Ok, lets look at example here
http://linux.fopf.mipt.ru/files/programming/qt/4.2/qstyleoption.html How can I set

option.state
option.features
option.text
option.icon

Maybe I should use other methods to access that object variables?

Best regards,
Paul Ishenin.

zeljko
to Павел Ишенин
????? ?????? wrote 28 lines
zeljko wrote: > On Sunday 03 June 2007 18:12, ????? ?????? wrote: >> Hello, Qt-Lazarus mail list >> >> I am writing this mail here since I cannot get any answer from Den Jean >> about 2 weeks and I think it is probably problems with delivering or >> spam filters. >> >> In 1.30 version of bindings we have QStyleOption and descendants, but we >> have no getters and setters for various QStyleOption properties. Without >> them we cannot use that classes. >> >> At this moment I need this setters: >> - QStyleOptionButton_setButtonFeatures >> - QStyleOption_setState >> - QStyleOption_setRect > > hm...there's no public "getters" and "setters" for QStyleOptionXXX, they > are used just to describe drawing parameters of come control eg. Button. Ok, lets look at example here http://linux.fopf.mipt.ru/files/programming/qt/4.2/qstyleoption.html How can I set option.state option.features option.text option.icon

hum...those are enums and public variables, som variables can be initialized via initFrom(const QWidget * widget), so for button you should use QStyleOptionButton(), create widget and give it to QStyleOption via initFrom(), widget already have a text, rect etc ...

Павел Ишенин
to zeljko
zeljko wrote 39 lines
On Sunday 03 June 2007 18:58, ????? ?????? wrote: > zeljko wrote: > >> On Sunday 03 June 2007 18:12, ????? ?????? wrote: >> >>> Hello, Qt-Lazarus mail list >>> >>> I am writing this mail here since I cannot get any answer from Den Jean >>> about 2 weeks and I think it is probably problems with delivering or >>> spam filters. >>> >>> In 1.30 version of bindings we have QStyleOption and descendants, but we >>> have no getters and setters for various QStyleOption properties. Without >>> them we cannot use that classes. >>> >>> At this moment I need this setters: >>> - QStyleOptionButton_setButtonFeatures >>> - QStyleOption_setState >>> - QStyleOption_setRect >>> >> hm...there's no public "getters" and "setters" for QStyleOptionXXX, they >> are used just to describe drawing parameters of come control eg. Button. >> > Ok, lets look at example here > http://linux.fopf.mipt.ru/files/programming/qt/4.2/qstyleoption.html > How can I set > > option.state > option.features > option.text > option.icon > hum...those are enums and public variables, som variables can be initialized via initFrom(const QWidget * widget), so for button you should use QStyleOptionButton(), create widget and give it to QStyleOption via initFrom(), widget already have a text, rect etc ...

But what should I do if have no widget? Where to get apropriate widget for TSpeedButton? for TSplitter? I need this for TQtThemeServices class implementation. I have no widgets but I need to widget parts. So I need some way to set that properties without InitFrom call.

Best regards,
Paul Ishenin.

Den Jean
to Павел Ишенин
some way to set that properties without InitFrom call.

Extract Qt Documentation:
For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.

.........

I will look into it. This probably will need some manual intervention, I did not notice that you did not have all you need. I am already in the midst of going to Qt 4.3.0, so please be patient

regards,

Den Jean

Павел Ишенин
to Den Jean
Den Jean wrote 16 lines
> some way to set that properties without InitFrom call. > Extract Qt Documentation: For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions. .......... I will look into it. This probably will need some manual intervention, I did not notice that you did not have all you need. I am already in the midst of going to Qt 4.3.0, so please be patient

Thanks, I will. I have about 4 other ThemeServices classes to play.

Best regards,
Paul Ishenin.

zeljko
to Павел Ишенин: But what should I do if have no widget? Where to get apropriate widget for TSpeedButton?…
????? ?????? wrote
But what should I do if have no widget? Where to get apropriate widget for TSpeedButton? for TSplitter? I need this for TQtThemeServices class implementation. I have no widgets but I need to widget parts. So I need some way to set that properties without InitFrom call.

TSplitter can have it's widget, we can create it, since we have TQtWSCustomSplitter in QtWSExtCtrls.
did U try to get result from TQtWidget(TSpeedButton.Handle).Widget ?

Павел Ишенин
to zeljko
zeljko wrote 12 lines
On Monday 04 June 2007 17:11, ????? ?????? wrote: > But what should I do if have no widget? Where to get apropriate widget > for TSpeedButton? for TSplitter? I need this for TQtThemeServices class > implementation. I have no widgets but I need to widget parts. So I need > some way to set that properties without InitFrom call. > TSplitter can have it's widget, we can create it, since we have TQtWSCustomSplitter in QtWSExtCtrls. did U try to get result from TQtWidget(TSpeedButton.Handle).Widget ?

TSplitter and TSpeedButton are painted through ThemeServices class now. To implement this painting under qt we need some methods to paint controls parts without having controls - only canvas, rectange and part :) This is already done and even works for most of widgetsets. Now it is time for QT widgetset. Qt library has apropriate methods to do this job and all I need is to get full access to QStyleOption.

About "TSplitter can have it's widget" - it can but not under all widgetsets. What can represent TSplitter widget under windows? There is no apropriate control and thats why TSplitter is TCustomControl that paints itself.

Best regards,
Paul Ishenin.

Den Jean
to Павел Ишенин: Hello, Qt-Lazarus mail list I am writing this mail here since I cannot get any answer…
????? ?????? wrote
At this moment I need this setters: ? ? ?- QStyleOptionButton_setButtonFeatures ? ? ?- QStyleOption_setState ? ? ?- QStyleOption_setRect

do you already have a standalone (not LCL) small pascal program that demoes this. I will then complete it by implementing getters/setters of some kind.

To test the manually generated setters/getters, it would be nice to have some demo.

I will first try to use overlaying pascal records (laid out as these Qt classes)
See: http://wiki.freepascal.org/index.php/Qt4_binding#Solution:Pascalify

regards,

Den Jean