This is more than just a “Hello World” app. It uses the linux notification API to send global notifications.
It is very easy to do this. It’s like working in Visual Basics.
– Create a button in the ui editor.
– Right-click on it then select “Go to slot”
– Select signal “clicked()”
For following code will be created in mainwindow.cpp
void MainWindow::on_pushButton_clicked()
{
}
Now you can add the notify function between the curly brackets
system("kdialog --title '*le Nayar testing' --passivepopup \"Hahaha, i still don't know how to fetch the text above :P\"");
You can alternatively use libnotify instead of kdialog. libnotify works in both GNOME and KDE.
system("notify-send '*le Nayar testing' \"Hahaha, i still don't know how to fetch the text above :P\"");
Now i need to put some variables instead of hardcoding texts and play with the options provided by kdialog and libnotify 😉
Which program do you use to develop the Qt apps?
Qt creator: http://qt.nokia.com/downloads
For Ubuntu based distros:-
$ sudo apt-get install qtcreator
Thanks! Will try it out if i get the chance or help someone else try it. 🙂