[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [gluon/creator-qmlintro-shreya] creator: tracing calls to setDockerName
From: Shreya Pandit <shreya () shreyapandit ! com>
Date: 2012-06-12 18:00:14
Message-ID: 20120612180014.6EE75A60B9 () git ! kde ! org
[Download RAW message or body]
Git commit 188fa8914e8ae329b9b8f3f607209364ca1c87ac by Shreya Pandit.
Committed on 12/06/2012 at 19:59.
Pushed by pandit into branch 'creator-qmlintro-shreya'.
tracing calls to setDockerName
M +9 -3 creator/introduction.cpp
M +7 -7 creator/introduction.h
M +11 -9 creator/ui/introduction.qml
http://commits.kde.org/gluon/188fa8914e8ae329b9b8f3f607209364ca1c87ac
diff --git a/creator/introduction.cpp b/creator/introduction.cpp
index ff60658..a2a3287 100644
--- a/creator/introduction.cpp
+++ b/creator/introduction.cpp
@@ -63,12 +63,13 @@ void IntroSlideShow::setYpos(qreal ypos)
void IntroSlideShow::setdockername(QString name)
{
+
docker=name;
if(QString::compare(docker,"", Qt::CaseInsensitive)) {
updateDocker();
}
- emit dockernameChanged();
+
}
qreal IntroSlideShow::getdockX()
@@ -81,7 +82,7 @@ qreal IntroSlideShow::getdockWidth()
return dockWidth;
}
-QString IntroSlideShow::dockername() const
+QString IntroSlideShow::dockername()
{
return docker;
}
@@ -113,6 +114,10 @@ int IntroSlideShow::xpos() const
void IntroSlideShow::updateDocker()
{
+ count++;
+ qDebug()<<"dockername"<< docker;
+
+ qDebug()<<"in update docker for" << count <<"th time";
QRect rectangle;
rectangle= kapp->activeWindow()->findChild<QWidget*>(docker)->frameGeometry();
setWidth(rectangle.width());
@@ -122,6 +127,7 @@ void IntroSlideShow::updateDocker()
setHeight(rectangle.height());
setXpos(rectangle.x());
setYpos(rectangle.y());
-
+ qDebug()<<rectangle.x()+rectangle.width();
+ qDebug()<<kapp->activeWindow()->width()/2 ;
}
diff --git a/creator/introduction.h b/creator/introduction.h
index 395589c..59ccccd 100644
--- a/creator/introduction.h
+++ b/creator/introduction.h
@@ -33,15 +33,15 @@ class IntroSlideShow: public QDeclarativeItem
{
Q_OBJECT
Q_PROPERTY(QString dockername READ dockername WRITE setdockername NOTIFY \
dockernameChanged)
- Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
- Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
- Q_PROPERTY(int xpos READ xpos WRITE setXpos NOTIFY xposChanged)
- Q_PROPERTY(int ypos READ ypos WRITE setYpos NOTIFY yposChanged)
+ Q_PROPERTY(int width READ width WRITE setWidth )
+ Q_PROPERTY(int height READ height WRITE setHeight )
+ Q_PROPERTY(int xpos READ xpos WRITE setXpos )
+ Q_PROPERTY(int ypos READ ypos WRITE setYpos )
public:
IntroSlideShow();
~IntroSlideShow();
- QString dockername() const;
+ QString dockername();
qreal width() const;
qreal height() const;
Q_INVOKABLE qreal getdockX();
@@ -53,9 +53,9 @@ class IntroSlideShow: public QDeclarativeItem
void setHeight(qreal height);
void setXpos(qreal xpos);
void setYpos(qreal ypos);
- void setAlignment(QString align);
- Q_INVOKABLE void setdockername(QString name);
+ void setdockername(QString name);
void updateDocker();
+ int count;
QString docker;
qreal refWidth;
qreal dockX;
diff --git a/creator/ui/introduction.qml b/creator/ui/introduction.qml
index f3b3e71..23bfbd7 100644
--- a/creator/ui/introduction.qml
+++ b/creator/ui/introduction.qml
@@ -86,8 +86,6 @@ Item {
id :animator;
}
-
-
Text {
id : text;
font.pointSize: 12;
@@ -125,9 +123,12 @@ Item {
if ((animator.getdockX() +animator.getdockWidth()) < \
(animator.getrefWidth())){ text.state = "right";
+ console.log(animator.dockername);
}
else{
text.state = "left";
+ console.log("dockname is");
+ console.log(animator.dockername);
}
show();
@@ -144,8 +145,10 @@ Item {
Timer {
id: showTimer
+ property int count: 0;
interval: 500
onTriggered: {
+
switch(animator.dockername){
case(""):
@@ -153,6 +156,7 @@ Item {
break;
case("ComponentsDock"):
+
viewport.state = 'project';
break;
@@ -185,14 +189,12 @@ Item {
onClicked: {
if(!text.showText){ text.opacity = 0 ;}
showTimer.start();
- onDockernameChanged: { animator.setdockername(animator.dockername);}
}
}
-
states: [
State {
@@ -201,7 +203,7 @@ Item {
PropertyChanges { target: viewport; x: animator.x; y: animator.y; \
width:animator.implicitWidth; height:animator.implicitHeight; } StateChangeScript {
name: "myScript"
- script: { text.orient();}
+ script: { text.orient(animator.dockername); \
showTimer.stop();}
}
},
@@ -212,7 +214,7 @@ Item {
PropertyChanges { target: viewport; x: animator.x; y: animator.y; \
width:animator.implicitWidth; height:animator.implicitHeight } StateChangeScript {
name: "myScript"
- script: { text.orient();}
+ script: { text.orient();showTimer.stop();}
}
},
@@ -223,7 +225,7 @@ Item {
PropertyChanges { target: viewport; x: animator.x; y: animator.y; \
width:animator.implicitWidth; height:animator.implicitHeight } StateChangeScript {
name: "myScript"
- script: { text.orient();}
+ script: { text.orient();showTimer.stop();}
}
},
@@ -234,7 +236,7 @@ Item {
PropertyChanges { target: viewport; x: animator.x; y: animator.y; \
width:animator.implicitWidth; height:animator.implicitHeight } StateChangeScript {
name: "myScript"
- script: { text.orient();}
+ script: { text.orient();showTimer.stop();}
}
},
@@ -245,7 +247,7 @@ Item {
PropertyChanges { target: viewport; x: animator.x; y: animator.y; \
width:animator.implicitWidth; height:animator.implicitHeight } StateChangeScript {
name: "myScript"
- script: { text.orient();}
+ script: { text.orient();showTimer.stop();}
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic