Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qicon.cpp File Reference

(9b439874d23d93ea627a3d82e1e2979925137705)

#include "qicon.h"
#include "qicon_p.h"
#include "qiconengine.h"
#include "qiconengineplugin.h"
#include "qimagereader.h"
#include "private/qfactoryloader_p.h"
#include "private/qiconloader_p.h"
#include "qpainter.h"
#include "qfileinfo.h"
#include "qpixmapcache.h"
#include "qvariant.h"
#include "qcache.h"
#include "qdebug.h"
#include "qdir.h"
#include "qpalette.h"
#include "qmath.h"
#include "private/qhexstring_p.h"
#include "private/qguiapplication_p.h"
#include "private/qoffsetstringarray_p.h"
#include "qpa/qplatformtheme.h"
+ Include dependency graph for qicon.cpp:

Go to the source code of this file.

Functions

static int nextSerialNumCounter ()
 
static void qt_cleanup_icon_cache ()
 
static int area (const QSize &s)
 
static QPixmapIconEngineEntrybestSizeScaleMatch (const QSize &size, qreal scale, QPixmapIconEngineEntry *pa, QPixmapIconEngineEntry *pb)
 
static int origIcoDepth (const QImage &image)
 
static int findBySize (const QList< QImage > &images, const QSize &size)
 
 Q_GLOBAL_STATIC_WITH_ARGS (QFactoryLoader, iceLoader,(QIconEngineFactoryInterface_iid, "/iconengines"_L1, Qt::CaseInsensitive)) QFactoryLoader *qt_iconEngineFactoryLoader()
 
static QIconEngineiconEngineFromSuffix (const QString &fileName, const QString &suffix)
 
static constexpr QLatin1StringView themeIconName (QIcon::ThemeIcon icon)
 
QDataStreamoperator<< (QDataStream &s, const QIcon &icon)
 
QDataStreamoperator>> (QDataStream &s, QIcon &icon)
 
QDebug operator<< (QDebug dbg, const QIcon &i)
 
QString qt_findAtNxFile (const QString &baseFileName, qreal targetDevicePixelRatio, qreal *sourceDevicePixelRatio)
 

Variables

static constexpr auto themeIconMapping
 

Function Documentation

◆ area()

static int area ( const QSize & s)
inlinestatic

Definition at line 153 of file qicon.cpp.

Referenced by addAtForBoundingArea(), QDeclarativeGeoRouteQuery::addExcludedArea(), adjustedArea(), areaToRect(), bestSizeScaleMatch(), QPrintPreviewWidgetPrivate::calcCurrentPage(), QQuickScrollBarAttachedPrivate::cleanupHorizontal(), QQuickScrollBarAttachedPrivate::cleanupVertical(), QBspTree::climbTree(), QAbstractItemView::doAutoScroll(), QTableViewPrivate::drawAndClipSpans(), QWindowsVistaStylePrivate::drawBackgroundDirectly(), QQC2::QWindowsXPStylePrivate::drawBackgroundDirectly(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QTreeView::drawTree(), QDockWidgetPrivate::endDrag(), QMdiArea::eventFilter(), AndroidCameraPrivate::getFocusAreas(), QOffscreenBackingStore::grabWindow(), gray_hline(), gray_render_line(), gray_sweep(), QListViewPrivate::horizontalScrollToValue(), QCommonListViewBase::horizontalScrollToValue(), QListModeViewBase::horizontalScrollToValue(), QBspTree::init(), QBspTree::init(), QQuickScrollBarAttachedPrivate::initHorizontal(), QQuickScrollBarAttachedPrivate::initVertical(), QListModeViewBase::intersectingSet(), QIconModeViewBase::intersectingSet(), QListViewPrivate::intersectingSet(), QDockWidget::isAreaAllowed(), QToolBar::isAreaAllowed(), QMdiSubWindow::mdiArea(), mdiAreaParent(), qt_evr_makeMFArea(), qt_evr_validateVideoArea(), qt_find_best_resolution_match(), rectToArea(), QDeclarativeGeoRouteQuery::removeExcludedArea(), QBackingStore::scroll(), QPlatformBackingStore::scroll(), QXcbBackingStoreImage::scroll(), QDirectFbBackingStore::scroll(), QOffscreenBackingStore::scroll(), QQnxRasterBackingStore::scroll(), QWindowsBackingStore::scroll(), QXcbNativeBackingStore::scroll(), QXcbBackingStore::scroll(), QTreeView::scrollTo(), QToolBarLayout::setGeometry(), QQuickScrollIndicatorAttached::setHorizontal(), QPlaceSearchRequest::setSearchArea(), QQuickScrollIndicatorAttached::setVertical(), QAbstractItemViewPrivate::shouldAutoScroll(), QWindowSystemInterfacePrivate::toNativeTouchPoint(), QQuickMultiPointTouchArea::updateTouchPoint(), QListViewPrivate::verticalScrollToValue(), QCommonListViewBase::verticalScrollToValue(), and QListModeViewBase::verticalScrollToValue().

◆ bestSizeScaleMatch()

static QPixmapIconEngineEntry * bestSizeScaleMatch ( const QSize & size,
qreal scale,
QPixmapIconEngineEntry * pa,
QPixmapIconEngineEntry * pb )
static

Definition at line 161 of file qicon.cpp.

References area(), QPixmap::devicePixelRatio(), QPixmapIconEngineEntry::fileName, QPixmap::isNull(), QSize::isNull(), QPixmapIconEngineEntry::pixmap, qAbs(), qMax(), qMin(), QPixmapIconEngineEntry::size, and QPixmap::size().

+ Here is the call graph for this function:

◆ findBySize()

static int findBySize ( const QList< QImage > & images,
const QSize & size )
inlinestatic

Definition at line 390 of file qicon.cpp.

References QList< T >::at(), i, images, QImage::size(), and QList< T >::size().

Referenced by QPixmapIconEngine::addFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ iconEngineFromSuffix()

static QIconEngine * iconEngineFromSuffix ( const QString & fileName,
const QString & suffix )
static

Definition at line 1070 of file qicon.cpp.

References factory, fileName, and QString::isEmpty().

Referenced by QIcon::addFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextSerialNumCounter()

static int nextSerialNumCounter ( )
static

Definition at line 69 of file qicon.cpp.

References Q_BASIC_ATOMIC_INITIALIZER.

◆ operator<<() [1/2]

QDataStream & operator<< ( QDataStream & s,
const QIcon & icon )
related

Definition at line 1849 of file qicon.cpp.

◆ operator<<() [2/2]

QDebug operator<< ( QDebug dbg,
const QIcon & i )

Definition at line 1943 of file qicon.cpp.

References Qt::dec(), Qt::hex(), i, Qt::noshowbase(), and Qt::showbase().

+ Here is the call graph for this function:

◆ operator>>()

QDataStream & operator>> ( QDataStream & s,
QIcon & icon )
related

Definition at line 1888 of file qicon.cpp.

◆ origIcoDepth()

static int origIcoDepth ( const QImage & image)
inlinestatic

Definition at line 384 of file qicon.cpp.

References QStringLiteral.

Referenced by QPixmapIconEngine::addFile().

+ Here is the caller graph for this function:

◆ Q_GLOBAL_STATIC_WITH_ARGS()

Q_GLOBAL_STATIC_WITH_ARGS ( QFactoryLoader ,
iceLoader ,
(QIconEngineFactoryInterface_iid, "/iconengines"_L1, Qt::CaseInsensitive)  )

Definition at line 535 of file qicon.cpp.

◆ qt_cleanup_icon_cache()

static void qt_cleanup_icon_cache ( )
static

Definition at line 89 of file qicon.cpp.

Referenced by QIconPrivate::clearIconCache().

+ Here is the caller graph for this function:

◆ qt_findAtNxFile()

QString qt_findAtNxFile ( const QString & baseFileName,
qreal targetDevicePixelRatio,
qreal * sourceDevicePixelRatio )
Since
5.6 Attempts to find a suitable @Nx file for the given targetDevicePixelRatio Returns the baseFileName if no such file was found.

Given base foo.png and a target dpr of 2.5, this function will look for foo@3.nosp@m.x.pn.nosp@m.g, then foo@2x, then fall back to foo.png if not found.

sourceDevicePixelRatio will be set to the value of N if the argument is not \nullptr

Definition at line 1984 of file qicon.cpp.

References QFile::exists(), QString::insert(), qCeil(), qEnvironmentVariableIsEmpty(), and qMin().

Referenced by QIcon::addFile(), findAtNxFileOrResource(), and QQuickImageBase::resolve2xLocalFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ themeIconName()

static constexpr QLatin1StringView themeIconName ( QIcon::ThemeIcon icon)
staticconstexpr

Definition at line 1564 of file qicon.cpp.

References icon, Q_ASSERT, and themeIconMapping.

Referenced by QIcon::fromTheme(), QIcon::fromTheme(), and QIcon::hasThemeIcon().

+ Here is the caller graph for this function:

Variable Documentation

◆ themeIconMapping

constexpr auto themeIconMapping
staticconstexpr

Definition at line 1408 of file qicon.cpp.

Referenced by themeIconName().