|
|
06-26-2012
, 12:11 PM
|
|
Posts: 324 |
Thanked: 367 times |
Joined on Dec 2009
@ Vancouver, BC
|
#2
|
| The Following User Says Thank You to Slocan For This Useful Post: | ||
|
|
06-27-2012
, 11:28 AM
|
|
Posts: 1,758 |
Thanked: 1,872 times |
Joined on May 2011
@ Poland
|
#4
|
import QtQuick 1.0
import org.maemo.fremantle 1.0
Rectangle
{
property color fontcolor: "white"
Column
{
id: c1
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
}
}
Rectangle
{
id: r1
anchors.top: c1.bottom
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(); }
}
}
Column
{
id: c2
anchors.top: r1.bottom
Button
{
id: go
text: "Go!"
width: parent.width
}
}
}
import QtQuick 1.0
import org.maemo.fremantle 1.0
Column
{
property color fontcolor: "white"
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
}
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
}
}
|
|
06-27-2012
, 11:41 AM
|
|
Posts: 949 |
Thanked: 1,757 times |
Joined on Jun 2011
@ Finland
|
#5
|
then it's showing up alright, but throwing that load of loops detected as before. Where should I move the selection dialog?
Item {
Column
{
property color fontcolor: "white"
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
}
Button
{
id: lyricssrcbutton
text: lyricssrcdialog.model.get(lyricssrcdialog.selectedIndex).name
width: parent.width
onClicked: { lyricssrcdialog.open(); }
}
Button
{
id: go
text: "Go!"
width: parent.width
}
}
SelectionDialog
{
id: lyricssrcdialog
titleText: "Download source"
selectedIndex: 0
model: ListModel
{
ListElement { name: "AZLyrics" }
}
}
}
| The Following User Says Thank You to ajalkane For This Useful Post: | ||
|
|
06-29-2012
, 11:33 AM
|
|
Posts: 1,758 |
Thanked: 1,872 times |
Joined on May 2011
@ Poland
|
#6
|
Perhaps like this (notice I wrapped Column inside Item):
Code:Item { Column { property color fontcolor: "white" 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 } Button { id: lyricssrcbutton text: lyricssrcdialog.model.get(lyricssrcdialog.selectedIndex).name width: parent.width onClicked: { lyricssrcdialog.open(); } } Button { id: go text: "Go!" width: parent.width } } SelectionDialog { id: lyricssrcdialog titleText: "Download source" selectedIndex: 0 model: ListModel { ListElement { name: "AZLyrics" } } } }
import QtQuick 1.0
import org.maemo.fremantle 1.0
Item
{
Loader
{
id: goloader
onLoaded: console.log("Go! clicked")
}
Loader
{
id: selecttrackloader
onLoaded: console.log("Select track view loaded")
}
Column
{
property color fontcolor: "white"
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:
{
}
}
Button
{
id: lyricssrcbutton
text: lyricssrcdialog.model.get(lyricssrcdialog.selectedIndex).name
width: parent.width
onClicked: { lyricssrcdialog.open(); }
}
Button
{
id: go
text: "Go!"
width: parent.width
}
}
SelectionDialog
{
id: lyricssrcdialog
titleText: "Download source"
selectedIndex: 0
model: ListModel
{
ListElement { name: "AZLyrics" }
}
}
}
.../main.qml:53 ReferenceError: Can't find variable fontcolor .../main.qml:45 ReferenceError: Can't find variable fontcolor
|
|
07-03-2012
, 02:55 AM
|
|
Posts: 949 |
Thanked: 1,757 times |
Joined on Jun 2011
@ Finland
|
#7
|
With this code:
[CODE]
I'm getting
What am I doing wrong?Code:.../main.qml:53 ReferenceError: Can't find variable fontcolor .../main.qml:45 ReferenceError: Can't find variable fontcolor
| The Following User Says Thank You to ajalkane For This Useful Post: | ||
|
|
07-03-2012
, 07:25 AM
|
|
Posts: 1,758 |
Thanked: 1,872 times |
Joined on May 2011
@ Poland
|
#8
|
I think you can't have property declarations anywhere else than the root item. So try to move 'property color fontcolor: "white"' under Item.
|
|
07-03-2012
, 07:53 AM
|
|
Posts: 949 |
Thanked: 1,757 times |
Joined on Jun 2011
@ Finland
|
#9
|
That way there are no errors, but still somehow only blank screen is painted..
| The Following User Says Thank You to ajalkane For This Useful Post: | ||
|
|
07-03-2012
, 08:08 AM
|
|
Posts: 1,758 |
Thanked: 1,872 times |
Joined on May 2011
@ Poland
|
#10
|
That's another problem then. In those kind of situations, I've found it useful to put up a minimal working page (say one component). Then start adding stuff until you've isolated the problem.
![]() |
| Thread Tools | Search this Thread |
|
I'm learning QML.
My code is:
import QtQuick 1.0 import org.maemo.fremantle 1.0 Column { property color fontcolor: "white" 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 } SelectionDialog { id: lyricssrcdialog titleText: "Download source" selectedIndex: 1 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 } }I want the lyricssrcbutton to display the currently selected option.
Why isn't it working. What's the problem with the loops?
Thanks 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.
Last edited by marmistrz; 07-13-2012 at 05:04 AM.