How can I disable use of default 'LaunchScreen.storyboard' (Qt 5.15 for iOS)? - iphone

I use my custom launch screen (storyboard-file) and need to disable default one, generated by qmake, to be bundled either. How can I do that?
Looking under the hood there is a code in 'mkspecs/features/uikit/default_post.prf' that does the job. How to inactivate that code (without changing the Qt's sources)?

If you want to use your own Launch.storyboard file you have to add something like this in your .pro file:
ios {
QMAKE_INFO_PLIST = ios/Info.plist
ios_icon.files = $$files($$PWD/ios/*.png)
QMAKE_BUNDLE_DATA *= ios_icon
app_launch_images.files = $$files($$PWD/ios/splash_image.png)
QMAKE_BUNDLE_DATA *= app_launch_images
app_launch_screen.files = $$files($$PWD/ios/Launch.storyboard)
QMAKE_BUNDLE_DATA *= app_launch_screen
}
With that options Qt should use your custom file instead of the default one.

Related

Xamarin.Essentials DeviceDisplay class in .NET6 MAUI

Xamarin.Essentials' class DeviceDisplay.KeepScreenOn does not have an equivalent in .NET6 MAUI as yet.
Is this intentional? or should I be using something else to stop the screen timing out?
DeviceDisplay class is now in namespace Microsoft.Maui.Devices.
This namespace is automatically referenced in new Maui projects, so you may refer to simply as DeviceDisplay, without needing any using ..; statement.
Typical usage is described in Device Display Information:
... DeviceDisplay.Current.MainDisplayInfo.Width // get Width in pixels.
// To keep screen on:
DeviceDisplay.Current.KeepScreenOn = true;
When accessing multiple properties, it is convenient to copy to a local variable:
IDeviceDisplay devinfo = DeviceDisplay.Current;
// OR if just want MainDisplayInfo:
DisplayInfo display = DeviceDisplay.Current.MainDisplayInfo;

what is proper way to change properties/generated code of custom HID in STM32CubeIDE

I`m trying to create custom HID device with STM32F103C8, IDE that i choose is STM32CubeIDE and the tutorial that i was following is at ST youtube official channel.
ST offers great tool "Device configuration tool" where i can configure microcontroler, and a lot of code based on my configuration will be generated. That generated code has "user code parts" where user creates his logic, and if he needs to reconfigure microcontroller "Device configuration tool" will not remove that parts of code.
Problem:
To configure custom usb HID i need to change code generated by "Device configuration tool" in places where is no place for user code and that changes will be removed if i run "Device configuration tool" again.
Fields that i only can set in "Device configuration tool" are this:
But that is not enough i also need to change CUSTOM_HID_EPIN_SIZE and CUSTOM_HID_EPOUT_SIZE defines which represent amount of bytes device and host send to each other at once, and also if i change the size of "data pack" i will need to change the default generated callback function that receives that data and works with it, for example the tool generates code like this:
{
USBD_CUSTOM_HID_HandleTypeDef *hhid = (USBD_CUSTOM_HID_HandleTypeDef *)pdev->pClassData;
if (hhid->IsReportAvailable == 1U)
{
((USBD_CUSTOM_HID_ItfTypeDef *)pdev->pUserData)->OutEvent(hhid->Report_buf[0],
hhid->Report_buf[1]);
hhid->IsReportAvailable = 0U;
}
return USBD_OK;
}
but i need the pointer to "Report_buf" not the copy of its first 2 elements, and the default generated code pass only copy of 2 first bytes, and i cant change this in "Device configuration tool".
My current solution:
Actually i solved this issue, but i don`t think i solved it the right way and it works. I have changed the template files which are here "STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_5.6.0.202002181639\db\templates"
And also changed files at "STM32CubeIDE_1.3.0\en.stm32cubef1.zip_expanded\STM32Cube_FW_F1_V1.8.0\Middlewares\ST\STM32_USB_Device_Library\Class\HID"
I don`t think this is the right way to do it, does any one know the right way to do this thing ?
I also found same question on ST forum here but it was not resolved.
what you want to achieve is exactly what is explained by st trainer on this link.
https://www.youtube.com/watch?v=3JGRt3BFYrM
Trainer is step by step explaining how to change the code to use the pointer to buffer
if (hhid->IsReportAvailable == 1U)
{
((USBD_CUSTOM_HID_ItfTypeDef *)pdev->pUserData)->OutEvent(hhid->Report_buf);
hhid->IsReportAvailable = 0U;
}

Change from one Unity app (.exe) to another Unity app (.exe)

Is there a way to change from one Unity app to another? I am not talking about scene changing but the whole application itself. Like:
(a) Changing from Game_1.exe to Game_2.exe
(b) Changing from Game_1.apk to Game_2.apk
You can launch a new process (e.g .exe) by using the process.Start()method, as explained in the docs here
Example from the above docs:
using (Process myProcess = new Process())
{
myProcess.StartInfo.UseShellExecute = false;
// You can start any process, HelloWorld is a do-nothing example.
myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}

Value for SWIFT_VERSION cannot be empty

I have installed swift pods for the obj c project. I got this error when I was trying to build it.
I have gone through all the solutions like deleting derived data, cleaning the build folder. Swift Compiler_Language also missing in the XCode 10.
Added user-defined setting too, even it didn't work.
Select your app target then goto build setting, search for swift set the swift language version from the dropdown.
In case there is anybody else reading through this thread who has this same problem but was unable to solve it using the above answers, this may help:
If you have a data model, you need to check that when you click on the data model, click on an entity, and bring up the file inspector, the "Code Generation" Language is properly set. In my case my whole app was written Objective-C, but was set here to Swift for some reason. This is another reason that Error will show up in the Issue Navigator.
It's very important to clear the build folder after changing Code Generation Language. This can be done by pressing Command-Shift-K or by clicking Product->Clean Build Folder in the menu at the top of the screen.
Check out this link for a picture of where to find the "Code Generation" option I'm talking about.
Model.xcdatamodeld->File Inspector->Code Generation
Update for Xcode 10.2
Go to --> Build Setting
Select All + Combined or All + Levels underneath the Build Settings
And Finally on the search bar, on the right hand side search for "Swift Language Version"
You need to search for every "PRODUCT_NAME ="
There needs to be a " SWIFT_VERSION = "4.2"; " after everyone.
eg. also PRODUCT_NAME = "$(TARGET_NAME)";enter code here
If you are using Ionic with Cordova and you got here because of this error do this:
In your config.xml add
<platform name="ios">
<preference name="UseSwiftLanguageVersion" value="5" />
You may need to remove the resource for ios and re-add it to make it work.
cordova platform remove ios
cordova platform add ios
Cheers!
For a Cordova app add the following line in config.xml
<preference name="SwiftVersion" value="5.3"/>
Still, after all of that, if you're still at lost, you can add a SWIFT_VERSION directly the project file:
80B11AAAAAAAAAAAAAAAC3E5D8 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DF5...040;
buildSettings = {
...
PRODUCT_MODULE_NAME = react-native-some-module;
...
SWIFT_VERSION = "4.2";
};
name = Debug;
};
Repeat for both the Debug and Release targets. That had me hop over this issue.
I use circle ci to run tests and generate app previews on testFlight
I was having this issue and was able to fix this issue by setting the SWIFT_VERSION under ios/{your_project_name}.xcodeproj/project.pcxproj.
Search for SWIFT_VERSION under this file and COPY IT
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8F6A6E403A1DCB019B5AB844 /* Pods-heartland_charter_s_34954.debug.xcconfig */;
buildSettings = {
...
PRODUCT_NAME = heartland_charter_s_34954;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; // Copy this line
...
};
name = Debug;
};
Search for PRODUCT_NAME and paste the SWIFT_VERSION just under each PRODUCT_NAME block, provided that it is not already there
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = CF85766339BED655A366B986 /* Pods-heartland_charter_s_34954.release.xcconfig */;
buildSettings = {
...
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; // Add it here
...
};
name = Release;
};
pod install and re run the app

Unity 4.6 assets not getting applied in Windows 8.1 export

I am building a game in which I need to change its theme at runtime according to player's choice. Here is a chunk of code to change background image:
string path;
string themeName;
themeName = PlayerPrefs.GetString("Theme_Name");
//Change Background Image
path = "Assets/Textures/" + themeName + "/Background.jpg";
Background_Image.GetComponent<Image>().sprite = Resources.LoadAssetAtPath<Sprite>(path);
This works perfectly in Unity however no image gets applied to the background when I export the game for Windows 8.1. The variable 'path' evaluates to "Assets/Textures/Default/Background.jpg" which is the right path and works for Unity project but not Windows.
Do I need to separately export my images folder or use a different path after exporting game or something? Might be a very stupid thing but I am kinda lost here
Use Resources.Load instead. Resources.LoadAssetAtPath works only in the Editor.
Create a folder called "Resources" under the "Assets" folder. Move all your images to this folder.
Then change your code to the below
path = themeName + "/Background.jpg";
Background_Image.GetComponent<Image>().sprite = Resources.Load<Sprite>(path);
The above code assumes that you have a subfolder named with your themes inside the Resources folder.
For example, if one of your themes is called "Theme1", then the background Image should be stored in {Your_Project_Folder}/Assets/Resources/Theme1/Background.jpg