Reply
Thread Tools
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#11
Originally Posted by marmistrz View Post
Wait... Does Item require x,y coordinates? It may be why it's a blank screen. As putting any component in a Rectangle caused not showing up of this component.
It does not require x/y co-ordinates, but of course it has basically no width/height if you don't specify them. It can be a problem if its descendants use indirectly the Item's width/height to calculate their size.
__________________
My N9/N950 projects:
 
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#12
Originally Posted by ajalkane View Post
It does not require x/y co-ordinates, but of course it has basically no width/height if you don't specify them. It can be a problem if its descendants use indirectly the Item's width/height to calculate their size.
Is there any way I can tell the Rectangle to occupy the maximum size (as it's with Column only), so that in landscape N900 it'll be 800x480, portrait N900 480x800, portrait N9 480x854 and so on?
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#13
Originally Posted by marmistrz View Post
Is there any way I can tell the Rectangle to occupy the maximum size (as it's with Column only), so that in landscape N900 it'll be 800x480, portrait N900 480x800, portrait N9 480x854 and so on?
I don't know about N900, but for N9 see the QML Window component's sources on how to do it. Here's its documentation:

http://harmattan-dev.nokia.com/docs/...go-window.html
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#14
Originally Posted by ajalkane View Post
I don't know about N900, but for N9 see the QML Window component's sources on how to do it. Here's its documentation:

http://harmattan-dev.nokia.com/docs/...go-window.html
I think it's what I'm looking for, as I plan to release my programs not only for N900 but for N9 too.

But somehow the hildon status menu is still shown. changing showExpanded() to showMaximized() doesn't work.

thanks in advance.

Here's my main.qml
Code:
import QtQuick 1.0
import org.maemo.fremantle 1.0

//property color fontcolor: "white"

PageStackWindow
{
    property color fontcolor: "white"
    initialPage: Component
    {
        Column
        {
            Row
            {
                width: parent.width
                CheckBox
                {
                    id: tracksrc
                    //text: "Select track from library"
                    checked: true
                    //checkable: true
                }
                Label
                {
                    id: tracksrcText
                    text: "Select track from library"
                    anchors.verticalCenter: tracksrc.verticalCenter
                    color: fontcolor
                }
            }

            Label
            {
                id: selecttracklabel
                text: "Selected track"
                color: fontcolor
            }
            Button
            {
                id: selecttrack
                text: "No track selected"
                checkable: false
                width: parent.width
                onClicked:
                {

                }
            }

            SelectionDialog
            {
                id: lyricssrcdialog
                titleText: "Download source"
                selectedIndex: 0
                model: ListModel
                {
                    ListElement { name: "AZLyrics" }
                }
            }
            Button
            {
                id: lyricssrcbutton
                text: lyricssrcdialog.model.get(lyricssrcdialog.selectedIndex).name
                width: parent.width
                onClicked: { lyricssrcdialog.open(); }
            }

            Button
            {
                id: go
                text: "Go!"
                width: parent.width
            }
        }
    }
}
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#15
Originally Posted by marmistrz View Post
I think it's what I'm looking for, as I plan to release my programs not only for N900 but for N9 too.

But somehow the hildon status menu is still shown. changing showExpanded() to showMaximized() doesn't work.
I'm not familiar with Fremantle, but on Harmattan PageStackWindow's showStatusBar property should do the trick:

Code:
PageStackWindow
{
    showStatusBar: false
    ...
}
In C++ showFullScreen() should be called.
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#16
Originally Posted by ajalkane View Post
I'm not familiar with Fremantle, but on Harmattan PageStackWindow's showStatusBar property should do the trick:

Code:
PageStackWindow
{
    showStatusBar: false
    ...
}
In C++ showFullScreen() should be called.
OK. I'm starting to work it out. showStatusBar should be true, and only showFullScreen() in C++.
Is there any way I set the width of the buttons to be resized as the screen rotates? With Column only I set
Code:
width: parent.width
But with PageStackWindow the width is set well only after clicking the button pointing to the SelectionDialog. And
Code:
screen.width
is always 800 even after rotation (then it should be 480)
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#17
Originally Posted by marmistrz View Post
OK. I'm starting to work it out. showStatusBar should be true, and only showFullScreen() in C++.
Is there any way I set the width of the buttons to be resized as the screen rotates? With Column only I set
Code:
width: parent.width
But with PageStackWindow the width is set well only after clicking the button pointing to the SelectionDialog. And
Code:
screen.width
is always 800 even after rotation (then it should be 480)

I finally worked it out with
Code:
    property int screenwidth: (screen.currentOrientation == Screen.Landscape) ? screen.displayWidth : screen.displayHeight
But I've got another problem. I want to divide the program into multiple files but
Files are:
main.qml - the main one, only PageStackWindow
mainView.qml - Page used by main.qml

And I'm getting
Code:
Can't find variable: mainView
I tried importing
Code:
import "."
import "mainView.qml"
import "mainView.qml" as mainView
But nothing works.
thanx in advance
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#18
No need to import your own qml-file
as long as it is in the same directory.
How does your main.qml file looks like?
The one with the pagestackwindow
must have set the initialPage property.

Here is a simple example
http://harmattan-dev.nokia.com/docs/...etutorial.html
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#19
Originally Posted by marmistrz View Post
But I've got another problem. I want to divide the program into multiple files but
Files are:
main.qml - the main one, only PageStackWindow
mainView.qml - Page used by main.qml

And I'm getting
Code:
Can't find variable: mainView
I tried importing
Code:
import "."
import "mainView.qml"
import "mainView.qml" as mainView
But nothing works.
thanx in advance
You should rename it to MainView.qml. Remove the imports, they're automatically imported. But the naming is important, ie. capital start letter.

So after that you can use it in main.qml like:

Code:
PageStackWindow {
  ...
  MainView {
    ...
  }
}
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#20
Originally Posted by ajalkane View Post
You should rename it to MainView.qml. Remove the imports, they're automatically imported. But the naming is important, ie. capital start letter.

So after that you can use it in main.qml like:

Code:
PageStackWindow {
  ...
  MainView {
    ...
  }
}
OK, thanks for help. Seems that I used it wrong (as if it was #include and extern declaration in C++), thinking it was already declared.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:12.