• May 20, 2024, 11:56:26 am

Author Topic: [TUT] Quick way to use InfoBanners QML  (Read 824 times)

0 Members and 1 Guest are viewing this topic.

Offline Allstar12345

  • Allstar Software Founder
  • Administrator
  • Forum Genius
  • ******
  • Posts: 5,235
  • Reputation: 812
    • Allstar Software
  • Current Phone: : OnePlus 8 Pro, Xperia 10, Nexus 6p, Jolla Phone, Nokia N8, Nokia 808 PureView, BlackBerry Z30
[TUT] Quick way to use InfoBanners QML
« on: June 01, 2013, 03:15:39 am »


A nice little way to fire a Info banner on QML without creating loads of the same component on different pages.

First you need to import the right module

Code: [Select]
import com.nokia.extras 1.1

Now it's better to put this in your main.qml or whatever the very first page that is loaded:

Code: [Select]
    InfoBanner {
            id: infoBanner
            function showText(text) {
                infoBanner.text = text
                infoBanner.open()
            }
    }

You have the function shown here :
Code: [Select]
  function showText(text) {
                infoBanner.text = text
                infoBanner.open()

Now that the Infobanner is defined you can place this following code wherever you want to show the InfoBanner

Code: [Select]
infoBanner.showText(qsTr("Note Is Already Empty"))
So you have the Infobanner's id :
Code: [Select]
infoBanner.
Then the show text function that was defined earlier:

Code: [Select]
showText
And put your text in between the quotation marks.


This can also be done on components like a CommonDialog.



« Last Edit: June 20, 2014, 08:25:31 pm by Allstar12345 »