taskinputdialog.cpp
/*
 * getInfo is passed three arguments, all three are pointers
 * getInfo stores the three pointers and will not manipulate contents of memory
 * pointed to by them. Contents of memory locations pointed to by pointers will
 * be manipulated in ::taskAccepted and ::taskRejected
 *
 * Input dialog is executed at end of the ::getInfo
 *
 * Now one of two functions will be executed: 1) ::taskAccepted (user pressed Ok)
 *                                            2) ::taskRejected (pressed cancel)
*/
getInfo is passed three arguments, all three are pointers
getInfo stores the three pointers and will not manipulate contents of memory
pointed to by them. Contents of memory locations pointed to by pointers will
be manipulated in ::taskAccepted and ::taskRejected

Input dialog is executed at end of the ::getInfo


getInfo is passed three arguments all three are pointers getInfo stores the three pointers and will not manipulate contents of memory pointed to by them . Contents of memory locations pointed to by pointers will be manipulated in :: taskAccepted and :: taskRejected Input dialog is executed at end of the :: getInfo
void TaskInputDialog::getInfo(QString *taskText,
                              int *priority,
                              bool *userPressedOk)
{
    TaskInputDialog& inputDialog = TaskInputDialog::getInstance();
    inputDialog.taskText = taskText;
    inputDialog.priority = priority;
    inputDialog.userPressedOk = userPressedOk;
    inputDialog.ui->taskLineEdit->setFocus();
    if (taskText->isEmpty()){
        inputDialog.ui->taskLineEdit->setText("Untitled Task");
    } else {
        inputDialog.ui->taskLineEdit->setText(*taskText);
    }
    if (*priority != -1){
        inputDialog.ui->priorityComboBox->setCurrentIndex(*priority);
    } else {
        inputDialog.ui->priorityComboBox->setCurrentIndex(0);
    }
    inputDialog.exec();
}
void TaskInputDialog :: getInfo ( QString * taskText , int * priority , bool * userPressedOk ) { TaskInputDialog & inputDialog = TaskInputDialog :: getInstance ( ) ; inputDialog . taskText = taskText ; inputDialog . priority = priority ; inputDialog . userPressedOk = userPressedOk ; inputDialog . ui -> taskLineEdit -> setFocus ( ) ; if ( taskText -> isEmpty ( ) ) { inputDialog . ui -> taskLineEdit -> setText ( " " ) ; } else { inputDialog . ui -> taskLineEdit -> setText ( * taskText ) ; } if ( * priority != -1 ) { inputDialog . ui -> priorityComboBox -> setCurrentIndex ( * priority ) ; } else { inputDialog . ui -> priorityComboBox -> setCurrentIndex ( 0 ) ; } inputDialog . exec ( ) ; }
getInfo is passed three arguments, all three are pointers
 getInfo stores the three pointers and will not manipulate contents of memory
 pointed to by them.
getInfo is passed three arguments all three are pointers getInfo stores the three pointers and will not manipulate contents of memory pointed to by them .