![]() |
Mapper
0.9.0
API documentation
|
A collection of GUI utility functions. More...
Namespaces | |
Headline | |
Marker | |
SpacerItem | |
SpinBox | |
TristateCheckbox | |
Classes | |
struct | InputProperties |
Provides information about the properties of Mapper types for the purpose of customizing input widgets. More... | |
struct | InputProperties< MapCoordF > |
Provides information about the properties of MapCoordF for the purpose of customizing input widgets. More... | |
struct | InputProperties< RealMeters > |
Provides information about the type double representing real meters for the purpose of customizing input widgets. More... | |
struct | InputProperties< RotationalDegrees > |
Provides information about the type double representing a rotation angle for the purpose of customizing input widgets. More... | |
struct | RealMeters |
Identifies the type double representing real meters. More... | |
struct | RotationalDegrees |
Identifies the type double representing a rotation angle in degrees. More... | |
Functions | |
void | showHelp (QWidget *dialog_parent, const char *filename_latin1, const char *anchor_latin1) |
Show the manual in Qt assistant. More... | |
void | showHelp (QWidget *dialog_parent, const char *file_and_anchor_latin1="index.html") |
Show the manual in Qt assistant. More... | |
void | showHelp (QWidget *dialog_parent, const QString &file_and_anchor) |
Show the manual in Qt assistant. More... | |
QString | makeWhatThis (const char *reference_latin1) |
Creates a What's-this text "See more" linking to the given page and fragment in the manual. More... | |
QString | plainText (QString maybe_markup) |
Remove any HTML markup from the input text. More... | |
qreal | mmToPixelPhysical (qreal millimeters) |
Converts millimeters to pixels using the physical dpi setting of Mapper's settings. More... | |
qreal | pixelToMMPhysical (qreal pixels) |
Inverse of mmToPixelPhysical(). More... | |
qreal | mmToPixelLogical (qreal millimeters) |
Converts millimeters to pixels using the "logical" dpi setting of the operating system. More... | |
qreal | pixelToMMLogical (qreal pixels) |
Inverse of mmToPixelLogical(). More... | |
bool | isAntialiasingRequired () |
Returns true for low-dpi screens, false for high-dpi screens. More... | |
bool | isAntialiasingRequired (qreal ppi) |
Returns true for low-dpi screens, false for high-dpi screens. More... | |
const char * | codepageForLanguage (const QString &language_name) |
Determines the name of the 8-bit legacy codepage for a language. More... | |
QTextCodec * | codecForName (const char *name) |
Determines the codec for a given name. More... | |
void | hatchingOperation (const QRectF &extent, double spacing, double offset, double rotation, std::function< void(const QPointF &, const QPointF &)> &process_line) |
Generates a pattern of parallel lines inside the box given by extent. More... | |
void | gridOperation (const QRectF &extent, double horz_spacing, double vert_spacing, double horz_offset, double vert_offset, double rotation, std::function< void(const QPointF &, const QPointF &)> &process_line) |
Generates a grid of lines inside the given box. More... | |
bool | pointsFormCorner (const MapCoord &point1, const MapCoord &anchor_point, const MapCoord &point2, qreal quantum_size) |
Tests whether three points form what we would call a corner. More... | |
A collection of GUI utility functions.
QTextCodec * OpenOrienteering::Util::codecForName | ( | const char * | name | ) |
Determines the codec for a given name.
This function wraps QTextCodec::codecForName. Other than that function, it will try to lookup the codepage name for the current locale if the name is "Default" (case sensitive). It may return nullptr.
const char * OpenOrienteering::Util::codepageForLanguage | ( | const QString & | language_name | ) |
Determines the name of the 8-bit legacy codepage for a language.
This function accepts language names as returned by QLocale::name(). Characters after the two letter language code are ignored.
If the language is unknown, it returns "Windows-1252".
language_name | A lowercase, two-letter ISO 639 language code |
|
inline |
Generates a grid of lines inside the given box.
extent | Extent of the box. |
horz_spacing | Horizontal spacing of the lines. |
vert_spacing | Vertical spacing of the lines. |
horz_offset | Horizontal offset of the first line from the origin. |
vert_offset | Vertical offset of the first line from the origin. |
rotation | Angle used to rotate the lines. |
process_line | Function object which will be called with start and end point for each line. |
void OpenOrienteering::Util::hatchingOperation | ( | const QRectF & | extent, |
double | spacing, | ||
double | offset, | ||
double | rotation, | ||
std::function< void(const QPointF &, const QPointF &)> & | process_line | ||
) |
Generates a pattern of parallel lines inside the box given by extent.
extent | Extent of the box. |
spacing | Spacing of the lines. |
offset | Offset of the first line from the origin. |
rotation | Angle used to rotate the lines. |
process_line | Function object which will be called with start and end point for each line. |
bool OpenOrienteering::Util::isAntialiasingRequired | ( | ) |
Returns true for low-dpi screens, false for high-dpi screens.
bool OpenOrienteering::Util::isAntialiasingRequired | ( | qreal | ppi | ) |
Returns true for low-dpi screens, false for high-dpi screens.
QString OpenOrienteering::Util::makeWhatThis | ( | const char * | reference_latin1 | ) |
Creates a What's-this text "See more" linking to the given page and fragment in the manual.
qreal OpenOrienteering::Util::mmToPixelLogical | ( | qreal | millimeters | ) |
Converts millimeters to pixels using the "logical" dpi setting of the operating system.
This should be used to calculate sizes of UI elements.
qreal OpenOrienteering::Util::mmToPixelPhysical | ( | qreal | millimeters | ) |
Converts millimeters to pixels using the physical dpi setting of Mapper's settings.
This should be used to calculate sizes of map elements.
qreal OpenOrienteering::Util::pixelToMMLogical | ( | qreal | pixels | ) |
Inverse of mmToPixelLogical().
qreal OpenOrienteering::Util::pixelToMMPhysical | ( | qreal | pixels | ) |
Inverse of mmToPixelPhysical().
Remove any HTML markup from the input text.
bool OpenOrienteering::Util::pointsFormCorner | ( | const MapCoord & | point1, |
const MapCoord & | anchor_point, | ||
const MapCoord & | point2, | ||
qreal | quantum_size | ||
) |
Tests whether three points form what we would call a corner.
The function returns true when point2 lies at least quantum_size from continuation of line from point1 to anchor_point. quantum_size parameter is essential for use of this function in GUI code as for various zoom levels point1 position get quantized with varying step size.
point1 | First point on a line. |
anchor_point | Point that is being tested as corner candidate. |
point2 | Final point on potentially bent line. |
quantum_size | How far can point2 lie from the line defined by point1–anchor to be considered unaligned with the two other points. |
void OpenOrienteering::Util::showHelp | ( | QWidget * | dialog_parent, |
const char * | filename_latin1, | ||
const char * | anchor_latin1 | ||
) |
Show the manual in Qt assistant.
filename_latin1 | the name of the manual page html file |
anchor_latin1 | the anchor in the specified file to jump to |
void OpenOrienteering::Util::showHelp | ( | QWidget * | dialog_parent, |
const char * | file_and_anchor_latin1 = "index.html" |
||
) |
Show the manual in Qt assistant.
The anchor may be left out or given with the filename.
file_and_anchor_latin1 | the name of the manual page html file, optionally including an anchor |