|
|
07-13-2012
, 05:03 AM
|
|
Posts: 1,763 |
Thanked: 1,874 times |
Joined on May 2011
@ Poland
|
#22
|
import QtQuick 1.0
import org.maemo.fremantle 1.0
Page
{
id: mainPage
tools: toolbar
Column
{
signal tracksrcChanged(bool state)
width: parent.width
CheckBox
{
id: tracksrc
text: "Select track from library" // label isn't needed with PageStackWindow
checked: true
//checkable: true
onClicked:
{
mainPage.tracksrcChanged(checked)
}
}
Label
{
id: selecttracklabel
text: "Selected track"
}
Button
{
id: selecttrack
text: "No track selected"
checkable: false
width: screenwidth
onClicked:
{
console.log("Select track button clicked")
pageStack.push(Qt.resolvedUrl("SelectTrackPage.qml"))
}
onTracksrcChanged:
{
( state == true ) ? this.show() :this.hide()
}
}
Button
{
id: lyricssrcbutton
text: lyricssrcdialog.model.get(lyricssrcdialog.selectedIndex).name
width: screenwidth
onClicked: { lyricssrcdialog.open(); }
}
Button
{
id: go
text: "Go!"
width: screenwidth
onClicked:
{
console.log("Go! button clicked")
pageStack.push(Qt.resolvedUrl("ShowLyricsPage.qml"))
}
}
}
SelectionDialog
{
id: lyricssrcdialog
titleText: "Download source"
selectedIndex: 0
model: ListModel
{
ListElement { name: "AZLyrics" }
}
}
OKDialog
{
id: notimplementeddialog
message: "Sorry, not implemented yet!"
}
}
.../MainPage.qml:42:13: Cannot assign to non-existent property onTracksrcChanged:
|
|
07-13-2012
, 05:12 AM
|
|
|
Posts: 1,621 |
Thanked: 4,297 times |
Joined on Apr 2009
@ Germany
|
#23
|
Button {
id: selecttrack
onTracksrcChanged { ...
}
Button
{
id: selecttrack
text: "No track selected"
checkable: false
width: screenwidth
visible:tracksrc.checked
onClicked:
{
console.log("Select track button clicked")
pageStack.push(Qt.resolvedUrl("SelectTrackPage.qml"))
}
}
| The Following User Says Thank You to nicolai For This Useful Post: | ||
|
|
07-13-2012
, 05:45 AM
|
|
Posts: 1,763 |
Thanked: 1,874 times |
Joined on May 2011
@ Poland
|
#24
|
tracksrcChanged is a signal in Column
you can not access it within
the onTracksrcChanged would work, only if trackSrcChanged is a property ofCode:Button { id: selecttrack onTracksrcChanged { ... }
selecttrack
The easier solution would be:
Code:Button { id: selecttrack text: "No track selected" checkable: false width: screenwidth visible:tracksrc.checked onClicked: { console.log("Select track button clicked") pageStack.push(Qt.resolvedUrl("SelectTrackPage.qml")) } }
|
|
07-13-2012
, 06:48 PM
|
|
Posts: 324 |
Thanked: 367 times |
Joined on Dec 2009
@ Vancouver, BC
|
#25
|
|
|
07-14-2012
, 08:13 AM
|
|
Posts: 1,763 |
Thanked: 1,874 times |
Joined on May 2011
@ Poland
|
#26
|
tracksrcChanged is a signal in Column
you can not access it within
the onTracksrcChanged would work, only if trackSrcChanged is a property ofCode:Button { id: selecttrack onTracksrcChanged { ... }
selecttrack
The easier solution would be:
Code:Button { id: selecttrack text: "No track selected" checkable: false width: screenwidth visible:tracksrc.checked onClicked: { console.log("Select track button clicked") pageStack.push(Qt.resolvedUrl("SelectTrackPage.qml")) } }
|
|
07-17-2012
, 04:48 AM
|
|
Posts: 1,763 |
Thanked: 1,874 times |
Joined on May 2011
@ Poland
|
#27
|
|
|
07-17-2012
, 02:28 PM
|
|
Posts: 324 |
Thanked: 367 times |
Joined on Dec 2009
@ Vancouver, BC
|
#28
|
But then I'll have to specify the height. And I want the spacer to automatically detect the space to take
| The Following User Says Thank You to Slocan For This Useful Post: | ||
|
|
07-17-2012
, 03:44 PM
|
|
Posts: 1,763 |
Thanked: 1,874 times |
Joined on May 2011
@ Poland
|
#29
|
Not if you use relative height (something like height: screen.height-otherstuff.height)
Yes, look up one of the examples on how to create animations on property changes. You probably want to use the animation on opacity from 0 to 1, or on height.
I think it's in ButtonStyle object.
typedef QString lyricsDownloaderString;
class lyricsDownloader : public QObject
{
public:
Q_INVOKABLE virtual short perform() = 0;
Q_INVOKABLE inline void setData(const string & a, const string & t); // set artist and track
// some other data
protected:
lyricsDownloader(const string & a, const string & t ) : artist(a), track(t) {}
/*other data*/
};
class AZLyricsDownloader : public lyricsDownloader
{
public:
AZLyricsDownloader() : lyricsDownloader("", "") {}
AZLyricsDownloader(const string & a, const string & t) : lyricsDownloader(a, t) {}
Q_INVOKABLE short perform();
Q_INVOKABLE inline void setData(const string & a, const string & t);// set artist and track
/*other data*/
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QApplication app(argc, argv);
mainWindow viewer;
qmlRegisterUncreatableType<lyricsDownloader>("MaeLyrica", 1, 0, "lyricsDownloader", "");
qmlRegisterType<AZLyricsDownloader>("MaeLyrica", 1, 0, "AZLyricsDownloader");
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.setMainQmlFile(QLatin1String("qml/maelyrica/main.qml"));
viewer.showFullScreen();
return app.exec();
}
import QtQuick 1.1
import com.nokia.meego 1.0
import com.nokia.extras 1.0
import MaeLyrica 1.0
//property color fontcolor: "white"
PageStackWindow
{
id: pagestackwindow
visible: true
MainPage
{
id: mainview
}
initialPage: mainview
AZLyricsDownloader
{
id: azdownloader
}
}
import QtQuick 1.1
import com.nokia.meego 1.0
Page
{
/*some gui elements*/
Button
{
id: go
text: "Go!"
width: parent.width
onClicked:
{
goLoader.source = "ShowLyricsPage.qml"
pageStack.push(goLoader.item)
azdownloader.perform()
showLyricsPage.busyind.visible = false
}
}
}
/*dialogs and toolbar definitions*/
}
import QtQuick 1.1
import com.nokia.meego 1.0
Sheet {
id: sheet
acceptButtonText: "Save"
rejectButtonText: "Cancel"
onAccepted:
{
if ( artistfield.text == "" || trackfield.text == "" ) // check whether empty
{
emptyfieldsdialog.open()
}
else
{
selecttrack.text = artistfield.text + " - " + trackfield.text
azdownloader.setData(artistfield.text, trackfield.text)
}
}
content: Rectangle { /*some content here*/ }
/*dialog definition*/
TypeError: Result of expression 'azdownloader.setData' is not a function TypeError: Result of expression 'azdownloader.perform' is not a function
![]() |
| Thread Tools | Search this Thread |
|
?
Thanks in advance
EDIT: QueryDialog seems to work great.
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-08-2012 at 09:30 AM.