Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 358
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Part of Mapview frame see through

awesome, and last question.

 

I have split up my main and different pages into different QML files so I could work on them and have my code mroe organized.

 

I currently have it like so:

 

TabbePane{

Tab1{

MapPage.qml

}

 then in the the mapPage.qml  I have my mapview.  How do I pass the active tab signal to the qml?

 

thanks in advance, you've really helped me out quite a bit this week Smiley Happy

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Part of Mapview frame see through

Can you explain a little more about what you mean by passing the tabbedpane active signal and why you would want to do that?


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 358
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Part of Mapview frame see through

so in my mapPage.qml there's no way for me to access the onActiveTabChanged signal

 

my mapPage is broken down like this:

 

Page{

Mapview{}

}

 and my main.qml references the mapPage like so:

 

TabbePane{

Tab1{

mapPage

}

 how do I do it so that I can connect my mapPage to the onActiveTabChanged signal?

Developer
Posts: 358
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Part of Mapview frame see through

also I'm doing different things with the main mapview and the other one.

 

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Part of Mapview frame see through

[ Edited ]

Ok definately have different MapViews for each page then and when you're not using one destroy it.

 

[Edit] In fact it should be common practice to keep the minimum number of objects alive in memory at any one time.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 358
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Part of Mapview frame see through

yea, I understand, what I don't understand is how to create the object once I've destroyed it.  So I've closed the page and yes the mapview has been destroyed.  Great, but how do I create it again so that the user isn't confronted with a blank page when they go back to Tab1.

 

Hopefully that explains it a bit more.

 

my mapPage is broken down like this:

 

Page{

Mapview{}

}

 and my main.qml references the mapPage like so:

 

TabbePane{

Tab1{

mapPage

}
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Part of Mapview frame see through

Either include it directly,

 

Page {
   id mapPage

   MapView {
   }
}

 

or as an attached object (my preference)...

 

Page {
   id mapPage

    Button  {                  
        text: "Click to show map"
        onClicked :  {                      
            // Create the component and add it to the Container   
            var createdControl = mapDef.createObject();
            rootContainer.add(createdControl);
        }             
    }

    attachedObjects: [
        ComponentDefinition {
            id: mapDef

            MapView {
            }
        }
    ]
}

 

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 358
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Part of Mapview frame see through

[ Edited ]

Thanks for the help BBSJdev, I don't think i'm phrasing my question the right way.  I've already directly included the MapView in my page like your first example.  So I've got my main.qml which is simple just this in pseudo code:

 

TabbePane{

Tab1{

MapPage{} <<<<This i a QML page directly inserted into the tab.  
<<<<This is the MapPage.qml that has the MapView. } Tab2{ {} }

 in the above code I'm directly inserting my MapPage.qml into the first tab.  and then within that MapPage.qml I have my MapView directly inserted into the page like so in pseudo code:

 

<<< This is the MapPage.qml that I inserted directly in the main.qml above^ >>>


Page{

Container{

MapView{}   <<<<<<This is what I want to destroy/create whenever I 
                 <<<<<<leave or enter Tab1 in the main.qml
                 <<<<<<In the main.qml this whole page is inserted directly as
                 <<<<<<a separate QML file called MapPage.qml which contains
                 <<<<<<this page here with the MapView

}

}

 I'm not worried about my second mapview because it's in a navPane so it gets created and destroyed.  I really just need to worry about this mapview above.

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Part of Mapview frame see through

In both cases the MapView object will be destroyed when the page is, if you are still experiencing a problem perhaps you could phrase it in  a different way.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 358
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Part of Mapview frame see through

The thing is the page that my MapView is in, doesn't get destroyed when I go to Tab2.  And if I did destroy it, how would I create it again?