Example #1
0
int launch(void *arg) {
	userArgStruct *uas = (userArgStruct *) arg;
	interruptsOn();
	userMode();
	int rc = uas->func(uas->arg);
	free(uas);
	Sys_Terminate(rc);
	/*Never gets here*/
	return rc;
}
/*
 *函数功能:实时显示当前表格中客户的信息到控件上
*/
void CostomerRegisterInfoDialog::showCustomerInfo()
{
    QSqlQueryModel userMode(ui->tableView);
    QString sql = "SELECT *FROM customer;";
    qDebug() <<sql;
    userMode.setQuery(QString(sql));
    int Row = ui->tableView->currentIndex().row();
    QSqlRecord record = userMode.record(Row);
    ui->CustomerNo->setText(record.value(0).toString());
    ui->CustomerName->setText(record.value(1).toString());
    ui->ledSex->setText(record.value(2).toString());
    ui->CustomerRePwd->setText(record.value(3).toString());
    ui->CustomerPhone->setText(record.value(4).toString());
    ui->CustomerAddress->setText(record.value(5).toString());
    ui->ledCustomDate->setText(record.value(6).toString());
    ui->CustomerRemark->setText(record.value(7).toString());
}
Example #3
0
//this method asks user for the configuration of the simulation, then calls the user mode method
void gameOfLife::userConfig(){ //get user input incase they choose file input option
    
    
    cout<<"What configuration? Random or flat file?"<<endl;
    cin>>configuration;
    
    if(configuration == "random" || configuration == "Random")
    {
        cout<<"How many rows?"<<endl;  //check for correct input...
        cin>>userRow;
        cout<<"How many columns?"<<endl;//check for correct input...
        cin>>userColumn;
        cout<<"How dense should it be?"<<endl;
        cin>>userDensity;
        
        cout<<"Here is your random game board: "<<endl;
        cout<<endl;
        randomArr(userRow, userColumn);
        printArray();
        cout<<endl;
        userMode();
    }