Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Wiki Markup
{alias:qtextedit}
h2. Name

*qtextedit* — multiline text editor

h2. Syntax
{panel:|borderStyle=solid|borderWidth=1|bgColor=#FFFFAA}

*qtextedit*

{panel}

h2. Description

The *qtextedit* command creates a QTextEdit object. This is a multiline text editor in which the user may edit text interactively or programmatically. To set the contents of the editor use the [qsettext] command. To append text use [qappend]. To retrieve the text use [qtext]. The editor contents may be cleared using [qclear]. 

h2. Arguments

None 

h2. Examples

h3. Ex.1: QTextEdit
{anchor:QTextEdit}

{noformat:|borderWidth=1|bgColor=#eeeeee}

Name

qtextedit — multiline text editor

Syntax

Panel
bgColor#FFFFAA
borderWidth1
borderStylesolid

qtextedit

Description

The qtextedit command creates a QTextEdit object. This is a multiline text editor in which the user may edit text interactively or programmatically. To set the contents of the editor use the qsettext command. To append text use qappend. To retrieve the text use qtext. The editor contents may be cleared using qclear.

Arguments

None

Examples

Ex.1: QTextEdit

Anchor
QTextEdit
QTextEdit

No Format
bgColor#eeeeee
borderWidth1
# Create toplevel window 
set w [qwidget ]
qsetwindowtitle QTextEdit

# Create editor and insert/retrieve text
qvboxlayout {
	set editor [qtextedit]
	qsettext $editor "Hello World"
	qappend $editor "Appending text is easy"

	# Get text and assign to Tcl variable
	set text [qtext $editor]
	puts $text
}

qshow $w

{noformat}

!att:_img_cmd^qtextedit.png!

Example +QTextEdit+ shows a QTextEdit with text added using the [qsettext] and [qappend] commands. 

h3. 

Image Added

Example QTextEdit shows a QTextEdit with text added using the qsettext and qappend commands.

Ex.2:

...

Editor

...

with

...

clear

...

button

...

Anchor
Editor with clear button
Editor with clear button

No Format
bgColor#eeeeee
borderWidth1
set w [qwidget]
qsetwindowtitle "Editor"
qvboxlayout {
     set editor [qtextedit]
     qpushbutton Clear "qclear $editor"
}
qshow $w

{noformat}

!att:_img_cmd^qtextedit_clear.png!

Example +Editor with clear button+ illustrates use of the [qclear] command. Pressing the *Clear* button will clear the textual contents of the editor. 

{pagebreak}

Image Added

Example Editor with clear button illustrates use of the qclear command. Pressing the Clear button will clear the textual contents of the editor.