Es geht darum:
Ich brauche den QPoint oder Vergleichbares von dem Textcursor (das blinkende Ding
Jedoch finde ich keinerlei Information zu QTextCursor, obwohl mein Objekt (QTextEdit) die Funktion
Code: Alles auswählen
QTextCursor * textCursor () constDer Sinn des Ganzen ist es, eine QListBox zu öffnen an der Stelle des Cursors.
Momentan kann ich leider nur die PixelPosition eines Paragraphen ermitteln, was aber nicht reicht... da die Box immer am Anfang (x) aufgeht.
Code: Alles auswählen
//CodeEditor ist ein QTextEdit
//completion ist die QListBox
void CodeEditor::fillList()
{
int a,b;
getCursorPosition(&a,&b);
QTextCursor ahhhhhh = this->textCursor();
QRect paraGeo = paragraphRect(a);
int x1,y1,x2,y2;
paraGeo.coords(&x1,&y1,&x2,&y2);
completion->setGeometry(x1,(y2-y1)+2,100,100);
completion->show();
}