NoRefer
3rd March 2015, 12:21
Hello everybody,
I'm new to QT and coding. What I want to do is a program that "plans a party" (after Rich Gold), where the people walk into the right distances from each other. Those people will get displayed by the first letter of their name (for example: A like Andrew). All other spaces of my grid should be '.'s ^^ I want the grid to be 60*20, so it would look for example like this:
.................................................. .......... //x = 60
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
//y = 20
And the final program would look for example like this:
...........A..........................T........... .......... //x = 60
................C................................. ..........
.................................................. ..........
........................................VW........ ..........
......................D........................... ..........
.....B............................................ .........
.................................................. ..........
.................................................. ..........
//y = 20
Edit: What I did already is creating this:
QChar grid[20][60];
QString tempi ="";
for (int i=0; i<20; i++)
{
for (int j=0; j<60; j++)
{
grid[i][j]='.';
tempi += grid[i][j];
txt->setPlainText(tempi);
}
}
This way I'm getting all my points displayed. Whoever I still need to add line breaks. After that I need to find a way to change some "coordinates", whoever I already got an idea for that. So the question is, how do I get line breaks into this? :)
I'm new to QT and coding. What I want to do is a program that "plans a party" (after Rich Gold), where the people walk into the right distances from each other. Those people will get displayed by the first letter of their name (for example: A like Andrew). All other spaces of my grid should be '.'s ^^ I want the grid to be 60*20, so it would look for example like this:
.................................................. .......... //x = 60
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
.................................................. ..........
//y = 20
And the final program would look for example like this:
...........A..........................T........... .......... //x = 60
................C................................. ..........
.................................................. ..........
........................................VW........ ..........
......................D........................... ..........
.....B............................................ .........
.................................................. ..........
.................................................. ..........
//y = 20
Edit: What I did already is creating this:
QChar grid[20][60];
QString tempi ="";
for (int i=0; i<20; i++)
{
for (int j=0; j<60; j++)
{
grid[i][j]='.';
tempi += grid[i][j];
txt->setPlainText(tempi);
}
}
This way I'm getting all my points displayed. Whoever I still need to add line breaks. After that I need to find a way to change some "coordinates", whoever I already got an idea for that. So the question is, how do I get line breaks into this? :)