Reply
Thread Tools Search this Thread
Posts: 952 | Thanked: 1,772 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: 1,765 | Thanked: 1,878 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?
__________________
MeeCoLay: run MeeGo Harmattan apps on Fremantle
PowEdit: manage power key menu entries
User Agent Tool - change Maemo Browser's user agent
MaeLyrica - lyrics download client

If you want to support my work, you can DONATE

You're encouraged to donate at least a couple of euros - otherwise PayPal takes almost everything as a fee.

If you would like to donate in other currency or can't donate but would like to support me, please contact me.
 
Posts: 952 | Thanked: 1,772 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: 1,765 | Thanked: 1,878 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
            }
        }
    }
}
__________________
MeeCoLay: run MeeGo Harmattan apps on Fremantle
PowEdit: manage power key menu entries
User Agent Tool - change Maemo Browser's user agent
MaeLyrica - lyrics download client

If you want to support my work, you can DONATE

You're encouraged to donate at least a couple of euros - otherwise PayPal takes almost everything as a fee.

If you would like to donate in other currency or can't donate but would like to support me, please contact me.
 
Posts: 952 | Thanked: 1,772 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: 1,765 | Thanked: 1,878 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)
__________________
MeeCoLay: run MeeGo Harmattan apps on Fremantle
PowEdit: manage power key menu entries
User Agent Tool - change Maemo Browser's user agent
MaeLyrica - lyrics download client

If you want to support my work, you can DONATE

You're encouraged to donate at least a couple of euros - otherwise PayPal takes almost everything as a fee.

If you would like to donate in other currency or can't donate but would like to support me, please contact me.
 
Posts: 1,765 | Thanked: 1,878 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
__________________
MeeCoLay: run MeeGo Harmattan apps on Fremantle
PowEdit: manage power key menu entries
User Agent Tool - change Maemo Browser's user agent
MaeLyrica - lyrics download client

If you want to support my work, you can DONATE

You're encouraged to donate at least a couple of euros - otherwise PayPal takes almost everything as a fee.

If you would like to donate in other currency or can't donate but would like to support me, please contact me.
 
nicolai's Avatar
Posts: 1,621 | Thanked: 4,297 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: 952 | Thanked: 1,772 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: 1,765 | Thanked: 1,878 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.
__________________
MeeCoLay: run MeeGo Harmattan apps on Fremantle
PowEdit: manage power key menu entries
User Agent Tool - change Maemo Browser's user agent
MaeLyrica - lyrics download client

If you want to support my work, you can DONATE

You're encouraged to donate at least a couple of euros - otherwise PayPal takes almost everything as a fee.

If you would like to donate in other currency or can't donate but would like to support me, please contact me.
 
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

 
Forum Jump


All times are GMT -4. The time now is 11:59 PM.