Salut,
je travaille avec qt3, j'ai un QTextEdit ayant comme textformat "Qt:: PlainText"; ce QTextEdit sert à afficher et saisir du code html .
je voudrais faire une fonction d'indentation automatique.
Merci de m'aider.
Salut,
je travaille avec qt3, j'ai un QTextEdit ayant comme textformat "Qt:: PlainText"; ce QTextEdit sert à afficher et saisir du code html .
je voudrais faire une fonction d'indentation automatique.
Merci de m'aider.
Salut, là tu demandes pas de t'aider sur un problème, c'est carrément sur le projet on dirait.
Qu'est-ce que tu appelles indentation automatique ? Pour fonctionner avec des caractères spéciaux ( "{" "}" )
Est-ce que tu veux mettre des mots clés genre for, while, if, else ... auquel cas, il faudrait connaître l'emplacement (colonne) du début de chacun de ces mots, et signaler qu'au prochain retour à la ligne il faut se décaler.
Un peu plus de précisions seraient les bienvenues.
Tu devrais regarder QScintilla, il me semble que ce que tu cherche à faire est déjà fait
Tu sais vraiment tout toi !
J'ai regardé un peu :
Documentation de scintillaScintilla can be set to treat tab and backspace in the white space at the start of a line in a special way: inserting a tab indents the line to the next indent position rather than just inserting a tab at the current character position and backspace unindents the line rather than deleting a character. Scintilla can also display indentation guides (vertical lines) to help you to generate code.
Partager