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

enum TextFormatButtons::Buttons

Enumerator
Plot3D |
AxisLabel |
Legend |
Equation |
TexLegend |

## Constructor & Destructor Documentation

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

Constructor.

Parameters

  textEdit | the QTextEdit that the buttons shall affect
  parent | parent widget

References init().

## Member Function Documentation

void TextFormatButtons::addBold | ( |  | ) |

private slot

Format seleted text to bold.

References formatText().

Referenced by init().

void TextFormatButtons::addCurve | ( |  | ) |

private slot

Insert curve marker into the text.

References formatText().

Referenced by init().

void TextFormatButtons::addFraction | ( |  | ) |

private slot

Format seleted text to fraction.

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

Referenced by init().

void TextFormatButtons::addItalics | ( |  | ) |

private slot

Format seleted text to italics.

References formatText().

Referenced by init().

void TextFormatButtons::addSquareRoot | ( |  | ) |

private slot

Format seleted text to square root.

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

Referenced by init().

void TextFormatButtons::addSubscript | ( |  | ) |

private slot

Format seleted text to subscript.

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

Referenced by init().

void TextFormatButtons::addSuperscript | ( |  | ) |

private slot

Format seleted text to superscript.

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

Referenced by init().

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

private slot

Insert 'letter' into the text.

References connectedTextEdit, d_buttons, Equation, and TexLegend.

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

void TextFormatButtons::addUnderline | ( |  | ) |

private slot

Format seleted text to underlined.

References formatText().

Referenced by init().

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().

void TextFormatButtons::init | ( | Buttons | btns | ) |

private

References addBold(), addCurve(), addFraction(), addItalics(), addSquareRoot(), addSubscript(), addSuperscript(), addUnderline(), Equation, Legend, Plot3D, showArrowSymbols(), showLowerGreek(), showMathSymbols(), showUpperGreek(), and TexLegend.

Referenced by setButtons(), and TextFormatButtons().

void TextFormatButtons::setButtons | ( | Buttons | btns | ) |

References d_buttons, and init().

Referenced by EnrichmentDialog::updateButtons().

void TextFormatButtons::showArrowSymbols | ( |  | ) |

private slot

Let the user insert arrow symbols.

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

Referenced by init().

void TextFormatButtons::showLowerGreek | ( |  | ) |

private slot

Let the user insert lower case greek letters.

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

Referenced by init().

void TextFormatButtons::showMathSymbols | ( |  | ) |

private slot

Let the user insert mathematical symbols.

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

Referenced by init().

void TextFormatButtons::showUpperGreek | ( |  | ) |

private slot

Let the user insert capital greek letters.

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

Referenced by init().

## Member Data Documentation

QTextEdit* TextFormatButtons::connectedTextEdit

private

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

Buttons TextFormatButtons::d_buttons

private

Referenced by addFraction(), addSquareRoot(), addSubscript(), addSuperscript(), addSymbol(), setButtons(), showArrowSymbols(), and showMathSymbols().

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

- qtiplot/src/lib/include/TextFormatButtons.h
- qtiplot/src/lib/src/TextFormatButtons.cpp