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 descri

[Interest] QML: weird popup positioning in ComboBox

2024-06-08 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