#include <BitmapFactory.h>
Public Types | |
enum Position { TopLeft, TopRight, BottomLeft, BottomRight } | |
Public Member Functions | |
void addPath (const QString &path) | |
Adds a path where pixmaps can be found. More... | |
void addPixmapToCache (const char *name, const QPixmap &icon) | |
Adds a build in XPM pixmap under a given name. More... | |
void addXPM (const char *name, const char **pXPM) | |
Adds a build in XPM pixmap under a given name. More... | |
void convert (const QImage &img, SoSFImage &out) const | |
Converts a QImage into a SoSFImage to use it inside a SoImage node. More... | |
void convert (const SoSFImage &img, QImage &out) const | |
Converts a SoSFImage into a QImage. More... | |
QPixmap disabled (const QPixmap &p) const | |
Creates a disabled pixmap of the given pixmap p by changing the brightness of all opaque pixels to a higher value. More... | |
QPixmap fillRect (int x, int y, int w, int h, const QPixmap &p, Qt::BGMode) const | |
Creates an opaque or transparent area in a pixmap If the background mode is opaque then this method can be used for drawing a smaller pixmap into pixmap p. More... | |
QStringList findIconFiles () const | |
Returns the absolute file names of icons found in the given search paths. More... | |
bool findPixmapInCache (const char *name, QPixmap &icon) const | |
Checks whether the pixmap is already registered. More... | |
QStringList getPaths () const | |
Returns the list of search paths. More... | |
QIcon iconFromTheme (const char *name, const QIcon &fallback=QIcon()) | |
Returns the QIcon corresponding to name in the current icon theme. More... | |
QPixmap merge (const QPixmap &p1, const QPixmap &p2, bool vertical) const | |
Merges the two pixmaps p1 and p2 to one pixmap in vertical order if vertical is true, in horizontal order otherwise. More... | |
QPixmap merge (const QPixmap &p1, const QPixmap &p2, Position pos=BitmapFactoryInst::BottomLeft) const | |
Merges the two pixmaps p1 and p2 to one pixmap. More... | |
QPixmap pixmap (const char *name) const | |
Retrieves a pixmap by name. More... | |
QPixmap pixmapFromSvg (const char *name, const QSize &size) const | |
Retrieves a pixmap by name and size created by an scalable vector graphics (SVG). More... | |
QPixmap pixmapFromSvg (const QByteArray &contents, const QSize &size) const | |
This method is provided for convenience and does the same as the method above except that it creates the pixmap from a byte array. More... | |
QStringList pixmapNames () const | |
Returns the names of all registered pixmaps. More... | |
void removePath (const QString &path) | |
Removes a path from the list of pixmap paths. More... | |
QPixmap resize (int w, int h, const QPixmap &p, Qt::BGMode bgmode) const | |
Resizes the area of a pixmap If the new size is greater than the old one the pixmap will be placed in the center. More... | |
![]() | |
void AddProducer (const char *sClassName, AbstractProducer *pcProducer) | |
Adds a new prducer instance. More... | |
std::list< std::string > CanProduce () const | |
returns a list of all registered producer More... | |
bool CanProduce (const char *sClassName) const | |
returns true if there is a producer for this class registered More... | |
Static Public Member Functions | |
static void destruct (void) | |
static BitmapFactoryInst & instance (void) | |
static QIcon mergePixmap (const QIcon &base, const QPixmap &px, Gui::BitmapFactoryInst::Position position) | |
Helper method to merge a pixmap into one corner of a QIcon. More... | |
Additional Inherited Members | |
![]() | |
Factory (void) | |
construction More... | |
void * Produce (const char *sClassName) const | |
produce a class with the given name More... | |
virtual ~Factory () | |
destruction More... | |
Member Enumeration Documentation
◆ Position
Member Function Documentation
◆ addPath()
void BitmapFactoryInst::addPath | ( | const QString & | path | ) |
Adds a path where pixmaps can be found.
Referenced by Gui::Application::sAddIconPath(), and Gui::Application::sAddResPath().
◆ addPixmapToCache()
void BitmapFactoryInst::addPixmapToCache | ( | const char * | name, |
const QPixmap & | icon | ||
) |
Adds a build in XPM pixmap under a given name.
References Gui::BitmapFactoryInstP::xpmCache.
Referenced by Gui::Application::sAddIcon(), and Gui::Application::workbenchIcon().
◆ addXPM()
void BitmapFactoryInst::addXPM | ( | const char * | name, |
const char ** | pXPM | ||
) |
Adds a build in XPM pixmap under a given name.
References Gui::BitmapFactoryInstP::xpmMap.
◆ convert() [1/2]
void BitmapFactoryInst::convert | ( | const QImage & | img, |
SoSFImage & | out | ||
) | const |
Converts a QImage into a SoSFImage to use it inside a SoImage node.
Referenced by Gui::ViewProviderAnnotationLabel::drawImage(), SketcherGui::ViewProviderSketch::sendConstraintIconToCoin(), Gui::AlignmentView::setupHeadUpDisplay(), ImageGui::ViewProviderImagePlane::updateData(), and Gui::SoFCOffscreenRenderer::writeToImage().
◆ convert() [2/2]
void BitmapFactoryInst::convert | ( | const SoSFImage & | img, |
QImage & | out | ||
) | const |
Converts a SoSFImage into a QImage.
◆ destruct()
|
static |
Referenced by Gui::Application::~Application().
◆ disabled()
QPixmap BitmapFactoryInst::disabled | ( | const QPixmap & | p | ) | const |
Creates a disabled pixmap of the given pixmap p by changing the brightness of all opaque pixels to a higher value.
◆ fillRect()
QPixmap BitmapFactoryInst::fillRect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
const QPixmap & | p, | ||
Qt::BGMode | bgmode | ||
) | const |
Creates an opaque or transparent area in a pixmap If the background mode is opaque then this method can be used for drawing a smaller pixmap into pixmap p.
Note: To draw a smaller pixmap into another one the area in the resulting pixmap for the small pixmapmust be opaque in every pixel, otherwise the drawing may fail.
If the background mode is transparent then this method can be used for resizing the pixmap p and make the new space transparent.
◆ findIconFiles()
QStringList BitmapFactoryInst::findIconFiles | ( | ) | const |
Returns the absolute file names of icons found in the given search paths.
Referenced by Gui::Dialog::IconDialog::IconDialog().
◆ findPixmapInCache()
bool BitmapFactoryInst::findPixmapInCache | ( | const char * | name, |
QPixmap & | icon | ||
) | const |
Checks whether the pixmap is already registered.
References Gui::BitmapFactoryInstP::xpmCache.
◆ getPaths()
QStringList BitmapFactoryInst::getPaths | ( | ) | const |
Returns the list of search paths.
◆ iconFromTheme()
QIcon BitmapFactoryInst::iconFromTheme | ( | const char * | name, |
const QIcon & | fallback = QIcon() |
||
) |
Returns the QIcon corresponding to name in the current icon theme.
If no such icon is found in the current theme fallback is returned instead.
References pixmap().
Referenced by Gui::PythonGroupCommand::languageChange().
◆ instance()
|
static |
References App::Application::Config(), and App::GetApplication().
Referenced by Gui::BitmapFactory().
◆ merge() [1/2]
QPixmap BitmapFactoryInst::merge | ( | const QPixmap & | p1, |
const QPixmap & | p2, | ||
bool | vertical | ||
) | const |
Merges the two pixmaps p1 and p2 to one pixmap in vertical order if vertical is true, in horizontal order otherwise.
The method resizes the resulting pixmap.
Referenced by mergePixmap(), Gui::Thumbnail::SaveDocFile(), Gui::CallTipsList::showTips(), and Gui::DocumentObjectItem::testStatus().
◆ merge() [2/2]
QPixmap BitmapFactoryInst::merge | ( | const QPixmap & | p1, |
const QPixmap & | p2, | ||
Position | pos = BitmapFactoryInst::BottomLeft |
||
) | const |
Merges the two pixmaps p1 and p2 to one pixmap.
The position of the smaller pixmap p2 is drawn into the given position pos of the bigger pixmap p1. This method does not resize the resulting pixmap.
References BottomLeft, BottomRight, fillRect(), TopLeft, and TopRight.
◆ mergePixmap()
|
static |
Helper method to merge a pixmap into one corner of a QIcon.
References Gui::BitmapFactory(), and merge().
Referenced by PartGui::ViewProviderAttachExtension::extensionMergeOverlayIcons(), and PartDesignGui::ViewProvider::mergeOverlayIcons().
◆ pixmap()
QPixmap BitmapFactoryInst::pixmap | ( | const char * | name | ) | const |
Retrieves a pixmap by name.
References Base::Console(), Base::ConsoleSingleton::Warning(), Gui::BitmapFactoryInstP::xpmCache, and Gui::BitmapFactoryInstP::xpmMap.
Referenced by DrawSketchHandlerGenConstraint::activated(), StdViewScreenShot::activated(), Gui::ElementColors::Private::addItem(), SurfaceGui::GeomFillSurface::flipOrientation(), SurfaceGui::ViewProviderGeomFillSurface::getIcon(), SurfaceGui::ViewProviderFilling::getIcon(), PathGui::ViewProviderPath::getIcon(), PartGui::ViewProviderMultiFuse::getIcon(), MeshGui::ViewProviderMeshCurvature::getIcon(), PathGui::ViewProviderPathCompound::getIcon(), PartGui::ViewProviderBoolean::getIcon(), PathGui::ViewProviderPathShape::getIcon(), PartGui::ViewProviderMultiCommon::getIcon(), MeshGui::ViewProviderMesh::getIcon(), Gui::ViewProviderLink::getIcon(), Gui::ViewProviderLink::getOverlayPixmap(), iconFromTheme(), Gui::Dialog::DlgCustomActionsImp::on_actionListWidget_itemActivated(), Gui::Dialog::DlgCustomActionsImp::on_buttonReplaceAction_clicked(), SketcherGui::ViewProviderSketch::renderConstrIcon(), SketcherGui::DrawSketchHandler::renderSuggestConstraintsCursor(), Gui::Thumbnail::SaveDocFile(), SurfaceGui::GeomFillSurface::setEditedObject(), Gui::Application::sGetIcon(), Gui::DockWnd::ComboView::showDialog(), Gui::CallTipsList::showTips(), Gui::MainWindow::splashImage(), Gui::TaskView::TaskWatcherPython::TaskWatcherPython(), and Gui::Application::workbenchIcon().
◆ pixmapFromSvg() [1/2]
QPixmap BitmapFactoryInst::pixmapFromSvg | ( | const char * | name, |
const QSize & | size | ||
) | const |
Retrieves a pixmap by name and size created by an scalable vector graphics (SVG).
Referenced by Gui::ExpressionBinding::getIcon(), and ExpressionDelegate::getIcon().
◆ pixmapFromSvg() [2/2]
QPixmap BitmapFactoryInst::pixmapFromSvg | ( | const QByteArray & | contents, |
const QSize & | size | ||
) | const |
This method is provided for convenience and does the same as the method above except that it creates the pixmap from a byte array.
References Base::Console(), Base::ConsoleSingleton::MsgType_Wrn, and Base::ConsoleSingleton::SetEnabledMsgType().
◆ pixmapNames()
QStringList BitmapFactoryInst::pixmapNames | ( | ) | const |
Returns the names of all registered pixmaps.
To get the appropriate pixmaps call pixmap() for each name.
References Gui::BitmapFactoryInstP::xpmCache, and Gui::BitmapFactoryInstP::xpmMap.
◆ removePath()
void BitmapFactoryInst::removePath | ( | const QString & | path | ) |
Removes a path from the list of pixmap paths.
◆ resize()
QPixmap BitmapFactoryInst::resize | ( | int | w, |
int | h, | ||
const QPixmap & | p, | ||
Qt::BGMode | bgmode | ||
) | const |
Resizes the area of a pixmap If the new size is greater than the old one the pixmap will be placed in the center.
The border area will be made depending on bgmode transparent or opaque.
References fillRect().
The documentation for this class was generated from the following files:
- src/Gui/BitmapFactory.h
- src/Gui/BitmapFactory.cpp