Qt Reference Documentation

QML InfoBanner Element

Shows the info banner. More...

Inherits Item

  • List of all members, including inherited members
  • Properties

    Signals

    Methods

    Detailed Description

    The InfoBanner component is used to display information to the user. The number of lines of text is limited to three. The screenshot below shows an example of info banner.

    Creating an InfoBanner

    The code snippet below illustrates how to create an InfoBanner.

     // Create an info banner with no icon
     InfoBanner {
         id: banner
         text: "This is an info banner with no icon"
     }
    
     // Create an info banner with icon
     InfoBanner {
         text: "This is an info banner with icon"
         iconSource: "info_banner_thumbnail.png"
     }
    
     function showBanner1() {
         // set display time to 5000 ms, default is 3000 ms
         banner.timeout = 5000;
         // display info banner
         banner.open();
     }
    
     function showBanner2() {
         // disable "self-dismissing" timer, banner has to be dismissed manually
         banner.timeout = 0;
         // interactive infobanner. click signal will be triggered when clicked.
         banner.interactive =  true
         // display info banner
         banner.open();
     }
    
     function closeBanner() {
         // close info banner manually
         banner.close();
     }

    Property Documentation

    read-onlyiconSource : url

    The path of the icon image. The default value is "".


    read-onlyinteractive : bool

    The InfoBanner is interactive if the value is true; otherwise the InfoBanner is informative. The default value is false.


    read-onlytext : string

    Text to be displayed in the InfoBanner.


    read-onlytimeout : int

    Enables or disables timer that dismisses the InfoBanner. The InfoBanner stays open if the timeout value is 0. The default value is 3000.


    Signal Documentation

    InfoBanner::clicked ()

    This signal is emitted when the interactive InfoBanner is pressed and then released.


    Method Documentation

    InfoBanner::close ()

    Hides the InfoBanner component.


    InfoBanner::open ()

    Displays the InfoBanner component.