July 19, 2011

senu188 senu188
Lab Rat
31 posts

[Solved] N950 QML element problem

Page  
1

Hi,
I have two issues with N950 app : 1) There is a lot of screen space which needs to be filled. I guess SVG graphics will help me fill up varying screen size.
2)QML elements don’t stay in place. Pl see the difference between the N8 sticky pad and N950 sticky pad letters in the attached screen shot. As you see the text in N950 has moved off the pad despite the fact that the text has been parented to sticky pad image
Has any one faced this problem? Found any solution? Please share . Thanks!
http://imageshack.us/photo/my-images/684/nokian950003.png/
(N950 SCREEN SHOT)!
http://imageshack.us/photo/my-images/16/n8insulincalc.jpg/
(N8 SCREEN SHOT)!

17 replies

July 19, 2011

Vijay Bhaska Reddy Vijay Bhaska Reddy
Lab Rat
383 posts

The images show the problem, but without code it will be difficult to point out the problem..

Through the part of code that creates sticky note, its anchoring part, and the text element..

July 20, 2011

Alicemirror Alicemirror
Lab Rat
717 posts

Hi seenu188,

sure the best is to see the code, say Vijay but the problem seems to be about the different resolution of the two devices. Using the last Qt-Quick common widgets (independently by their graphic features) you can access to the QML Screen element. See the documentation because it contains a set of really useful information related not only to device screen size, orientation (angle of) and width/height pixel data but also dpi and density. This means that you can scale or resize of do whathever you want on your images (your screenshots seems created from vector graphic objects) so they fill the screen following a logic and not fuzzy behavior.

The fact is that the same screen size, with different resolution can have a different pixel density (I can move your same problem to my E7 device vs. N950/QEMU) and see the same. Yours seems to be a problem of geometry and not of pixel size only.

let me know if this help in your problem. Cheers.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 20, 2011

senu188 senu188
Lab Rat
31 posts

Thank you Vijay and Alicemirror. The problem is definitely due to resolution as the coding has not changed much between N8 and N950. I will read up on Harmattan Qt components and see if I can solve the issue. I am also trying to see whether rotating the text element has any effect on the position difference between N8 stick pad and N950 sticky pad.
I will keep you posted on the results
Thanks

July 20, 2011

Vijay Bhaska Reddy Vijay Bhaska Reddy
Lab Rat
383 posts

My doubt is that.. if you have anchored your text to the stick note, it should work well does not matter the resolution. Are you anchoring your text well??

July 20, 2011

senu188 senu188
Lab Rat
31 posts

Hi,
I do believe I anchored it properly.
Here’s my anchoring code. The ‘Storage’ is database from which saved value of insulin is retrieved and showed. The sticky_txt is the text field which is anchored to the yello stick pad image (parent). I have rotated the sticky_txt value by -40 degree. I don’t know if this is a problem but this is neccessary (asthetically) as I have coded the yellow sticky pad to zoom out when it is pressed.

  1. Text {
  2.                 id: sticky_txt
  3.                 color: "#2922ec"
  4.                 text:Storage.getValue("valInsulin");
  5.                 rotation: -40
  6.                 wrapMode: Text.WordWrap
  7.                 anchors.rightMargin: 1
  8.                 anchors.leftMargin: 1
  9.                 anchors.topMargin: 1
  10.                 anchors.bottomMargin: 1
  11.                 anchors.fill: parent
  12.                 font.pixelSize: 12
  13.             }

zoom on press code:
  1. states: State {
  2.                         name: "pressed"
  3.                         when: mouse.pressed
  4.                         PropertyChanges { target: img_stickypad; rotation: 8; scale: 2 }
  5.  
  6.                     }
  7.  
  8.                     transitions: Transition {
  9.                         NumberAnimation { properties: "rotation,scale"; duration: 200 }
  10.                     }

July 20, 2011

Alicemirror Alicemirror
Lab Rat
717 posts

Hello, I have received today the N950 kit so I will testh the framwork Qt-Complex for N9 (need the physical device) asap and will update you on the results.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 20, 2011

Alicemirror Alicemirror
Lab Rat
717 posts

  1. wrapMode: Text.WordWrap
  2. anchors.rightMargin: 1
  3. anchors.leftMargin: 1
  4. anchors.topMargin: 1
  5. anchors.bottomMargin: 1
  6. anchors.fill: parent
  7. font.pixelSize: 12

Hi, I am not so convincted to this anchoration method. Please can you explain what you want exactly? I had problems with text anchored by all sides when the text is wordwrap. This is because you can’t know a-priori when and where the text is broken.
Try to remove the margins one step at a time to see how the behavior changes. Wordwrap is very useful but has some problems. I have also experienced that it can no be anchored to the bottom because its bottom does not exist.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 20, 2011

senu188 senu188
Lab Rat
31 posts

Alicemirror wrote:
I have also experienced that it can no be anchored to the bottom because its bottom does not exist.

Thank you. You are right. I should remove the bottom anchor. I will check the anchors again but my question is why does it work perfectly with N8 and not with N950?

July 20, 2011

Alicemirror Alicemirror
Lab Rat
717 posts

This software if open? can you post a working piece somewhere so I can test? Do you have the emulator of the device ?

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 20, 2011

mlong mlong
Robot Herder
1537 posts

It might be could to use “anchors.centerIn: parent” rather than anchoring to the sides. Then make sure your rotationOrigin is set to center.

As an aside, is your sticky note image (the parent) already rotated? Or are you rotating it as well?

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

July 21, 2011

senu188 senu188
Lab Rat
31 posts

THANK YOU. Duh ! anchoring centreIn worked ! In hide sight I can see why the rotated text didn’t work now. I have removed the side anchors and rotation of text and though the word wrap didn’t work, I have structured the text content to fit in the yellow stick pad._ but I still have no idea why earlier anchoring worked in N8 and not in N950_

mlong wrote:

As an aside, is your sticky note image (the parent) already rotated? Or are you rotating it as well?

No the parent image rotates only when it is pressed on. It zooms up 2x and rotates.
The sticky note in screen shot [non-zoom] shows that it is at an angle because the image is as such-the yellow pad is not straight.
Thanks all of you

July 21, 2011

mlong mlong
Robot Herder
1537 posts
senu188 wrote:
I have removed the side anchors and rotation of text and though the word wrap didn’t work, I have structured the text content to fit in the yellow stick pad.

You can always set an explicit width: and height: for your Text area to enable the text to wrap properly, also.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

July 22, 2011

senu188 senu188
Lab Rat
31 posts

Thank you for the suggestion. However I still find that in this app’s case, I need to adjust the top margin by some amount – [parent’s image – 40 ].

August 2, 2011

senu188 senu188
Lab Rat
31 posts

[Solved]

August 2, 2011

senu188 senu188
Lab Rat
31 posts

Solved Damn I don’t get it. How do you close the thread with ‘Solve d’ tag ?

Page  
1

  ‹‹ N9/N950 SCREEN dimension what changes needed from symbian 3 development      [Solved]select effect in pushbuttons ››

You must log in to post a reply. Not a member yet? Register here!