Fetch an embedded image as Pixmap or Icon. All functions are static. More...
#include "us_images.h"
Public Types | |
enum | ImagesType { US3_SPLASH, CHECK, ARROW_BLUE, ARROW_GREEN, ARROW_RED, AXES_BOX, AXES_FRAME, AXES_NONE, FILE_CELL, FILE_OPEN, FLOOR_DATA, FLOOR_EMPTY, FLOOR_ISO, FLOOR_MESH, GRID_NONE, GRID_BACK, GRID_CEILING, GRID_FLOOR, GRID_FRONT, GRID_LEFT, GRID_RIGHT, MESH_FILLED, MESH_HIDDEN, MESH_NODATA, MESH_NORMALS, MESH_POLYGON, MESH_SCATTERED, MESH_WIRE, MOVIE, SAVE_CONTENT, ICON_PROP, QWTPLOT, US3_ICON, ARROW_LEFT, ARROW_RIGHT } |
Type values for images available. More... | |
Static Public Member Functions | |
static QPixmap | getImage (const QString &) |
Get image (embedded or from file) as a pixmap. More... | |
static QPixmap | getImage (int) |
Get image (embedded or from file) as a pixmap. More... | |
static QIcon | getIcon (const QString &) |
Get image (embedded or from file) as an icon. More... | |
static QIcon | getIcon (int) |
Get image (embedded or from file) as an icon. More... | |
Static Private Member Functions | |
static const QString | image_name (int) |
Get the image name corresponding to a given type flag. More... | |
static const QString | expanded_name (const QString &) |
Get the full expanded embedded image name. More... | |
Fetch an embedded image as Pixmap or Icon. All functions are static.
These methods are primarily designed to return a QPixmap or a QIcon of an embedded image. So the input argument is either a base image name string or an integer enum value. The methods may also take a full image file path name as an argument. The following are equivalent:
1) QIcon check = US_Images::getIcon( US_Images::CHECK );
2) QIcon check = US_Images::getIcon( "check" );
3) QIcon check = US_Images::getIcon( ":/images/check.png" );
4) QIcon check = US_Images::getIcon( US_Settings::usHomeDir() + "/etc/check.png" );
5) QPixmap cpix = US_Images::getImage( US_Images::CHECK ); QIcon check = QIcon( cpix ); int ckwidth = cpix.width();
Note: the last variation addresses the need to both get an image and determine its width.
Definition at line 39 of file us_images.h.
Type values for images available.
Definition at line 43 of file us_images.h.
|
staticprivate |
Get the full expanded embedded image name.
bname | Base name of embedded image (e.g., "check") |
Definition at line 96 of file us_images.cpp.
|
static |
Get image (embedded or from file) as an icon.
bname | Name of embedded image or full path image file name |
Definition at line 17 of file us_images.cpp.
|
static |
Get image (embedded or from file) as an icon.
itype | Enum type flag of desired embedded image |
Definition at line 23 of file us_images.cpp.
|
static |
Get image (embedded or from file) as a pixmap.
bname | Name of embedded image or full path image file name |
Definition at line 5 of file us_images.cpp.
|
static |
Get image (embedded or from file) as a pixmap.
itype | Enum type flag of desired embedded image |
Definition at line 11 of file us_images.cpp.
|
staticprivate |
Get the image name corresponding to a given type flag.
itype | Enum type flag of desired embedded image |
Definition at line 30 of file us_images.cpp.