QtiPlot  0.9.8.2
Public Types | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TextFormatButtons Class Reference

Widget with text format buttons (connected to a QTextEdit) More...

#include <TextFormatButtons.h>

Inheritance diagram for TextFormatButtons:

Public Types

enum  Buttons {
  Plot3D, AxisLabel, Legend, Equation,
  TexLegend
}
 

Public Member Functions

void setButtons (Buttons btns)
 
 TextFormatButtons (QTextEdit *textEdit, Buttons buttons=Plot3D, QWidget *parent=0)
 Constructor. More...
 

Private Slots

void addBold ()
 Format seleted text to bold. More...
 
void addCurve ()
 Insert curve marker into the text. More...
 
void addFraction ()
 Format seleted text to fraction. More...
 
void addItalics ()
 Format seleted text to italics. More...
 
void addSquareRoot ()
 Format seleted text to square root. More...
 
void addSubscript ()
 Format seleted text to subscript. More...
 
void addSuperscript ()
 Format seleted text to superscript. More...
 
void addSymbol (const QString &letter)
 Insert 'letter' into the text. More...
 
void addUnderline ()
 Format seleted text to underlined. More...
 
void showArrowSymbols ()
 Let the user insert arrow symbols. More...
 
void showLowerGreek ()
 Let the user insert lower case greek letters. More...
 
void showMathSymbols ()
 Let the user insert mathematical symbols. More...
 
void showUpperGreek ()
 Let the user insert capital greek letters. More...
 

Private Member Functions

void formatText (const QString &prefix, const QString &postfix)
 Internal function: format selected text with prefix and postfix. More...
 
void init (Buttons btns)
 

Private Attributes

QTextEdit * connectedTextEdit
 
Buttons d_buttons
 

Detailed Description

Widget with text format buttons (connected to a QTextEdit)

Member Enumeration Documentation

§ Buttons

Enumerator
Plot3D 
AxisLabel 
Legend 
Equation 
TexLegend 

Constructor & Destructor Documentation

§ TextFormatButtons()

TextFormatButtons::TextFormatButtons ( QTextEdit *  textEdit,
Buttons  buttons = Plot3D,
QWidget *  parent = 0 
)

Constructor.

Parameters
textEditthe QTextEdit that the buttons shall affect
parentparent widget

References init().

Member Function Documentation

§ addBold

void TextFormatButtons::addBold ( )
privateslot

Format seleted text to bold.

References formatText().

Referenced by init().

§ addCurve

void TextFormatButtons::addCurve ( )
privateslot

Insert curve marker into the text.

References formatText().

Referenced by init().

§ addFraction

void TextFormatButtons::addFraction ( )
privateslot

Format seleted text to fraction.

References d_buttons, Equation, formatText(), and TexLegend.

Referenced by init().

§ addItalics

void TextFormatButtons::addItalics ( )
privateslot

Format seleted text to italics.

References formatText().

Referenced by init().

§ addSquareRoot

void TextFormatButtons::addSquareRoot ( )
privateslot

Format seleted text to square root.

References d_buttons, Equation, formatText(), and TexLegend.

Referenced by init().

§ addSubscript

void TextFormatButtons::addSubscript ( )
privateslot

Format seleted text to subscript.

References d_buttons, Equation, formatText(), Plot3D, and TexLegend.

Referenced by init().

§ addSuperscript

void TextFormatButtons::addSuperscript ( )
privateslot

Format seleted text to superscript.

References d_buttons, Equation, formatText(), Plot3D, and TexLegend.

Referenced by init().

§ addSymbol

void TextFormatButtons::addSymbol ( const QString &  letter)
privateslot

Insert 'letter' into the text.

References connectedTextEdit, d_buttons, Equation, and TexLegend.

Referenced by showArrowSymbols(), showLowerGreek(), showMathSymbols(), and showUpperGreek().

§ addUnderline

void TextFormatButtons::addUnderline ( )
privateslot

Format seleted text to underlined.

References formatText().

Referenced by init().

§ formatText()

void TextFormatButtons::formatText ( const QString &  prefix,
const QString &  postfix 
)
private

Internal function: format selected text with prefix and postfix.

References connectedTextEdit.

Referenced by addBold(), addCurve(), addFraction(), addItalics(), addSquareRoot(), addSubscript(), addSuperscript(), and addUnderline().

§ init()

void TextFormatButtons::init ( Buttons  btns)
private

§ setButtons()

void TextFormatButtons::setButtons ( Buttons  btns)

References d_buttons, and init().

Referenced by EnrichmentDialog::updateButtons().

§ showArrowSymbols

void TextFormatButtons::showArrowSymbols ( )
privateslot

Let the user insert arrow symbols.

References addSymbol(), SymbolDialog::arrowSymbols, connectedTextEdit, d_buttons, Equation, SymbolDialog::latexArrowSymbols, and TexLegend.

Referenced by init().

§ showLowerGreek

void TextFormatButtons::showLowerGreek ( )
privateslot

Let the user insert lower case greek letters.

References addSymbol(), connectedTextEdit, and SymbolDialog::lowerGreek.

Referenced by init().

§ showMathSymbols

void TextFormatButtons::showMathSymbols ( )
privateslot

Let the user insert mathematical symbols.

References addSymbol(), connectedTextEdit, d_buttons, Equation, SymbolDialog::latexMathSymbols, SymbolDialog::mathSymbols, and TexLegend.

Referenced by init().

§ showUpperGreek

void TextFormatButtons::showUpperGreek ( )
privateslot

Let the user insert capital greek letters.

References addSymbol(), connectedTextEdit, and SymbolDialog::upperGreek.

Referenced by init().

Member Data Documentation

§ connectedTextEdit

QTextEdit* TextFormatButtons::connectedTextEdit
private

§ d_buttons

Buttons TextFormatButtons::d_buttons
private

The documentation for this class was generated from the following files: