Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qicon.cpp File Reference
#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 "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)
 
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)
 

Function Documentation

◆ area()

static int area ( const QSize s)
inlinestatic

Definition at line 152 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 160 of file qicon.cpp.

References area(), QPixmapIconEngineEntry::fileName, QPixmap::isNull(), QPixmapIconEngineEntry::pixmap, qAbs(), qMax(), qMin(), QPixmapIconEngineEntry::scale, 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 383 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 1024 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 68 of file qicon.cpp.

References Q_BASIC_ATOMIC_INITIALIZER.

◆ operator<<() [1/2]

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

Definition at line 1393 of file qicon.cpp.

◆ operator<<() [2/2]

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

Definition at line 1487 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 1432 of file qicon.cpp.

◆ origIcoDepth()

static int origIcoDepth ( const QImage image)
inlinestatic

Definition at line 377 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 523 of file qicon.cpp.

◆ qt_cleanup_icon_cache()

static void qt_cleanup_icon_cache ( )
static

Definition at line 88 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 1528 of file qicon.cpp.

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

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

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