[Interest] Support of ChromeOS

2024-06-24 Thread A. Klitzing
Hi there!

The list of supported platforms [1] shows that Qt does not officially
supports ChromeOS. We tried our Qt application for Android on ChromeOS
and found that it works good with some rough edges here and there.

Is it planed to support ChromeOS someday or accept bug reports for
Android applications on ChromeOS?

Best regards André Klitzing

[1] https://doc.qt.io/qt-6/supported-platforms.html
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMediaCaptureSession capture from QGraphicsScene?

2024-06-21 Thread Jøger Hansegård via Interest
> Do you have a link to that?

Unfortunately, the links to the tests were missing from the previous email. The 
current tests for encoding audio and video can be seen at 
https://github.com/qt/qtmultimedia/blob/dev/tests/auto/integration/qmediaframeinputsbackend/tst_qmediaframeinputsbackend.cpp.
 You may want to look at all the files in the test's directory: 
https://github.com/qt/qtmultimedia/tree/dev/tests/auto/integration/qmediaframeinputsbackend

In an earlier version of the tests, the usage pattern is a bit more explicit:
* 
https://github.com/qt/qtmultimedia/blob/c8ba076f80d1c100d237343a19887db51e091117/tests/auto/integration/qmediaframeinputsbackend/tst_qmediaframeinputsbackend.cpp

Thanks,
Jøger Hansegård
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMediaCaptureSession capture from QGraphicsScene?

2024-06-21 Thread David M. Cotter
Do you have a link to that?

> On Jun 21, 2024, at 4:52 AM, Volker Hilsheimer  
> wrote:
> 
> An early tests revision with a straight-forward flow

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] When we have a custom QQuickItem is there anything we need to in order to work with ShaderEffectSource?

2024-06-21 Thread Nuno Santos via Interest
Hi,

I have made a custom QQuickItem and now I’m trying to pass it through 
ShaderEffectSource in order to have a copy of it and then apply a FastBlur 
effect.

The problem is that it gives me nothing. Everything is black. But if I pass a 
rectangle with a basic color, it works.

Is there anything I need to make in order for a custom QQuickItem to work with 
ShaderEffectSource? I’m on Qt 6.6.3.

Regards,

Nuno
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMediaCaptureSession capture from QGraphicsScene?

2024-06-21 Thread Volker Hilsheimer via Interest
> On 19 Jun 2024, at 20:14, David M. Cotter  wrote:
> 
> If i have a QGraphicsScene (not necessarily connected to a view, or if 
> required, an OFFSCREEN view), can i set its output as the input to a 
> QMediaCaptureSession?
> I see i can connect a QWindowCapture, but must that window be showing? can 
> that window be invisible? eg: h.264 output in the background, unrelated to 
> the showing (visible) windows?
> I had asked this question a couple years ago, but times have changed and i 
> wonder if it is now possible?
> if it is not possible from QGraphicsScene directly, then how about a 
> temporary buffer of QImage? Can i feed QMediaCaptureSession a QImageCapture 
> class, then feed the QImageCapture class a series of QImage or QVideoFrame 
> refs?
> is there sample code for sending in-memory images into QMediaCaptureSession ?
> 
> -Dave


Hi Dave,

Forwarding Artem’s reply (which went to development@):


Thanks for the questions! 

In 6.8, we added QVideoFramesInput, and QAudioBufferInput, which can be 
connected toQMediaCaptureSession as inputs.
Let's go through the questions.

>  If i have a QGraphicsScene (not necessarily connected to a view, or if 
> required, an OFFSCREEN view), can i set its output as the input to a 
> QMediaCaptureSession?

You cannot set QGraphicsScene as an input to QMediaCaptureSession. Instead, you 
may render QGraphicsScene to QImage, construct QVideoFrame from the image, and 
send your sequence of images to QVideoFrameInput, connected to 
QMediaCaptureSession.


> I see i can connect a QWindowCapture, but must that window be showing? can 
> that window be invisible? eg: h.264 output in the background, unrelated to 
> the showing (visible) windows?

It’s platform-dependent. E.g. on Windows, we cannot capture invisible windows. 
On other platforms, it’s to be double-checked and documented, the ticket is 
https://bugreports.qt.io/browse/QTBUG-126552. 
In general, the result of QWindowCapture::capturableWindows is designed to 
represent the windows we can capture. If the list contains an invisible window 
that QtMM cannot capture, a ticket might be reported.


> if it is not possible from QGraphicsScene directly, then how about a 
> temporary buffer of QImage? Can i feed QMediaCaptureSession a QImageCapture 
> class, then feed the QImageCapture class a series of QImage or QVideoFrame 
> refs?

QImageCapture is rather an output for capturing image shots from cameras, 
screens, windows, so it doesn’t cover your needs. Please use QVideoFrameInput. 
In 6.8, you may create video frames from QImage or from your custom data via 
QAbstractVideoBuffer, see the constructors of QVideoFrame.


> is there sample code for sending in-memory images into QMediaCaptureSession ?


There are no code samples in the public documentation yet. We have a ticket for 
writing them:https://bugreports.qt.io/browse/QTBUG-126319.
Until we add the snippets or examples, you may take a look at the tests:
An early tests revision with a straight-forward flow.
The current tests revision is a bit harder to learn from. 



Regards
Artem


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QMediaCaptureSession capture from QGraphicsScene?

2024-06-19 Thread David M. Cotter
If i have a QGraphicsScene (not necessarily connected to a view, or if 
required, an OFFSCREEN view), can i set its output as the input to a 
QMediaCaptureSession?

I see i can connect a QWindowCapture, but must that window be showing? can that 
window be invisible? eg: h.264 output in the background, unrelated to the 
showing (visible) windows?

I had asked this question 
 a couple 
years ago, but times have changed and i wonder if it is now possible?

if it is not possible from QGraphicsScene directly, then how about a temporary 
buffer of QImage? Can i feed QMediaCaptureSession a QImageCapture class, then 
feed the QImageCapture class a series of QImage or QVideoFrame refs?

is there sample code for sending in-memory images into QMediaCaptureSession ?



-Dave___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] signing webenginewidgets issue

2024-06-16 Thread Hamish Moffatt via Interest
Hmm, I have different entitlements set here, as per 
https://forum.qt.io/topic/102212/qtwebengine-signing-issues/20


In short, the QtWebEngineProcess.app Helper within 
QtWebEngineCore.framework is signed with 
com.apple.security.cs.disable-executable-page-protection true.


Runtime is hard and the application is signed, notarised and packaged 
(and signed).


Hamish

On 15/6/24 22:23, Alexander Carôt via Interest wrote:

P.S.: Nevermind – I simply did not wait long enough for the app to be 
notarized. The solution for me was to only include this key:

com.apple.security.cs.allow-jit

and then I could sign, notarize and launch.


--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797



Gesendet: Samstag, 15. Juni 2024 um 13:44 Uhr
Von: "Alexander Carôt via Interest" 
An: "qt qt" 
Betreff: [Interest] signing webenginewidgets issue

Hello all,

I just saw an issue when signing and notarizing an app containing a web browser 
based on webenginewidgets (applies also for the Qt example minibrowser):

1.) Codesigning via

codesign --options=runtime --deep ./minibrowser.app -s "Developer ID Application: 
XXX"

works fine but breaks the app: Launching minibrowser afterwards makes the 
webprocess crash.

2.) Including the following keys into an entitlements file:

com.apple.security.cs.allow-jit
com.apple.security.cs.disable-library-validation
com.apple.security.cs.allow-dyld-environment-variables
com.apple.security.cs.allow-unsigned-executable-memory

and then signing via

codesign --options=runtime --entitlements ./entitlements.xml --deep ./minibrowser.app -s 
"Developer ID Application: XXX"

does not lead to the crash anymore and

codesign --verify --deep --strict --verbose=2 ./minibrowser.app

tells that all is signed just fine, however, when I package the app as a DMG, 
load it up to the web, load it down to my desktop and launch it, it tells me 
that the developer cannot be verified – so it basically tells that it is not 
signed.

The same happens when I only include the first key:

com.apple.security.cs.allow-jit

but here comes the message that the package cannot be opened because it cannot 
be checked in terms of malware etc.

Can anyone help with this ?

Thanks a lot in advance,
best

Alex




--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] signing webenginewidgets issue

2024-06-15 Thread Alexander Carôt via Interest
P.S.: Nevermind – I simply did not wait long enough for the app to be 
notarized. The solution for me was to only include this key:

com.apple.security.cs.allow-jit

and then I could sign, notarize and launch.


--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797


> Gesendet: Samstag, 15. Juni 2024 um 13:44 Uhr
> Von: "Alexander Carôt via Interest" 
> An: "qt qt" 
> Betreff: [Interest] signing webenginewidgets issue
>
> Hello all,
> 
> I just saw an issue when signing and notarizing an app containing a web 
> browser based on webenginewidgets (applies also for the Qt example 
> minibrowser):
> 
> 1.) Codesigning via 
> 
> codesign --options=runtime --deep ./minibrowser.app -s "Developer ID 
> Application: XXX" 
> 
> works fine but breaks the app: Launching minibrowser afterwards makes the 
> webprocess crash.
> 
> 2.) Including the following keys into an entitlements file:
> 
> com.apple.security.cs.allow-jit
> com.apple.security.cs.disable-library-validation
> com.apple.security.cs.allow-dyld-environment-variables
> com.apple.security.cs.allow-unsigned-executable-memory
> 
> and then signing via 
> 
> codesign --options=runtime --entitlements ./entitlements.xml --deep 
> ./minibrowser.app -s "Developer ID Application: XXX"
> 
> does not lead to the crash anymore and
> 
> codesign --verify --deep --strict --verbose=2 ./minibrowser.app
> 
> tells that all is signed just fine, however, when I package the app as a DMG, 
> load it up to the web, load it down to my desktop and launch it, it tells me 
> that the developer cannot be verified – so it basically tells that it is not 
> signed.
> 
> The same happens when I only include the first key:
> 
> com.apple.security.cs.allow-jit
> 
> but here comes the message that the package cannot be opened because it 
> cannot be checked in terms of malware etc.
> 
> Can anyone help with this ?
> 
> Thanks a lot in advance,
> best
> 
> Alex
> 
> 
> 
> 
> --
> http://www.carot.de
> Email : alexan...@carot.de
> Tel.: +49 (0)177 5719797
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] signing webenginewidgets issue

2024-06-15 Thread Alexander Carôt via Interest
Hello all,

I just saw an issue when signing and notarizing an app containing a web browser 
based on webenginewidgets (applies also for the Qt example minibrowser):

1.) Codesigning via 

codesign --options=runtime --deep ./minibrowser.app -s "Developer ID 
Application: XXX" 

works fine but breaks the app: Launching minibrowser afterwards makes the 
webprocess crash.

2.) Including the following keys into an entitlements file:

com.apple.security.cs.allow-jit
com.apple.security.cs.disable-library-validation
com.apple.security.cs.allow-dyld-environment-variables
com.apple.security.cs.allow-unsigned-executable-memory

and then signing via 

codesign --options=runtime --entitlements ./entitlements.xml --deep 
./minibrowser.app -s "Developer ID Application: XXX"

does not lead to the crash anymore and

codesign --verify --deep --strict --verbose=2 ./minibrowser.app

tells that all is signed just fine, however, when I package the app as a DMG, 
load it up to the web, load it down to my desktop and launch it, it tells me 
that the developer cannot be verified – so it basically tells that it is not 
signed.

The same happens when I only include the first key:

com.apple.security.cs.allow-jit

but here comes the message that the package cannot be opened because it cannot 
be checked in terms of malware etc.

Can anyone help with this ?

Thanks a lot in advance,
best

Alex




--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QAccessibleAnnouncementEvent on a non-object class

2024-06-13 Thread Volker Hilsheimer via Interest
Your MainWindow::slotOnAnnouncement(const QString )

does the right thing: create the event with the message string, and send it to 
the accessibility system via updateAccessibility().

You can call that function from any code where you have access to your 
MainWindow instance; and you can add a second (possibly defaulted) “QObject *” 
parameter if other code needs that announcement to be made on behalf of other 
objects. Or you can just as well use those exact two lines of code anywhere 
else you need to make an announcement.

I don’t think keeping making the QAccessibleAnnouncementEvent object accessible 
for other code to modify it before you send it with updateAccessibility() would 
be an improvement.

Volker


> On 13 Jun 2024, at 13:32, Corentin Bacqué-cazenave  
> wrote:
> 
> My idea is to instantiate QAccessibleAnnouncementEvent in the main window 
> class of the app, and then exteren this instance to use in other class. Then, 
> we can just call the instance with setMessage.
> For now I tried to extern a QObject of my main window and use this object in 
> my non object class, but it seams to be not working.
> So, yes, probably add a setMessage method can help.
> If it can helps to understand what I'm trying to do, you can check here:
> WIP: Support Qt Accessibility Announcement for TTS events by CoBC · Pull 
> Request #2366 · BearWare/TeamTalk5 (github.com)
> Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité & 
> Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 100% 
> Handinamique
> Le 13/06/2024 à 13:27, Volker Hilsheimer a écrit :
>> I don’t think I understand the problem.
>> 
>> Are you not able to instantiate QAccessibleAnnouncementEvent because you are 
>> not in C++? Or do you not have access to Qt APIs?
>> 
>> If adding QAccessibleAnnouncementEvent::setMessage would help, then how do 
>> you get hold of the QAccessibleAnnouncementEvent instance to call that 
>> method on?
>> 
>> 
>> FWIW, QAccessibleAnnouncementEvent, is a new type in Qt 6.8, and we are 
>> still in beta, so if there’s anything missing from that class to make it 
>> usable, then there’s still time to add it.
>> 
>> Volker
>> 
>> 
>> 
>>> On 13 Jun 2024, at 12:28, Corentin Bacqué-cazenave 
>>>  wrote:
>>> 
>>> Hi,
>>> yes, I understand, but in this case, how should we make to send a 
>>> notification from everywhere. In the project I'm contributing to, we have 
>>> to send notification for some events (E.G. by an user send a message, or 
>>> when we change the volume), so we have just a method to send a text to 
>>> speech message, but this method can be called from any object class.
>>> A solution could be to extern the QAccessibleAnnouncementEvent, but 
>>> unfortunately we don't have a setMessage method so we can't do this :(
>>> Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité 
>>> & Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 
>>> 100% Handinamique
>>> Le 13/06/2024 à 12:14, Volker Hilsheimer a écrit :
>>> 
> On 13 Jun 2024, at 11:48, Corentin Bacqué-cazenave via Interest 
>  wrote:
> 
> Hi,
> I'm trying to implement the new QAccessibleAnnouncementEvent in my 
> project. However, I have a class to hander some TTS functions, and this 
> class is not derived from QObject.
> Is there a way to use QAccessibleAnnouncementEvent to send a notification 
> to screenreaders without a QObject class? I saw we can also use a 
> QAccessibleInterface but it seams we also need a QObject for this.
> Does anyone have a solution?
> Thanks.
> -- 
> Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission 
> Cécité & Co et Mandataire CNCPH à la commission Accessibilité Universelle 
> - Fédé 100% Handinamique
> 
> 
 Hi Corentin,
 
 
 Qt's accessibility framework is based on a tree of QAcessibleInterfaces. 
 For most cases, that tree mirrors the corresponding QObject trees. Only 
 QObjects can respond to events (which is required to handle incoming 
 calls), so an introspection through accessibility technology has to start 
 with something that is a QObject (typically a widget).
 
 But e.g. an item view’s items are not QObjects, so the implementation of 
 QAccessibleInterface for an item view returns interfaces for items based 
 on their position in the view. To raise an event for such an item, you 
 have to get the interface for that item, and then you can construct a 
 QAccessibleAnnouncementEvent with that interface.
 
 Alternatively, if you have only one level of children and already have the 
 QObject that they belong to, then you can create the event with the 
 QObject, and the child index by calling QAccessibleEvent::setChild.
 
 
 Volker
 
 
 
 
>> 

___
Interest mailing list
Interest@qt-project.org

Re: [Interest] QAccessibleAnnouncementEvent on a non-object class

2024-06-13 Thread Volker Hilsheimer via Interest
> On 13 Jun 2024, at 11:48, Corentin Bacqué-cazenave via Interest 
>  wrote:
> 
> Hi,
> I'm trying to implement the new QAccessibleAnnouncementEvent in my project. 
> However, I have a class to hander some TTS functions, and this class is not 
> derived from QObject.
> Is there a way to use QAccessibleAnnouncementEvent to send a notification to 
> screenreaders without a QObject class? I saw we can also use a 
> QAccessibleInterface but it seams we also need a QObject for this.
> Does anyone have a solution?
> Thanks.
> -- 
> Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité & 
> Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 100% 
> Handinamique

Hi Corentin,


Qt's accessibility framework is based on a tree of QAcessibleInterfaces. For 
most cases, that tree mirrors the corresponding QObject trees. Only QObjects 
can respond to events (which is required to handle incoming calls), so an 
introspection through accessibility technology has to start with something that 
is a QObject (typically a widget).

But e.g. an item view’s items are not QObjects, so the implementation of 
QAccessibleInterface for an item view returns interfaces for items based on 
their position in the view. To raise an event for such an item, you have to get 
the interface for that item, and then you can construct a 
QAccessibleAnnouncementEvent with that interface.

Alternatively, if you have only one level of children and already have the 
QObject that they belong to, then you can create the event with the QObject, 
and the child index by calling QAccessibleEvent::setChild.


Volker


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QAccessibleAnnouncementEvent on a non-object class

2024-06-13 Thread Corentin Bacqué-cazenave via Interest
My idea is to instantiate QAccessibleAnnouncementEvent in the main 
window class of the app, and then exteren this instance to use in other 
class. Then, we can just call the instance with setMessage.


For now I tried to extern a QObject of my main window and use this 
object in my non object class, but it seams to be not working.


So, yes, probably add a setMessage method can help.

If it can helps to understand what I'm trying to do, you can check here:

WIP: Support Qt Accessibility Announcement for TTS events by CoBC · Pull 
Request #2366 · BearWare/TeamTalk5 (github.com) 



Corentin : expert certifié 2022 et Sponsor 
 NVDA, Référent commission 
Cécité & Co et Mandataire CNCPH à la commission Accessibilité 
Universelle - Fédé 100% Handinamique 


Le 13/06/2024 à 13:27, Volker Hilsheimer a écrit :

I don’t think I understand the problem.

Are you not able to instantiate QAccessibleAnnouncementEvent because you are 
not in C++? Or do you not have access to Qt APIs?

If adding QAccessibleAnnouncementEvent::setMessage would help, then how do you 
get hold of the QAccessibleAnnouncementEvent instance to call that method on?


FWIW, QAccessibleAnnouncementEvent, is a new type in Qt 6.8, and we are still 
in beta, so if there’s anything missing from that class to make it usable, then 
there’s still time to add it.

Volker

  

On 13 Jun 2024, at 12:28, Corentin Bacqué-cazenave 
wrote:

Hi,
yes, I understand, but in this case, how should we make to send a notification 
from everywhere. In the project I'm contributing to, we have to send 
notification for some events (E.G. by an user send a message, or when we change 
the volume), so we have just a method to send a text to speech message, but 
this method can be called from any object class.
A solution could be to extern the QAccessibleAnnouncementEvent, but 
unfortunately we don't have a setMessage method so we can't do this :(
Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité & 
Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 100% 
Handinamique
Le 13/06/2024 à 12:14, Volker Hilsheimer a écrit :

On 13 Jun 2024, at 11:48, Corentin Bacqué-cazenave via 
Interest wrote:

Hi,
I'm trying to implement the new QAccessibleAnnouncementEvent in my project. 
However, I have a class to hander some TTS functions, and this class is not 
derived from QObject.
Is there a way to use QAccessibleAnnouncementEvent to send a notification to 
screenreaders without a QObject class? I saw we can also use a 
QAccessibleInterface but it seams we also need a QObject for this.
Does anyone have a solution?
Thanks.
--
Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité & 
Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 100% 
Handinamique


Hi Corentin,


Qt's accessibility framework is based on a tree of QAcessibleInterfaces. For 
most cases, that tree mirrors the corresponding QObject trees. Only QObjects 
can respond to events (which is required to handle incoming calls), so an 
introspection through accessibility technology has to start with something that 
is a QObject (typically a widget).

But e.g. an item view’s items are not QObjects, so the implementation of 
QAccessibleInterface for an item view returns interfaces for items based on 
their position in the view. To raise an event for such an item, you have to get 
the interface for that item, and then you can construct a 
QAccessibleAnnouncementEvent with that interface.

Alternatively, if you have only one level of children and already have the 
QObject that they belong to, then you can create the event with the QObject, 
and the child index by calling QAccessibleEvent::setChild.


Volker


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QAccessibleAnnouncementEvent on a non-object class

2024-06-13 Thread Volker Hilsheimer via Interest
I don’t think I understand the problem.

Are you not able to instantiate QAccessibleAnnouncementEvent because you are 
not in C++? Or do you not have access to Qt APIs?

If adding QAccessibleAnnouncementEvent::setMessage would help, then how do you 
get hold of the QAccessibleAnnouncementEvent instance to call that method on?


FWIW, QAccessibleAnnouncementEvent, is a new type in Qt 6.8, and we are still 
in beta, so if there’s anything missing from that class to make it usable, then 
there’s still time to add it.

Volker

 
> On 13 Jun 2024, at 12:28, Corentin Bacqué-cazenave  
> wrote:
> 
> Hi,
> yes, I understand, but in this case, how should we make to send a 
> notification from everywhere. In the project I'm contributing to, we have to 
> send notification for some events (E.G. by an user send a message, or when we 
> change the volume), so we have just a method to send a text to speech 
> message, but this method can be called from any object class.
> A solution could be to extern the QAccessibleAnnouncementEvent, but 
> unfortunately we don't have a setMessage method so we can't do this :(
> Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité & 
> Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 100% 
> Handinamique
> Le 13/06/2024 à 12:14, Volker Hilsheimer a écrit :
>>> On 13 Jun 2024, at 11:48, Corentin Bacqué-cazenave via Interest 
>>>  wrote:
>>> 
>>> Hi,
>>> I'm trying to implement the new QAccessibleAnnouncementEvent in my project. 
>>> However, I have a class to hander some TTS functions, and this class is not 
>>> derived from QObject.
>>> Is there a way to use QAccessibleAnnouncementEvent to send a notification 
>>> to screenreaders without a QObject class? I saw we can also use a 
>>> QAccessibleInterface but it seams we also need a QObject for this.
>>> Does anyone have a solution?
>>> Thanks.
>>> -- 
>>> Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité 
>>> & Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 
>>> 100% Handinamique
>>> 
>> Hi Corentin,
>> 
>> 
>> Qt's accessibility framework is based on a tree of QAcessibleInterfaces. For 
>> most cases, that tree mirrors the corresponding QObject trees. Only QObjects 
>> can respond to events (which is required to handle incoming calls), so an 
>> introspection through accessibility technology has to start with something 
>> that is a QObject (typically a widget).
>> 
>> But e.g. an item view’s items are not QObjects, so the implementation of 
>> QAccessibleInterface for an item view returns interfaces for items based on 
>> their position in the view. To raise an event for such an item, you have to 
>> get the interface for that item, and then you can construct a 
>> QAccessibleAnnouncementEvent with that interface.
>> 
>> Alternatively, if you have only one level of children and already have the 
>> QObject that they belong to, then you can create the event with the QObject, 
>> and the child index by calling QAccessibleEvent::setChild.
>> 
>> 
>> Volker
>> 
>> 
>> 

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QAccessibleAnnouncementEvent on a non-object class

2024-06-13 Thread Corentin Bacqué-cazenave via Interest

Hi,

yes, I understand, but in this case, how should we make to send a 
notification from everywhere. In the project I'm contributing to, we 
have to send notification for some events (E.G. by an user send a 
message, or when we change the volume), so we have just a method to send 
a text to speech message, but this method can be called from any object 
class.


A solution could be to extern the QAccessibleAnnouncementEvent, but 
unfortunately we don't have a setMessage method so we can't do this :(


Corentin : expert certifié 2022 et Sponsor 
 NVDA, Référent commission 
Cécité & Co et Mandataire CNCPH à la commission Accessibilité 
Universelle - Fédé 100% Handinamique 


Le 13/06/2024 à 12:14, Volker Hilsheimer a écrit :

On 13 Jun 2024, at 11:48, Corentin Bacqué-cazenave via 
Interest wrote:

Hi,
I'm trying to implement the new QAccessibleAnnouncementEvent in my project. 
However, I have a class to hander some TTS functions, and this class is not 
derived from QObject.
Is there a way to use QAccessibleAnnouncementEvent to send a notification to 
screenreaders without a QObject class? I saw we can also use a 
QAccessibleInterface but it seams we also need a QObject for this.
Does anyone have a solution?
Thanks.
--
Corentin : expert certifié 2022 et Sponsor NVDA, Référent commission Cécité & 
Co et Mandataire CNCPH à la commission Accessibilité Universelle - Fédé 100% 
Handinamique

Hi Corentin,


Qt's accessibility framework is based on a tree of QAcessibleInterfaces. For 
most cases, that tree mirrors the corresponding QObject trees. Only QObjects 
can respond to events (which is required to handle incoming calls), so an 
introspection through accessibility technology has to start with something that 
is a QObject (typically a widget).

But e.g. an item view’s items are not QObjects, so the implementation of 
QAccessibleInterface for an item view returns interfaces for items based on 
their position in the view. To raise an event for such an item, you have to get 
the interface for that item, and then you can construct a 
QAccessibleAnnouncementEvent with that interface.

Alternatively, if you have only one level of children and already have the 
QObject that they belong to, then you can create the event with the QObject, 
and the child index by calling QAccessibleEvent::setChild.


Volker

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QAccessibleAnnouncementEvent on a non-object class

2024-06-13 Thread Corentin Bacqué-cazenave via Interest

Hi,

I'm trying to implement the new QAccessibleAnnouncementEvent in my 
project. However, I have a class to hander some TTS functions, and this 
class is not derived from QObject.


Is there a way to use QAccessibleAnnouncementEvent to send a 
notification to screenreaders without a QObject class? I saw we can also 
use a QAccessibleInterface but it seams we also need a QObject for this.


Does anyone have a solution?

Thanks.

--

Corentin : expert certifié 2022 et Sponsor 
 NVDA, Référent commission 
Cécité & Co et Mandataire CNCPH à la commission Accessibilité 
Universelle - Fédé 100% Handinamique 
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QtVirtualKeyboard Raspi4 Wayland

2024-06-10 Thread Alexander Carôt via Interest
Hello all,

I tried to get QtVirtualKeyboard running on a Raspi4 (Bookworm / Wayland) with 
a touch screen but it seems to recognize it as a desktop app:

Project ERROR: Could not find feature vkb-desktop.

When I force to run it as non-vkb-desktop it compiles fine but when running the 
binary it says

"qt.qpa-plugin: Could not find the Qt platform "wayland in "" "

and then complains about numerous non-existing QML files.

Before I start researching/fixing I wonder if QtVirtualKeyboard should with 
Raspi4/Wayland at all.

Thanks in advance for hints of any kind,
best

Alex


--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QML: weird popup positioning in ComboBox

2024-06-09 Thread Alexander Dyagilev
Hello,

I'm trying to customize my ComboBox. All is working fine except that the
Popup is positioned above the control.

I'm overriding popup using examples in docs. I set its y position to y:
combo.height-1. I.e.

ComboBox {
id: combo
.
popup: Popup {
 y: combo.height-1
}
}

Sometimes it works as expected, sometimes - it does not. See the screenshot
below:

[image: image.png]

If I set popup's y to some small value, e.g. 5 (five pixels), it works
"better". Now at least it's positioning it below the combo:

[image: image.png]
If I set it to 10 pixels, this weird thing happens:

[image: image.png]

What is going on? Is it me? Or maybe it's a Qt bug?
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt 6.6.1 - MacOS] qt.permissions: Could not find permission plugin for QCameraPermission.

2024-06-08 Thread David M. Cotter
Is there a simpler way to do this? Like something in the PLIST file?

> On Jun 7, 2024, at 1:23 PM, Nuno Santos via Interest 
>  wrote:
> 
> Tor,
> 
> Setting QMAKE_INFO_PLIST made the trick.
> 
> This should be referenced on the documentation though.
> 
> Thank you!
> 
> Have a great weekend!
> 
> Best,
> 
> Nuno
> 
>> On 7 Jun 2024, at 17:11, Tor Arne Vestbø  wrote:
>> 
>> If you set QMAKE_INFO_PLIST the permission.prf logic should resolve the 
>> required permission plugins automatically. If you have a 6.6.3 or 6.7.x 
>> based sample that reproduces that not working please file an issue.
>> 
>> The part you’re missing is likely the QMAKE_LFLAGS += $$request_flag
>> 
>> 
>> ❯ cat ../../qtbase/mkspecs/modules/qt_plugin_qdarwincamerapermission.pri 
>>   12s
>> QT_PLUGIN.qdarwincamerapermission.TYPE = permissions
>> QT_PLUGIN.qdarwincamerapermission.EXTENDS = -
>> QT_PLUGIN.qdarwincamerapermission.DEPENDS = core
>> QT_PLUGIN.qdarwincamerapermission.CLASS_NAME = QDarwinCameraPermissionPlugin
>> QT_PLUGIN.qdarwincamerapermission.module_config = v2 staticlib
>> QT_PLUGINS += qdarwincamerapermission
>> QT_PLUGIN.qdarwincamerapermission.usage_descriptions = 
>> NSCameraUsageDescription
>> QT_PLUGIN.qdarwincamerapermission.request_flag = 
>> -Wl,-u,_QDarwinCameraPermissionRequest
>> 
>> ❯ cat ../../qtbase/mkspecs/modules/qt_plugin_qdarwinmicrophonepermission.pri
>> QT_PLUGIN.qdarwinmicrophonepermission.TYPE = permissions
>> QT_PLUGIN.qdarwinmicrophonepermission.EXTENDS = -
>> QT_PLUGIN.qdarwinmicrophonepermission.DEPENDS = core
>> QT_PLUGIN.qdarwinmicrophonepermission.CLASS_NAME = 
>> QDarwinMicrophonePermissionPlugin
>> QT_PLUGIN.qdarwinmicrophonepermission.module_config = v2 staticlib
>> QT_PLUGINS += qdarwinmicrophonepermission
>> QT_PLUGIN.qdarwinmicrophonepermission.usage_descriptions = 
>> NSMicrophoneUsageDescription
>> QT_PLUGIN.qdarwinmicrophonepermission.request_flag = 
>> -Wl,-u,_QDarwinMicrophonePermissionRequest
>> 
>>> On 7 Jun 2024, at 18:02, Nuno Santos  wrote:
>>> 
>>> Tor,
>>> 
>>> Thanks for your reply. I’m still using QMake
>>> 
>>> After a long time debugging I have realised that there is some kind of 
>>> magic involved in using QPermission api.
>>> 
>>> I have found a qmake script that seems to look at Info.plist and search for 
>>> the necessary key: qtbase/mkspecs/features/permissions.prf
>>> 
>>> Also, it seems that a QT_PLUGIN must be set in qmake in order to link the 
>>> appropriate plugin.
>>> 
>>> But this is not stated anywhere in the documentation therefore I’m linking 
>>> the plugin manually:
>>> 
>>> LIBS += 
>>> /Users/nsantos/Qt/6.6.3/macos_static/plugins/permissions/libqdarwincamerapermission.a
>>> 
>>> And I’m registering the plugin manually using: 
>>> Q_IMPORT_PLUGIN(QDarwinCameraPermissionPlugin)
>>> 
>>> When running the program I don’t have the same message anymore but it is 
>>> still complaining about the key not being on the Info.plist when it is.
>>> 
>>> checking permissions Qt::PermissionStatus::Undetermined
>>> qt.permissions: Requesting QCameraPermission requires 
>>> "NSCameraUsageDescription" in Info.plist
>>> 
>>> The application is code signed with the camera entitlements:
>>> 
>>> Executable=/private/tmp/build-vs-Qt_6_6_3_for_macOS_static-Release/VS.app/Contents/MacOS/VS
>>> [Dict]
>>> [Key] com.apple.security.device.audio-input
>>> [Value]
>>> [Bool] true
>>> [Key] com.apple.security.device.camera
>>> [Value]
>>> [Bool] true
>>> 
>>> 
>>> >> "http://www.apple.com/DTDs/PropertyList-1.0.dtd;>
>>> 
>>> 
>>> CFBundleExecutable
>>> VS
>>> CFBundleGetInfoString
>>> 1.6.0
>>> CFBundleIconFile
>>> icon.icns
>>> CFBundleIdentifier
>>> com.imaginando.vs
>>> CFBundlePackageType
>>> APPL
>>> CFBundleShortVersionString
>>> 1.6.0
>>> CFBundleSignature
>>> 
>>> CFBundleVersion
>>> 1.6.0
>>> NSCameraUsageDescription
>>> You can use camera input to create audio reactive 
>>> visuals
>>> NSMicrophoneUsageDescription
>>> You can use audio input to create audio reactive 
>>> visuals
>>> NSPrincipalClass
>>> NSApplication
>>> NSSupportsAutomaticGraphicsSwitching
>>> 
>>> 
>>> 
>>> 
>>> What am I missing?
>>> 
>>> Thanks!
>>> 
>>> Regards,
>>> 
>>> Nuno
>>> 
 On 7 Jun 2024, at 16:32, Tor Arne Vestbø  wrote:
 
 Is the problem there in v6.6.3 as well? qmake or CMake based project?
 
 Tor Arne
 
> On 7 Jun 2024, at 16:44, Nuno Santos via Interest 
>  wrote:
> 
> Hi,
> 
> I’m trying to use the new QPermissions API on Qt 6.6.1 on a Mac but I’m 
> having a problem.
> 
> Even the app is code signed, has the necessary NSCameraUsageDescription 
> on the Info.plist I always get the following message:
> 
> qt.permissions: Could not find permission plugin for QCameraPermission. 
> Please make sure you have included the required usage 

Re: [Interest] [Qt 6.6.1 - MacOS] qt.permissions: Could not find permission plugin for QCameraPermission.

2024-06-07 Thread Nuno Santos via Interest
Tor,

Setting QMAKE_INFO_PLIST made the trick.

This should be referenced on the documentation though.

Thank you!

Have a great weekend!

Best,

Nuno

> On 7 Jun 2024, at 17:11, Tor Arne Vestbø  wrote:
> 
> If you set QMAKE_INFO_PLIST the permission.prf logic should resolve the 
> required permission plugins automatically. If you have a 6.6.3 or 6.7.x based 
> sample that reproduces that not working please file an issue.
> 
> The part you’re missing is likely the QMAKE_LFLAGS += $$request_flag
> 
> 
> ❯ cat ../../qtbase/mkspecs/modules/qt_plugin_qdarwincamerapermission.pri  
>  12s
> QT_PLUGIN.qdarwincamerapermission.TYPE = permissions
> QT_PLUGIN.qdarwincamerapermission.EXTENDS = -
> QT_PLUGIN.qdarwincamerapermission.DEPENDS = core
> QT_PLUGIN.qdarwincamerapermission.CLASS_NAME = QDarwinCameraPermissionPlugin
> QT_PLUGIN.qdarwincamerapermission.module_config = v2 staticlib
> QT_PLUGINS += qdarwincamerapermission
> QT_PLUGIN.qdarwincamerapermission.usage_descriptions = 
> NSCameraUsageDescription
> QT_PLUGIN.qdarwincamerapermission.request_flag = 
> -Wl,-u,_QDarwinCameraPermissionRequest
> 
> ❯ cat ../../qtbase/mkspecs/modules/qt_plugin_qdarwinmicrophonepermission.pri
> QT_PLUGIN.qdarwinmicrophonepermission.TYPE = permissions
> QT_PLUGIN.qdarwinmicrophonepermission.EXTENDS = -
> QT_PLUGIN.qdarwinmicrophonepermission.DEPENDS = core
> QT_PLUGIN.qdarwinmicrophonepermission.CLASS_NAME = 
> QDarwinMicrophonePermissionPlugin
> QT_PLUGIN.qdarwinmicrophonepermission.module_config = v2 staticlib
> QT_PLUGINS += qdarwinmicrophonepermission
> QT_PLUGIN.qdarwinmicrophonepermission.usage_descriptions = 
> NSMicrophoneUsageDescription
> QT_PLUGIN.qdarwinmicrophonepermission.request_flag = 
> -Wl,-u,_QDarwinMicrophonePermissionRequest
> 
>> On 7 Jun 2024, at 18:02, Nuno Santos  wrote:
>> 
>> Tor,
>> 
>> Thanks for your reply. I’m still using QMake
>> 
>> After a long time debugging I have realised that there is some kind of magic 
>> involved in using QPermission api.
>> 
>> I have found a qmake script that seems to look at Info.plist and search for 
>> the necessary key: qtbase/mkspecs/features/permissions.prf
>> 
>> Also, it seems that a QT_PLUGIN must be set in qmake in order to link the 
>> appropriate plugin.
>> 
>> But this is not stated anywhere in the documentation therefore I’m linking 
>> the plugin manually:
>> 
>> LIBS += 
>> /Users/nsantos/Qt/6.6.3/macos_static/plugins/permissions/libqdarwincamerapermission.a
>> 
>> And I’m registering the plugin manually using: 
>> Q_IMPORT_PLUGIN(QDarwinCameraPermissionPlugin)
>> 
>> When running the program I don’t have the same message anymore but it is 
>> still complaining about the key not being on the Info.plist when it is.
>> 
>> checking permissions Qt::PermissionStatus::Undetermined
>> qt.permissions: Requesting QCameraPermission requires 
>> "NSCameraUsageDescription" in Info.plist
>> 
>> The application is code signed with the camera entitlements:
>> 
>> Executable=/private/tmp/build-vs-Qt_6_6_3_for_macOS_static-Release/VS.app/Contents/MacOS/VS
>> [Dict]
>>  [Key] com.apple.security.device.audio-input
>>  [Value]
>>  [Bool] true
>>  [Key] com.apple.security.device.camera
>>  [Value]
>>  [Bool] true
>> 
>> 
>> > "http://www.apple.com/DTDs/PropertyList-1.0.dtd;>
>> 
>> 
>>  CFBundleExecutable
>>  VS
>>  CFBundleGetInfoString
>>  1.6.0
>>  CFBundleIconFile
>>  icon.icns
>>  CFBundleIdentifier
>>  com.imaginando.vs
>>  CFBundlePackageType
>>  APPL
>>  CFBundleShortVersionString
>>  1.6.0
>>  CFBundleSignature
>>  
>>  CFBundleVersion
>>  1.6.0
>>  NSCameraUsageDescription
>>  You can use camera input to create audio reactive 
>> visuals
>>  NSMicrophoneUsageDescription
>>  You can use audio input to create audio reactive 
>> visuals
>>  NSPrincipalClass
>>  NSApplication
>>  NSSupportsAutomaticGraphicsSwitching
>>  
>> 
>> 
>> 
>> What am I missing?
>> 
>> Thanks!
>> 
>> Regards,
>> 
>> Nuno
>> 
>>> On 7 Jun 2024, at 16:32, Tor Arne Vestbø  wrote:
>>> 
>>> Is the problem there in v6.6.3 as well? qmake or CMake based project?
>>> 
>>> Tor Arne
>>> 
 On 7 Jun 2024, at 16:44, Nuno Santos via Interest 
  wrote:
 
 Hi,
 
 I’m trying to use the new QPermissions API on Qt 6.6.1 on a Mac but I’m 
 having a problem.
 
 Even the app is code signed, has the necessary NSCameraUsageDescription on 
 the Info.plist I always get the following message:
 
 qt.permissions: Could not find permission plugin for QCameraPermission. 
 Please make sure you have included the required usage description in your 
 Info.plist
 
 I’ve looked to the source code and it seems that it tried to load a plugin 
 and this message is only shown when the plugin is not found.
 
 I’ve also checked the qt build to see if the lib was around.
 
 Am I 

Re: [Interest] [Qt 6.6.1 - MacOS] qt.permissions: Could not find permission plugin for QCameraPermission.

2024-06-07 Thread Tor Arne Vestbø via Interest
If you set QMAKE_INFO_PLIST the permission.prf logic should resolve the 
required permission plugins automatically. If you have a 6.6.3 or 6.7.x based 
sample that reproduces that not working please file an issue.

The part you’re missing is likely the QMAKE_LFLAGS += $$request_flag


❯ cat ../../qtbase/mkspecs/modules/qt_plugin_qdarwincamerapermission.pri
   12s
QT_PLUGIN.qdarwincamerapermission.TYPE = permissions
QT_PLUGIN.qdarwincamerapermission.EXTENDS = -
QT_PLUGIN.qdarwincamerapermission.DEPENDS = core
QT_PLUGIN.qdarwincamerapermission.CLASS_NAME = QDarwinCameraPermissionPlugin
QT_PLUGIN.qdarwincamerapermission.module_config = v2 staticlib
QT_PLUGINS += qdarwincamerapermission
QT_PLUGIN.qdarwincamerapermission.usage_descriptions = NSCameraUsageDescription
QT_PLUGIN.qdarwincamerapermission.request_flag = 
-Wl,-u,_QDarwinCameraPermissionRequest

❯ cat ../../qtbase/mkspecs/modules/qt_plugin_qdarwinmicrophonepermission.pri
QT_PLUGIN.qdarwinmicrophonepermission.TYPE = permissions
QT_PLUGIN.qdarwinmicrophonepermission.EXTENDS = -
QT_PLUGIN.qdarwinmicrophonepermission.DEPENDS = core
QT_PLUGIN.qdarwinmicrophonepermission.CLASS_NAME = 
QDarwinMicrophonePermissionPlugin
QT_PLUGIN.qdarwinmicrophonepermission.module_config = v2 staticlib
QT_PLUGINS += qdarwinmicrophonepermission
QT_PLUGIN.qdarwinmicrophonepermission.usage_descriptions = 
NSMicrophoneUsageDescription
QT_PLUGIN.qdarwinmicrophonepermission.request_flag = 
-Wl,-u,_QDarwinMicrophonePermissionRequest

> On 7 Jun 2024, at 18:02, Nuno Santos  wrote:
>
> Tor,
>
> Thanks for your reply. I’m still using QMake
>
> After a long time debugging I have realised that there is some kind of magic 
> involved in using QPermission api.
>
> I have found a qmake script that seems to look at Info.plist and search for 
> the necessary key: qtbase/mkspecs/features/permissions.prf
>
> Also, it seems that a QT_PLUGIN must be set in qmake in order to link the 
> appropriate plugin.
>
> But this is not stated anywhere in the documentation therefore I’m linking 
> the plugin manually:
>
> LIBS += 
> /Users/nsantos/Qt/6.6.3/macos_static/plugins/permissions/libqdarwincamerapermission.a
>
> And I’m registering the plugin manually using: 
> Q_IMPORT_PLUGIN(QDarwinCameraPermissionPlugin)
>
> When running the program I don’t have the same message anymore but it is 
> still complaining about the key not being on the Info.plist when it is.
>
> checking permissions Qt::PermissionStatus::Undetermined
> qt.permissions: Requesting QCameraPermission requires 
> "NSCameraUsageDescription" in Info.plist
>
> The application is code signed with the camera entitlements:
>
> Executable=/private/tmp/build-vs-Qt_6_6_3_for_macOS_static-Release/VS.app/Contents/MacOS/VS
> [Dict]
>   [Key] com.apple.security.device.audio-input
>   [Value]
>   [Bool] true
>   [Key] com.apple.security.device.camera
>   [Value]
>   [Bool] true
>
> 
>  "http://www.apple.com/DTDs/PropertyList-1.0.dtd;>
> 
> 
>   CFBundleExecutable
>   VS
>   CFBundleGetInfoString
>   1.6.0
>   CFBundleIconFile
>   icon.icns
>   CFBundleIdentifier
>   com.imaginando.vs
>   CFBundlePackageType
>   APPL
>   CFBundleShortVersionString
>   1.6.0
>   CFBundleSignature
>   
>   CFBundleVersion
>   1.6.0
>   NSCameraUsageDescription
>   You can use camera input to create audio reactive 
> visuals
>   NSMicrophoneUsageDescription
>   You can use audio input to create audio reactive 
> visuals
>   NSPrincipalClass
>   NSApplication
>   NSSupportsAutomaticGraphicsSwitching
>   
> 
> 
>
> What am I missing?
>
> Thanks!
>
> Regards,
>
> Nuno
>
>> On 7 Jun 2024, at 16:32, Tor Arne Vestbø  wrote:
>>
>> Is the problem there in v6.6.3 as well? qmake or CMake based project?
>>
>> Tor Arne
>>
>>> On 7 Jun 2024, at 16:44, Nuno Santos via Interest  
>>> wrote:
>>>
>>> Hi,
>>>
>>> I’m trying to use the new QPermissions API on Qt 6.6.1 on a Mac but I’m 
>>> having a problem.
>>>
>>> Even the app is code signed, has the necessary NSCameraUsageDescription on 
>>> the Info.plist I always get the following message:
>>>
>>> qt.permissions: Could not find permission plugin for QCameraPermission. 
>>> Please make sure you have included the required usage description in your 
>>> Info.plist
>>>
>>> I’ve looked to the source code and it seems that it tried to load a plugin 
>>> and this message is only shown when the plugin is not found.
>>>
>>> I’ve also checked the qt build to see if the lib was around.
>>>
>>> Am I missing something?
>>>
>>> Thanks!
>>>
>>> Regards
>>>
>>> Nuno
>>> ___
>>> Interest mailing list
>>> Interest@qt-project.org
>>> https://lists.qt-project.org/listinfo/interest
>>
>

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt 6.6.1 - MacOS] qt.permissions: Could not find permission plugin for QCameraPermission.

2024-06-07 Thread Nuno Santos via Interest
Tor,

Thanks for your reply. I’m still using QMake

After a long time debugging I have realised that there is some kind of magic 
involved in using QPermission api.

I have found a qmake script that seems to look at Info.plist and search for the 
necessary key: qtbase/mkspecs/features/permissions.prf

Also, it seems that a QT_PLUGIN must be set in qmake in order to link the 
appropriate plugin.

But this is not stated anywhere in the documentation therefore I’m linking the 
plugin manually:

LIBS += 
/Users/nsantos/Qt/6.6.3/macos_static/plugins/permissions/libqdarwincamerapermission.a

And I’m registering the plugin manually using: 
Q_IMPORT_PLUGIN(QDarwinCameraPermissionPlugin)

When running the program I don’t have the same message anymore but it is still 
complaining about the key not being on the Info.plist when it is.

checking permissions Qt::PermissionStatus::Undetermined
qt.permissions: Requesting QCameraPermission requires 
"NSCameraUsageDescription" in Info.plist

The application is code signed with the camera entitlements:

Executable=/private/tmp/build-vs-Qt_6_6_3_for_macOS_static-Release/VS.app/Contents/MacOS/VS
[Dict]
[Key] com.apple.security.device.audio-input
[Value]
[Bool] true
[Key] com.apple.security.device.camera
[Value]
[Bool] true


http://www.apple.com/DTDs/PropertyList-1.0.dtd;>


CFBundleExecutable
VS
CFBundleGetInfoString
1.6.0
CFBundleIconFile
icon.icns
CFBundleIdentifier
com.imaginando.vs
CFBundlePackageType
APPL
CFBundleShortVersionString
1.6.0
CFBundleSignature

CFBundleVersion
1.6.0
NSCameraUsageDescription
You can use camera input to create audio reactive 
visuals
NSMicrophoneUsageDescription
You can use audio input to create audio reactive 
visuals
NSPrincipalClass
NSApplication
NSSupportsAutomaticGraphicsSwitching




What am I missing?

Thanks!

Regards,

Nuno

> On 7 Jun 2024, at 16:32, Tor Arne Vestbø  wrote:
> 
> Is the problem there in v6.6.3 as well? qmake or CMake based project?
> 
> Tor Arne 
> 
>> On 7 Jun 2024, at 16:44, Nuno Santos via Interest  
>> wrote:
>> 
>> Hi,
>> 
>> I’m trying to use the new QPermissions API on Qt 6.6.1 on a Mac but I’m 
>> having a problem.
>> 
>> Even the app is code signed, has the necessary NSCameraUsageDescription on 
>> the Info.plist I always get the following message:
>> 
>> qt.permissions: Could not find permission plugin for QCameraPermission. 
>> Please make sure you have included the required usage description in your 
>> Info.plist
>> 
>> I’ve looked to the source code and it seems that it tried to load a plugin 
>> and this message is only shown when the plugin is not found.
>> 
>> I’ve also checked the qt build to see if the lib was around.
>> 
>> Am I missing something?
>> 
>> Thanks!
>> 
>> Regards
>> 
>> Nuno
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> https://lists.qt-project.org/listinfo/interest
> 

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt 6.6.1 - MacOS] qt.permissions: Could not find permission plugin for QCameraPermission.

2024-06-07 Thread Tor Arne Vestbø via Interest
Is the problem there in v6.6.3 as well? qmake or CMake based project?

Tor Arne 

> On 7 Jun 2024, at 16:44, Nuno Santos via Interest  
> wrote:
> 
> Hi,
> 
> I’m trying to use the new QPermissions API on Qt 6.6.1 on a Mac but I’m 
> having a problem.
> 
> Even the app is code signed, has the necessary NSCameraUsageDescription on 
> the Info.plist I always get the following message:
> 
> qt.permissions: Could not find permission plugin for QCameraPermission. 
> Please make sure you have included the required usage description in your 
> Info.plist
> 
> I’ve looked to the source code and it seems that it tried to load a plugin 
> and this message is only shown when the plugin is not found.
> 
> I’ve also checked the qt build to see if the lib was around.
> 
> Am I missing something?
> 
> Thanks!
> 
> Regards
> 
> Nuno
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt 6.6.1 - MacOS] qt.permissions: Could not find permission plugin for QCameraPermission.

2024-06-07 Thread Nuno Santos via Interest
Hi,

I’m trying to use the new QPermissions API on Qt 6.6.1 on a Mac but I’m having 
a problem.

Even the app is code signed, has the necessary NSCameraUsageDescription on the 
Info.plist I always get the following message:

qt.permissions: Could not find permission plugin for QCameraPermission. Please 
make sure you have included the required usage description in your Info.plist

I’ve looked to the source code and it seems that it tried to load a plugin and 
this message is only shown when the plugin is not found.

I’ve also checked the qt build to see if the lib was around.

Am I missing something?

Thanks!

Regards

Nuno
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QtCS4: Venue, Registration, CfP and Working Group

2024-06-05 Thread Pedro Bessa via Interest
Hi everyone,

We have just opened registrations for our Qt Contributor Summit 2024!

In a nutshell:

  *   Sep 5-6, 2024
  *   Congress Centrum Würzburg (Pleichertorstraße, 97070)
  *   Würzburg, Germany
  *   Pleichertorstraße, 97070 Würzburg, Germany
  *   Back-to-back with KDE’s Akademy

Quick links:

Latest blog post: QtCS24: Venue, Registration, CfP and Working 
Group
Form for registration: register 
here
QtCS24 wiki main page
QtCS24 wiki program 
page (you can add your 
talk here)

Additionally, we would like to organize a Working Group for our Summit!
Write a message to pedro.be...@qt.io, stating your 
interest and we will let you know how you can help by the end of June!
Please send your message by June 13th.


Hope to see you in Würzburg!

If you have any questions, feel free to reach out to me. :)

Cheers,
Pedro Bessa
Qt Community Specialist


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Save the Date: Qt Contributor Summit 5-6 Sep, 2024

2024-06-03 Thread Pedro Bessa via Interest
Hi everyone,

Just sending you a “Save the Date” message regarding our Qt Contributor Summit.
Our event will be on Sep 5-6 in Würzburg, Germany.
You can find some information on our blog: 
https://www.qt.io/blog/qtcs24-sep-5-6-save-the-date

Additionally, it is back-to-back to KDE Akademy (https://akademy.kde.org/2024/).

Registration, venue confirmation, CfP, and more will be published very soon.
Thank you for your understanding and hope you can make plans to join us.


Cheers,
Pedro Bessa
Qt Community Specialist

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-29 Thread David M. Cotter
OMG I FIGURED IT OUT!!!

qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
qWidgetP->show();
QtLetTimersFire(0);
qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);


And here is QtLetTimersFire for completeness.

voidQtLetTimersFire(
CFTimeInterval  durationT,  //  = 0.1
boolall_eventsB,//  = false
boolextrasB)//  = false
{
//  don't let timers fire when this thread IS a timer
if (!IsCooperativeThread()) {
QEventLoop  loop;   //  MUST be 
on the stack for events to flow!
QEventLoop::ProcessEventsFlags  flags(
all_eventsB ? QEventLoop::AllEvents : 
QEventLoop::ExcludeUserInputEvents);

CT_Timer::AvoidRecursiveTimer();

if (durationT) {
CFTimeIntervalMilliseconds  
milliSecT(CFSecondsToMilliseconds(durationT));

if (extrasB) {
flags |= QEventLoop::WaitForMoreEvents | 
QEventLoop::EventLoopExec;
}

loop.processEvents(flags, milliSecT);
} else {
loop.processEvents(flags);
}
}
}




___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-29 Thread David M. Cotter
Tried something like that:

qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
true);
qWidgetP->show();
qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
false);

It doesn’t do as advertised (window does not show, but also doesn’t lay out the 
geometry of widgets)

-dave

> On May 29, 2024, at 11:29 AM, John Weeks  wrote:
> 
> Well, I wasn't going to say anything ("If you don’ know how to answer it, 
> please don’t chime in, thanks.")
> 
> In my experience, Qt doesn't maintain a good notion of a window's size until 
> it's shown. But you are guaranteed a Resize event as the window is being 
> shown, so if you can manage it, you need to handle the Resize event and do 
> your polishing and layouting there.
> 
> In fact, I had for a while a function called ShowAndHideInvisibly(); the 
> important part of it was like this:
>>  getQWidget()->setAttribute(Qt::WA_DontShowOnScreen, true);
>>  WMshow();
>>  WMhide();
>>  getQWidget()->setAttribute(Qt::WA_DontShowOnScreen, false);
> 
> Maybe that helps. Setting the attribute prevents the screen flash.
> 
> -John Weeks
> WaveMetrics, Inc.

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-29 Thread John Weeks
Well, I wasn't going to say anything ("If you don’ know how to answer it, 
please don’t chime in, thanks.")

In my experience, Qt doesn't maintain a good notion of a window's size until 
it's shown. But you are guaranteed a Resize event as the window is being shown, 
so if you can manage it, you need to handle the Resize event and do your 
polishing and layouting there.

In fact, I had for a while a function called ShowAndHideInvisibly(); the 
important part of it was like this:
>   getQWidget()->setAttribute(Qt::WA_DontShowOnScreen, true);
>   WMshow();
>   WMhide();
>   getQWidget()->setAttribute(Qt::WA_DontShowOnScreen, false);

Maybe that helps. Setting the attribute prevents the screen flash.

-John Weeks
WaveMetrics, Inc.

> On May 23, 2024, at 3:52 PM, David M. Cotter  wrote:
> 
> I need to do something like this:
> 
> windowP->layout()->updateGeometry(); // causes all widget geometry to update
> DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
> something with the geometry of a widget (which must be up to date)
> windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based on 
> the fact that we KNOW the geometry of one of the widgets BEFORE the window is 
> shown
> windowP->show(); // only NOW show the window, NOT before now
> 
> How do I do something like the first line? Cause all widget geometry 
> (Recursively), to know / figure out its size AND position? And this BEFORE 
> the window or any widget is “shown”  via the windowP->show() command?
> 
> Please don’t try to tell me to do it differently. If you don’ know how to 
> answer it, please don’t chime in, thanks.
> 
> -Dave
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-29 Thread David M. Cotter
Can any one recommend a way to temporarily remove the boundary constraints for 
displaying a window? so that we CAN “Show” it way off the screen, so it is 
“visible” so it can do what I’m asking?

> On May 28, 2024, at 4:00 PM, David M. Cotter  wrote:
> 
> Yes I did. Sorry I didn’t document that:
>   //  this doesn't work because the window 
> position is constrained to the boundaries
>   //  of the display. it shows at (0, 0), 
> causing an on-screen flash.
>   //  can the constraint be temporarily 
> lifted so it actually shows at (-32000, -32000) ??
> 
> 
>> On May 26, 2024, at 11:05 PM, coroberti  wrote:
>> 
>> Have you tried the suggestion from Henry to move the window first to the 
>> negative coordinates?

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QTableView Column Width and Headers

2024-05-29 Thread Volker Hilsheimer via Interest


On 24 May 2024, at 20:39, Michael Jackson  wrote:

I have a question about how the column widths of a QTableView are calculated? 
How can I have the QTableView set the column with “to contents” that includes 
the QHeader also? For example I have a QHeaderView with the first “section” 
that has text “This is a really really really long header”, but the actual data 
that is in the QTableView under that header are short values such as “100” or 
“2” or “1.231”. When the QTableView is rendered the the column with is only as 
wide as the QTableView. It is like the QHeaderView is not taken into account 
when calculating the width of the column.

This is with Qt 6.5.3 and 6.6.3.

--
Mike Jackson


Hi Mike,

you should be able to reimplement 
https://doc.qt.io/qt-6/qtableview.html#sizeHintForColumn and 
https://doc.qt.io/qt-6/qtableview.html#sizeHintForRow to take the 
https://doc.qt.io/qt-6/qheaderview.html#sectionSizeHint into account.

Cheers,
Volker


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-29 Thread Axel Spoerl via Interest
Hi David,

a few colleagues and I are currently exploring options to optimize our UI tests 
in CI.
Your requirement is interesting in that context: It would sometimes be handy to 
know in advance, how stuff is going to look before it's rendered onto a screen.

The calculation of a widget's geometry is tied to the process of showing. There 
are good reasons for that, e.g. native window decoration or native elements 
like checkboxes, buttons, menus. Platform specific approaches to window 
minimisation, maximisation, full-screen also play a role.

Our documentation (https://doc.qt.io/qt-6/qwidget.html#geometry-prop 
andhttps://doc.qt.io/qt-6/application-windows.html#window-geometry) doesn't 
promise accurate geometry, before a widget is shown. It could be clearer on 
that particular point. Such a requirement hasn't been an issue, at least AFAIK.

That said: When we test geometries, or even rendering, we always compare 
against a base line. In other words: We take screenshots or read geometries 
from visible widgets and compare against those.

Maybe there are ways to trick the system into a geometry calculation of 
invisible widgets. I don't know of any, and if they exist, they are probably 
not reliable.
I don't see a solid implementation, meeting your requirement. Not now, not in 
the forseeable future.

Cheers
Axel

Von: Interest  im Auftrag von David M. Cotter 

Gesendet: Mittwoch, 29. Mai 2024 01:32
An: interest@qt-project.org 
Betreff: Re: [Interest] Update widget geometry BEFORE window shown

Tried that too, to no avail

static void activateLayoutsRecursive(QObject *objectP)
{
if (objectP) {

for (auto* childP: objectP->children()) {
activateLayoutsRecursive(childP);
}

QWidget* widgetP(dynamic_cast(objectP));

if (widgetP) {
widgetP->updateGeometry();

QLayout* layoutP(widgetP->layout());

if (layoutP) {
layoutP->invalidate();
layoutP->update();
layoutP->activate();
}
}
}
}


On May 27, 2024, at 1:07 AM, Tony Rietwyk  wrote:


Hi Dave,

I have had a similar issue at various times, especially in Qt4, but not as much 
in Qt5 & 6.  A few places still had problems when adjusting after creating or 
deleting widgets, or switching pages in an embedded page control.  This is the 
routine I use:

void activateLayoutsRecursive(QWidget *w)
{
if (w)
{
// Depth first traversal.
for (auto k : w->children())
{
if (auto z = qobject_cast(k))
activateLayoutsRecursive( z );
}

if (w->layout())
{
w->layout()->invalidate();
w->layout()->activate();
//qCDebug(lc) << w->objectName() << w->layout()->totalMinimumSize();
}
}
}

I hope that helps!

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-28 Thread David M. Cotter
Tried that too, to no avail

static void activateLayoutsRecursive(QObject *objectP)
{
if (objectP) {

for (auto* childP: objectP->children()) {
activateLayoutsRecursive(childP);
}

QWidget*
widgetP(dynamic_cast(objectP));

if (widgetP) {
widgetP->updateGeometry();

QLayout*layoutP(widgetP->layout());

if (layoutP) {
layoutP->invalidate();
layoutP->update();
layoutP->activate();
}
}
}
}


> On May 27, 2024, at 1:07 AM, Tony Rietwyk  wrote:
> 
> Hi Dave,
> 
> I have had a similar issue at various times, especially in Qt4, but not as 
> much in Qt5 & 6.  A few places still had problems when adjusting after 
> creating or deleting widgets, or switching pages in an embedded page control. 
>  This is the routine I use:
> 
> void activateLayoutsRecursive(QWidget *w)
> {
> if (w)
> {
> // Depth first traversal. 
> for (auto k : w->children())
> {
> if (auto z = qobject_cast(k))
> activateLayoutsRecursive( z );
> }
> 
> if (w->layout())
> {
> w->layout()->invalidate();
> w->layout()->activate();
> //qCDebug(lc) << w->objectName() << 
> w->layout()->totalMinimumSize();
> }
> }
> }
> 
> I hope that helps!

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-28 Thread David M. Cotter
Sorry if I wasn’t clear, I meant simply “don’t tell me to no longer have the 
requirement to get the correct/updated rectangles before the window is shown”

Please do FEEL FREE to tell me how to do anything differently, as long as we 
keep the requirement "get the correct/updated rectangles before the window is 
shown”

:)

> On May 26, 2024, at 11:58 PM, Axel Spoerl via Interest 
>  wrote:
> 
> Hi David,
> 
> §1 Please don’t try to tell me to do it differently.
> §2 If you don’ know how to answer it, please don’t chime in, thanks.
> 
> These instructions are a bit limiting, are they not?
> 
> In essence, you want a widget's geometry to be precise and up to date, before 
> it has been shown.
> That is done (under more), if QWidgetPrivate::updateGeometry_helper(true) is 
> called.
> There are three ways to achieve that on a hidden widget:
> setVisible(true), show() => probably not an option
> setMaximumSize()
> setMinimumSize() => under certain circumstances.
> 
> Except for the first code path shown, all others cause the helper to be 
> called with a "false" argument, hence the result is not to your liking.
> I haven't debugged with negative co-ordinates. Maybe it works. However, I 
> would be reluctant to depend on something like that.
> There are hacky ways, like re-implementing geometry calculation in the 
> application, linking to WidgetsPrivate. I guess you have discarded those for 
> good reasons.
> 
> With §1 in sight: Grinding stop.
> 
> Cheers
> Axel
> Von: Interest  im Auftrag von coroberti 
> 
> Gesendet: Montag, 27. Mai 2024 08:05
> An: David M. Cotter 
> Cc: Qt Project 
> Betreff: Re: [Interest] Update widget geometry BEFORE window shown
>  
> Have you tried the suggestion from Henry to move the window first to the 
> negative coordinates?
> 
> Kind regards,
> Robert Iakobashvili
> 
> 
> 
> On Mon, May 27, 2024 at 9:01 AM David M. Cotter  > wrote:
> Does ANY ONE have any ideas on this?? Pretty please??
> 
> -dave
> 
>> On May 24, 2024, at 12:14 PM, David M. Cotter > > wrote:
>> 
>> I’ve tried everything I can think of. The ONLY one that works the way I NEED 
>> is the first one, but that one flashes the window on the screen
>> 
>> #if 1
>> qWidgetP->show();
>> qWidgetP->hide();
>> QtLetTimersFire(0);
>> #endif
>> 
>> #if 0
>> QLayout*
>> layoutP(qWidgetP->layout());
>> 
>> layoutP->update();
>> layoutP->activate();
>> QtLetTimersFire(0);
>> #endif
>> 
>> #if 0
>> for (auto* childP: qWidgetP->findChildren()) {
>> childP->updateGeometry();
>> }
>> 
>> qWidgetP->updateGeometry();
>> QtLetTimersFire(0);
>> #endif
>> 
>> #if 0
>> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
>> qWidgetP->show();
>> // qWidgetP->layout()->invalidate();
>> // qWidgetP->layout()->update();
>> // qWidgetP->layout()->activate();
>> qWidgetP->hide();
>> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
>> QtLetTimersFire(0);
>> #endif
>> 
>> #if 0
>> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
>> qWidgetP->show();
>> 
>> qWidgetP->layout()->invalidate();
>> qWidgetP->layout()->update();
>> qWidgetP->layout()->activate();
>> 
>> for (auto* childP: qWidgetP->findChildren()) {
>> childP->updateGeometry();
>> }
>> 
>> qWidgetP->updateGeometry();
>> 
>> qWidgetP->hide();
>> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
>> QtLetTimersFire(0);
>> #endif
>> 
>> 
>>> On May 24, 2024, at 12:47 AM, coroberti >> > wrote:
>>> 
>>> David,
>>> Try
>>> yourWidget->layout()->update();
>>> yourWidget->layout()->activate();
>>> 
>>> If not,
>>> let the event loop to run, ie. arranging a short timer.
>>> 
>>> Kind regards,
>>> Robert Iakobashvili
>>> 
>>> 
>>> On Fri, May 24, 2024 at 1:53 AM David M. Cotter >> > wrote:
 
 I need to do something like this:
 
 windowP->layout()->updateGeometry(); // causes all widget geometry to 
 update
 DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
 something with the geometry of a widget (which must be up to date)
 windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based 
 on the fact that we KNOW the geometry of one of the widgets BEFORE the 
 window is shown
 windowP->show(); // only NOW show the window, NOT before now
 
 How do I do something like the first line? Cause all widget geometry 
 (Recursively), to know / figure out its size AND position? And this BEFORE 
 the window or any widget is “shown”  via the windowP->show() command?
 
 Please don’t try to tell me to do it differently. If you don’ know how to 
 answer it, please don’t chime in, thanks.
 
 -Dave
 ___
 Interest mailing list
 Interest@qt-project.org 
 https://lists.qt-project.org/listinfo/interest
>> 
>> 

Re: [Interest] Update widget geometry BEFORE window shown

2024-05-28 Thread David M. Cotter
Yes I did. Sorry I didn’t document that:
//  this doesn't work because the window 
position is constrained to the boundaries
//  of the display. it shows at (0, 0), 
causing an on-screen flash.
//  can the constraint be temporarily 
lifted so it actually shows at (-32000, -32000) ??


> On May 26, 2024, at 11:05 PM, coroberti  wrote:
> 
> Have you tried the suggestion from Henry to move the window first to the 
> negative coordinates?
> 
> Kind regards,
> Robert Iakobashvili
> 
> 
> 
> On Mon, May 27, 2024 at 9:01 AM David M. Cotter  > wrote:
>> Does ANY ONE have any ideas on this?? Pretty please??
>> 
>> -dave
>> 
>>> On May 24, 2024, at 12:14 PM, David M. Cotter >> > wrote:
>>> 
>>> I’ve tried everything I can think of. The ONLY one that works the way I 
>>> NEED is the first one, but that one flashes the window on the screen

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Getting "really old" Qt sources

2024-05-27 Thread René J . V . Bertin
Doh, turns out they're all there in a different subdirectory that I wasn't 
aware of ...
https://download.qt.io/new_archive/qt


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-27 Thread Tony Rietwyk

Hi Dave,

I have had a similar issue at various times, especially in Qt4, but not 
as much in Qt5 & 6.  A few places still had problems when adjusting 
after creating or deleting widgets, or switching pages in an embedded 
page control.  This is the routine I use:


void activateLayoutsRecursive(QWidget *w)
{
    if (w)
    {
    // Depth first traversal.
    for (auto k : w->children())
    {
        if (auto z = qobject_cast(k))
            activateLayoutsRecursive( z );
    }

    if (w->layout())
    {
        w->layout()->invalidate();
        w->layout()->activate();
        //qCDebug(lc) << w->objectName() << 
w->layout()->totalMinimumSize();

    }
    }
}

I hope that helps!

Tony

On 27/05/2024 4:01 pm, David M. Cotter wrote:

Does ANY ONE have any ideas on this?? Pretty please??

-dave


On May 24, 2024, at 12:14 PM, David M. Cotter  wrote:

I’ve tried everything I can think of. The ONLY one that works the way 
I NEED is the first one, but that one flashes the window on the screen


#if 1
qWidgetP->show();
qWidgetP->hide();
QtLetTimersFire(0);
#endif

#if 0
QLayout*layoutP(qWidgetP->layout());

layoutP->update();
layoutP->activate();
QtLetTimersFire(0);
#endif

#if 0
for (auto* childP: qWidgetP->findChildren()) {
childP->updateGeometry();
}

qWidgetP->updateGeometry();
QtLetTimersFire(0);
#endif

#if 0
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
qWidgetP->show();
// qWidgetP->layout()->invalidate();
// qWidgetP->layout()->update();
// qWidgetP->layout()->activate();
qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
QtLetTimersFire(0);
#endif

#if 0
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
qWidgetP->show();

qWidgetP->layout()->invalidate();
qWidgetP->layout()->update();
qWidgetP->layout()->activate();

for (auto* childP: qWidgetP->findChildren()) {
childP->updateGeometry();
}

qWidgetP->updateGeometry();

qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
QtLetTimersFire(0);
#endif___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-27 Thread Axel Spoerl via Interest
Hi David,

§1 Please don’t try to tell me to do it differently.
§2 If you don’ know how to answer it, please don’t chime in, thanks.

These instructions are a bit limiting, are they not?

In essence, you want a widget's geometry to be precise and up to date, before 
it has been shown.
That is done (under more), if QWidgetPrivate::updateGeometry_helper(true) is 
called.
There are three ways to achieve that on a hidden widget:

  *
setVisible(true), show() => probably not an option
  *
setMaximumSize()
  *
setMinimumSize() => under certain circumstances.

Except for the first code path shown, all others cause the helper to be called 
with a "false" argument, hence the result is not to your liking.
I haven't debugged with negative co-ordinates. Maybe it works. However, I would 
be reluctant to depend on something like that.
There are hacky ways, like re-implementing geometry calculation in the 
application, linking to WidgetsPrivate. I guess you have discarded those for 
good reasons.

With §1 in sight: Grinding stop.

Cheers
Axel

Von: Interest  im Auftrag von coroberti 

Gesendet: Montag, 27. Mai 2024 08:05
An: David M. Cotter 
Cc: Qt Project 
Betreff: Re: [Interest] Update widget geometry BEFORE window shown

Have you tried the suggestion from Henry to move the window first to the 
negative coordinates?

Kind regards,
Robert Iakobashvili



On Mon, May 27, 2024 at 9:01 AM David M. Cotter 
mailto:d...@kjams.com>> wrote:
Does ANY ONE have any ideas on this?? Pretty please??

-dave

On May 24, 2024, at 12:14 PM, David M. Cotter 
mailto:d...@kjams.com>> wrote:

I’ve tried everything I can think of. The ONLY one that works the way I NEED is 
the first one, but that one flashes the window on the screen

#if 1
qWidgetP->show();
qWidgetP->hide();
QtLetTimersFire(0);
#endif

#if 0
QLayout* layoutP(qWidgetP->layout());

layoutP->update();
layoutP->activate();
QtLetTimersFire(0);
#endif

#if 0
for (auto* childP: qWidgetP->findChildren()) {
childP->updateGeometry();
}

qWidgetP->updateGeometry();
QtLetTimersFire(0);
#endif

#if 0
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
qWidgetP->show();
// qWidgetP->layout()->invalidate();
// qWidgetP->layout()->update();
// qWidgetP->layout()->activate();
qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
QtLetTimersFire(0);
#endif

#if 0
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
qWidgetP->show();

qWidgetP->layout()->invalidate();
qWidgetP->layout()->update();
qWidgetP->layout()->activate();

for (auto* childP: qWidgetP->findChildren()) {
childP->updateGeometry();
}

qWidgetP->updateGeometry();

qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
QtLetTimersFire(0);
#endif


On May 24, 2024, at 12:47 AM, coroberti 
mailto:corobe...@gmail.com>> wrote:

David,
Try
yourWidget->layout()->update();
yourWidget->layout()->activate();

If not,
let the event loop to run, ie. arranging a short timer.

Kind regards,
Robert Iakobashvili


On Fri, May 24, 2024 at 1:53 AM David M. Cotter 
mailto:d...@kjams.com>> wrote:

I need to do something like this:

windowP->layout()->updateGeometry(); // causes all widget geometry to update
DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
something with the geometry of a widget (which must be up to date)
windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based on 
the fact that we KNOW the geometry of one of the widgets BEFORE the window is 
shown
windowP->show(); // only NOW show the window, NOT before now

How do I do something like the first line? Cause all widget geometry 
(Recursively), to know / figure out its size AND position? And this BEFORE the 
window or any widget is “shown”  via the windowP->show() command?

Please don’t try to tell me to do it differently. If you don’ know how to 
answer it, please don’t chime in, thanks.

-Dave
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Getting "really old" Qt sources

2024-05-27 Thread Ulf Hermann via Interest

This should do:

git checkout v5.3.2
git submodule sync --recursive
git submodule update --init --recursive

best,
Ulf
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-27 Thread coroberti
Have you tried the suggestion from Henry to move the window first to the
negative coordinates?

Kind regards,
Robert Iakobashvili



On Mon, May 27, 2024 at 9:01 AM David M. Cotter  wrote:

> Does ANY ONE have any ideas on this?? Pretty please??
>
> -dave
>
> On May 24, 2024, at 12:14 PM, David M. Cotter  wrote:
>
> I’ve tried everything I can think of. The ONLY one that works the way I
> NEED is the first one, but that one flashes the window on the screen
>
> #if 1
> qWidgetP->show();
> qWidgetP->hide();
> QtLetTimersFire(0);
> #endif
>
> #if 0
> QLayout* layoutP(qWidgetP->layout());
>
> layoutP->update();
> layoutP->activate();
> QtLetTimersFire(0);
> #endif
>
> #if 0
> for (auto* childP: qWidgetP->findChildren()) {
> childP->updateGeometry();
> }
>
> qWidgetP->updateGeometry();
> QtLetTimersFire(0);
> #endif
>
> #if 0
> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
> qWidgetP->show();
> // qWidgetP->layout()->invalidate();
> // qWidgetP->layout()->update();
> // qWidgetP->layout()->activate();
> qWidgetP->hide();
> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
> QtLetTimersFire(0);
> #endif
>
> #if 0
> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
> qWidgetP->show();
>
> qWidgetP->layout()->invalidate();
> qWidgetP->layout()->update();
> qWidgetP->layout()->activate();
>
> for (auto* childP: qWidgetP->findChildren()) {
> childP->updateGeometry();
> }
>
> qWidgetP->updateGeometry();
>
> qWidgetP->hide();
> qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);
> QtLetTimersFire(0);
> #endif
>
>
> On May 24, 2024, at 12:47 AM, coroberti  wrote:
>
> David,
> Try
> yourWidget->layout()->update();
> yourWidget->layout()->activate();
>
> If not,
> let the event loop to run, ie. arranging a short timer.
>
> Kind regards,
> Robert Iakobashvili
> 
>
> On Fri, May 24, 2024 at 1:53 AM David M. Cotter  wrote:
>
>
> I need to do something like this:
>
> windowP->layout()->updateGeometry(); // causes all widget geometry to
> update
> DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do
> something with the geometry of a widget (which must be up to date)
> windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based
> on the fact that we KNOW the geometry of one of the widgets BEFORE the
> window is shown
> windowP->show(); // only NOW show the window, NOT before now
>
> How do I do something like the first line? Cause all widget geometry
> (Recursively), to know / figure out its size AND position? And this BEFORE
> the window or any widget is “shown”  via the windowP->show() command?
>
> Please don’t try to tell me to do it differently. If you don’ know how to
> answer it, please don’t chime in, thanks.
>
> -Dave
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
>
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-27 Thread David M. Cotter
Does ANY ONE have any ideas on this?? Pretty please??

-dave

> On May 24, 2024, at 12:14 PM, David M. Cotter  wrote:
> 
> I’ve tried everything I can think of. The ONLY one that works the way I NEED 
> is the first one, but that one flashes the window on the screen
> 
>   #if 1
>   qWidgetP->show();
>   qWidgetP->hide();
>   QtLetTimersFire(0);
>   #endif
> 
>   #if 0
>   QLayout*layoutP(qWidgetP->layout());
> 
>   layoutP->update();
>   layoutP->activate();
>   QtLetTimersFire(0);
>   #endif
> 
>   #if 0
>   for (auto* childP: 
> qWidgetP->findChildren()) {
>   childP->updateGeometry();
>   }
> 
>   qWidgetP->updateGeometry();
>   QtLetTimersFire(0);
>   #endif
> 
>   #if 0
>   qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
> true);
>   qWidgetP->show();
>   // qWidgetP->layout()->invalidate();
>   // qWidgetP->layout()->update();
>   // qWidgetP->layout()->activate();
>   qWidgetP->hide();
>   qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
> false);
>   QtLetTimersFire(0);
>   #endif
> 
>   #if 0
>   qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
> true);
>   qWidgetP->show();
> 
>   qWidgetP->layout()->invalidate();
>   qWidgetP->layout()->update();
>   qWidgetP->layout()->activate();
> 
>   for (auto* childP: 
> qWidgetP->findChildren()) {
>   childP->updateGeometry();
>   }
> 
>   qWidgetP->updateGeometry();
> 
>   qWidgetP->hide();
>   qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
> false);
>   QtLetTimersFire(0);
>   #endif
> 
> 
>> On May 24, 2024, at 12:47 AM, coroberti  wrote:
>> 
>> David,
>> Try
>> yourWidget->layout()->update();
>> yourWidget->layout()->activate();
>> 
>> If not,
>> let the event loop to run, ie. arranging a short timer.
>> 
>> Kind regards,
>> Robert Iakobashvili
>> 
>> 
>> On Fri, May 24, 2024 at 1:53 AM David M. Cotter  wrote:
>>> 
>>> I need to do something like this:
>>> 
>>> windowP->layout()->updateGeometry(); // causes all widget geometry to update
>>> DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
>>> something with the geometry of a widget (which must be up to date)
>>> windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based 
>>> on the fact that we KNOW the geometry of one of the widgets BEFORE the 
>>> window is shown
>>> windowP->show(); // only NOW show the window, NOT before now
>>> 
>>> How do I do something like the first line? Cause all widget geometry 
>>> (Recursively), to know / figure out its size AND position? And this BEFORE 
>>> the window or any widget is “shown”  via the windowP->show() command?
>>> 
>>> Please don’t try to tell me to do it differently. If you don’ know how to 
>>> answer it, please don’t chime in, thanks.
>>> 
>>> -Dave
>>> ___
>>> Interest mailing list
>>> Interest@qt-project.org
>>> https://lists.qt-project.org/listinfo/interest
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Getting "really old" Qt sources

2024-05-26 Thread René J . V . Bertin
René J.V. Bertin wrote on 20240526::14:25:20 re: "Getting "really old" Qt 
sources"

>I can manage to check out the skeleton at the commit (tag) of interest (say, 
>v5.3.2) but the actual sources aren't there.

I'm beginning to get the idea that there's a perl (i.e. contrived...) script 
that must be called to fetch each submodule as if done manually. Except that it 
insists on checking out the latest version, even if I prepare the skeleton tree 
with (say):

# git clone -n -b v5.3.2 --depth=1 https://code.qt.io/qt/qt5.git qt532-git
# git -C qt532-git reset --hard v5.3.2

(--depth=1 because guess what, I'm not interested in gigabytes of commit logs.)

R.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Getting "really old" Qt*5* sources

2024-05-26 Thread René J . V . Bertin
On Sunday May 26 2024 14:33:35 apoenitz wrote:

>Versions down to 1.41 are at  https://download.qt.io/archive/qt/
>
>Do you really need even older ones?
>

Sorry, I meant Qt *5* sources. That archive only holds a seemingly random 
collection of "mijor" versions, nothing between 5.12 and 5.1 .

R
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Getting "really old" Qt sources

2024-05-26 Thread apoenitz
On Sun, May 26, 2024 at 02:25:20PM +0200, René J.V. Bertin wrote:
> Hi,
> 
> Qt have decided (in their wisdom?) to retire the sources of "really old"
> releases from their servers.

Versions down to 1.41 are at  https://download.qt.io/archive/qt/

Do you really need even older ones?

> I assume they're still available via git
> (including the mirrors on github, I hope) but I'm drawing a blank in checking
> out the "everywhere" source tree from the github:qt/qt5 repo. I can manage to
> check out the skeleton at the commit (tag) of interest (say, v5.3.2) but the
> actual sources aren't there.
> 
> Can anyone give me a vetted series of commands (the more compact the better
> :) ), please?

wget https://download.qt.io/archive/qt/1/qt-1.41.tar.gz

Andre' 
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Getting "really old" Qt sources

2024-05-26 Thread René J . V . Bertin
Hi,

Qt have decided (in their wisdom?) to retire the sources of "really old" 
releases from their servers. I assume they're still available via git 
(including the mirrors on github, I hope) but I'm drawing a blank in checking 
out the "everywhere" source tree from the github:qt/qt5 repo. I can manage to 
check out the skeleton at the commit (tag) of interest (say, v5.3.2) but the 
actual sources aren't there.

Can anyone give me a vetted series of commands (the more compact the better :) 
), please?

TIA,
R.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] More on Exceptions

2024-05-25 Thread Thiago Macieira
On Saturday 25 May 2024 09:51:49 GMT-3 Jean-Michaël Celerier wrote:
> Likely there are "bad things" that could theoretically happen but in 10
> years of https://ossia.io across Mac, Windows, Linux and tens of thousands
> of exceptions being caught after unwinding through the Qt and QWidget event
> handling due to fairly defensive programming strategies (assertions
> everywhere being transformed into exceptions in release builds), I have yet
> to see *one* of these mysterious corruptions mentioned here.
> 
> The time saved by my users who can however just resume using the software
> after a small error popup is immense.

Hello Jean-Michaël

Do you have experience of this working on ARM Macs? That's the issue that 
Dennis is having: by default, the compiler there doesn't generate unwind 
information if exceptions are disabled, unlike on x86. So the big question I 
asked: does the same apply to the Apple libraries themselves?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] More on Exceptions

2024-05-25 Thread Thiago Macieira
On Saturday 25 May 2024 09:27:54 GMT-3 Turtle Creek Software wrote:
> Thiago, I'll describe what happens when our typical exception is thrown,
> since conditions are very different from what you describe.
> 
> Before any method uses a pointer, it first does a sanity check. If nullptr
> it shows a dialog with file/line number and what failed, then throws an
> exception to avoid crashing.  There are 7000+ checks, plus another 1000+
> assertions for other bad states. 99% will never be called. Some throws are
> caught internally but most go out to the event loop, which has a try/catch
> block.

What is a user going to do with that information? This is my case of "clicking 
a button causes std::runtime_exception" - no, this is a UX bug. The user can't 
affect the result and will confuse the user. You should design your software so 
this condition will not happen and, in the unexpected case where it does 
happen, you need to handle it without user interaction.

> The app has a couple megabytes of just file/line number text, since it
> needs to be compiled in. The original plan was to remove them in release
> build, but they help for user bug reports so they're permanent. Users tell
> us exactly where to find the problem.

You don't need the UI for this. More importantly, you *cannot* trust the 
process itself to display UI because, by construction, you've run into an 
unexpected condition because some internal invariant was violated. If you want 
to display any sort of UI, it needs to be out-of-process.

> In practice, 99% of throws are from something trivial/stupid- a missing
> field, or a link to something that doesn't need to be linked.  They are
> caught in the event loop and users can safely continue working. In rare
> cases they may see a ton of weird messages and need to force-quit.

Then just catch before returning to the event loop, eat the exception, and 
continue. You don't need to display a dialogue asking the user if they want to 
continue: they always do.

My advice is you do no such thing. If you've run into an unexpected condition, 
continuing is just going to accumulate errors, postponing the crash until 
finding out what caused the initial problem is nearly impossible.

> As the stack unwinds after a throw, in theory it should tidy everything via
> scope endings and destructors.  In practice, maybe there are leaks or other
> bugs along the way. But in theory, those bugs would show up anyhow when the
> stack unwinds from normal use.  In practice, the setup has worked well for
> 20+ years. Users see helpful error messages rather than crashes.  Maybe the
> exception throws cause subtle, unknown problems but no worse than the usual
> problems in any app.

In theory, there are no bugs. In practice, there are.

> I think Qt should enable exceptions in QWidget etc by default, strengthen
> the disclaimer a bit, and feel no obligation to survive throws in perfect
> condition. Pass them along and let developers deal with the consequences.
> Exceptions should be for weird problems, and if things get weirder, so
> what? Based on our experience in x86 it probably will be just fine.

As I said before in the dev mailing list: this is pending someone checking 
that the Cocoa and Win32 and glib frames that may be in the call stack can be 
unwound too. If they can't, then the exception unwind info in QtWidgets is 
dead weight.

Even if someone shows they work, we may not do it in the official builds. But 
you can do it yourself. In fact, since you do have such a good infrastructure 
for testing whether it works, I recommend you just do it and tell us if it 
works.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] More on Exceptions

2024-05-25 Thread Jean-Michaël Celerier
I share a similar experience.

Likely there are "bad things" that could theoretically happen but in 10
years of https://ossia.io across Mac, Windows, Linux and tens of thousands
of exceptions being caught after unwinding through the Qt and QWidget event
handling due to fairly defensive programming strategies (assertions
everywhere being transformed into exceptions in release builds), I have yet
to see *one* of these mysterious corruptions mentioned here.

The time saved by my users who can however just resume using the software
after a small error popup is immense.

On Sat, 25 May 2024, 08:29 Turtle Creek Software, 
wrote:

> Thiago, I'll describe what happens when our typical exception is thrown,
> since conditions are very different from what you describe.
>
> Before any method uses a pointer, it first does a sanity check. If nullptr
> it shows a dialog with file/line number and what failed, then throws an
> exception to avoid crashing.  There are 7000+ checks, plus another 1000+
> assertions for other bad states. 99% will never be called. Some throws are
> caught internally but most go out to the event loop, which has a try/catch
> block.
>
> The app has a couple megabytes of just file/line number text, since it
> needs to be compiled in. The original plan was to remove them in release
> build, but they help for user bug reports so they're permanent. Users tell
> us exactly where to find the problem.
>
> A few exceptions are fatal and just terminate.  The database is never in
> unstable state so we can leave safely at any time. Actually it's unstable
> briefly during commits but nothing throws in there so the only danger is
> power failures.
>
> There probably are apps that need cleanup on terminate, but ours isn't one.
>
> In practice, 99% of throws are from something trivial/stupid- a missing
> field, or a link to something that doesn't need to be linked.  They are
> caught in the event loop and users can safely continue working. In rare
> cases they may see a ton of weird messages and need to force-quit.
>
> As the stack unwinds after a throw, in theory it should tidy everything
> via scope endings and destructors.  In practice, maybe there are leaks or
> other bugs along the way. But in theory, those bugs would show up anyhow
> when the stack unwinds from normal use.  In practice, the setup has worked
> well for 20+ years. Users see helpful error messages rather than crashes.
> Maybe the exception throws cause subtle, unknown problems but no worse than
> the usual problems in any app.
>
> I think Qt should enable exceptions in QWidget etc by default, strengthen
> the disclaimer a bit, and feel no obligation to survive throws in perfect
> condition. Pass them along and let developers deal with the consequences.
> Exceptions should be for weird problems, and if things get weirder, so
> what? Based on our experience in x86 it probably will be just fine.
>
> Thanks,
> Dennis Kolva
> Programming Director
> TurtleSoft.com
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] More on Exceptions

2024-05-25 Thread Turtle Creek Software
Thiago, I'll describe what happens when our typical exception is thrown,
since conditions are very different from what you describe.

Before any method uses a pointer, it first does a sanity check. If nullptr
it shows a dialog with file/line number and what failed, then throws an
exception to avoid crashing.  There are 7000+ checks, plus another 1000+
assertions for other bad states. 99% will never be called. Some throws are
caught internally but most go out to the event loop, which has a try/catch
block.

The app has a couple megabytes of just file/line number text, since it
needs to be compiled in. The original plan was to remove them in release
build, but they help for user bug reports so they're permanent. Users tell
us exactly where to find the problem.

A few exceptions are fatal and just terminate.  The database is never in
unstable state so we can leave safely at any time. Actually it's unstable
briefly during commits but nothing throws in there so the only danger is
power failures.

There probably are apps that need cleanup on terminate, but ours isn't one.

In practice, 99% of throws are from something trivial/stupid- a missing
field, or a link to something that doesn't need to be linked.  They are
caught in the event loop and users can safely continue working. In rare
cases they may see a ton of weird messages and need to force-quit.

As the stack unwinds after a throw, in theory it should tidy everything via
scope endings and destructors.  In practice, maybe there are leaks or other
bugs along the way. But in theory, those bugs would show up anyhow when the
stack unwinds from normal use.  In practice, the setup has worked well for
20+ years. Users see helpful error messages rather than crashes.  Maybe the
exception throws cause subtle, unknown problems but no worse than the usual
problems in any app.

I think Qt should enable exceptions in QWidget etc by default, strengthen
the disclaimer a bit, and feel no obligation to survive throws in perfect
condition. Pass them along and let developers deal with the consequences.
Exceptions should be for weird problems, and if things get weirder, so
what? Based on our experience in x86 it probably will be just fine.

Thanks,
Dennis Kolva
Programming Director
TurtleSoft.com
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-25 Thread Henry Skoglund

On 2024-05-24 21:14, David M. Cotter wrote:
I’ve tried everything I can think of. The ONLY one that works the way 
I NEED is the first one, but that one flashes the window on the screen


#if 1
qWidgetP->show();
qWidgetP->hide();
QtLetTimersFire(0);
#endif

Hi, have you tried the old Windows trick of moving the widget to 
Cleveland, i.e. way off into negative territory like Minimize does? 
https://devblogs.microsoft.com/oldnewthing/20041028-00/?p=37453

Say you have this code:

   auto qWidgetP = new QWidget();
   qWidgetP->setGeometry({100,100,1000,1000});
   qWidgetP->show();
   QTimer::singleShot(1000,[qWidgetP]{ qWidgetP->hide(); });

FLashes for sure. But if you position it like this:
   qWidgetP->setGeometry({-32000,-32000,1000,1000});
do all the setup and then later move it back into the normal coords.
The flash will still occur but noone will here you scream/flash.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-24 Thread David M. Cotter
I’ve tried everything I can think of. The ONLY one that works the way I NEED is 
the first one, but that one flashes the window on the screen

#if 1
qWidgetP->show();
qWidgetP->hide();
QtLetTimersFire(0);
#endif

#if 0
QLayout*layoutP(qWidgetP->layout());

layoutP->update();
layoutP->activate();
QtLetTimersFire(0);
#endif

#if 0
for (auto* childP: 
qWidgetP->findChildren()) {
childP->updateGeometry();
}

qWidgetP->updateGeometry();
QtLetTimersFire(0);
#endif

#if 0
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
true);
qWidgetP->show();
// qWidgetP->layout()->invalidate();
// qWidgetP->layout()->update();
// qWidgetP->layout()->activate();
qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
false);
QtLetTimersFire(0);
#endif

#if 0
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
true);
qWidgetP->show();

qWidgetP->layout()->invalidate();
qWidgetP->layout()->update();
qWidgetP->layout()->activate();

for (auto* childP: 
qWidgetP->findChildren()) {
childP->updateGeometry();
}

qWidgetP->updateGeometry();

qWidgetP->hide();
qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, 
false);
QtLetTimersFire(0);
#endif


> On May 24, 2024, at 12:47 AM, coroberti  wrote:
> 
> David,
> Try
> yourWidget->layout()->update();
> yourWidget->layout()->activate();
> 
> If not,
> let the event loop to run, ie. arranging a short timer.
> 
> Kind regards,
> Robert Iakobashvili
> 
> 
> On Fri, May 24, 2024 at 1:53 AM David M. Cotter  wrote:
>> 
>> I need to do something like this:
>> 
>> windowP->layout()->updateGeometry(); // causes all widget geometry to update
>> DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
>> something with the geometry of a widget (which must be up to date)
>> windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based 
>> on the fact that we KNOW the geometry of one of the widgets BEFORE the 
>> window is shown
>> windowP->show(); // only NOW show the window, NOT before now
>> 
>> How do I do something like the first line? Cause all widget geometry 
>> (Recursively), to know / figure out its size AND position? And this BEFORE 
>> the window or any widget is “shown”  via the windowP->show() command?
>> 
>> Please don’t try to tell me to do it differently. If you don’ know how to 
>> answer it, please don’t chime in, thanks.
>> 
>> -Dave
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Is it safe to construct QBindable from QProperty* via QUntypedBindable?

2024-05-24 Thread Schimkowitsch Robert
Sorry, the code was incomplete, it should have been

Q_PROPERTY(qreal x BINDABLE getBindableX READ default FINAL)
//...
QProperty m_X;
//...
QBindable CPropertyClass::getBindableX() const
{
return _X;
}

The purpose is to transmit data from the C++ backend to the QML front end. It’s 
a one-way road, QML only has to read and update when properties change.
I have hundreds of such properties in dozens of classes, so I was looking for 
the simplest possible way to get it done. Before 6.5, code was more like this

Q_PROPERTY(qreal x READ getX NOTIFY notifyXChanged FINAL)
//..
qreal m_X;
//...
signals:
   void notifyXChanged();
//...
qreal getX() const
{
   return m_X;
}
//...
void setX(const qreal arg)
{
   if (m_X == arg)
   {
  return;
   }
   m_X = arg;
   emit notifyXChanged();
}

Since 6.5, using BINDABLE keyword and READ DEFAULT is sufficient for QML to 
update, and as you can see, the code is much simpler. In the older version, I 
need a setter (which is not reachable from QML) because of the change 
comparison. The QProperty/QBindable implements that for me: If I set a property 
to the same value, no updates are triggered.

Hope that helps making things clear.

Kind regards

Robert

From: Interest  On Behalf Of Axel Spoerl via 
Interest
Sent: Friday, 24 May 2024 15:02
To: interest@qt-project.org
Subject: Re: [Interest] Is it safe to construct QBindable from QProperty* via 
QUntypedBindable?

CAUTION: External email. Do not click on links or open attachments unless you 
know the sender and that the content is safe.

Seas Robert,

If memory serves well, there was a recent post about the same question on the 
Qt Forum.
Haven't got around to answer, because I wanted to read some code upfront.
The given implementation of getBindable() has no return type, but you say it's 
a bindable.
I also assume that there's a reason for actually returning a bindable, rather 
than a qreal value.
Probably a calculation is implemented.

The code looks safe to me. The only caveat could be, that the propery is 
actually qreal typed.Depending on how it changes hands in QML, it might become 
a qreal value at some point, hence loosing the actual binding. But that's not 
related to your implementation.

I still find it unusual and haven't seen it anywhere else, than in the 
mentioned example.
Don't fully understand the use case of it. But you sound like you do , so IMHO 
there's nothing to worry about.

Cheers,
Axel

Von: Interest 
mailto:interest-boun...@qt-project.org>> im 
Auftrag von Schimkowitsch Robert 
mailto:robert.schimkowit...@andritz.com>>
Gesendet: Freitag, 24. Mai 2024 14:08
An: interest@qt-project.org 
mailto:interest@qt-project.org>>
Betreff: [Interest] Is it safe to construct QBindable from QProperty* via 
QUntypedBindable?

I use QBindable a lot in C++ classes that expose properties to QML.
My typical property implementation looks as follows:

Q_PROPERTY(qreal x BINDABLE getBindableX READ default FINAL)
//...
QProperty m_X;
//...
CPropertyClass::getBindableX() const
{
return _X;
}

I got the idea to use "_X" to get the QBindable for a property from the 
example in QObjectBindableProperty. And initially, I also used 
QObjectBindableProperty via Q_OBJECT_BINDABLE_PROPERTY macro.
But once QML natively supported BINDABLE properties, I no longer saw any 
advantage, and using QProperty produces less boilerplate.

So the usage of "_X" to get QBindable is documented for 
QObjectBindableProperty, but only in the example, not in the docs specifically. 
It feels a bit dirty to create a derived class via promotion from a base class.
And for QProperty, "_X" is not documented even in an example.

So the question is: Is it safe to use? Have I misunderstood something by 
choosing QProperty over Q_OBJECT_BINDABLE_PROPERTY?

Robert Schimkowitsch


This message and any attachments are solely for the use of the intended 
recipients. They may contain privileged and/or confidential information or 
other information protected from disclosure. If you are not an intended 
recipient, you are hereby notified that you received this email in error and 
that any review, dissemination, distribution or copying of this email and any 
attachment is strictly prohibited. If you have received this email in error, 
please contact the sender and delete the message and any attachment from your 
system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You

___
Interest mailing list
Interest@qt-project.org

[Interest] QTableView Column Width and Headers

2024-05-24 Thread Michael Jackson
I have a question about how the column widths of a QTableView are
calculated? How can I have the QTableView set the column with “to contents”
that includes the QHeader also? For example I have a QHeaderView with the
first “section” that has text “This is a really really really long header”,
but the actual data that is in the QTableView under that header are short
values such as “100” or “2” or “1.231”. When the QTableView is rendered the
the column with is only as wide as the QTableView. It is like the
QHeaderView is not taken into account when calculating the width of the
column.

This is with Qt 6.5.3 and 6.6.3.

--
Mike Jacksonmike.jack...@bluequartz.net
BlueQuartz Software www.bluequartz.net
President/Owner   Dayton, Ohio
Principal DREAM.3D Developer
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Exceptions

2024-05-24 Thread Thiago Macieira
On Friday 24 May 2024 13:25:37 GMT-3 Turtle Creek Software wrote:
> >> Install a terminate handler instead.
> 
> Is there some way to get from there back to the event loop?  

No and you don't want to. The moment you let the exception escape back to the 
Qt event loop, YOU MUST QUIT. So it doesn't matter where you quit it from, so 
long as you do so right now. Doing so from the terminate handler means you 
have a much better chance of having a valid state of everything you need to 
log stuff and save any files that you can still try to.

Trying to go through the exception-unsafe code in Qt and, worse, the third 
party and system libraries, is a worse outcome. The application may crash 
before that, with a second exception being thrown, or just plain crash.

> If so, that
> would solve our problem. If not, there's nothing we can do safely in a
> handler. Doing a database commit would cause worse chaos if there are
> unfinished records.  It needs GUI code to check that.

I understand, but it's too late. My point is that you've let an untestable and 
unexpected condition happen, so you should not trust the GUI.

You may want to try and save the state of what you would commit to the 
database, terminate the application and restart it. The newly-started process 
can inspect the saved state and decide how to continue, possibly offering the 
user the chance to decide to keep or not.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Exceptions

2024-05-24 Thread Turtle Creek Software
>> Install a terminate handler instead.

Is there some way to get from there back to the event loop?  If so, that
would solve our problem. If not, there's nothing we can do safely in a
handler. Doing a database commit would cause worse chaos if there are
unfinished records.  It needs GUI code to check that.

It's been a few years since we worked in Obj-C, but it was possible to give
a message, throw an exception then continue work.  I don't remember whether
they were caught in an Obj-C++ override of the event loop, or if Cocoa just
swallowed the throws.  If necessary we can go back and check the details.

Thanks,
Dennis Kolva
Programming Director
TurtleSoft.com

On Fri, May 24, 2024 at 6:00 AM  wrote:

> Send Interest mailing list submissions to
> interest@qt-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.qt-project.org/listinfo/interest
> or, via email, send a message with subject or body 'help' to
> interest-requ...@qt-project.org
>
> You can reach the person managing the list at
> interest-ow...@qt-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Interest digest..."
> Today's Topics:
>
>1. Re: Exceptions (Turtle Creek Software)
>2. Re: Exceptions (Thiago Macieira)
>3. Undefined symbols when porting from Qt5 to Qt6
>   (Corentin Bacqu?-cazenave)
>4. Re: Undefined symbols when porting from Qt5 to Qt6
>   (Thiago Macieira)
>5. Re: Undefined symbols when porting from Qt5 to Qt6
>   (Corentin Bacqu?-cazenave)
>6. Update widget geometry BEFORE window shown (David M. Cotter)
>7. Re: Undefined symbols when porting from Qt5 to Qt6
>   (Thiago Macieira)
>8. Re: Update widget geometry BEFORE window shown (Volker Hilsheimer)
>9. Re: Update widget geometry BEFORE window shown (coroberti)
>   10. Support for deployment on iOS 17 devices ?
>   (worldwides...@sina.com)
>
>
>
> -- Forwarded message --
> From: Turtle Creek Software 
> To: interest@qt-project.org
> Cc:
> Bcc:
> Date: Thu, 23 May 2024 10:57:39 -0400
> Subject: Re: [Interest] Exceptions
> *Qt 6.7 > Best Practice Guides > Exception Safety* as currently written
> seems very reasonable. We'd much rather see that extended to ARM rather
> than abandoned.
>
> This link states that ARM fully supports C++ exception handling:
>
> https://developer.arm.com/documentation/dui0491/i/C-and-C---Implementation-Details/C---exception-handling
>
> If the problem is with Apple/Cocoa/SwiftUI, would a throw just skip their
> code in the stack unwind?  That might cause unknown errors, but would still
> be better than fast termination.
>
> In a GUI app, there's always a tall pile of QWidgetry on the stack.
> Catching rare errors before it means extra code that will never be used.
> More time and clutter. Throws to the event loop are such an elegant
> solution.
>
> Dennis Kolva
> Programming Director
> TurtleSoft.com
>
>
>
>
>
> -- Forwarded message --
> From: Thiago Macieira 
> To: interest@qt-project.org
> Cc:
> Bcc:
> Date: Thu, 23 May 2024 12:14:01 -0300
> Subject: Re: [Interest] Exceptions
> On Thursday 23 May 2024 11:57:39 GMT-3 Turtle Creek Software wrote:
> > *Qt 6.7 > Best Practice Guides > Exception Safety* as currently written
> > seems very reasonable. We'd much rather see that extended to ARM rather
> > than abandoned.
>
> That is pending an investigation on whether the frames provided by Apple
> frameworks support unwinding. If they don't, then there's nothing we can
> do
> and you can argue with Apple.
>
> > This link states that ARM fully supports C++ exception handling:
> >
> https://developer.arm.com/documentation/dui0491/i/C-and-C---Implementation-D
> > etails/C---exception-handling
>
> That's irrelevant for Objective C, which is what Apple writes their code
> in.
>
> > If the problem is with Apple/Cocoa/SwiftUI, would a throw just skip their
> > code in the stack unwind?  That might cause unknown errors, but would
> still
> > be better than fast termination.
>
> No, it makes unwinding impossible. You can't unwind a frame if you don't
> know
> how to unwind it. The only possibility is to std::terminate().
>
> > In a GUI app, there's always a tall pile of QWidgetry on the stack.
> > Catching rare errors before it means extra code that will never be used.
> > More time and clutter. Throws to the event loop are such an elegant
> > solution.
>
> Install a terminate handler instead.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Principal Engineer - Intel DCAI Fleet Engineering and Quality
>
>
>
> -- Forwarded message --
> From: "Corentin Bacqué-cazenave" 
> To: "interest@qt-project.org Interest" 
> Cc:
> Bcc:
> Date: Thu, 23 May 2024 23:14:01 +0200
> Subject: [Interest] Undefined symbols when porting from Qt5 to Qt6
>
> Hi,
>
> I'm trying to port an application from Qt5 to Qt6.
>
> I get a lot of errors regarding 

Re: [Interest] Support for deployment on iOS 17 devices ?

2024-05-24 Thread ekke

Hi,

sorry - have overlooked this sentence.
All my physical IOS devices are still on 16.6.1 ;-)

just googled and found out, that also Flutter apps start Xcode to deploy 
to physical ios 17 devices.

seems these limitations from Apple hinder Flutter Apps just like Qt Apps,
so there's no way yet

or have you found other frameworks with solutions to this problem ?

ekke

Am 24.05.24 um 15:02 schrieb worldwides...@sina.com:

Hi, ekke, thank you for replying.

According to the page, only iOS 17 simulators are supported, because 
there is another sentence "However, these features are not supported 
for physical devices with iOS 17 or later because of limitations of 
the Apple tool for accessing these devices."


Currently I need to deploy the app directly to the physical device.



- Original Message -
From: ekke 
To: interest@qt-project.org
Subject: Re: [Interest] Support for deployment on iOS 17 devices ?
Date: 2024-05-24 18:01

Am 24.05.24 um 11:37 schrieb worldwides...@sina.com:

Hello.

The lastest release of Qt creator does not support deploying apps on 
iOS 17 device. Currently I have to switch between Xcode and Creator, 
one for deployment and the other for development.


Is it possible to support it in the future?

Thanks.


from https://doc.qt.io/qtcreator/creator-developing-ios.html


iOS 17 Devices

Qt Creator detects iOS devices, and you can deploy and run 
applications on them.


so "only" the application output is missed

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Support for deployment on iOS 17 devices ?

2024-05-24 Thread worldwidestar
Hi, ekke, thank you for replying.
According to the page, only iOS 17 simulators are supported, because there is 
another sentence "However, these features are not supported for physical 
devices with iOS 17 or later because of limitations of the Apple tool for 
accessing these devices."
Currently I need to deploy the app directly to the physical device.


- Original Message -
From: ekke 
To: interest@qt-project.org
Subject: Re: [Interest] Support for deployment on iOS 17 devices ?
Date: 2024-05-24 18:01

Am 24.05.24 um 11:37 schrieb
  worldwides...@sina.com:



  
  Hello.
  

  
  The lastest
release of Qt creator does not support deploying apps on iOS 17
device. Currently I have to switch between Xcode and Creator,
one for deployment and the other for development.
  

  
  Is it possible
to support it in the future?
  

  
  Thanks.

from https://doc.qt.io/qtcreator/creator-developing-ios.html 


iOS 17 Devices
Qt Creator detects iOS devices, and you can deploy and run
  applications on them.
so "only" the application output is missed


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Is it safe to construct QBindable from QProperty* via QUntypedBindable?

2024-05-24 Thread Axel Spoerl via Interest
Seas Robert,

If memory serves well, there was a recent post about the same question on the 
Qt Forum.
Haven't got around to answer, because I wanted to read some code upfront.

The given implementation of getBindable() has no return type, but you say it's 
a bindable.
I also assume that there's a reason for actually returning a bindable, rather 
than a qreal value.
Probably a calculation is implemented.

The code looks safe to me. The only caveat could be, that the propery is 
actually qreal typed.Depending on how it changes hands in QML, it might become 
a qreal value at some point, hence loosing the actual binding. But that's not 
related to your implementation.

I still find it unusual and haven't seen it anywhere else, than in the 
mentioned example.
Don't fully understand the use case of it. But you sound like you do , so IMHO 
there's nothing to worry about.

Cheers,
Axel

Von: Interest  im Auftrag von Schimkowitsch 
Robert 
Gesendet: Freitag, 24. Mai 2024 14:08
An: interest@qt-project.org 
Betreff: [Interest] Is it safe to construct QBindable from QProperty* via 
QUntypedBindable?

I use QBindable a lot in C++ classes that expose properties to QML.
My typical property implementation looks as follows:

Q_PROPERTY(qreal x BINDABLE getBindableX READ default FINAL)
//...
QProperty m_X;
//...
CPropertyClass::getBindableX() const
{
return _X;
}

I got the idea to use "_X" to get the QBindable for a property from the 
example in QObjectBindableProperty. And initially, I also used 
QObjectBindableProperty via Q_OBJECT_BINDABLE_PROPERTY macro.
But once QML natively supported BINDABLE properties, I no longer saw any 
advantage, and using QProperty produces less boilerplate.

So the usage of "_X" to get QBindable is documented for 
QObjectBindableProperty, but only in the example, not in the docs specifically. 
It feels a bit dirty to create a derived class via promotion from a base class.
And for QProperty, "_X" is not documented even in an example.

So the question is: Is it safe to use? Have I misunderstood something by 
choosing QProperty over Q_OBJECT_BINDABLE_PROPERTY?

Robert Schimkowitsch


This message and any attachments are solely for the use of the intended 
recipients. They may contain privileged and/or confidential information or 
other information protected from disclosure. If you are not an intended 
recipient, you are hereby notified that you received this email in error and 
that any review, dissemination, distribution or copying of this email and any 
attachment is strictly prohibited. If you have received this email in error, 
please contact the sender and delete the message and any attachment from your 
system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Is it safe to construct QBindable from QProperty* via QUntypedBindable?

2024-05-24 Thread Schimkowitsch Robert
I use QBindable a lot in C++ classes that expose properties to QML.
My typical property implementation looks as follows:

Q_PROPERTY(qreal x BINDABLE getBindableX READ default FINAL)
//...
QProperty m_X;
//...
CPropertyClass::getBindableX() const
{
return _X;
}

I got the idea to use "_X" to get the QBindable for a property from the 
example in QObjectBindableProperty. And initially, I also used 
QObjectBindableProperty via Q_OBJECT_BINDABLE_PROPERTY macro.
But once QML natively supported BINDABLE properties, I no longer saw any 
advantage, and using QProperty produces less boilerplate.

So the usage of "_X" to get QBindable is documented for 
QObjectBindableProperty, but only in the example, not in the docs specifically. 
It feels a bit dirty to create a derived class via promotion from a base class.
And for QProperty, "_X" is not documented even in an example.

So the question is: Is it safe to use? Have I misunderstood something by 
choosing QProperty over Q_OBJECT_BINDABLE_PROPERTY?

Robert Schimkowitsch


This message and any attachments are solely for the use of the intended 
recipients. They may contain privileged and/or confidential information or 
other information protected from disclosure. If you are not an intended 
recipient, you are hereby notified that you received this email in error and 
that any review, dissemination, distribution or copying of this email and any 
attachment is strictly prohibited. If you have received this email in error, 
please contact the sender and delete the message and any attachment from your 
system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Scene Graph - Graph example background noise not appearing when OpenGL backend is used

2024-05-24 Thread Laszlo Agocs via Interest

Hello,

It is not expected to happen, no. The example is expected to work identically 
with all the supported 3D APIs, but the noise texture is indeed sampled 
differently when running with OpenGL. There is a patch upcoming to remedy this.

Best regards,
Laszlo


From: Interest  on behalf of Nuno Santos via 
Interest 
Sent: Saturday, May 18, 2024 8:28 PM
To: interestqt-project. org 
Subject: [Interest] Scene Graph - Graph example background noise not appearing 
when OpenGL backend is used

Hi,

I’m taking as an example the Qt Scene Graph - Graph in order to pass a texture 
to a custom material.

However, if I use OpenGL as graphical backend by setting 
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL), the noise texture 
in the background does not appear.

Is this example supposed to work if the backend is the default one?

Does anyone know the reason or the caveat here?

Thanks!

Regards,

Nuno










___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Support for deployment on iOS 17 devices ?

2024-05-24 Thread ekke

Am 24.05.24 um 11:37 schrieb worldwides...@sina.com:

Hello.

The lastest release of Qt creator does not support deploying apps on 
iOS 17 device. Currently I have to switch between Xcode and Creator, 
one for deployment and the other for development.


Is it possible to support it in the future?

Thanks.


from https://doc.qt.io/qtcreator/creator-developing-ios.html


   iOS 17
   
Devices

Qt Creator detects iOS devices, and you can deploy and run applications 
on them.


so "only" the application output is missed
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Support for deployment on iOS 17 devices ?

2024-05-24 Thread worldwidestar
Hello.
The lastest release of Qt creator does not support deploying apps on iOS 17 
device. Currently I have to switch between Xcode and Creator, one for 
deployment and the other for development.
Is it possible to support it in the future?
Thanks.___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-24 Thread coroberti
David,
Try
yourWidget->layout()->update();
yourWidget->layout()->activate();

If not,
let the event loop to run, ie. arranging a short timer.

Kind regards,
Robert Iakobashvili


On Fri, May 24, 2024 at 1:53 AM David M. Cotter  wrote:
>
> I need to do something like this:
>
> windowP->layout()->updateGeometry(); // causes all widget geometry to update
> DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
> something with the geometry of a widget (which must be up to date)
> windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based on 
> the fact that we KNOW the geometry of one of the widgets BEFORE the window is 
> shown
> windowP->show(); // only NOW show the window, NOT before now
>
> How do I do something like the first line? Cause all widget geometry 
> (Recursively), to know / figure out its size AND position? And this BEFORE 
> the window or any widget is “shown”  via the windowP->show() command?
>
> Please don’t try to tell me to do it differently. If you don’ know how to 
> answer it, please don’t chime in, thanks.
>
> -Dave
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Update widget geometry BEFORE window shown

2024-05-24 Thread Volker Hilsheimer via Interest


On 24 May 2024, at 00:52, David M. Cotter  wrote:

I need to do something like this:

windowP->layout()->updateGeometry(); // causes all widget geometry to update
DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
something with the geometry of a widget (which must be up to date)
windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based on 
the fact that we KNOW the geometry of one of the widgets BEFORE the window is 
shown
windowP->show(); // only NOW show the window, NOT before now

How do I do something like the first line? Cause all widget geometry 
(Recursively), to know / figure out its size AND position? And this BEFORE the 
window or any widget is “shown”  via the windowP->show() command?

Please don’t try to tell me to do it differently. If you don’ know how to 
answer it, please don’t chime in, thanks.

-Dave

Hi David,

QLayout::activate should do what you are looking for. And QLayout::sizeHint 
should give you the size the layout would the window to have. You might be able 
to just call windowP->sizeHint() though.

It might depend on what your various functions do, though. If any of them 
changes any widget’s content in such a way that the widget’s sizeHint would 
change (in which case that widget is supposed to call QWidget::updateGeometry, 
which posts a layout requests event), then you are back in some asynchronous 
situation where the processing of events will result in the layout activating 
again, after you showed the window. Forcing the processing of 
QEvent::LayoutRequest with QCoreApplication::sendPostedEvents before calling 
windowP->show() might help then. Or you can deactivate the layout, or give 
windowP a fixed size based on its sizeHint, when you are confident that future 
changes should be ignored.


Volker

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Undefined symbols when porting from Qt5 to Qt6

2024-05-23 Thread Thiago Macieira
On Thursday 23 May 2024 19:06:59 GMT-3 Corentin Bacqué-cazenave via Interest 
wrote:
> So I probably have to link LibX11 in CmakeList.txt, not sure how however 
> 
> Thanks for the help 

https://cmake.org/cmake/help/latest/module/FindX11.html

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Update widget geometry BEFORE window shown

2024-05-23 Thread David M. Cotter
I need to do something like this:

windowP->layout()->updateGeometry(); // causes all widget geometry to update
DoSomethingImportant(windowP->GetWidget(“someWidget”).geometry()); // do 
something with the geometry of a widget (which must be up to date)
windowP->setGeometry(windowP->GetInitialGeometry()); // pos/size now based on 
the fact that we KNOW the geometry of one of the widgets BEFORE the window is 
shown
windowP->show(); // only NOW show the window, NOT before now

How do I do something like the first line? Cause all widget geometry 
(Recursively), to know / figure out its size AND position? And this BEFORE the 
window or any widget is “shown”  via the windowP->show() command?

Please don’t try to tell me to do it differently. If you don’ know how to 
answer it, please don’t chime in, thanks.

-Dave___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Undefined symbols when porting from Qt5 to Qt6

2024-05-23 Thread Corentin Bacqué-cazenave via Interest

Hi,

yes, it's from my application.

So I probably have to link LibX11 in CmakeList.txt, not sure how however :(

Thanks for the help :)

Corentin : expert certifié 2022 et Sponsor 
 NVDA, Référent commission 
Cécité & Co et Mandataire CNCPH à la commission Accessibilité 
Universelle - Fédé 100% Handinamique 


Le 24/05/2024 à 00:01, Thiago Macieira a écrit :

On Thursday 23 May 2024 18:14:01 GMT-3 Corentin Bacqué-cazenave via Interest
wrote:

Hi,

I'm trying to port an application from Qt5 to Qt6.

I get a lot of errors regarding undefined symbols reference like
XUngrabKey, XFree, XStringToKeysym, XFlush...

All symbols related to X11 seam to be missing.

Does anyone have an idea?

Hello Corentin

Where are those symbols being used? Is it from your application or is it from
some Qt code? If it's from your application, then you probably forgot to link
to the X11 library. Something in the buildsystem changed and your indirect
dependency is not there any more.

Qt5's GUI libraries, unlike Qt 4 and Qt 6, did not link to libX11. Qt 4 did
because it did not have the feature as a plugin; Qt 6 has to do it because of
OpenGL. But because of this, I wouldn't expect to see this problem at all:
libX11 is in use.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Undefined symbols when porting from Qt5 to Qt6

2024-05-23 Thread Thiago Macieira
On Thursday 23 May 2024 18:14:01 GMT-3 Corentin Bacqué-cazenave via Interest 
wrote:
> Hi,
> 
> I'm trying to port an application from Qt5 to Qt6.
> 
> I get a lot of errors regarding undefined symbols reference like
> XUngrabKey, XFree, XStringToKeysym, XFlush...
> 
> All symbols related to X11 seam to be missing.
> 
> Does anyone have an idea?

Hello Corentin

Where are those symbols being used? Is it from your application or is it from 
some Qt code? If it's from your application, then you probably forgot to link 
to the X11 library. Something in the buildsystem changed and your indirect 
dependency is not there any more.

Qt5's GUI libraries, unlike Qt 4 and Qt 6, did not link to libX11. Qt 4 did 
because it did not have the feature as a plugin; Qt 6 has to do it because of 
OpenGL. But because of this, I wouldn't expect to see this problem at all: 
libX11 is in use.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Undefined symbols when porting from Qt5 to Qt6

2024-05-23 Thread Corentin Bacqué-cazenave via Interest

Hi,

I'm trying to port an application from Qt5 to Qt6.

I get a lot of errors regarding undefined symbols reference like 
XUngrabKey, XFree, XStringToKeysym, XFlush...


All symbols related to X11 seam to be missing.

Does anyone have an idea?

Thanks

--

Corentin : expert certifié 2022 et Sponsor 
 NVDA, Référent commission 
Cécité & Co et Mandataire CNCPH à la commission Accessibilité 
Universelle - Fédé 100% Handinamique 
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Exceptions

2024-05-23 Thread Thiago Macieira
On Thursday 23 May 2024 11:57:39 GMT-3 Turtle Creek Software wrote:
> *Qt 6.7 > Best Practice Guides > Exception Safety* as currently written
> seems very reasonable. We'd much rather see that extended to ARM rather
> than abandoned.

That is pending an investigation on whether the frames provided by Apple 
frameworks support unwinding. If they don't, then there's nothing we can do 
and you can argue with Apple.

> This link states that ARM fully supports C++ exception handling:
> https://developer.arm.com/documentation/dui0491/i/C-and-C---Implementation-D
> etails/C---exception-handling

That's irrelevant for Objective C, which is what Apple writes their code in.

> If the problem is with Apple/Cocoa/SwiftUI, would a throw just skip their
> code in the stack unwind?  That might cause unknown errors, but would still
> be better than fast termination.

No, it makes unwinding impossible. You can't unwind a frame if you don't know 
how to unwind it. The only possibility is to std::terminate().

> In a GUI app, there's always a tall pile of QWidgetry on the stack.
> Catching rare errors before it means extra code that will never be used.
> More time and clutter. Throws to the event loop are such an elegant
> solution.

Install a terminate handler instead.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Exceptions

2024-05-23 Thread Turtle Creek Software
*Qt 6.7 > Best Practice Guides > Exception Safety* as currently written
seems very reasonable. We'd much rather see that extended to ARM rather
than abandoned.

This link states that ARM fully supports C++ exception handling:
https://developer.arm.com/documentation/dui0491/i/C-and-C---Implementation-Details/C---exception-handling

If the problem is with Apple/Cocoa/SwiftUI, would a throw just skip their
code in the stack unwind?  That might cause unknown errors, but would still
be better than fast termination.

In a GUI app, there's always a tall pile of QWidgetry on the stack.
Catching rare errors before it means extra code that will never be used.
More time and clutter. Throws to the event loop are such an elegant
solution.

Dennis Kolva
Programming Director
TurtleSoft.com
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Scene Graph - Graph example background noise not appearing when OpenGL backend is used

2024-05-18 Thread Nuno Santos via Interest
Hi,

I’m taking as an example the Qt Scene Graph - Graph in order to pass a texture 
to a custom material.

However, if I use OpenGL as graphical backend by setting 
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL), the noise texture 
in the background does not appear. 

Is this example supposed to work if the backend is the default one?

Does anyone know the reason or the caveat here?

Thanks!

Regards,

Nuno










___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and OpenGL frame buffer object

2024-05-15 Thread Nuno Santos via Interest
Lazslo,

Thank you very much for your prompt reply.

If I will be doing this very very regularly, should I keep an instance of the 
FBO instance of creating and deleting all the time?

Best regards,

Nuno

> On 15 May 2024, at 15:46, Laszlo Agocs  wrote:
> 
> 
> Hi Nuno,
> 
> You can always create an FBO on the fly for the purposes of the readback.
> 
> For example, something along the lines of:
> 
> glGenFramebuffers(1, );
> glBindFramebuffer(GL_FRAMEBUFFER, fbo);
> glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 
> texture, 0);
> glReadPixels(...);
> glBindFramebuffer(GL_FRAMEBUFFER, context->defaultFramebufferObject());
> glDeleteFramebuffers(1, );
> 
> Best regards,
> Laszlo
> 
> From: Nuno Santos  >
> Sent: Wednesday, May 15, 2024 4:29 PM
> To: Laszlo Agocs mailto:laszlo.ag...@qt.io>>
> Cc: interestqt-project. org  >
> Subject: Re: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget 
> and OpenGL frame buffer object
>  
> Laszlo,
> 
> I have a new problem regarding this question.
> 
> I have a QQuickRenderControl in order to do a side render and be able to 
> extract the render output. I was reading from the FBO using the glReadPixels 
> function.
> 
> But now the render target is a OpenGL Texture but apparently the function 
> that reads from a GLTexture is glGetTexImage but that function is not on the 
> qopenglfunctions.
> 
> How can I read the texture now? 
> 
> Thanks!
> 
> Best regards,
> 
> Nuno
> 
>> On 8 May 2024, at 16:41, Laszlo Agocs > > wrote:
>> 
>> Hi,
>> 
>> Passing 0 as a renderbuffer object name is not going to work. Try using 
>> https://doc.qt.io/qt-6/qquickrendertarget.html#fromOpenGLTexture with the 
>> texture that is used as the color attachment of your OpenGL framebuffer 
>> object. (actually that FBO is not useful in Qt 6 as one will be created 
>> internally as needed)
>> 
>> Best regards,
>> Laszlo
>> 
>> From: Interest > > on behalf of Nuno Santos via 
>> Interest mailto:interest@qt-project.org>>
>> Sent: Tuesday, April 16, 2024 4:21 PM
>> To: interestqt-project. org > >
>> Subject: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and 
>> OpenGL frame buffer object
>>  
>> Hi,
>> 
>> I have an application that was heavily written on top of OpenGL. Right now I 
>> want to port it to Qt 6 with the minimum effort trying to stick to the 
>> OpenGL backend until I get the grip on the new things of Qt 6 Graphics API 
>> abstraction.
>> 
>> I used to do this in order to assign a target FBO to a QuickWindow:
>> 
>> _quickWindow->setRenderTarget(_fboRender);
>> 
>> This is no longer possible and it requires a QQuickRenderTarget to be 
>> created and I seem to have three options:
>> 
>> (since 6.2) QQuickRenderTarget  fromOpenGLRenderBuffer(uint renderbufferId, 
>> const QSize , int sampleCount = 1)
>> (since 6.4) QQuickRenderTarget  fromOpenGLTexture(uint textureId, uint 
>> format, const QSize , int sampleCount = 1)
>> QQuickRenderTarget  fromOpenGLTexture(uint textureId, const QSize 
>> , int sampleCount = 1)
>> 
>> I’m trying this:
>> 
>> _renderTarget = QQuickRenderTarget::fromOpenGLRenderBuffer(0, 
>> QSize(_renderResolution.width(), _renderResolution.height()));
>> _quickWindow->setRenderTarget(_renderTarget);
>> 
>> But nothing appears on the screen and I get a warning:
>> 
>> QQuickWindow: No render target (neither swapchain nor custom target was 
>> provided)
>> 
>> Can anyone tell me what am I failing here?
>> 
>> Any ideas suggestions are very welcome.
>> 
>> With my best regards,
>> 
>> Nuno
>> ___
>> Interest mailing list
>> Interest@qt-project.org 
>> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and OpenGL frame buffer object

2024-05-15 Thread Laszlo Agocs via Interest

Hi Nuno,

You can always create an FBO on the fly for the purposes of the readback.

For example, something along the lines of:

glGenFramebuffers(1, );
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 
texture, 0);
glReadPixels(...);
glBindFramebuffer(GL_FRAMEBUFFER, context->defaultFramebufferObject());
glDeleteFramebuffers(1, );

Best regards,
Laszlo


From: Nuno Santos 
Sent: Wednesday, May 15, 2024 4:29 PM
To: Laszlo Agocs 
Cc: interestqt-project. org 
Subject: Re: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and 
OpenGL frame buffer object

Laszlo,

I have a new problem regarding this question.

I have a QQuickRenderControl in order to do a side render and be able to 
extract the render output. I was reading from the FBO using the glReadPixels 
function.

But now the render target is a OpenGL Texture but apparently the function that 
reads from a GLTexture is glGetTexImage but that function is not on the 
qopenglfunctions.

How can I read the texture now?

Thanks!

Best regards,

Nuno

On 8 May 2024, at 16:41, Laszlo Agocs  wrote:

Hi,

Passing 0 as a renderbuffer object name is not going to work. Try using 
https://doc.qt.io/qt-6/qquickrendertarget.html#fromOpenGLTexture with the 
texture that is used as the color attachment of your OpenGL framebuffer object. 
(actually that FBO is not useful in Qt 6 as one will be created internally as 
needed)

Best regards,
Laszlo


From: Interest  on behalf of Nuno Santos via 
Interest 
Sent: Tuesday, April 16, 2024 4:21 PM
To: interestqt-project. org 
Subject: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and 
OpenGL frame buffer object

Hi,

I have an application that was heavily written on top of OpenGL. Right now I 
want to port it to Qt 6 with the minimum effort trying to stick to the OpenGL 
backend until I get the grip on the new things of Qt 6 Graphics API abstraction.

I used to do this in order to assign a target FBO to a QuickWindow:

_quickWindow->setRenderTarget(_fboRender);

This is no longer possible and it requires a QQuickRenderTarget to be created 
and I seem to have three options:

(since 6.2) QQuickRenderTarget  fromOpenGLRenderBuffer(uint renderbufferId, 
const QSize , int sampleCount = 1)
(since 6.4) QQuickRenderTarget  fromOpenGLTexture(uint textureId, uint format, 
const QSize , int sampleCount = 1)
QQuickRenderTarget  fromOpenGLTexture(uint textureId, const QSize 
, int sampleCount = 1)

I’m trying this:

_renderTarget = QQuickRenderTarget::fromOpenGLRenderBuffer(0, 
QSize(_renderResolution.width(), _renderResolution.height()));
_quickWindow->setRenderTarget(_renderTarget);

But nothing appears on the screen and I get a warning:

QQuickWindow: No render target (neither swapchain nor custom target was 
provided)

Can anyone tell me what am I failing here?

Any ideas suggestions are very welcome.

With my best regards,

Nuno
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and OpenGL frame buffer object

2024-05-15 Thread Nuno Santos via Interest
Laszlo,

I have a new problem regarding this question.

I have a QQuickRenderControl in order to do a side render and be able to 
extract the render output. I was reading from the FBO using the glReadPixels 
function.

But now the render target is a OpenGL Texture but apparently the function that 
reads from a GLTexture is glGetTexImage but that function is not on the 
qopenglfunctions.

How can I read the texture now? 

Thanks!

Best regards,

Nuno

> On 8 May 2024, at 16:41, Laszlo Agocs  wrote:
> 
> Hi,
> 
> Passing 0 as a renderbuffer object name is not going to work. Try using 
> https://doc.qt.io/qt-6/qquickrendertarget.html#fromOpenGLTexture with the 
> texture that is used as the color attachment of your OpenGL framebuffer 
> object. (actually that FBO is not useful in Qt 6 as one will be created 
> internally as needed)
> 
> Best regards,
> Laszlo
> 
> From: Interest  on behalf of Nuno Santos via 
> Interest 
> Sent: Tuesday, April 16, 2024 4:21 PM
> To: interestqt-project. org 
> Subject: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and 
> OpenGL frame buffer object
>  
> Hi,
> 
> I have an application that was heavily written on top of OpenGL. Right now I 
> want to port it to Qt 6 with the minimum effort trying to stick to the OpenGL 
> backend until I get the grip on the new things of Qt 6 Graphics API 
> abstraction.
> 
> I used to do this in order to assign a target FBO to a QuickWindow:
> 
> _quickWindow->setRenderTarget(_fboRender);
> 
> This is no longer possible and it requires a QQuickRenderTarget to be created 
> and I seem to have three options:
> 
> (since 6.2) QQuickRenderTarget  fromOpenGLRenderBuffer(uint renderbufferId, 
> const QSize , int sampleCount = 1)
> (since 6.4) QQuickRenderTarget  fromOpenGLTexture(uint textureId, uint 
> format, const QSize , int sampleCount = 1)
> QQuickRenderTarget  fromOpenGLTexture(uint textureId, const QSize 
> , int sampleCount = 1)
> 
> I’m trying this:
> 
> _renderTarget = QQuickRenderTarget::fromOpenGLRenderBuffer(0, 
> QSize(_renderResolution.width(), _renderResolution.height()));
> _quickWindow->setRenderTarget(_renderTarget);
> 
> But nothing appears on the screen and I get a warning:
> 
> QQuickWindow: No render target (neither swapchain nor custom target was 
> provided)
> 
> Can anyone tell me what am I failing here?
> 
> Any ideas suggestions are very welcome.
> 
> With my best regards,
> 
> Nuno
> ___
> Interest mailing list
> Interest@qt-project.org 
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] How to implement 3 level windows in Qt (Windows)

2024-05-14 Thread Furkan Uzumcu
I had a similar problem to this for a Qt Quick application.

I don’t think there’s a Qt specific solution to it on Windows. What I ended up 
doing is dynamically changing the transient parent of the windows to maintain a 
particular z-order.

The main window would be the base parent, then when the top level windows 
become active I change their transient parent to the mid level ones and alter 
the logic to fit our need. I achieved this with an attached type that exposes a 
property to specify which order the window should be in and an event filter to 
watch for window events.

Regards,
Furkan Üzümcü
On Apr 24, 2024 at 10:18 -0400, sivan nanthiran , 
wrote:
> Hi all,
>
> I am trying to create a dual screen application which should support 3 levels 
> (z-order) of windows/dialogs. Each level of widgets should be preserved at 
> any given time.
>
> At the base level, a main widget (MainWidget) and an aux dialog (AuxDialog) 
> with MainWidget as its parent. These 2 widgets are ensured that they won't 
> overlap each other as the geometry is handled at all times.
>
> At the mid level, several dialogs can be opened by clicking buttons in the 
> main/aux widget. This dialog is created with Qt::Tool flag and MainWidget as 
> its parent.
>
> The highest level is a modal dialog that can be opened by mid level dialogs 
> or the base level widgets.
>
> > MainWidget mainWidget;
> > AuxDialog auxDialog(mainWidget);
> > MidLevelDialog dlg (Qt::Tool, mainWidget);
> > QDialog dlg; // modal dialog using ::exec()
>
> The following implementation works in MacOS as expected. However, in Windows, 
> midLevel dialog can get behind the Aux dialog.
>
> I have tried the following steps, but it's still not working:
> a) Add Qt::WindowStaysOnTopHint to the midLevelDialog on top of Qt::Tool. 
> This causes the modal dialog to go behind midLevelDialog.
> b) Create midLevelDialog with AuxDialog as the parent instead of MainWidget. 
> Although this works, I still think it should not be this way. Furthermore, in 
> reality, the AuxDialog may/may not be created, and might get deleted midway.
> c) Create modal dialog with midLevel dialog as the parent. But this is not 
> feasible as there can be several midLevel dialogs opened at the same time and 
> only one can be parent.
>
> Could anyone please advice on how to prevent the dialog/widget from getting 
> into the wrong z-order.
>
> Regards,
> Sivan
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QWebAssembly

2024-05-14 Thread Sley HORTES


> On May 14, 2024, at 12:13 PM, Sley HORTES  wrote:
> 
> Hello everyone, I have a little question I wanna post here.
> 
> I would like to run my qt app in a browser like, I have seen that I can use 
> QwebAssembly to do so. I have already read the Documentation and installed 
> the prerequisites (Emscripten, python3 etc).
> 
> The problem is that I am not using Qt-creator and I don’t know How to build 
> the app so the .json and .html files got created. 
> I have seen that I am supposed to build qt from source or something but I 
> don’t really get it neither know how to do it. 
> 
> Can someone please enlighten me about this? I am using CMake to build the app.


This is the part that is ambiguous to me. 

Building Qt from Source 

Building from source lets you set Qt configuration options such as thread 
support, OpenGL ES level, or SIMD support. Download the Qt sources from the 
Downloads section of your Qt account.

Configure Qt as a cross-compile build for the wasm-emscripten platform. This 
sets the -static, -no-feature-thread, and -no-make examples configure options. 
You can enable thread support with the -feature-thread, configure option. 
Shared library builds are not supported.

You need a host build of the same version of Qt and specify that path in the 
QT_HOST_PATH CMake variable or by using the -qt-host-path configure argument.

Although it should be detected, you may optionally set the CMAKE_TOOLCHAIN_FILE 
CMake variable to the Emscripten.cmake toolchain file that comes with 
Emscripten SDK. This can be done by setting the environment variable 
CMAKE_TOOLCHAIN_FILE or by passing 
CMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake to configure.

./configure -qt-host-path /path/to/Qt -platform wasm-emscripten -prefix 
$PWD/qtbase


Note: configure always uses the Ninja generator and build tool if a ninja 
executable is available. Ninja is cross-platform, feature-rich, performant, and 
recommended on all platforms. The use of other generators might work but is not 
officially supported.
On Windows, make sure you have MinGW in your PATH and configure with the 
following:

configure -qt-host-path C:\Path\to\Qt -no-warnings-are-errors -platform 
wasm-emscripten -prefix %CD%\qtbase


Then build the required modules:

cmake --build . -t qtbase -t qtdeclarative [-t another_module]





They are saying to use a configure script but I don’t find it anywhere in the 
qt installation path. Also when I am using the cmake --build in the terminal, 
it says that there is no CMakeLists.txt file in qt’s main directory. I just 
don’t know what to do. ___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QWebAssembly

2024-05-13 Thread Sley HORTES
Hello everyone, I have a little question I wanna post here.

I would like to run my qt app in a browser like, I have seen that I can use 
QwebAssembly to do so. I have already read the Documentation and installed the 
prerequisites (Emscripten, python3 etc).

The problem is that I am not using Qt-creator and I don’t know How to build the 
app so the .json and .html files got created. 
I have seen that I am supposed to build qt from source or something but I don’t 
really get it neither know how to do it. 

Can someone please enlighten me about this? I am using CMake to build the app.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Recommendation for fast drawing for QtQuick?

2024-05-12 Thread Stan Morris
My first implementation was with QNanoPainter on OpenGL and was not fast
enough. The QSGGeometry code is 4X faster and half the CPU utilization of
QNanoPainter. QNanoPainter has better line quality than what I achieved
with QSGGeomery, but I need not only speed but low CPU utilization.

On Sat, May 11, 2024 at 2:58 AM  wrote:


> -- Forwarded message --
> From: Samuel Stirtzel 
> To: Stan Morris 
> Cc: interest@qt-project.org
> Bcc:
> Date: Sat, 11 May 2024 03:11:40 +0200
> Subject: Re: [Interest] Recommendation for fast drawing for QtQuick?
> Hi,
>
> there is also qnanopainter, an opengl / nanovg based painting library
> for qt, it is available under the zlib license at
> https://github.com/QUItCoding/qnanopainter
> However, I only used this on an i.MX6Q with entaviv on qt 5.15 years
> ago, the performance was very good though.
>
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Is it possible to compile a shader in runtime using qsb?

2024-05-11 Thread Nuno Santos via Interest
Laszlo,

Thanks for this amazing tip. This is exactly what we needed! ;)

The Qt Company team rocks!

Have a great weekend.

Best regards,

Nuno

> On 8 May 2024, at 16:42, Laszlo Agocs  wrote:
> 
> Hi,
> 
> From Qt 6.6 on you can pull in the Qt Shader Tools module into the project 
> and try using https://doc.qt.io/qt-6/qshaderbaker.html
> 
> If this is actually suitable for your use case, cannot say without more 
> details, because doing the heavyweight compilation and transpilation at 
> runtime is one thing, being able to do something with the resulting QShader 
> object is another.
> 
> For instance, when working with custom scenegraph materials, a QShader can be 
> used instead of .qsb filenames via 
> https://doc.qt.io/qt-6/qsgmaterialshader.html#setShader
> If however the intention would be to do something similar in a ShaderEffect 
> declared in QML, there is no API to achieve that since its vertexShader and 
> fragmentShader properties only consume (.qsb) file URLs.
> 
> Best regards,
> Laszlo
> 
> From: Interest  on behalf of Nuno Santos via 
> Interest 
> Sent: Tuesday, May 7, 2024 11:28 AM
> To: interestqt-project. org 
> Subject: [Interest] Is it possible to compile a shader in runtime using qsb?
>  
> Hi,
> 
> I’m wondering if it is possible to run qsb to compile a shader in run time on 
> iOS.
> 
> I’m using QProcess to call qbs in order to compile in run time but since 
> QProcess does not exist on iOS, I wonder how can I achieve the same result?
> 
> Thanks!
> 
> Regards,
> 
> Nuno
> ___
> Interest mailing list
> Interest@qt-project.org 
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Recommendation for fast drawing for QtQuick?

2024-05-10 Thread Samuel Stirtzel via Interest
Hi,

there is also qnanopainter, an opengl / nanovg based painting library
for qt, it is available under the zlib license at
https://github.com/QUItCoding/qnanopainter
However, I only used this on an i.MX6Q with entaviv on qt 5.15 years
ago, the performance was very good though.

Am Mi., 8. Mai 2024 um 22:19 Uhr schrieb Stan Morris :
>
> I need to draw a lot of lines with low CPU utilization in a QtQuick app on 
> ARM i.MX8. Neither QML Shapes nor QNanoPainter are fast enough.
>
> What do you recommend?
>
> Drawing with QSGGeometry is fast enough, but I need to draw lines with widths 
> greater than one pixel and there's an annoying notch on line joins. My first 
> attempt at rounded end caps ends up as single pixels. I see there are ways to 
> draw circles... but I feel like QSGGeometry is the wrong direction. This is 
> Qt 6.7 on Linux (could be Qt 6.8 in a few months).  Surely there is something 
> better?
>
> QSGRenderNode and QRhi look promising, but I want to get an opinion before I 
> spend the next few weeks exploring QSGRenderNode. Also, it would be nice to 
> draw text from C++ to keep the interface simple.
>
> Thanks, Stan
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest



-- 
Regards
Samuel
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.7: How to set the blend equation when doing blend on updateGraphicsPipelineState?

2024-05-10 Thread Laszlo Agocs via Interest
Hi Nuno,

There is no immediate solution to this, or any similar cases where a 
QSGMaterialShader subclass alters arbitrary OpenGL state, completely unknown to 
Qt and the scenegraph renderer. (the number of such materials out there is 
believed to be quite low, though)

The old Qt 5 approach is not compatible with Qt 6, for multiple reasons: one 
being the obvious problem that application code calling glWhatever() when the 
scenegraph is rendering with D3D or Metal is not going to work very well; the 
other that even if one only cares about OpenGL, the internal rendering pipeline 
in Qt 6 is different enough from Qt 5 so that a QSGMaterialShader subclass 
attempting to issue OpenGL calls in any of its virtual overrides is futile.

See also 
https://doc.qt.io/qt-6/qsgmaterialshader-graphicspipelinestate.html#details

Graphics pipeline state settings that we deem important enough for custom 
scenegraph materials to have control over, need to have explicit support in the 
GraphicsPipelineState struct and the scenegraph renderer. Some things got added 
during the 6.x series so far (polygon mode, separate blend factors). What we 
can do with regards to the rgb/alpha blend operations is to follow the same 
pattern and introduce these in Qt 6.8 for example. (but it will not be possible 
to support this in patch releases of earlier versions)

Best regards,
Laszlo


From: Nuno Santos 
Sent: Wednesday, May 8, 2024 5:55 PM
To: Laszlo Agocs 
Cc: interestqt-project. org 
Subject: Re: [Interest] Qt 6.7: How to set the blend equation when doing blend 
on updateGraphicsPipelineState?

Lazslo,

Thank you very much for your reply.

I was really hopeful that there was some kind of workaround for this 
limitation. This renders impossible to port an application from Qt 5 to Qt 6 at 
least as far as my knowledge goes.

Is there any possible workaround for this limitation? Can I do it if I edit the 
source code in any way? Can you please advise?

With the current architecture the application relies heavily on this to make 
blending between layers.

Thank you in advance!

Best regards,

Nuno

On 8 May 2024, at 16:42, Laszlo Agocs  wrote:

Hi,

As you found, QSGMaterialShader::GraphicsPipelineState allows specifying the 
blend factors, and from Qt 6.5 on it also supports specifying separate RGB and 
alpha factors.

However, the blend equation is always ADD. There is no way to change that 
currently.

Best regards,
Laszlo


From: Interest  on behalf of Nuno Santos via 
Interest 
Sent: Monday, May 6, 2024 7:21 PM
To: interestqt-project. org 
Subject: [Interest] Qt 6.7: How to set the blend equation when doing blend on 
updateGraphicsPipelineState?

Hi,

I’m porting an app from Qt 5.15 to Qt 6.7 but I’m stumbling on the fact that 
there is no equivalent to blend equation in OpenGL.

Note: At the time being, I’m still using OpenGL as graphics backend to minimise 
the already huge ongoing port.


To achieve blending mode between nodes, I was using a mix between glBlendFunc 
and glBlendEquation:

case Normal:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_ONE, 
GL_ONE_MINUS_SRC_ALPHA);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_ADD);
break;
case Screen:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
GL_ONE);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_ADD);
break;
case Overlay:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
GL_ONE);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_MAX);
break;
case Difference:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
GL_ONE);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
break;

But in the newest version of QSGMaterialShader class documentation it says:

"The shader pipeline state changes are less often used. One use case is 
materials that wish to use a specific blend mode. The relevant function is 
updateGraphicsPipelineState(). This function is not called unless the 
QSGMaterialShader has opted in by setting the flag 
UpdatesGraphicsPipelineState. The task of the function is to update the 
GraphicsPipelineState struct instance that is passed to it with the desired 
changes. Currently only blending and culling-related features are available, 
other states cannot be controlled by materials.”

So I’m now trying to use

bool 
QSGMaterialShader::updateGraphicsPipelineState(QSGMaterialShader::RenderState 
, QSGMaterialShader::GraphicsPipelineState *ps, QSGMaterial *newMaterial, 
QSGMaterial *oldMaterial)

case Normal:
ps->srcColor = QSGMaterialShader::GraphicsPipelineState::One;
ps->dstColor = QSGMaterialShader::GraphicsPipelineState::OneMinusSrcAlpha;
break;
case Screen:
ps->srcColor = QSGMaterialShader::GraphicsPipelineState::SrcColor;
ps->dstColor = QSGMaterialShader::GraphicsPipelineState::One;
break;
case Overlay:

[Interest] Recommendation for fast drawing for QtQuick?

2024-05-08 Thread Stan Morris
I need to draw a lot of lines with low CPU utilization in a QtQuick app on
ARM i.MX8. Neither QML Shapes nor QNanoPainter are fast enough.

What do you recommend?

Drawing with QSGGeometry is fast enough, but I need to draw lines with
widths greater than one pixel and there's an annoying notch on line joins.
My first attempt at rounded end caps ends up as single pixels. I see there
are ways to draw circles... but I feel like QSGGeometry is the
wrong direction. This is Qt 6.7 on Linux (could be Qt 6.8 in a few
months).  Surely there is something better?

QSGRenderNode and QRhi look promising, but I want to get an opinion before
I spend the next few weeks exploring QSGRenderNode. Also, it would be nice
to draw text from C++ to keep the interface simple.

Thanks, Stan
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and OpenGL frame buffer object

2024-05-08 Thread Nuno Santos via Interest
Laszlo,

Thanks for your reply.

I was able to overcome this problem a couple of weeks ago. Your suggestion was 
exactly what I have followed.

My biggest problem right now is definitely the lack of blend equation support. 
Can you please help?

Thank you!

Best regards,

Nuno

> On 8 May 2024, at 16:41, Laszlo Agocs  wrote:
> 
> Hi,
> 
> Passing 0 as a renderbuffer object name is not going to work. Try using 
> https://doc.qt.io/qt-6/qquickrendertarget.html#fromOpenGLTexture with the 
> texture that is used as the color attachment of your OpenGL framebuffer 
> object. (actually that FBO is not useful in Qt 6 as one will be created 
> internally as needed)
> 
> Best regards,
> Laszlo
> 
> From: Interest  on behalf of Nuno Santos via 
> Interest 
> Sent: Tuesday, April 16, 2024 4:21 PM
> To: interestqt-project. org 
> Subject: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and 
> OpenGL frame buffer object
>  
> Hi,
> 
> I have an application that was heavily written on top of OpenGL. Right now I 
> want to port it to Qt 6 with the minimum effort trying to stick to the OpenGL 
> backend until I get the grip on the new things of Qt 6 Graphics API 
> abstraction.
> 
> I used to do this in order to assign a target FBO to a QuickWindow:
> 
> _quickWindow->setRenderTarget(_fboRender);
> 
> This is no longer possible and it requires a QQuickRenderTarget to be created 
> and I seem to have three options:
> 
> (since 6.2) QQuickRenderTarget  fromOpenGLRenderBuffer(uint renderbufferId, 
> const QSize , int sampleCount = 1)
> (since 6.4) QQuickRenderTarget  fromOpenGLTexture(uint textureId, uint 
> format, const QSize , int sampleCount = 1)
> QQuickRenderTarget  fromOpenGLTexture(uint textureId, const QSize 
> , int sampleCount = 1)
> 
> I’m trying this:
> 
> _renderTarget = QQuickRenderTarget::fromOpenGLRenderBuffer(0, 
> QSize(_renderResolution.width(), _renderResolution.height()));
> _quickWindow->setRenderTarget(_renderTarget);
> 
> But nothing appears on the screen and I get a warning:
> 
> QQuickWindow: No render target (neither swapchain nor custom target was 
> provided)
> 
> Can anyone tell me what am I failing here?
> 
> Any ideas suggestions are very welcome.
> 
> With my best regards,
> 
> Nuno
> ___
> Interest mailing list
> Interest@qt-project.org 
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.7: How to set the blend equation when doing blend on updateGraphicsPipelineState?

2024-05-08 Thread Nuno Santos via Interest
Lazslo,

Thank you very much for your reply.

I was really hopeful that there was some kind of workaround for this 
limitation. This renders impossible to port an application from Qt 5 to Qt 6 at 
least as far as my knowledge goes.

Is there any possible workaround for this limitation? Can I do it if I edit the 
source code in any way? Can you please advise? 

With the current architecture the application relies heavily on this to make 
blending between layers. 

Thank you in advance!

Best regards,

Nuno

> On 8 May 2024, at 16:42, Laszlo Agocs  wrote:
> 
> Hi,
> 
> As you found, QSGMaterialShader::GraphicsPipelineState allows specifying the 
> blend factors, and from Qt 6.5 on it also supports specifying separate RGB 
> and alpha factors.
> 
> However, the blend equation is always ADD. There is no way to change that 
> currently.
> 
> Best regards,
> Laszlo
> 
> From: Interest  on behalf of Nuno Santos via 
> Interest 
> Sent: Monday, May 6, 2024 7:21 PM
> To: interestqt-project. org 
> Subject: [Interest] Qt 6.7: How to set the blend equation when doing blend on 
> updateGraphicsPipelineState?
>  
> Hi,
> 
> I’m porting an app from Qt 5.15 to Qt 6.7 but I’m stumbling on the fact that 
> there is no equivalent to blend equation in OpenGL.
> 
> Note: At the time being, I’m still using OpenGL as graphics backend to 
> minimise the already huge ongoing port.
> 
> 
> To achieve blending mode between nodes, I was using a mix between glBlendFunc 
> and glBlendEquation:
> 
> 
> case 
> Normal:
> 
> QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_ONE, 
> GL_ONE_MINUS_SRC_ALPHA);
> 
> QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_ADD);
> 
> break;
> 
> case 
> Screen:
> 
> QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
> GL_ONE);
> 
> QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_ADD);
> 
> break;
> 
> case 
> Overlay:
> 
> QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
> GL_ONE);
> 
> QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_MAX);
> 
> break;
> 
> case 
> Difference:
> 
> QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
> GL_ONE);
> 
> QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
> 
> break;
> 
> 
> But in the newest version of QSGMaterialShader class documentation it says:
> 
> "The shader pipeline state changes are less often used. One use case is 
> materials that wish to use a specific blend mode. The relevant function is 
> updateGraphicsPipelineState(). This function is not called unless the 
> QSGMaterialShader has opted in by setting the flag 
> UpdatesGraphicsPipelineState. The task of the function is to update the 
> GraphicsPipelineState struct instance that is passed to it with the desired 
> changes. Currently only blending and culling-related features are available, 
> other states cannot be controlled by materials.”
> 
> So I’m now trying to use 
> 
> bool 
> QSGMaterialShader::updateGraphicsPipelineState(QSGMaterialShader::RenderState 
> , QSGMaterialShader::GraphicsPipelineState *ps, QSGMaterial 
> *newMaterial, QSGMaterial *oldMaterial)
> 
> 
> case Normal:
> 
> ps->srcColor = QSGMaterialShader::GraphicsPipelineState::One;
> 
> ps->dstColor = QSGMaterialShader::GraphicsPipelineState::OneMinusSrcAlpha;
> 
> break;
> 
> case Screen:
> 
> ps->srcColor = QSGMaterialShader::GraphicsPipelineState::SrcColor;
> 
> ps->dstColor = QSGMaterialShader::GraphicsPipelineState::One;
> 
> break;
> 
> case Overlay:
> 
> ps->srcColor = QSGMaterialShader::GraphicsPipelineState::SrcColor;
> 
> ps->dstColor = QSGMaterialShader::GraphicsPipelineState::One;
> 
> break;
> 
> case Difference:
> 
> ps->srcColor = QSGMaterialShader::GraphicsPipelineState::SrcColor;
> 
> ps->dstColor = QSGMaterialShader::GraphicsPipelineState::One;
> 
> break;
> 
> 
> 
> 
> 
> When the blendEquation GL_FUNC_ADD was used, it seems to be working.
> 
> But when I get to modes like Overlay and Difference, where the SRC and DST 
> are the same, without a blend equation, I don’t know how to do it.
> 
> Is there support to this use case?
> 
> Thank you in advance!
> 
> Best regards,
> 
> Nuno

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt 6.7: How to set the blend equation when doing blend on updateGraphicsPipelineState?

2024-05-08 Thread Laszlo Agocs via Interest
Hi,

As you found, QSGMaterialShader::GraphicsPipelineState allows specifying the 
blend factors, and from Qt 6.5 on it also supports specifying separate RGB and 
alpha factors.

However, the blend equation is always ADD. There is no way to change that 
currently.

Best regards,
Laszlo


From: Interest  on behalf of Nuno Santos via 
Interest 
Sent: Monday, May 6, 2024 7:21 PM
To: interestqt-project. org 
Subject: [Interest] Qt 6.7: How to set the blend equation when doing blend on 
updateGraphicsPipelineState?

Hi,

I’m porting an app from Qt 5.15 to Qt 6.7 but I’m stumbling on the fact that 
there is no equivalent to blend equation in OpenGL.

Note: At the time being, I’m still using OpenGL as graphics backend to minimise 
the already huge ongoing port.


To achieve blending mode between nodes, I was using a mix between glBlendFunc 
and glBlendEquation:

case Normal:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_ONE, 
GL_ONE_MINUS_SRC_ALPHA);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_ADD);
break;
case Screen:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
GL_ONE);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_ADD);
break;
case Overlay:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
GL_ONE);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_MAX);
break;
case Difference:
QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_SRC_COLOR, 
GL_ONE);
QOpenGLContext::currentContext()->functions()->glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
break;

But in the newest version of QSGMaterialShader class documentation it says:

"The shader pipeline state changes are less often used. One use case is 
materials that wish to use a specific blend mode. The relevant function is 
updateGraphicsPipelineState(). This function is not called unless the 
QSGMaterialShader has opted in by setting the flag 
UpdatesGraphicsPipelineState. The task of the function is to update the 
GraphicsPipelineState struct instance that is passed to it with the desired 
changes. Currently only blending and culling-related features are available, 
other states cannot be controlled by materials.”

So I’m now trying to use

bool 
QSGMaterialShader::updateGraphicsPipelineState(QSGMaterialShader::RenderState 
, QSGMaterialShader::GraphicsPipelineState *ps, QSGMaterial *newMaterial, 
QSGMaterial *oldMaterial)

case Normal:
ps->srcColor = QSGMaterialShader::GraphicsPipelineState::One;
ps->dstColor = QSGMaterialShader::GraphicsPipelineState::OneMinusSrcAlpha;
break;
case Screen:
ps->srcColor = QSGMaterialShader::GraphicsPipelineState::SrcColor;
ps->dstColor = QSGMaterialShader::GraphicsPipelineState::One;
break;
case Overlay:
ps->srcColor = QSGMaterialShader::GraphicsPipelineState::SrcColor;
ps->dstColor = QSGMaterialShader::GraphicsPipelineState::One;
break;
case Difference:
ps->srcColor = QSGMaterialShader::GraphicsPipelineState::SrcColor;
ps->dstColor = QSGMaterialShader::GraphicsPipelineState::One;
break;


When the blendEquation GL_FUNC_ADD was used, it seems to be working.

But when I get to modes like Overlay and Difference, where the SRC and DST are 
the same, without a blend equation, I don’t know how to do it.

Is there support to this use case?

Thank you in advance!

Best regards,

Nuno
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Is it possible to compile a shader in runtime using qsb?

2024-05-08 Thread Laszlo Agocs via Interest
Hi,

>From Qt 6.6 on you can pull in the Qt Shader Tools module into the project and 
>try using https://doc.qt.io/qt-6/qshaderbaker.html

If this is actually suitable for your use case, cannot say without more 
details, because doing the heavyweight compilation and transpilation at runtime 
is one thing, being able to do something with the resulting QShader object is 
another.

For instance, when working with custom scenegraph materials, a QShader can be 
used instead of .qsb filenames via 
https://doc.qt.io/qt-6/qsgmaterialshader.html#setShader
If however the intention would be to do something similar in a ShaderEffect 
declared in QML, there is no API to achieve that since its vertexShader and 
fragmentShader properties only consume (.qsb) file URLs.

Best regards,
Laszlo


From: Interest  on behalf of Nuno Santos via 
Interest 
Sent: Tuesday, May 7, 2024 11:28 AM
To: interestqt-project. org 
Subject: [Interest] Is it possible to compile a shader in runtime using qsb?

Hi,

I’m wondering if it is possible to run qsb to compile a shader in run time on 
iOS.

I’m using QProcess to call qbs in order to compile in run time but since 
QProcess does not exist on iOS, I wonder how can I achieve the same result?

Thanks!

Regards,

Nuno
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and OpenGL frame buffer object

2024-05-08 Thread Laszlo Agocs via Interest
Hi,

Passing 0 as a renderbuffer object name is not going to work. Try using 
https://doc.qt.io/qt-6/qquickrendertarget.html#fromOpenGLTexture with the 
texture that is used as the color attachment of your OpenGL framebuffer object. 
(actually that FBO is not useful in Qt 6 as one will be created internally as 
needed)

Best regards,
Laszlo


From: Interest  on behalf of Nuno Santos via 
Interest 
Sent: Tuesday, April 16, 2024 4:21 PM
To: interestqt-project. org 
Subject: [Interest] Porting Qt5 OpenGL app to Qt6 - QQuickRenderTarget and 
OpenGL frame buffer object

Hi,

I have an application that was heavily written on top of OpenGL. Right now I 
want to port it to Qt 6 with the minimum effort trying to stick to the OpenGL 
backend until I get the grip on the new things of Qt 6 Graphics API abstraction.

I used to do this in order to assign a target FBO to a QuickWindow:

_quickWindow->setRenderTarget(_fboRender);

This is no longer possible and it requires a QQuickRenderTarget to be created 
and I seem to have three options:

(since 6.2) QQuickRenderTarget  fromOpenGLRenderBuffer(uint renderbufferId, 
const QSize , int sampleCount = 1)
(since 6.4) QQuickRenderTarget  fromOpenGLTexture(uint textureId, uint format, 
const QSize , int sampleCount = 1)
QQuickRenderTarget  fromOpenGLTexture(uint textureId, const QSize 
, int sampleCount = 1)

I’m trying this:

_renderTarget = QQuickRenderTarget::fromOpenGLRenderBuffer(0, 
QSize(_renderResolution.width(), _renderResolution.height()));
_quickWindow->setRenderTarget(_renderTarget);

But nothing appears on the screen and I get a warning:

QQuickWindow: No render target (neither swapchain nor custom target was 
provided)

Can anyone tell me what am I failing here?

Any ideas suggestions are very welcome.

With my best regards,

Nuno
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Issues when requesting access to use the Microphone on macOS

2024-05-08 Thread Tor Arne Vestbø via Interest
Hi,

On macOS we selectively link in the relevant permission plugins based on what 
you’ve declared in your Info.plist.
This magic depend on using the qt_ prefixed function for adding your executable:

https://doc.qt.io/qt-6/qt-add-executable.html

Cheers,
Tor Arne

On 8 May 2024, at 16:44, Sley HORTES  wrote:

Hello All, Hope You are doing fine.

I am all new to Qt and this email is  concerning an issue that I have had 
lately regarding a chat application which requests access to use the Microphone.

I have read the Documentation on how to handle it. I have written exactly what 
they said but I didn’t receive the popup message which request access to the 
microphone. The function where I tried to do so is below, the Info.plist file 
command along with the terminal message that is prompted when trying to use it.

Function:

void client_chat_window::start_recording()
{
QMicrophonePermission microphonePermission;

switch (qApp->checkPermission(microphonePermission))
{
case Qt::PermissionStatus::Undetermined:
qApp->requestPermission(microphonePermission, this, [=]()
{ qDebug() << "Undetermined: Microphone permission granted!"; });

std::cout << std::endl;
break;

case Qt::PermissionStatus::Denied:
qApp->requestPermission(microphonePermission, this, [=]()
{ qDebug() << "Asking permission within the Denied case"; });

qWarning("Denied: Microphone permission is not granted!");
std::cout << std::endl;
break;

case Qt::PermissionStatus::Granted:
QMediaCaptureSession session;

QAudioInput audioInput;
session.setAudioInput();

QMediaRecorder recorder;
session.setRecorder();

recorder.setQuality(QMediaRecorder::HighQuality);
recorder.setOutputLocation(QUrl::fromLocalFile("test.mp3"));
recorder.record();
qDebug() << "Recording started!";

std::cout << std::endl;
break;
}
}


Within the Info.plist, I've written this:
NSMicrophoneUsageDescription
We need access to your microphone to record audio for voice 
chat.


CMakeLists.txt file related to the app:
add_executable(client
client_main.cpp
client_main_window.cpp
client_manager.cpp
client_chat_window.cpp
chat_protocol.cpp
chat_line.cpp
)
target_link_libraries(client PRIVATE database_library)

qt_add_resources(client "images"
PREFIX "/images"
FILES send_icon.png
)

set(MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)

set_target_properties(client PROPERTIES MACOSX_BUNDLE ON)



Terminal Message:
qt.permissions: Could not find permission plugin for QMicrophonePermission. 
Please make sure you have included the required usage description in your 
Info.plist

I really Hope That You will spot where I went wrong and give me an hint on how 
to solve it.
Thanks.




On May 5, 2024, at 5:59 AM, interest-requ...@qt-project.org wrote:

Welcome to the Interest@qt-project.org mailing list!

To post to this list, send your message to:

 interest@qt-project.org

General information about the mailing list is at:

 https://lists.qt-project.org/listinfo/interest

If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

 https://lists.qt-project.org/options/interest/sleyhortes13%40gmail.com


You can also make such adjustments via email by sending a message to:

 interest-requ...@qt-project.org

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe without confirmation.  It is:

 c5x3KgHZbCTv3HJ

Normally, Mailman will remind you of your qt-project.org mailing list
passwords once every month, although you can disable this if you
prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Issues when requesting access to use the Microphone on macOS

2024-05-08 Thread Sley HORTES
Hello All, Hope You are doing fine.

I am all new to Qt and this email is  concerning an issue that I have had 
lately regarding a chat application which requests access to use the 
Microphone. 

I have read the Documentation on how to handle it. I have written exactly what 
they said but I didn’t receive the popup message which request access to the 
microphone. The function where I tried to do so is below, the Info.plist file 
command along with the terminal message that is prompted when trying to use it.

Function:

void client_chat_window::start_recording()
{
QMicrophonePermission microphonePermission;

switch (qApp->checkPermission(microphonePermission))
{
case Qt::PermissionStatus::Undetermined:
qApp->requestPermission(microphonePermission, this, [=]()
{ qDebug() << "Undetermined: Microphone 
permission granted!"; });

std::cout << std::endl;
break;

case Qt::PermissionStatus::Denied:
qApp->requestPermission(microphonePermission, this, [=]()
{ qDebug() << "Asking permission within the 
Denied case"; });

qWarning("Denied: Microphone permission is not granted!");
std::cout << std::endl;
break;

case Qt::PermissionStatus::Granted:
QMediaCaptureSession session;

QAudioInput audioInput;
session.setAudioInput();

QMediaRecorder recorder;
session.setRecorder();

recorder.setQuality(QMediaRecorder::HighQuality);
recorder.setOutputLocation(QUrl::fromLocalFile("test.mp3"));
recorder.record();
qDebug() << "Recording started!";

std::cout << std::endl;
break;
}
}


Within the Info.plist, I've written this:
NSMicrophoneUsageDescription
We need access to your microphone to record audio for voice 
chat.


CMakeLists.txt file related to the app:
add_executable(client
client_main.cpp
client_main_window.cpp
client_manager.cpp
client_chat_window.cpp
chat_protocol.cpp
chat_line.cpp
)
target_link_libraries(client PRIVATE database_library)

qt_add_resources(client "images"
PREFIX "/images"
FILES send_icon.png
)

set(MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)

set_target_properties(client PROPERTIES MACOSX_BUNDLE ON)



Terminal Message:
qt.permissions: Could not find permission plugin for QMicrophonePermission. 
Please make sure you have included the required usage description in your 
Info.plist

I really Hope That You will spot where I went wrong and give me an hint on how 
to solve it. 
Thanks.




> On May 5, 2024, at 5:59 AM, interest-requ...@qt-project.org wrote:
> 
> Welcome to the Interest@qt-project.org mailing list!
> 
> To post to this list, send your message to:
> 
>  interest@qt-project.org
> 
> General information about the mailing list is at:
> 
>  https://lists.qt-project.org/listinfo/interest
> 
> If you ever want to unsubscribe or change your options (eg, switch to
> or from digest mode, change your password, etc.), visit your
> subscription page at:
> 
>  https://lists.qt-project.org/options/interest/sleyhortes13%40gmail.com
> 
> 
> You can also make such adjustments via email by sending a message to:
> 
>  interest-requ...@qt-project.org
> 
> with the word `help' in the subject or body (don't include the
> quotes), and you will get back a message with instructions.
> 
> You must know your password to change your options (including changing
> the password, itself) or to unsubscribe without confirmation.  It is:
> 
>  c5x3KgHZbCTv3HJ
> 
> Normally, Mailman will remind you of your qt-project.org mailing list
> passwords once every month, although you can disable this if you
> prefer.  This reminder will also include instructions on how to
> unsubscribe or change your account options.  There is also a button on
> your options page that will email your current password to you.

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] New survey roll-out on doq.qt.io

2024-05-08 Thread Safiyyah Moosa via Interest
Hi Qties

We have recently launched a survey on doc.qt.io and would love to know what 
improvements you would like to see in our documentation.

Each page under doc.qt.io contains a survey banner at the bottom of the page. 
If you spot any issues or have any ideas on how we can improve the contents of 
that page, click on the banner and share your thoughts.


Kind Regards,

Safiyyah Moosa

Bsc Electronic Engineering

Documentation Engineer

Qt Group
Sandakerveien 116
0484 Oslo
Norway

safiyyah.mo...@qt.io

+47 47794451

www.qt.io

[https://s3.eu-north-1.amazonaws.com/email-signature-tool-leroy/Qt-Group-logo-black.png]
[https://s3.eu-north-1.amazonaws.com/email-signature-tool-leroy/facebook-x2-right_2023-03-01-095511_zhlr.png]
 
[https://s3.eu-north-1.amazonaws.com/email-signature-tool-leroy/twitter-x2.png] 
 
[https://s3.eu-north-1.amazonaws.com/email-signature-tool-leroy/linkedin-x2.png]
 
[https://s3.eu-north-1.amazonaws.com/email-signature-tool-leroy/youtube-x2.png] 

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Bug#1070406: Qt5: badly clips some fonts when rendering to PDFs

2024-05-07 Thread Thorsten Glaser
Dmitry Shachnev dixit:

>Will you be able to forward your patch upstream when you finalize it?

Sort of. I can do the CLA, Gerrit, etc. dance, but I probably cannot
respond well if they want me to test things with vanilla upstream
(instead of the packaging), or if they have requests I as a C (but
not C++) developer don’t understand.

(The other half of fixing things is even more challenging. I got a
confirmation that Mu͒seScore Evolution upstream cannot upgrade their
Qt versions so they’ll need a different fix subclassing and overriding
the library functions for some cases. If anyone sufficiently proficient
in C++ is interested in helping with that, once we got the fix for Qt
itself going, ping me. Alternatively, helping to figure out how to patch
and rebuild the exact versions they use for Win/Mac or upgrade their
versions without losing Win7 and qtwebengine, IIUC — AIUI their Mac OSX
builds are still at Qt 5.9 for that reason…)

>> +static inline int roundForBbox(qreal v)
>> +{
>> +return (v < 0) ? floor(v) : ceil(v);
>> +}
>
>I see you are passing negated values to this function, e.g. roundForBbox(-x).

Not only them. And roundForBbox is basically just the canonical
“round away from zero / towards ±infinity for integer results”.

The negation in the callers is to convert *some* Qt coordinates
to PS/PDF coordinates, but only for the Y axis, as the X axis is
the same for them.

>I see why you moved properties to the top, but is moving postscriptName
>needed? Maybe leave it where it was to minimize the diff?

It’s not. I moved the whole block to make it easier to read,
but good point.

>You are passing scalep pointer here only to multiply it by this value?

Yes.

>It looks like fontEngine is a public member of QFontSubset, so you can
>do it in the calling code.

Yes, except it’s the callee that determines the scaling factor,
not the caller. By passing it back like this, nothing would have
to change in the caller should the callee ever decide to not scale.


Sune Stolborg Vuorela dixit:

>I can't find any references to something that look like a "OS/2" table
>in the pdf spec.

That’s because we’re talking about OTF/TTF-format tables here.

The problem exists at two different layers.

One is that, when embedding and subsetting a font, Qt generates
a PDF font descriptor whose bounding box is wrong.

The other is that, when embedding and subsetting a font, Qt
converts it to quadratic-spline TTF and scales it to 2048 ppem,
then embedding the resulting TTF in the data object corresponding
to the above-mentioned font descriptor (the data object itself,
when extracted, is a fully functional .ttf font file). The OTF/TTF
file format has description tables, and Qt does not correctly adjust
all values in all tables it includes when scaling the font itself.

>Just to help me double check, how is is the OS/2 table described in the
>font in the pdf ?

The references I’ve been using are:

PDF: 
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.0.pdf
TTF: https://learn.microsoft.com/en-us/typography/opentype/spec/

The OS/2 table specifically is documented at:
https://learn.microsoft.com/en-us/typography/opentype/spec/os2

bye,
//mirabilos
-- 
18:47⎜ well channels… you see, I see everything in the
same window anyway  18:48⎜ i know, you have some kind of
telnet with automatic pong 18:48⎜ haha, yes :D
18:49⎜ though that's more tinyirc – sirc is more comfy
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] what are the requirements for QMetaType::metaObjectForType(QMetaType::type("QQuickLayout*")) to work?

2024-05-07 Thread Thiago Macieira
On Tuesday 7 May 2024 00:26:41 GMT-7 NIkolai Marchenko wrote:
> That sounds more unhinged than loading a dummy if metaobject is empty with
> createObject in c++ 

It sounds like discussing two different workarounds for a bug that has been 
fixed. Workarounds are seldom clean.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Is it possible to compile a shader in runtime using qsb?

2024-05-07 Thread Nuno Santos via Interest
Hi,

I’m wondering if it is possible to run qsb to compile a shader in run time on 
iOS.

I’m using QProcess to call qbs in order to compile in run time but since 
QProcess does not exist on iOS, I wonder how can I achieve the same result?

Thanks!

Regards,

Nuno
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] {Qt3D} Problem with the look of QDiffuseSpecularMaterial moving from Qt5 to Qt6

2024-05-07 Thread Mike Krus via Interest
Hi

do you know which backend you are using? RHI (default)? If so, could you try 
the GL backend?
In either case, please create a bug report with, if possible, a small example 
to reproduce the issue.


Mike


> On 4 May 2024, at 23:25, Andy  wrote:
> 
> I've been upgrading an old codebase from Qt5 to Qt6. For Qt3D, I've followed 
> the info from here:
> 
>   https://www.kdab.com/qt-3d-changes-in-qt-6/
> 
> The changes I've had to make so far were all around geometry, but I'm getting 
> different visuals between Qt5 and Qt6.
> 
> Qt 5.15.2:
> Qt 6.7.0:
> 
> 
> (Ignore slight camera position difference.)
> 
> I haven't changed the light or any of the materials.
> 
> I'm using QDiffuseSpecularMaterial for all these meshes, and setting ambient, 
> diffuse, shininess, and specular for all.
> 
> I haven't found anything describing any changes to QDiffuseSpecularMaterial. 
> Am I missing something I need to change? Did QDiffuseSpecularMaterial just 
> change to be darker? If so, how do I get lighter colours back? No matter what 
> I change it's super-dark.
> 
> My offscreen renderer is also broken now, but that seems to be a separate 
> issue.
> 
> (Aside: It would be useful to have C++ examples of the new stuff - 
> QBoundingVolume and QGeometryView for example. The official docs - as with 
> all of Qt3D - are very sparse. More docs & more examples would be of great 
> help.)
> 
> Thank you!
> 
> P.S. My active framegraph looks like this:
> 
> myCustomFrameGraph::Custom (:0, (null))
> Qt3DRender::QRenderSurfaceSelector:: (:0, (null))
> Qt3DRender::QViewport:: (:0, (null))
> Qt3DRender::QClearBuffers::backgroundColour (:0, (null))
> Qt3DRender::QNoDraw:: (:0, (null))
> Qt3DRender::QFrustumCulling:: (:0, (null))
> Qt3DRender::QCameraSelector::onScreenCameraSelector (:0, 
> (null))
> Qt3DRender::QRenderCapture::onScreenCapture (:0, (null))
> Qt3DRender::QLayerFilter::opaqueLayer (:0, (null))
> Qt3DRender::QLayerFilter::transparentLayer (:0, (null))
> Qt3DRender::QCameraSelector::offScreenCameraSelector (:0, 
> (null))
> Qt3DRender::QRenderTargetSelector:: (:0, (null))
> Qt3DRender::QRenderTarget::offScreenTarget (:0, 
> (null))
> Qt3DRender::QRenderTargetOutput:: (:0, (null))
> 
> Qt3DRender::QTexture2DMultisample::offScreenTexture (:0, (null))
> Qt3DRender::QClearBuffers::backgroundColour (:0, 
> (null))
> Qt3DRender::QNoDraw:: (:0, (null))
> Qt3DRender::QRenderCapture::offScreenCapture (:0, 
> (null))
> Qt3DRender::QLayerFilter::opaqueLayer (:0, (null))
> Qt3DRender::QLayerFilter::transparentLayer (:0, 
> (null))
> 
> ---
> Andy Maloney
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer & Teamlead
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] what are the requirements for QMetaType::metaObjectForType(QMetaType::type("QQuickLayout*")) to work?

2024-05-07 Thread NIkolai Marchenko
That sounds more unhinged than loading a dummy if metaobject is empty with
createObject in c++ :)

On Tue, May 7, 2024 at 10:25 AM Ulf Hermann  wrote:

> > I am not seeing it in 5.15.2, was it added later?
>
> Oh, sorry, I was mistaken.
> https://codereview.qt-project.org/c/qt/qtdeclarative/+/304078 did indeed
> not make it into Qt5. Otherwise you could actually use the syntax with
> versions also in qmldir.
>
> So in Qt5 the versions have to match. Maybe you need to introduce a
> version 1.15 of your module for this specific purpose.
>
> best regards,
> Ulf
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] what are the requirements for QMetaType::metaObjectForType(QMetaType::type("QQuickLayout*")) to work?

2024-05-07 Thread Ulf Hermann via Interest

I am not seeing it in 5.15.2, was it added later?


Oh, sorry, I was mistaken. 
https://codereview.qt-project.org/c/qt/qtdeclarative/+/304078 did indeed 
not make it into Qt5. Otherwise you could actually use the syntax with 
versions also in qmldir.


So in Qt5 the versions have to match. Maybe you need to introduce a 
version 1.15 of your module for this specific purpose.


best regards,
Ulf
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] what are the requirements for QMetaType::metaObjectForType(QMetaType::type("QQuickLayout*")) to work?

2024-05-07 Thread NIkolai Marchenko
I am not seeing it in 5.15.2, was it added later?

On Tue, May 7, 2024 at 9:54 AM Ulf Hermann  wrote:

> > Not possible as in this case it assumes the same version as the module
> > that qmldirs belongs to
>
> Looks like qmlRegisterModuleImport() is also available (and
> undocumented) in Qt 5.15 and it does allow you to specify versions:
> https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterModuleImport
>
> best regards,
> ULf
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Bug#1070406: Qt5: badly clips some fonts when rendering to PDFs

2024-05-07 Thread Thorsten Glaser
Dixi quod…
>Dmitry Shachnev dixit:
>>Now that you dug so deeply, maybe you can try to replace qRound in those
>>three lines that you mentioned with TO_TTF, and check if it fixes the bug
>
>That *and* figure out somehow how to fix the PDF /FontBBox, at
>least… (though I binary-patched the hhea ascender in the PDF and
>it made Atril happy, so it “should”, despite the still-wrong OS/2
>table values some of which are notably used in clipping by some
>softwares…)

Yes, that worked. I’m attaching the final patch in entirety again
for your convenience.

>I’m trying this (attached). That does both (by letting toTruetype()
>adjust the already-existing scaling factor in the caller) and
>applies suitable rounding (normal for normal values, away from zero
>for the bounding box so it’s guaranteed to encompass all possible
>values). I’ll build it now so I don’t know if it even compiles yet…

It still does not address the OS/2 table, but it does manage to
fix both the PDF-side and font-side hhea table metrics, which is
enough for Atril at least. (Not sure whether it’s enough for my
gf’s printer, I’ll have to test. Or extend the patch to fix the
OS/2 table as well, which I probably should anyway; I have to find
the time for that sometime within the next few days.)

bye,
//mirabilos
-- 
> Hi, does anyone sell openbsd stickers by themselves and not packaged
> with other products?
No, the only way I've seen them sold is for $40 with a free OpenBSD CD.
-- Haroon Khalid and Steve Shockley in gmane.os.openbsd.miscDescription: scale /FontBBox and hhea table when scaling fonts
 for embedding (the OS/2 table needs handling XXX TODO)
Author: mirabilos 
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070406

--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1870,11 +1870,20 @@ void QPdfEnginePrivate::writeAttachmentR
 "endobj\n");
 }
 
+static inline int roundForBbox(qreal v)
+{
+return (v < 0) ? floor(v) : ceil(v);
+}
+
 void QPdfEnginePrivate::embedFont(QFontSubset *font)
 {
+QFontEngine::Properties properties = font->fontEngine->properties();
+QByteArray postscriptName = properties.postscriptName.replace(' ', '_');
+qreal scale = 1000/properties.emSquare.toReal();
+
 //qDebug() << "embedFont" << font->object_id;
 int fontObject = font->object_id;
-QByteArray fontData = font->toTruetype();
+QByteArray fontData = font->toTruetype();
 #ifdef FONT_DUMP
 static int i = 0;
 QString fileName("font%1.ttf");
@@ -1891,11 +1900,7 @@ void QPdfEnginePrivate::embedFont(QFontS
 int toUnicode = requestObject();
 int cidset = requestObject();
 
-QFontEngine::Properties properties = font->fontEngine->properties();
-QByteArray postscriptName = properties.postscriptName.replace(' ', '_');
-
 {
-qreal scale = 1000/properties.emSquare.toReal();
 addXrefEntry(fontDescriptor);
 QByteArray descriptor;
 QPdf::ByteStream s();
@@ -1909,15 +1914,15 @@ void QPdfEnginePrivate::embedFont(QFontS
 s <<  '+' << postscriptName << "\n"
 "/Flags " << 4 << "\n"
 "/FontBBox ["
-  << properties.boundingBox.x()*scale
-  << -(properties.boundingBox.y() + 
properties.boundingBox.height())*scale
-  << (properties.boundingBox.x() + 
properties.boundingBox.width())*scale
-  << -properties.boundingBox.y()*scale  << "]\n"
+  << roundForBbox(properties.boundingBox.x()*scale)
+  << roundForBbox(-(properties.boundingBox.y() + 
properties.boundingBox.height())*scale)
+  << roundForBbox((properties.boundingBox.x() + 
properties.boundingBox.width())*scale)
+  << roundForBbox(-properties.boundingBox.y()*scale)  << "]\n"
 "/ItalicAngle " << properties.italicAngle.toReal() << "\n"
-"/Ascent " << properties.ascent.toReal()*scale << "\n"
-"/Descent " << -properties.descent.toReal()*scale << "\n"
-"/CapHeight " << properties.capHeight.toReal()*scale << "\n"
-"/StemV " << properties.lineWidth.toReal()*scale << "\n"
+"/Ascent " << qRound(properties.ascent.toReal()*scale) << "\n"
+"/Descent " << qRound(-properties.descent.toReal()*scale) << "\n"
+"/CapHeight " << qRound(properties.capHeight.toReal()*scale) << 
"\n"
+"/StemV " << qRound(properties.lineWidth.toReal()*scale) << "\n"
 "/FontFile2 " << fontstream << "0 R\n"
 "/CIDSet " << cidset << "0 R\n"
 ">>\nendobj\n";
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -1162,13 +1162,14 @@ static QByteArray bindFont(const QVector
   if really required.
 */
 
-QByteArray QFontSubset::toTruetype() const
+QByteArray QFontSubset::toTruetype(qreal *scalep) const
 {
 qttf_font_tables font;
 memset(, 0, sizeof(qttf_font_tables));
 
 qreal ppem = fontEngine->fontDef.pixelSize;
 #define TO_TTF(x) qRound(x * 2048. / ppem)
+*scalep *= 

Re: [Interest] what are the requirements for QMetaType::metaObjectForType(QMetaType::type("QQuickLayout*")) to work?

2024-05-07 Thread Ulf Hermann via Interest
Not possible as in this case it assumes the same version as the module 
that qmldirs belongs to


Looks like qmlRegisterModuleImport() is also available (and 
undocumented) in Qt 5.15 and it does allow you to specify versions: 
https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterModuleImport


best regards,
ULf
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] what are the requirements for QMetaType::metaObjectForType(QMetaType::type("QQuickLayout*")) to work?

2024-05-07 Thread NIkolai Marchenko
Not possible as in this case it assumes the same version as the module that
qmldirs belongs to

On Tue, May 7, 2024 at 9:40 AM Ulf Hermann  wrote:

> > I don't think it works, adding `import QtQuick.Layouts 1.15` to qmldir
> > of that module produces an error  "import requires 2 arguments, but 2
> > were provided"
>
> In Qt5 you couldn't specify the version, yet. Try with only:
>
> import QtQuick.Layouts
>
> best regards,
> Ulf
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


  1   2   3   4   5   6   7   8   9   10   >