Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Q3MultiLineEdit Class Reference

The Q3MultiLineEdit widget is a simple editor for inputting text. More...

 #include <Q3MultiLineEdit>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Inherits: Q3TextEdit.

Properties

Public Functions

Q3MultiLineEdit ( QWidget * parent = 0, const char * name = 0 )
~Q3MultiLineEdit ()
Qt::Alignment alignment () const
bool atBeginning () const
bool atEnd () const
bool autoUpdate () const
void cursorWordBackward ( bool mark )
void cursorWordForward ( bool mark )
bool edited () const
bool hasMarkedText () const
virtual void insertAt ( const QString & s, int line, int col, bool mark )
virtual void insertLine ( const QString & txt, int line = -1 )
QString markedText () const
int maxLines () const
int numLines () const
virtual void removeLine ( int paragraph )
void setAlignment ( Qt::Alignment flags )
virtual void setCursorPosition ( int line, int col, bool mark )
void setEdited ( bool )
void setMaxLines ( int max )
QString textLine ( int line ) const
int totalHeight () const
int totalWidth () const

Reimplemented Public Functions

virtual void insertAt ( const QString & s, int line, int col )
virtual void setCursorPosition ( int line, int col )
  • 53 public functions inherited from Q3TextEdit
  • 49 public functions inherited from Q3ScrollView
  • 4 public functions inherited from Q3Frame
  • 14 public functions inherited from QFrame
  • 217 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 13 public functions inherited from QPaintDevice

Public Slots

void deselect ()

Protected Functions

virtual void backspace ()
virtual void cursorDown ( bool mark = false )
virtual void cursorLeft ( bool mark = false, bool wrap = true )
QPoint cursorPoint () const
virtual void cursorRight ( bool mark = false, bool wrap = true )
virtual void cursorUp ( bool mark = false )
virtual void end ( bool mark = false )
bool getMarkedRegion ( int * line1, int * col1, int * line2, int * col2 ) const
virtual void home ( bool mark = false )
virtual void insertAndMark ( const QString & str, bool mark )
virtual void killLine ()
int lineLength ( int row ) const
virtual void newLine ()
virtual void pageDown ( bool mark = false )
virtual void pageUp ( bool mark = false )
  • 22 protected functions inherited from Q3TextEdit
  • 26 protected functions inherited from Q3ScrollView
  • 5 protected functions inherited from Q3Frame
  • 3 protected functions inherited from QFrame
  • 37 protected functions inherited from QWidget
  • 7 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice

Additional Inherited Members

Detailed Description

The Q3MultiLineEdit widget is a simple editor for inputting text.

The Q3MultiLineEdit was a simple editor widget in former Qt versions. Qt 3.0 includes a new richtext engine which obsoletes Q3MultiLineEdit. It is still included for compatibility reasons. It is now a subclass of Q3TextEdit, and provides enough of the old Q3MultiLineEdit API to keep old applications working.

If you implement something new with Q3MultiLineEdit, we suggest using Q3TextEdit instead and call Q3TextEdit::setTextFormat(Qt::PlainText).

Although most of the old Q3MultiLineEdit API is still available, there is a few difference. The old Q3MultiLineEdit operated on lines, not on paragraphs. As lines change all the time during wordwrap, the new richtext engine uses paragraphs as basic elements in the data structure. All functions (numLines(), textLine(), etc.) that operated on lines, now operate on paragraphs. Further, getString() has been removed completely. It revealed too much of the internal data structure.

Applications which made normal and reasonable use of Q3MultiLineEdit should still work without problems. Some odd usage will require some porting. In these cases, it may be better to use Q3TextEdit now.

See also Q3TextEdit.

Property Documentation

alignment : Qt::Alignment

This property holds the editor's paragraph alignment.

Sets the alignment to flag, which must be Qt::AlignLeft, Qt::AlignHCenter, or Qt::AlignRight.

If flag is an illegal flag, nothing happens.

Access functions:

Qt::Alignment alignment () const
void setAlignment ( Qt::Alignment flags )

atBeginning : const bool

This property holds whether the cursor is placed at the beginning of the text.

Access functions:

bool atBeginning () const

See also atEnd.

atEnd : const bool

This property holds whether the cursor is placed at the end of the text.

Access functions:

bool atEnd () const

See also atBeginning.

edited : bool

This property holds whether the document has been edited by the user.

This is the same as Q3TextEdit's "modifed" property.

Access functions:

bool edited () const
void setEdited ( bool )

numLines : const int

This property holds the number of paragraphs in the editor.

The count includes any empty paragraph at top and bottom, so for an empty editor this method returns 1.

Access functions:

int numLines () const

Member Function Documentation

Q3MultiLineEdit::Q3MultiLineEdit ( QWidget * parent = 0, const char * name = 0 )

Constructs a new, empty, Q3MultiLineEdit with parent parent called name.

Q3MultiLineEdit::~Q3MultiLineEdit ()

Destructor.

bool Q3MultiLineEdit::autoUpdate () const

This function is a noop that always returns true.

void Q3MultiLineEdit::backspace () [virtual protected]

Deletes the character on the left side of the text cursor and moves the cursor one position to the left. If a text has been selected by the user (e.g. by clicking and dragging) the cursor is put at the beginning of the selected text and the selected text is removed.

del()

void Q3MultiLineEdit::cursorDown ( bool mark = false ) [virtual protected]

Moves the cursor one line down. If mark is true, the text is selected.

See also cursorUp(), cursorLeft(), and cursorRight().

void Q3MultiLineEdit::cursorLeft ( bool mark = false, bool wrap = true ) [virtual protected]

Moves the cursor one character to the left. If mark is true, the text is selected. The wrap parameter is currently ignored.

See also cursorRight(), cursorUp(), and cursorDown().

QPoint Q3MultiLineEdit::cursorPoint () const [protected]

Returns the top center point where the cursor is drawn.

void Q3MultiLineEdit::cursorRight ( bool mark = false, bool wrap = true ) [virtual protected]

Moves the cursor one character to the right. If mark is true, the text is selected. The wrap parameter is currently ignored.

See also cursorLeft(), cursorUp(), and cursorDown().

void Q3MultiLineEdit::cursorUp ( bool mark = false ) [virtual protected]

Moves the cursor up one line. If mark is true, the text is selected.

See also cursorDown(), cursorLeft(), and cursorRight().

void Q3MultiLineEdit::cursorWordBackward ( bool mark )

Moves the cursor one word to the left. If mark is true, the text is selected.

See also cursorWordForward().

void Q3MultiLineEdit::cursorWordForward ( bool mark )

Moves the cursor one word to the right. If mark is true, the text is selected.

See also cursorWordBackward().

void Q3MultiLineEdit::deselect () [slot]

void Q3MultiLineEdit::end ( bool mark = false ) [virtual protected]

Moves the text cursor to the right end of the line. If mark is true, text is selected toward the last position. If it is false and the cursor is moved, all selected text is unselected.

See also home().

bool Q3MultiLineEdit::getMarkedRegion ( int * line1, int * col1, int * line2, int * col2 ) const [protected]

If there is selected text, sets line1, col1, line2 and col2 to the start and end of the selected region and returns true. Returns false if there is no selected text.

bool Q3MultiLineEdit::hasMarkedText () const

Returns true if there is selected text.

void Q3MultiLineEdit::home ( bool mark = false ) [virtual protected]

Moves the text cursor to the left end of the line. If mark is true, text is selected toward the first position. If it is false and the cursor is moved, all selected text is unselected.

See also end().

void Q3MultiLineEdit::insertAndMark ( const QString & str, bool mark ) [virtual protected]

Inserts str at the current cursor position and selects the text if mark is true.

void Q3MultiLineEdit::insertAt ( const QString & s, int line, int col ) [virtual]

Reimplemented from Q3TextEdit::insertAt().

void Q3MultiLineEdit::insertAt ( const QString & s, int line, int col, bool mark ) [virtual]

Inserts string s at paragraph number line, after character number col in the paragraph. If s contains newline characters, new lines are inserted. If mark is true the inserted string will be selected.

The cursor position is adjusted.

void Q3MultiLineEdit::insertLine ( const QString & txt, int line = -1 ) [virtual]

Inserts txt at paragraph number line. If line is less than zero, or larger than the number of paragraphs, the new text is put at the end. If txt contains newline characters, several paragraphs are inserted.

The cursor position is not changed.

void Q3MultiLineEdit::killLine () [virtual protected]

Deletes text from the current cursor position to the end of the line. (Note that this function still operates on lines, not paragraphs.)

int Q3MultiLineEdit::lineLength ( int row ) const [protected]

Returns the number of characters at paragraph number row. If row is out of range, -1 is returned.

QString Q3MultiLineEdit::markedText () const

Returns a copy of the selected text.

int Q3MultiLineEdit::maxLines () const

See also setMaxLines().

void Q3MultiLineEdit::newLine () [virtual protected]

Splits the paragraph at the current cursor position.

void Q3MultiLineEdit::pageDown ( bool mark = false ) [virtual protected]

Moves the cursor one page down. If mark is true, the text is selected.

void Q3MultiLineEdit::pageUp ( bool mark = false ) [virtual protected]

Moves the cursor one page up. If mark is true, the text is selected.

void Q3MultiLineEdit::removeLine ( int paragraph ) [virtual]

Deletes the paragraph at paragraph number paragraph. If paragraph is less than zero or larger than the number of paragraphs, nothing is deleted.

void Q3MultiLineEdit::setCursorPosition ( int line, int col ) [virtual]

Reimplemented from Q3TextEdit::setCursorPosition().

void Q3MultiLineEdit::setCursorPosition ( int line, int col, bool mark ) [virtual]

Sets the cursor position to character number col in paragraph number line. The parameters are adjusted to lie within the legal range.

If mark is false, the selection is cleared. otherwise it is extended.

void Q3MultiLineEdit::setMaxLines ( int max )

Sets the maximum number of lines this Q3MultiLineEdit will hold to max.

See also maxLines().

QString Q3MultiLineEdit::textLine ( int line ) const

Returns the text at line number line (possibly the empty string), or a null if line is invalid.

int Q3MultiLineEdit::totalHeight () const

int Q3MultiLineEdit::totalWidth () const

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 103
  2. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 56
  3. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 90
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 31
  5. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 11
Page suivante
  1. Linus Torvalds : le "C++ est un langage horrible", en justifiant le choix du C pour le système de gestion de version Git 100
  2. Comment prendre en compte l'utilisateur dans vos applications ? Pour un développeur, « 90 % des utilisateurs sont des idiots » 231
  3. Quel est LE livre que tout développeur doit lire absolument ? Celui qui vous a le plus marqué et inspiré 96
  4. Apple cède et s'engage à payer des droits à Nokia, le conflit des brevets entre les deux firmes s'achève 158
  5. Nokia porte à nouveau plainte contre Apple pour violation de sept nouveaux brevets 158
  6. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 103
  7. Quel est le code dont vous êtes le plus fier ? Pourquoi l'avez-vous écrit ? Et pourquoi vous a-t-il donné autant de satisfaction ? 83
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.7-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web