mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-10-25 00:05:24 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			136 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			136 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/gui/qgsrichtexteditor.h                                          *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | |
|  ************************************************************************/
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| class QgsRichTextEditor : QWidget, protected Ui::QgsRichTextEditorBase
 | |
| {
 | |
| %Docstring(signature="appended")
 | |
| A widget for editing rich text documents, with support for user controlled formatting of text
 | |
| and insertion of hyperlinks and images.
 | |
| 
 | |
| :py:class:`QgsRichTextEditor` provides a reusable widget for allowing users to edit rich text documents,
 | |
| and retrieving and setting the documents via HTML formatted strings.
 | |
| 
 | |
| .. versionadded:: 3.20
 | |
| %End
 | |
| 
 | |
| %TypeHeaderCode
 | |
| #include "qgsrichtexteditor.h"
 | |
| %End
 | |
|   public:
 | |
|     enum class Mode
 | |
|     {
 | |
|       QTextDocument,
 | |
|       QgsTextRenderer,
 | |
|       PlainText,
 | |
|     };
 | |
| 
 | |
|     QgsRichTextEditor( QWidget *parent = 0 );
 | |
| %Docstring
 | |
| Constructor for QgsRichTextEditor, with the specified ``parent`` widget.
 | |
| %End
 | |
| 
 | |
|     Mode mode() const;
 | |
| %Docstring
 | |
| Returns the widget's mode, which defines which formatting options are exposed in the widget.
 | |
| 
 | |
| .. seealso:: :py:func:`setMode`
 | |
| 
 | |
| .. versionadded:: 3.40
 | |
| %End
 | |
| 
 | |
|     void setMode( Mode mode );
 | |
| %Docstring
 | |
| Sets the widget's ``mode``, which defines which formatting options are exposed in the widget.
 | |
| 
 | |
| .. seealso:: :py:func:`mode`
 | |
| 
 | |
| .. versionadded:: 3.40
 | |
| %End
 | |
| 
 | |
|     QString toPlainText() const;
 | |
| %Docstring
 | |
| Returns the widget's content as a plain text string.
 | |
| 
 | |
| .. seealso:: :py:func:`toHtml`
 | |
| %End
 | |
| 
 | |
|     QString toHtml() const;
 | |
| %Docstring
 | |
| Returns the widget's content as a HTML string.
 | |
| 
 | |
| .. seealso:: :py:func:`toPlainText`
 | |
| %End
 | |
| 
 | |
|     QTextEdit *textEdit();
 | |
| %Docstring
 | |
| Returns the widget's QTextEditor control.
 | |
| 
 | |
| .. versionadded:: 3.40
 | |
| %End
 | |
| 
 | |
|     QTextDocument *document();
 | |
| %Docstring
 | |
| Returns a reference to the QTextDocument shown in the widget.
 | |
| %End
 | |
| 
 | |
|     QTextCursor textCursor() const;
 | |
| %Docstring
 | |
| Returns a reference to the text cursor.
 | |
| 
 | |
| .. seealso:: :py:func:`setTextCursor`
 | |
| %End
 | |
| 
 | |
|     void setTextCursor( const QTextCursor &cursor );
 | |
| %Docstring
 | |
| Sets the current text ``cursor``.
 | |
| 
 | |
| .. seealso:: :py:func:`textCursor`
 | |
| %End
 | |
| 
 | |
|   public slots:
 | |
| 
 | |
|     void setText( const QString &text );
 | |
| %Docstring
 | |
| Sets the ``text`` to show in the widget.
 | |
| 
 | |
| The ``text`` can either be a plain text string or a HTML document.
 | |
| %End
 | |
| 
 | |
|     void clearSource();
 | |
| %Docstring
 | |
| Clears the current text from the widget.
 | |
| %End
 | |
| 
 | |
|   signals:
 | |
| 
 | |
|     void textChanged();
 | |
| %Docstring
 | |
| Emitted when the text contents are changed.
 | |
| 
 | |
| .. versionadded:: 3.26
 | |
| %End
 | |
| 
 | |
|   protected:
 | |
|     virtual void focusInEvent( QFocusEvent *event );
 | |
| 
 | |
| 
 | |
| };
 | |
| 
 | |
| 
 | |
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/gui/qgsrichtexteditor.h                                          *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | |
|  ************************************************************************/
 |