@Spacecoyote said:
We need more real WTFs.
What about this great piece of code I noticed in some open source project to draw to numbers above eachother:
//write the numbers one by one, first, the number of beats QString curBeats = QString::number(timeSignature()->beats()); QString curBeat = QString::number(timeSignature()->beat()); int curX = s.x; while (!curBeats.isEmpty() || !curBeat.isEmpty()) { if (!curBeats.isEmpty()) p->drawText(curX, (int)(s.y + 0.5*drawableContext()->height()*s.z), QString(curBeats[0])) ; if (!curBeat.isEmpty()) p->drawText(curX, (int)(s.y + drawableContext()->height()*s.z), QString(curBeat[0]));curX += (int)(14*s.z + 0.5); curBeats = curBeats.mid(1); //trim-off the left-most character curBeat = curBeat.mid(1); //trim-off the left-most character }