UltraScan III
List of all members | Public Types | Static Public Member Functions | Static Private Member Functions
US_Images Class Reference

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

Detailed Description

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.

Member Enumeration Documentation

Type values for images available.

Enumerator
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 

Definition at line 43 of file us_images.h.

Member Function Documentation

const QString US_Images::expanded_name ( const QString &  bname)
staticprivate

Get the full expanded embedded image name.

Parameters
bnameBase name of embedded image (e.g., "check")
Returns
Full embedded image name (e.g., ":/images/check.png")

Definition at line 96 of file us_images.cpp.

QIcon US_Images::getIcon ( const QString &  bname)
static

Get image (embedded or from file) as an icon.

Parameters
bnameName of embedded image or full path image file name
Returns
QIcon of named image

Definition at line 17 of file us_images.cpp.

QIcon US_Images::getIcon ( int  itype)
static

Get image (embedded or from file) as an icon.

Parameters
itypeEnum type flag of desired embedded image
Returns
QIcon of named image

Definition at line 23 of file us_images.cpp.

QPixmap US_Images::getImage ( const QString &  bname)
static

Get image (embedded or from file) as a pixmap.

Parameters
bnameName of embedded image or full path image file name
Returns
QPixmap of named image

Definition at line 5 of file us_images.cpp.

QPixmap US_Images::getImage ( int  itype)
static

Get image (embedded or from file) as a pixmap.

Parameters
itypeEnum type flag of desired embedded image
Returns
QPixmap of named image

Definition at line 11 of file us_images.cpp.

const QString US_Images::image_name ( int  itype)
staticprivate

Get the image name corresponding to a given type flag.

Parameters
itypeEnum type flag of desired embedded image
Returns
Name of image corresponding to given type

Definition at line 30 of file us_images.cpp.


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