Пример #1
0
// update the game text on screen
void ProcessingThread::updateGameText(char inv[]){

    emit clearMsgText();

    if (GameState.table.players.size() < 1) return;

    std::string str;
    tableToString(&GameState, &str, inv);
    QString msg = QString::fromStdString(str);
    msg.toAscii();

    emit newTextMsg(msg);

    return;
}
Пример #2
0
int main(void) {

	HashTable t;

	initHashTable(&t);

	char a1[5] = "X";
	char a2[5] = "xy";
	char a3[5] = "xx";
	char a4[5] = "a";
	char a5[5] = "b";
	char a6[5] = "A";
	char a7[5] = "Z";
	char a8[5] = "inc";
	char a9[5] = "lsj";
	char a10[5] = "sdf";
	char a11[5] = "grx";
	char a12[5] = "yfg";
	char a13[5] = "dsf";
	char a14[5] = "inc"; // notice a variable already exits with this name,
						 // the variable with this name in the list will have the
						 // newest value, i.e. old values are overwritten
	addToHash(&t, a1, 5.0);
	addToHash(&t, a2, 6.0);
	addToHash(&t, a3, 7.0);
	addToHash(&t, a4, 8.0);
	addToHash(&t, a5, 9.0);
	addToHash(&t, a6, 10.0);
	addToHash(&t, a7, 11.0);
	addToHash(&t, a8, 12.0);
	addToHash(&t, a9, 13.0);
	addToHash(&t, a10, 14.0);
	addToHash(&t, a11, 15.0);
	addToHash(&t, a12, 16.0);
	addToHash(&t, a13, 17.0);
	addToHash(&t, a14, 18.0);

	printf("HashTable:\n%s", tableToString(&t));

	return 0;
}
Пример #3
0
QString TableEditor::readModifiedTable()
{
  QString tableString;
  tableString = m_table->toString();
  if (!captionText->text().isEmpty()) {
    tableString += indent(2);
    tableString += "<" + QuantaCommon::tagCase("caption") + ">";
    tableString += captionText->text();
    tableString += "</" + QuantaCommon::tagCase("caption") + ">";
  }
  for (QValueList<Tag*>::Iterator it = m_colTags.begin(); it != m_colTags.end(); ++it) {
    tableString += indent(2);
    tableString += (*it)->toString();
  }
  if (headerCheckBox->isChecked() && headerTableData->numRows() > 0) {
    //insert the <thead> tag
    tableString += indent(2);
    tableString += m_thead->toString();

    kdDebug(24000) << "thead" << endl;
    m_tableTags = m_tableHeaderTags;
    m_tableRows = m_tableHeaderRows;
    m_dataTable = headerTableData;
    tableString += tableToString();
    tableString += indent(2);
    tableString += "</" + QuantaCommon::tagCase(m_thead->name) +">";
  }
  if (footerCheckBox->isChecked() && footerTableData->numRows() > 0) {
    //insert the <tfoot> tag
    tableString += indent(2);
    tableString += m_tfoot->toString();

    kdDebug(24000) << "tfoot" << endl;
    m_tableTags = m_tableFooterTags;
    m_tableRows = m_tableFooterRows;
    m_dataTable = footerTableData;
    tableString += tableToString();
    tableString += indent(2);
    tableString += "</" + QuantaCommon::tagCase(m_tfoot->name) +">";
  }
  //insert the <tbody> tag
  if (!m_tbody)
  {
    m_tbody = new Tag();
    newNum++;
    m_tbody->parse("<tbody>", m_write);
  }
  tableString += indent(2);
  tableString += m_tbody->toString();
  kdDebug(24000) << "tbody" << endl;
  m_tableTags = m_tableDataTags;
  m_tableRows = m_tableDataRows;
  m_dataTable = tableData;
  tableString += tableToString();
  //close the <tbody> and <table> tags
  tableString += indent(2);
  tableString += "</" + QuantaCommon::tagCase(m_tbody->name) +">";
  tableString += "\n";
  tableString += "</" + QuantaCommon::tagCase(m_table->name) + ">";

  //kdDebug(24000) << tableString << endl;
  return tableString;
}