Helper to generate a keyboard shortcuts reference PDF.
More...
#include <shortcutsreferencegenerator.h>
|
| void | drawSectionTitle (QPdfWriter &writer, QPainter &painter, qreal x1, qreal x2, qreal y, const QString &text) const noexcept |
| |
| void | drawCommandCategory (QPdfWriter &writer, QPainter &painter, qreal x, qreal y, EditorCommandCategory &cat) const noexcept |
| |
| void | drawRow (QPdfWriter &writer, QPainter &painter, qreal x, qreal y, qreal totalWidth, qreal shortcutsWidth, const QString &text, const QString &shortcuts, bool gray) const noexcept |
| |
| int | drawText (QPdfWriter &writer, QPainter &painter, qreal x, qreal y, qreal size, qreal maxLength, const QString &text, Flags flags=Flags()) const noexcept |
| |
| int | mmToPx (QPdfWriter &writer, qreal mm) const noexcept |
| |
Helper to generate a keyboard shortcuts reference PDF.
Dynamically creates a PDF using the configured keyboard shortcuts (via workspace settings) from librepcb::editor::EditorCommandSet.
- Attention
- The exported PDF shall be locale-independent, i.e. always in english to avoid unexpected formatting in other languages!
◆ Flag
| Enumerator |
|---|
| Bold | |
| Italic | |
| AlignCenter | |
| AlignRight | |
◆ ShortcutsReferenceGenerator() [1/3]
◆ ShortcutsReferenceGenerator() [2/3]
◆ ShortcutsReferenceGenerator() [3/3]
◆ ~ShortcutsReferenceGenerator()
◆ generatePdf()
Generate the PDF.
- Parameters
-
| fp | Destination PDF file path. |
- Return values
-
| true | on success. |
| false | If the PDF was generated, but the layout has overflown. |
- Exceptions
-
◆ operator=()
◆ drawSectionTitle()
| void drawSectionTitle |
( |
QPdfWriter & |
writer, |
|
|
QPainter & |
painter, |
|
|
qreal |
x1, |
|
|
qreal |
x2, |
|
|
qreal |
y, |
|
|
const QString & |
text |
|
) |
| const |
|
privatenoexcept |
◆ drawCommandCategory()
| void drawCommandCategory |
( |
QPdfWriter & |
writer, |
|
|
QPainter & |
painter, |
|
|
qreal |
x, |
|
|
qreal |
y, |
|
|
EditorCommandCategory & |
cat |
|
) |
| const |
|
privatenoexcept |
◆ drawRow()
| void drawRow |
( |
QPdfWriter & |
writer, |
|
|
QPainter & |
painter, |
|
|
qreal |
x, |
|
|
qreal |
y, |
|
|
qreal |
totalWidth, |
|
|
qreal |
shortcutsWidth, |
|
|
const QString & |
text, |
|
|
const QString & |
shortcuts, |
|
|
bool |
gray |
|
) |
| const |
|
privatenoexcept |
◆ drawText()
| int drawText |
( |
QPdfWriter & |
writer, |
|
|
QPainter & |
painter, |
|
|
qreal |
x, |
|
|
qreal |
y, |
|
|
qreal |
size, |
|
|
qreal |
maxLength, |
|
|
const QString & |
text, |
|
|
Flags |
flags = Flags() |
|
) |
| const |
|
privatenoexcept |
◆ mmToPx()
| int mmToPx |
( |
QPdfWriter & |
writer, |
|
|
qreal |
mm |
|
) |
| const |
|
privatenoexcept |
◆ mCommands
◆ sPageWidth
| constexpr qreal sPageWidth = 270 |
|
staticconstexprprivate |
◆ sPageHeight
| constexpr qreal sPageHeight = 190 |
|
staticconstexprprivate |
◆ sCategoryTextSize
| constexpr qreal sCategoryTextSize = 3 |
|
staticconstexprprivate |
◆ sRowTextSize
| constexpr qreal sRowTextSize = 2.5 |
|
staticconstexprprivate |
◆ sRowHeight
| constexpr qreal sRowHeight = 3 |
|
staticconstexprprivate |
◆ sCategorySpacing
| constexpr qreal sCategorySpacing = 5 |
|
staticconstexprprivate |
◆ sColumnSpacing
| constexpr qreal sColumnSpacing = 3.5 |
|
staticconstexprprivate |
◆ sColumnWidth
◆ sShortcutsWidth
| constexpr qreal sShortcutsWidth = 28 |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: