Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!


OverviewFelgo 2 Support (Qt 5) › How to make App orientation to always to be portrait?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #17972



    I red that the App portrait properties is read only = bool.

    So, How to make App orientation to always to be portrait?


    Kind Regards


    Felgo Team

    Hi Niyazi,

    you can configure the portrait / landscape setting for iOS / Android with different configurations in the android/AndroidManifest.xml or ios/Project-Info.plist. This is similar to developing native applications without Felgo. For an example how these files look like when configured appropriately, you can create a new Felgo Project with the Qt Creator project wizard and choose the orientation setting in the wizard dialog.

    When the project is created, the wizard then automatically configures the manifest and plist configuration for your chosen setting.




    Thanks Günther.

    I did what you describe. But is not working. I create a 3 times new project and set orientation to portrait in the wizard. But everytime I hold my phone landscape mode, my app also changes to landscape. Here is the newly created project qml->config.json, android->AndroidManifest.xml and the ios->Project-Info.plist. When I hold my phone landscape mode I need my app to stay as potrait.




        "title": "CAPITAL",
        "identifier": "com.CAPITAL",
        "orientation": "portrait",
        "versioncode": 1,
        "versionname": "1.0",
        "stage": "test"




     <div><?xml version='1.0' encoding='utf-8'?>
     <manifest package="com.CAPITAL" xmlns:android="" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
     <application android:hardwareAccelerated="true" android:name="net.vplay.helper.VPlayApplication" android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
     <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
     <action android:name="android.intent.action.MAIN"/>
     <category android:name="android.intent.category.LAUNCHER"/>
     <meta-data android:name="" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
     <meta-data android:name="" android:resource="@array/qt_sources"/>
     <meta-data android:name="" android:value="default"/>
     <meta-data android:name="" android:resource="@array/qt_libs"/>
     <meta-data android:name="" android:resource="@array/bundled_libs"/>
     <!-- Deploy Qt libs as part of package -->
     <meta-data android:name="" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
     <meta-data android:name="" android:resource="@array/bundled_in_lib"/>
     <meta-data android:name="" android:resource="@array/bundled_in_assets"/>
     <!-- Run with local libs -->
     <meta-data android:name="" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
     <meta-data android:name="" android:value="/data/local/tmp/qt/"/>
     <meta-data android:name="" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
     <meta-data android:name="" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
     <meta-data android:name="" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
     <!--  Messages maps -->
     <meta-data android:value="@string/ministro_not_found_msg" android:name=""/>
     <meta-data android:value="@string/ministro_needed_msg" android:name=""/>
     <meta-data android:value="@string/fatal_error_msg" android:name=""/>
     <!--  Messages maps --></div>
     <div>            <!-- Splash screen -->
     <meta-data android:name="" android:resource="@drawable/logo"/>
     <!-- Splash screen --></div>
     <div>            <!-- Background running -->
     <!-- Warning: changing this value to true may cause unexpected crashes if the
     application still try to draw after
     signal is sent! -->
     <meta-data android:name="" android:value="false"/>
     <!-- Background running --></div>
     <div>            <!-- auto screen scale factor -->
     <meta-data android:name="" android:value="false"/>
     <!-- auto screen scale factor -->
     <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
     <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/></div>
     <div>    <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
     Remove the comment if you do not require these default permissions. -->
     <!-- %%INSERT_PERMISSIONS --></div>
     <div>    <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
     Remove the comment if you do not require these default features. -->
     <!-- %%INSERT_FEATURES --></div>




    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
    <plist version="1.0">
        <string>App would like to access the library.</string>
        <string>App would like to access the camera.</string>





    Felgo Team


    the code looks correct, and I also tried different settings (auto, landscape, portrait) with the wizard, which works fine.

    To avoid potential issues from a previous builds or app version, please:

    • Remove the shadow build directory from your file system (build-<project>-android…)
    • Right-click your project in Qt Creator and choose “Clean”, followed by right-click “Run qmake”
    • Uninstall current version of your app from your device
    • Rebuild and run the application

    Do you still have issues with portrait-only then?
    If yes, which devices are experiencing this issue on, and does it happen for both iOS and Android?




    Hi Günther,

    What do you mean by shadow build directory? I clean the way that you describe in your post. I clean previous app from my mobile.

    Unfortunately, orientation portrait is not working on Samsung Galaxy S7 Edge (Android 6.0 Marshmallow and the Android 7.0 Nougat)

    But likely I test my app with my friends iPhone 5 (iOS 10.3.3) and the orientation.portrait is working.

    I have no idea why is not working in my mobile.

    Kind Regards





    By the way I uninstall the Felgo from my macOS High Sierra (10.13.2). I clean everything related to Felgo. And I download and clean install Felgo. Still the same issue.


    Felgo Team

    Hi Niyazi,

    when you build your project with Qt Creator, a new folder is created besides your project folder (the shadow build directory). It is usually named something like “build-<project>-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_3_Android_armv7_V_Play-Debug”. To speed up the building process, relevant build files are re-used at later builds and kept in the shadow build folder. This can cause issues sometimes, which is why I recommended to delete this folder before creating a new build.

    One additional question:
    Are you building and testing your own Android app with the Android Build Kit or are you using the Felgo Live App for testing?
    The Felgo Live App always has to support both interface orientations, as it is a finished application with pre-configured AndroidManifest.xml. Your own manifest configuration can only be used with a custom app build using the Android Build Kit.





    Thanks Günther,

    Yes, I clean the “build-<project>-Android … folder as well.

    I am using Felgo Live App and my Qt Kids points the “Android for armeabi-v7a(GCC 4.9, Qt 5.9.3 Android armv7 Felgo” when I run the Qt LIVE green button.


    Felgo Team


    Hi, I see – thanks for clarification!

    As posted above, the Felgo Live App, which let’s you quickly preview your app on the device, always supports both portrait and landscape (regardless of the AndroidManifest configuration). To test your own portrait-only setting, you can build and deploy your own application package (.apk) for Android.

    To do this, you can close Felgo Live for your project, and build/run the “Android for armeabi-v7a(GCC 4.9, Qt 5.9.3 Android armv7 Felgo” with the regular play button (no Felgo Live involved). It is required to connect your Android phone to your computer with a cable, so your built application can be transferred and installed. Please also make sure to enable USB Debugging mode on your device, as otherwise you can’t install and debug apps (for security reasons).




    Thanks Günther,
    I built the app and send the apk file via bluetooth to my mobile. I installed (allowing the usb debugging) the apk file. Now is working. I rotate my mobile app in my palm and the application always stay on portrait mode.

    Kind Regards

Viewing 10 posts - 1 through 10 (of 10 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded