Skip to content

Instantly share code, notes, and snippets.

@ameerkahiri
Created August 2, 2021 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ameerkahiri/cf2a5d0ea8fa0aa436acb52c484d596d to your computer and use it in GitHub Desktop.
Save ameerkahiri/cf2a5d0ea8fa0aa436acb52c484d596d to your computer and use it in GitHub Desktop.
ToDoApps : SlotAddNewTask
void ToDoApps::SlotAddNewTask() {
// Get the line edit text
QString taskName = ui.NewTaskLineEdit->text();
// Get current date
QString date = QDate::currentDate().toString();
createNewTask(taskName, date);
// This is how to trigger signal
//emit SignalAddNewTask(taskName, date);
// Then in other class/widget connect it like
//ToDoApps* obj;
//connect(obj, SIGNAL(SignalAddNewTask(QString, QString)), this, SLOT(SlotToSomethingInThatClass()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment