[Solved] N950 QML element problem
-
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)! -
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..
-
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.
-
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 -
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??
-
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.
@Text {
id: sticky_txt
color: "#2922ec"
text:Storage.getValue("valInsulin");
rotation: -40
wrapMode: Text.WordWrap
anchors.rightMargin: 1
anchors.leftMargin: 1
anchors.topMargin: 1
anchors.bottomMargin: 1
anchors.fill: parent
font.pixelSize: 12
}@
zoom on press code:
@states: State {
name: "pressed"
when: mouse.pressed
PropertyChanges { target: img_stickypad; rotation: 8; scale: 2 }} transitions: Transition { NumberAnimation { properties: "rotation,scale"; duration: 200 } }@
-
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.
-
@wrapMode: Text.WordWrap
anchors.rightMargin: 1
anchors.leftMargin: 1
anchors.topMargin: 1
anchors.bottomMargin: 1
anchors.fill: parent
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. -
[quote author="Alicemirror" date="1311181045"]I have also experienced that it can no be anchored to the bottom because its bottom does not exist.
[/quote]
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? -
This software if open? can you post a working piece somewhere so I can test? Do you have the emulator of the device ?
-
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_
[quote author="mlong" date="1311184172"]
As an aside, is your sticky note image (the parent) already rotated? Or are you rotating it as well?
[/quote]
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 -
[quote author="senu188" date="1311233387"]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.[/quote]
You can always set an explicit width: and height: for your Text area to enable the text to wrap properly, also.
-
Edit the title of your first post and change ist to [Solved] title of the post