void OutputTableBase::openFile(QString appendix) { QString fileNameApp = insertAppendix(fileName, appendix); QString useFileName = (runNumber() == 1 || hasSummary()) ? fileNameApp : insertNumber(fileNameApp, runNumber()); QString path = FileLocations::location(FileLocationInfo::Output).absolutePath(); QString filePath = path + "/" + useFileName; outputFilePaths << filePath; file.setFileName(filePath); if (!file.open(QIODevice::Text | QIODevice::WriteOnly)) throw Exception("Could not open output file to write table:\n'" + filePath + "'"); // If more than one file then give the first file a number too if (runNumber() == 2 && !hasSummary()) { QString filePath = path + "/" + fileNameApp; QFile prevFile(filePath); QString newName = path + "/" + insertNumber(fileNameApp, 1); outputFilePaths[0] = newName; // Delete any existing file named newName QFile toDelete(newName); toDelete.remove(); prevFile.rename(newName); } }
void LineEdit::backspace() { QLineEdit::backspace(); if(text().isEmpty()) clearSlot(); insertNumber(Number::toNumber(text())); }
void test_single_linked_list() { LinkedList *list = createLinkedList(); printf("Starting size of the list: %d\n", sizeOfList(list)); insertNumber(5, list); printf("Inserting number into list, new size: %d\n", sizeOfList(list)); removeAll(list); free(list); }
void Game::compose() { for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (grid[i * 9 + j] == 0) { insertNumber(i, j); } } } }
void LineEdit::pasteSlot() { QClipboard *cl = qApp->clipboard(); insertNumber(Number::toNumber(cl->text())); }