rookee
10th December 2015, 14:54
Hello All,
Please take a look at the following code. I have the following 2 questions.
FILE *filename1;
void MainWindow::update1(void)
{
//something
//something
filename1 = fopen(filename.toLocal8Bit(),"a");
//something
}
void MainWindow::on_checkBox_clicked()
{
if(ui->checkBox->isChecked())
{
filename = QFileDialog::getSaveFileName(...)
/*I'm creating a file when the checkBox is checked. When the checkBox is unchecked and checked back again, If the user selects existing file I want to append data
instead of creating a new file. How do I do it?*/
if(!ui->checkBox->isChecked()){
//I want to append empty lines to the file a created above and close it. How can I do that?
Please help. Thanks in advance.
Please take a look at the following code. I have the following 2 questions.
FILE *filename1;
void MainWindow::update1(void)
{
//something
//something
filename1 = fopen(filename.toLocal8Bit(),"a");
//something
}
void MainWindow::on_checkBox_clicked()
{
if(ui->checkBox->isChecked())
{
filename = QFileDialog::getSaveFileName(...)
/*I'm creating a file when the checkBox is checked. When the checkBox is unchecked and checked back again, If the user selects existing file I want to append data
instead of creating a new file. How do I do it?*/
if(!ui->checkBox->isChecked()){
//I want to append empty lines to the file a created above and close it. How can I do that?
Please help. Thanks in advance.