[Interest] Regarding auto resizing of the QtQuick window for embedded device

Filip Piechocki fpiechocki at gmail.com
Thu Nov 6 14:08:22 CET 2014


With eglfs you're application would always be resized to fullscreen. So
your window DOES NOT have 2000x800 - it has 1920x1080. You can check your
current fb mode (on Ubuntu on wandboard it is
in: /sys/devices/platform/mxc_sdc_fb.0/graphics/fb0/modes) and available
modes (wandboard: /sys/devices/platform/mxc_sdc_fb.0/graphics/fb0/modes).
And with eglfs your window would always be covering whole framebuffer. So
if you want your content be in a different size, the you have create some
root element, like black rectangle, which is going to fill the screen and
then the jest of your app is positioned in this rectangle. So if you have
such application:

Window {
  width: 320
  height: 200
  Image {
    anchors.fill: parent
    source: "some/source"
  }
}

And you want it to still be 320x200 on your hd monitor with eglfs, then you
can do:

Window {
  Rectangle {
    width: 320
    height: 200
    color: "black"
    Image {
      anchors.fill: parent
      source: "some/source"
    }
  }
}

So this rectangle becomes the background filling the rest of the screen.
But I am really wondering how you are going to display somethig 2000 pixels
wide on the monitor which is only 1920 pixels wide.

BR,
Filip

On Thu, Nov 6, 2014 at 9:55 AM, Jha Sonakumar <Sona.Jha at techmahindra.com>
wrote:

>   Hi,
>
>
>  Let me explain my problem clearly. 2000x800 has come from the below
> existing code in my application main.qml.
>
>
>  Window {
>     id: root
>     visible: true
>     width: 2000
>     height: 800
>
>
>         SplitView {
>             anchors.fill: parent
>             orientation: Qt.Horizontal
>
>             Item {
>                 id: driveInfo
>                 width: 1000
>                 height: 800
>
>
>                 Layout.minimumWidth: 640
>                 Layout.fillWidth: true
>                 Layout.minimumHeight: 480
>                 Layout.fillHeight: true
>
>               .......
>                ....
>             }
>
>
>             Item {
>                 id: ivi
>
>                 width: 1000
>                 height: 800
>
>                 Layout.fillWidth: true
>
>                 Layout.fillHeight: true
>                .......
>                .......
>                 }
>        }
> }
>
>
>  I would like to see 2000*480 to fit both displays by modifying the top
> width and height. However, it scales to full screen. am testing on HD
> monitor display having resolution 1920X1080.
>
>
>  Inorder to achieve 1000*480 on each of split view displays, Do I need to
> set any environment variable on embedded linux with eglfs as QPA plugin?
>
>
>  I tried to set using environment variables mentioned in
> http://qt-project.org/doc/qt-5/embedded-linux.html with no success.
>
>
>  Please let me know if there is any solution for the same in this regard.
>
>
>  Thanks and Regards,
>
> Sona
>
>
>  ------------------------------
> *From:* Filip Piechocki <fpiechocki at gmail.com>
> *Sent:* Wednesday, November 5, 2014 6:11 PM
>
> *To:* Jha Sonakumar
> *Cc:* interest at qt-project.org Interest
> *Subject:* Re: [Interest] Regarding auto resizing of the QtQuick window
> for embedded device
>
>  I give up :) If you've found that you can set some environment variables
> and they are described on this page - what more can I tell? Just read this
> page. And I don't know what width and height you've set. And I don't know
> where those 2000x800 come from. To be honest - now I am not sure what the
> problem is. How can I help you then?
>
> On Wed, Nov 5, 2014 at 1:35 PM, Jha Sonakumar <Sona.Jha at techmahindra.com>
> wrote:
>
>>  We already set the width and height.
>>  ------------------------------
>> *From:* Filip Piechocki <fpiechocki at gmail.com>
>> *Sent:* Wednesday, November 5, 2014 6:00 PM
>>
>> *To:* Jha Sonakumar
>> *Cc:* interest at qt-project.org Interest
>> *Subject:* Re: [Interest] Regarding auto resizing of the QtQuick window
>> for embedded device
>>
>>   How you know that currently it uses 2000x800?
>>
>> On Wed, Nov 5, 2014 at 12:09 PM, Jha Sonakumar <Sona.Jha at techmahindra.com
>> > wrote:
>>
>>>  Hi Filip
>>>
>>> My display is HD Monitor is 1920X1080,we'd like to connect twin lcd
>>> displays each of 1280X480. I would like ensure,whether my application
>>> window will fit to the display or not.
>>>
>>> Currently my application uses widthxheight :(2000x800)
>>>
>>> Is there environment-variable to be set ?
>>>
>>>
>>>  BR
>>>
>>> SonaKumar
>>>
>>>
>>>  ------------------------------
>>> *From:* Filip Piechocki <fpiechocki at gmail.com>
>>> *Sent:* Wednesday, November 5, 2014 4:28 PM
>>>
>>> *To:* Jha Sonakumar
>>> *Cc:* interest at qt-project.org Interest
>>> *Subject:* Re: [Interest] Regarding auto resizing of the QtQuick window
>>> for embedded device
>>>
>>>   Like I said - your Window will always be covering whole screen.
>>> That's how the 'eglfs' plugin works. Why do you want it to cover only a
>>> part of screen?
>>>
>>> On Wed, Nov 5, 2014 at 11:47 AM, Jha Sonakumar <
>>> Sona.Jha at techmahindra.com> wrote:
>>>
>>>>  Hi Filip
>>>>
>>>> i tried with the following code:
>>>>
>>>> Window {
>>>>     visible: true
>>>>     width: 1200
>>>>     height: 480
>>>>
>>>>     Rectangle{
>>>>         id:rect
>>>>         color:"black"
>>>>         anchors.fill: parent
>>>>
>>>>         Item {
>>>>             anchors.centerIn: parent
>>>>             width: 800
>>>>             height: 480
>>>>             focus:true
>>>>
>>>>             Audio {
>>>>                 id: player
>>>>                 source:"qrc:/Neela Yevaru.mp3"
>>>>                 autoPlay: true
>>>>                 muted: false
>>>>             }
>>>>
>>>>             Keys.onSpacePressed: playPauseMedia()
>>>>
>>>>             function playPauseMedia(){
>>>>                 switch(player.playbackState) {
>>>>                 case Audio.PlayingState:
>>>>                     player.pause()
>>>>                     console.log("Paused media")
>>>>                     break
>>>>                 case Audio.PausedState:
>>>>                     player.play()
>>>>                     console.log("Playing media")
>>>>                     break
>>>>                 default:
>>>>                     break
>>>>                 }
>>>>
>>>>             }
>>>>         }
>>>>     }
>>>> }
>>>>
>>>>
>>>>  still result is same
>>>>
>>>>
>>>>  BR
>>>>
>>>> Sona
>>>>  ------------------------------
>>>> *From:* Filip Piechocki <fpiechocki at gmail.com>
>>>> *Sent:* Wednesday, November 5, 2014 3:36 PM
>>>> *To:* Jha Sonakumar
>>>> *Cc:* interest at qt-project.org Interest
>>>>
>>>> *Subject:* Re: [Interest] Regarding auto resizing of the QtQuick
>>>> window for embedded device
>>>>
>>>>   That's what I thought as with linuxfb you won't be able to use
>>>> QtQuick 2.x as it requires OpenGL.
>>>> So with 'eglfs' your application is displayed on the whole frame buffer
>>>> and so it covers whole screen. So anything you type as width and height of
>>>> the root element has no meaning as it will be resized to whole screen. I
>>>> you want it smaller then you might wrap your main element with Rectangle.
>>>> Something like this:
>>>>
>>>>  Window {
>>>>   Rectangle {
>>>>     anchors.fill: parent
>>>>     color: "black"
>>>>
>>>>      Item { // this item is representig the main item of your
>>>> application
>>>>       anchors.centerIn: parent
>>>>       width: 2560
>>>>       height: 480
>>>>     }
>>>>   }
>>>> }
>>>>
>>>>  You application will stiil be full screen, but the content will be
>>>> resized inside this black rectangle.
>>>>
>>>> On Wed, Nov 5, 2014 at 10:52 AM, Jha Sonakumar <
>>>> Sona.Jha at techmahindra.com> wrote:
>>>>
>>>>>  Hi Filip,
>>>>>
>>>>>
>>>>>  you are right, i am using eglfs Yocto
>>>>>
>>>>>
>>>>>  BR
>>>>>
>>>>> SonaKumar
>>>>>  ------------------------------
>>>>> *From:* interest-bounces+sona.jha=techmahindra.com at qt-project.org
>>>>> <interest-bounces+sona.jha=techmahindra.com at qt-project.org> on behalf
>>>>> of Filip Piechocki <fpiechocki at gmail.com>
>>>>> *Sent:* Wednesday, November 5, 2014 3:18 PM
>>>>> *To:* Jha Sonakumar; interest at qt-project.org Interest
>>>>>
>>>>> *Subject:* Re: [Interest] Regarding auto resizing of the QtQuick
>>>>> window for embedded device
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Nov 5, 2014 at 10:32 AM, Jha Sonakumar <
>>>>> Sona.Jha at techmahindra.com> wrote:
>>>>>
>>>>>>  sory.. what do u mean by QPA?
>>>>>>
>>>>> Platform Abstraction plugin. Are you using X11? If yes then you are
>>>>> probably using 'xcb' QPA plugin, but I guess you are not using X11, a then
>>>>> 'eglfs' plugin is what you use, right?
>>>>>
>>>>>
>>>>>>   ------------------------------
>>>>>> *From:* interest-bounces+sona.jha=techmahindra.com at qt-project.org
>>>>>> <interest-bounces+sona.jha=techmahindra.com at qt-project.org> on
>>>>>> behalf of Filip Piechocki <fpiechocki at gmail.com>
>>>>>> *Sent:* Wednesday, November 5, 2014 2:56 PM
>>>>>> *To:* Jha Sonakumar
>>>>>> *Cc:* interest at qt-project.org
>>>>>> *Subject:* Re: [Interest] Regarding auto resizing of the QtQuick
>>>>>> window for embedded device
>>>>>>
>>>>>>    Hi,
>>>>>> What QPA plugin are you using?
>>>>>>
>>>>>>  BR,
>>>>>> Filip
>>>>>>
>>>>>> On Wed, Nov 5, 2014 at 10:17 AM, Jha Sonakumar <
>>>>>> Sona.Jha at techmahindra.com> wrote:
>>>>>>
>>>>>>>  Hi All,
>>>>>>>
>>>>>>>
>>>>>>>  I have developed an application using QtQuick 2.0 for IMX 6 board.
>>>>>>> The view window has been automatically resized to cover whole display
>>>>>>> irrespective of specified width height.
>>>>>>>
>>>>>>>
>>>>>>>  Display size  :(2560X800)
>>>>>>>
>>>>>>>
>>>>>>>  But i need to show the QtQuick window of size (2560X480).
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  Would you please guide me to resolve the issue.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  Best Regards
>>>>>>>
>>>>>>> SonaKumar
>>>>>>>
>>>>>>> ------------------------------
>>>>>>>
>>>>>>> ============================================================================================================================
>>>>>>> Disclaimer: This message and the information contained herein is
>>>>>>> proprietary and confidential and subject to the Tech Mahindra policy
>>>>>>> statement, you may review the policy at
>>>>>>> http://www.techmahindra.com/Disclaimer.html externally
>>>>>>> http://tim.techmahindra.com/tim/disclaimer.html internally within
>>>>>>> TechMahindra.
>>>>>>>
>>>>>>> ============================================================================================================================
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Interest mailing list
>>>>>>> Interest at qt-project.org
>>>>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>>>>>
>>>>>>>
>>>>>>      ------------------------------
>>>>>>
>>>>>> ============================================================================================================================
>>>>>> Disclaimer: This message and the information contained herein is
>>>>>> proprietary and confidential and subject to the Tech Mahindra policy
>>>>>> statement, you may review the policy at
>>>>>> http://www.techmahindra.com/Disclaimer.html externally
>>>>>> http://tim.techmahindra.com/tim/disclaimer.html internally within
>>>>>> TechMahindra.
>>>>>>
>>>>>> ============================================================================================================================
>>>>>>
>>>>>>
>>>>>       ------------------------------
>>>>>
>>>>> ============================================================================================================================
>>>>> Disclaimer: This message and the information contained herein is
>>>>> proprietary and confidential and subject to the Tech Mahindra policy
>>>>> statement, you may review the policy at
>>>>> http://www.techmahindra.com/Disclaimer.html externally
>>>>> http://tim.techmahindra.com/tim/disclaimer.html internally within
>>>>> TechMahindra.
>>>>>
>>>>> ============================================================================================================================
>>>>>
>>>>>
>>>>      ------------------------------
>>>>
>>>> ============================================================================================================================
>>>> Disclaimer: This message and the information contained herein is
>>>> proprietary and confidential and subject to the Tech Mahindra policy
>>>> statement, you may review the policy at
>>>> http://www.techmahindra.com/Disclaimer.html externally
>>>> http://tim.techmahindra.com/tim/disclaimer.html internally within
>>>> TechMahindra.
>>>>
>>>> ============================================================================================================================
>>>>
>>>>
>>>      ------------------------------
>>>
>>> ============================================================================================================================
>>> Disclaimer: This message and the information contained herein is
>>> proprietary and confidential and subject to the Tech Mahindra policy
>>> statement, you may review the policy at
>>> http://www.techmahindra.com/Disclaimer.html externally
>>> http://tim.techmahindra.com/tim/disclaimer.html internally within
>>> TechMahindra.
>>>
>>> ============================================================================================================================
>>>
>>>
>>      ------------------------------
>>
>> ============================================================================================================================
>> Disclaimer: This message and the information contained herein is
>> proprietary and confidential and subject to the Tech Mahindra policy
>> statement, you may review the policy at
>> http://www.techmahindra.com/Disclaimer.html externally
>> http://tim.techmahindra.com/tim/disclaimer.html internally within
>> TechMahindra.
>>
>> ============================================================================================================================
>>
>>
>    ------------------------------
>
> ============================================================================================================================
> Disclaimer: This message and the information contained herein is
> proprietary and confidential and subject to the Tech Mahindra policy
> statement, you may review the policy at
> http://www.techmahindra.com/Disclaimer.html externally
> http://tim.techmahindra.com/tim/disclaimer.html internally within
> TechMahindra.
>
> ============================================================================================================================
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141106/4534299a/attachment.html>


More information about the Interest mailing list