Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.

Developer API

Mohammed Nafees edited this page Dec 19, 2013 · 2 revisions

QNotify API

QNotify( QWidget *parent )
Constructs a QNotify widget with parent as the parent widget.
The default size of the notification widget is 300 x 100.

void setPosition( QPoint p )
This function enables you to change the position of the notification widget on the parent widget wherever you want.

void setDialogWidth( int width )
This function can be used to set the width of the notification widget.

void adjustInViewport()
If you have changed the position and/or the size of the widget, then you can use this function to place the widget in the default top-right side of the parent window. This function does all the background placement for you.

void notify( QString text, NotificationType type, int duration = 1000 )
This is the main function which handles the type of notification and the text you want to show in your application.
The text is what is shown in the widget.
The type is the type of notification which you want to show. Be it a success message, error or a warning message.
The duration is the time in milli-seconds for which the notification widget will be shown on the parent window.

NotificationType
The possible values are:

  1. SUCCESS
  2. ERROR
  3. WARNING
    You can use which ever one you want based on your needs.
Clone this wiki locally