... if(file.open(QIODevice::WriteOnly)) { QBrush BrushBlack = QBrush(Qt::black, Qt::SolidPattern); QDataStream sfile(&file); QChar sdata; ushort idata; if(State == false) sfile << strPassword; sfile << TableCrosswordEdit->rowCount(); sfile << TableCrosswordEdit->columnCount(); sfile << TableCrosswordEdit->rowHeight(0); sfile << TableCrosswordEdit->font(); for(int i = 0; i < TableCrosswordEdit->rowCount(); i++) for(int j = 0; j < TableCrosswordEdit->columnCount(); j++) { if(TableCrosswordEdit->item(i,j)->background() == BrushBlack) { sdata = 'b'; idata = sdata.unicode() + 1; sfile << idata; } else { sdata = 'w'; idata = sdata.unicode() + 1; sfile << idata; } sdata = 0; } if(State == false) CrosswordToData(2); if(State == false) sfile << CrosswordData; file.close(); if(State == false) SaveStateCross = true; else SaveStateTemplate = true; } ...
... for(int i = 0; i < ListWord.count(); i++) { CrosswordData.append(QChar('W')); CrosswordData.append(QChar(ushort(i))); CurrentString.clear(); CurrentString.append(ListWord.at(i)); CrosswordData.append(QChar(ushort(CurrentString.length()))); CrosswordData.append(ListWord.at(i)); } for(int i = 0; i < ListQuestions->count(); i++) { CrosswordData.append(QChar('Q')); CrosswordData.append(QChar(ushort(i))); CrosswordData.append(QChar(ushort(ListQuestions->item(i)->text().length()))); CrosswordData.append(ListQuestions->item(i)->text()); } ...