| qabstractfileiconengine.cpp |
!
\class QAbstractFileIconEngine
\brief Helper base class for retrieving icons for files for usage by QFileIconProvider and related.
Reimplement availableSizes() and new virtual filePixmap() and return icons created
with this engine from QPlatformTheme::fileIcon().
Note: The class internally caches pixmaps for files by suffix (with the exception
of some files on Windows), but not for directories (since directory icons may have
overlay icons on Windows). You might want to cache pixmaps for directories
in your implementation.
\since 5.8
\internal
\sa QFileIconProvider::DontUseCustomDirectoryIcons, QPlatformTheme
\ingroup qpa
|
3506 |
- |
| qabstractfileiconengine_p.h |
|
1967 |
- |
| qabstractfileiconprovider.cpp |
|
9278 |
- |
| qabstractfileiconprovider.h |
|
1383 |
- |
| qabstractfileiconprovider_p.h |
|
1505 |
- |
| qbitmap.cpp |
!
\class QBitmap
\inmodule QtGui
\brief The QBitmap class provides monochrome (1-bit depth) pixmaps.
\ingroup painting
\ingroup shared
The QBitmap class is a monochrome off-screen paint device used
mainly for creating custom QCursor and QBrush objects,
constructing QRegion objects, and for setting masks for pixmaps
and widgets.
QBitmap is a QPixmap subclass ensuring a depth of 1, except for
null objects which have a depth of 0. If a pixmap with a depth
greater than 1 is assigned to a bitmap, the bitmap will be
dithered automatically.
Use the QColor objects Qt::color0 and Qt::color1 when drawing on a
QBitmap object (or a QPixmap object with depth 1).
Painting with Qt::color0 sets the bitmap bits to 0, and painting
with Qt::color1 sets the bits to 1. For a bitmap, 0-bits indicate
background (or transparent pixels) and 1-bits indicate foreground
(or opaque pixels). Use the clear() function to set all the bits
to Qt::color0. Note that using the Qt::black and Qt::white colors
make no sense because the QColor::pixel() value is not necessarily
0 for black and 1 for white.
The QBitmap class provides the transformed() function returning a
transformed copy of the bitmap; use the QTransform argument to
translate, scale, shear, and rotate the bitmap. In addition,
QBitmap provides the static fromData() function which returns a
bitmap constructed from the given \c uchar data, and the static
fromImage() function returning a converted copy of a QImage
object.
Just like the QPixmap class, QBitmap is optimized by the use of
implicit data sharing. For more information, see the \l {Implicit
Data Sharing} documentation.
\sa QPixmap, QImage, QImageReader, QImageWriter
|
8269 |
- |
| qbitmap.h |
|
1592 |
- |
| qbmphandler.cpp |
QImageIO::defineIOHandler("BMP", "^BM", 0,
read_bmp_image, write_bmp_image);
|
30359 |
- |
| qbmphandler_p.h |
|
3193 |
- |
| qfonticonengine.cpp |
|
7096 |
- |
| qfonticonengine_p.h |
|
1934 |
- |
| qicon.cpp |
!
\enum QIcon::Mode
This enum type describes the mode for which a pixmap is intended
to be used. The currently defined modes are:
\value Normal
Display the pixmap when the user is
not interacting with the icon, but the
functionality represented by the icon is available.
\value Disabled
Display the pixmap when the
functionality represented by the icon is not available.
\value Active
Display the pixmap when the
functionality represented by the icon is available and
the user is interacting with the icon, for example, moving the
mouse over it or clicking it.
\value Selected
Display the pixmap when the item represented by the icon is
selected.
|
72330 |
- |
| qicon.h |
|
8161 |
- |
| qicon_p.h |
|
4161 |
- |
| qiconengine.cpp |
!
\class QIconEngine
\brief The QIconEngine class provides an abstract base class for QIcon renderers.
\ingroup painting
\inmodule QtGui
An icon engine provides the rendering functions for a QIcon. Each icon has a
corresponding icon engine that is responsible for drawing the icon with a
requested size, mode and state.
The icon is rendered by the paint() function, and the icon can additionally be
obtained as a pixmap with the pixmap() function (the default implementation
simply uses paint() to achieve this). The addPixmap() function can be used to
add new pixmaps to the icon engine, and is used by QIcon to add specialized
custom pixmaps.
The paint(), pixmap(), and addPixmap() functions are all virtual, and can
therefore be reimplemented in subclasses of QIconEngine.
\sa QIconEnginePlugin
|
10504 |
- |
| qiconengine.h |
|
1898 |
- |
| qiconengine_p.h |
|
1836 |
- |
| qiconengineplugin.cpp |
!
\class QIconEnginePlugin
\brief The QIconEnginePlugin class provides an abstract base for custom QIconEngine plugins.
\ingroup plugins
\inmodule QtGui
The icon engine plugin is a simple plugin interface that makes it easy to
create custom icon engines that can be loaded dynamically into applications
through QIcon. QIcon uses the file or resource name's suffix to determine
what icon engine to use.
Writing a icon engine plugin is achieved by subclassing this base class,
reimplementing the pure virtual function create(), and
exporting the class with the Q_PLUGIN_METADATA() macro.
The json metadata should contain a list of icon engine keys that this plugin supports.
The keys correspond to the suffix of the file or resource name used when the plugin was
created. Keys are case insensitive.
\code
{ "Keys": [ "myiconengine" ] }
\endcode
\sa {How to Create Qt Plugins}
|
1861 |
- |
| qiconengineplugin.h |
|
758 |
- |
| qiconloader.cpp |
Theme to use in last resort, if the theme does not have the icon, neither the parents |
35391 |
- |
| qiconloader_p.h |
|
6184 |
- |
| qimage.cpp |
! \fn QImageData * QImageData::create(const QSize &size, QImage::Format format)
\internal
Creates a new image data.
Returns \nullptr if invalid parameters are give or anything else failed.
|
234924 |
- |
| qimage.h |
|
14101 |
- |
| qimage_conversions.cpp |
open OUT, "| fmt";
for $i (0..255) {
print OUT (($i >> 7) & 0x01) | (($i >> 5) & 0x02) |
(($i >> 3) & 0x04) | (($i >> 1) & 0x08) |
(($i << 7) & 0x80) | (($i << 5) & 0x40) |
(($i << 3) & 0x20) | (($i << 1) & 0x10), ", ";
}
close OUT;
|
117371 |
- |
| qimage_darwin.mm |
!
\fn CGImageRef QImage::toCGImage() const
Creates a \c CGImage equivalent to this QImage, and returns a \c CGImageRef
handle.
The returned CGImageRef partakes in the QImage implicit sharing,
and holds a reference to the QImage data. CGImage is immutable
and will never detach the QImage. Writing to the QImage will detach
as usual.
This function is fast, and does not copy or convert image data.
If the image format can not be converted a null CGImageRef will
be returned. Users of this function may then convert the QImage
to a supported format first, for example Format_ARGB32_Premultiplied.
If the image does not have a color space set the resulting
CGImageRef color space is set to the sRGB color space.
\ingroup platform-type-conversions
|
2092 |
- |
| qimage_lasx.cpp |
RGB888 has 10 pixels per vector, + 2 byte from the next pixel. The idea here is
to load vectors of RGB888 and use palignr to select a vector out of two vectors.
After 3 loads of RGB888 and 3 stores of RGB32, we have 8 pixels left in the last
vector of RGB888, we can mask it directly to get a last store or RGB32. After that,
the first next byte is a R, and we can loop for the next 32 pixels.
The conversion itself is done with a byte permutation (xvshuf_b and xvpermi_q).
|
5134 |
- |
| qimage_lsx.cpp |
RGB888 has 5 pixels per vector, + 1 byte from the next pixel. The idea here is
to load vectors of RGB888 and use palignr to select a vector out of two vectors.
After 3 loads of RGB888 and 3 stores of RGB32, we have 4 pixels left in the last
vector of RGB888, we can mask it directly to get a last store or RGB32. After that,
the first next byte is a R, and we can loop for the next 16 pixels.
The conversion itself is done with a byte permutation (vshuf_b).
|
5121 |
- |
| qimage_mips_dspr2.cpp |
|
1871 |
- |
| qimage_mips_dspr2_asm.S |
|
7933 |
- |
| qimage_neon.cpp |
|
2509 |
- |
| qimage_p.h |
|
20626 |
- |
| qimage_ssse3.cpp |
RGB888 has 5 pixels per vector, + 1 byte from the next pixel. The idea here is
to load vectors of RGB888 and use palignr to select a vector out of two vectors.
After 3 loads of RGB888 and 3 stores of RGB32, we have 4 pixels left in the last
vector of RGB888, we can mask it directly to get a last store or RGB32. After that,
the first next byte is a R, and we can loop for the next 16 pixels.
The conversion itself is done with a byte permutation (pshufb).
|
4629 |
- |
| qimageiohandler.cpp |
!
\class QImageIOHandler
\brief The QImageIOHandler class defines the common image I/O
interface for all image formats in Qt.
\reentrant
\inmodule QtGui
Qt uses QImageIOHandler for reading and writing images through
QImageReader and QImageWriter. You can also derive from this class
to write your own image format handler using Qt's plugin mechanism.
Call setDevice() to assign a device to the handler, and
setFormat() to assign a format to it. One QImageIOHandler may
support more than one image format. canRead() returns \c true if an
image can be read from the device, and read() and write() return
true if reading or writing an image was completed successfully.
QImageIOHandler also has support for animations formats, through
the functions loopCount(), imageCount(), nextImageDelay() and
currentImageNumber().
In order to determine what options an image handler supports, Qt
will call supportsOption() and setOption(). Make sure to
reimplement these functions if you can provide support for any of
the options in the ImageOption enum.
To write your own image handler, you must at least reimplement
canRead() and read(). Then create a QImageIOPlugin that
can create the handler. Finally, install your plugin, and
QImageReader and QImageWriter will then automatically load the
plugin, and start using it.
\sa QImageIOPlugin, QImageReader, QImageWriter
|
20308 |
- |
| qimageiohandler.h |
|
3528 |
- |
| qimagepixmapcleanuphooks.cpp |
|
3244 |
- |
| qimagepixmapcleanuphooks_p.h |
|
2187 |
- |
| qimagereader.cpp |
!
\class QImageReader
\brief The QImageReader class provides a format independent interface
for reading images from files or other devices.
\inmodule QtGui
\reentrant
\ingroup painting
The most common way to read images is through QImage and QPixmap's
constructors, or by calling QImage::load() and
QPixmap::load(). QImageReader is a specialized class which gives
you more control when reading images. For example, you can read an
image into a specific size by calling setScaledSize(), and you can
select a clip rect, effectively loading only parts of an image, by
calling setClipRect(). Depending on the underlying support in the
image format, this can save memory and speed up loading of images.
To read an image, you start by constructing a QImageReader object.
Pass either a file name or a device pointer, and the image format
to QImageReader's constructor. You can then set several options,
such as the clip rect (by calling setClipRect()) and scaled size
(by calling setScaledSize()). canRead() returns the image if the
QImageReader can read the image (i.e., the image format is
supported and the device is open for reading). Call read() to read
the image.
If any error occurs when reading the image, read() will return a
null QImage. You can then call error() to find the type of error
that occurred, or errorString() to get a human readable
description of what went wrong.
\note QImageReader assumes exclusive control over the file or
device that is assigned. Any attempts to modify the assigned file
or device during the lifetime of the QImageReader object will
yield undefined results.
\section1 Formats
Call supportedImageFormats() for a list of formats that
QImageReader can read. QImageReader supports all built-in image
formats, in addition to any image format plugins that support
reading. Call supportedMimeTypes() to obtain a list of supported MIME
types, which for example can be passed to QFileDialog::setMimeTypeFilters().
QImageReader autodetects the image format by default, by looking at the
provided (optional) format string, the file name suffix, and the data
stream contents. You can enable or disable this feature, by calling
setAutoDetectImageFormat().
\section1 High Resolution Versions of Images
It is possible to provide high resolution versions of images should a scaling
between \e{device pixels} and \e{device independent pixels} be in effect.
The high resolution version is marked by the suffix \c @2x on the base name.
The image read will have its \e{device pixel ratio} set to a value of 2.
This can be disabled by setting the environment variable
\c QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING.
\sa QImageWriter, QImageIOHandler, QImageIOPlugin, QMimeDatabase, QColorSpace
\sa QImage::devicePixelRatio(), QPixmap::devicePixelRatio(), QIcon, QPainter::drawPixmap(), QPainter::drawImage()
|
51900 |
- |
| qimagereader.h |
|
3136 |
- |
| qimagereaderwriterhelpers.cpp |
|
5212 |
- |
| qimagereaderwriterhelpers_p.h |
|
2322 |
- |
| qimagewriter.cpp |
!
\class QImageWriter
\brief The QImageWriter class provides a format independent interface
for writing images to files or other devices.
\inmodule QtGui
\reentrant
\ingroup painting
QImageWriter supports setting format specific options, such as
compression level and quality, prior to storing the
image. If you do not need such options, you can use QImage::save()
or QPixmap::save() instead.
To store an image, you start by constructing a QImageWriter
object. Pass either a file name or a device pointer, and the
image format to QImageWriter's constructor. You can then set
several options, such as quality (by calling setQuality()).
canWrite() returns \c true if QImageWriter can write the image
(i.e., the image format is supported and the device is open for
writing). Call write() to write the image to the device.
If any error occurs when writing the image, write() will return
false. You can then call error() to find the type of error that
occurred, or errorString() to get a human readable description of
what went wrong.
Call supportedImageFormats() for a list of formats that
QImageWriter can write. QImageWriter supports all built-in image
formats, in addition to any image format plugins that support
writing.
\note QImageWriter assumes exclusive control over the file or
device that is assigned. Any attempts to modify the assigned file
or device during the lifetime of the QImageWriter object will
yield undefined results. If immediate access to a resource is
desired, the use of a scope is the recommended method.
For example:
\snippet qimagewriter/main.cpp 0
\sa QImageReader, QImageIOHandler, QImageIOPlugin, QColorSpace
|
25535 |
- |
| qimagewriter.h |
|
2268 |
- |
| qmovie.cpp |
!
\class QMovie
\inmodule QtGui
\brief The QMovie class is a convenience class for playing movies
with QImageReader.
This class is used to show simple animations without sound.
First, create a QMovie object by passing either the name of a file or a
pointer to a QIODevice containing an animated image format to QMovie's
constructor. You can call isValid() to check if the image data is valid,
before starting the movie. To start the movie, call start(). QMovie will
enter \l Running state, and emit started() and stateChanged(). To get the
current state of the movie, call state().
To display the movie in your application, you can pass your QMovie object
to QLabel::setMovie(). Example:
\snippet code/src_gui_image_qmovie.cpp 0
Whenever a new frame is available in the movie, QMovie will emit
updated(). If the size of the frame changes, resized() is emitted. You can
call currentImage() or currentPixmap() to get a copy of the current
frame. When the movie is done, QMovie emits finished(). If any error
occurs during playback (i.e, the image file is corrupt), QMovie will emit
error().
You can control the speed of the movie playback by calling setSpeed(),
which takes the percentage of the original speed as an argument. Pause the
movie by calling setPaused(true). QMovie will then enter \l Paused state
and emit stateChanged(). If you call setPaused(false), QMovie will reenter
\l Running state and start the movie again. To stop the movie, call
stop().
Certain animation formats allow you to set the background color. You can
call setBackgroundColor() to set the color, or backgroundColor() to
retrieve the current background color.
currentFrameNumber() returns the sequence number of the current frame. The
first frame in the animation has the sequence number 0. frameCount()
returns the total number of frames in the animation, if the image format
supports this. You can call loopCount() to get the number of times the
movie should loop before finishing. nextFrameDelay() returns the number of
milliseconds the current frame should be displayed.
QMovie can be instructed to cache frames of an animation by calling
setCacheMode().
Call supportedFormats() for a list of formats that QMovie supports.
\sa QLabel, QImageReader
|
30183 |
- |
| qmovie.h |
|
2868 |
- |
| qpaintengine_pic.cpp |
|
16690 |
- |
| qpaintengine_pic_p.h |
|
2539 |
- |
| qpicture.cpp |
!
\class QPicture
\brief The QPicture class is a paint device that records and
replays QPainter commands.
\inmodule QtGui
\ingroup shared
A picture serializes painter commands to an IO device in a
platform-independent format. They are sometimes referred to as meta-files.
Qt pictures use a proprietary binary format. Unlike native picture
(meta-file) formats on many window systems, Qt pictures have no
limitations regarding their contents. Everything that can be
painted on a widget or pixmap (e.g., fonts, pixmaps, regions,
transformed graphics, etc.) can also be stored in a picture.
QPicture is resolution independent, i.e. a QPicture can be
displayed on different devices (for example svg, pdf, ps, printer
and screen) looking the same. This is, for instance, needed for
WYSIWYG print preview. QPicture runs in the default system dpi,
and scales the painter to match differences in resolution
depending on the window system.
Example of how to record a picture:
\snippet picture/picture.cpp 0
Note that the list of painter commands is reset on each call to
the QPainter::begin() function.
Example of how to replay a picture:
\snippet picture/picture.cpp 1
Pictures can also be drawn using play(). Some basic data about a
picture is available, for example, size(), isNull() and
boundingRect().
\note QPicture uses QDataStream for serialization. The
\l {QDataStream#Corruption and Security}{same reservations} against
reading untrusted data apply.
\sa QMovie
|
33187 |
- |
| qpicture.h |
QPicture stream functions
*************************************************************************** |
2420 |
- |
| qpicture_p.h |
|
4053 |
- |
| qpixmap.cpp |
!
Constructs a null pixmap.
\sa isNull()
|
46562 |
- |
| qpixmap.h |
|
6526 |
- |
| qpixmap_blitter.cpp |
|
8245 |
- |
| qpixmap_blitter_p.h |
|
4786 |
- |
| qpixmap_raster.cpp |
|
10018 |
- |
| qpixmap_raster_p.h |
|
2186 |
- |
| qpixmap_win.cpp |
|
21056 |
- |
| qpixmap_win_p.h |
|
1271 |
- |
| qpixmapcache.cpp |
!
\class QPixmapCache
\inmodule QtGui
\brief The QPixmapCache class provides an application-wide cache for pixmaps.
This class is a tool for optimized drawing with QPixmap. You can
use it to store temporary pixmaps that are expensive to generate
without using more storage space than cacheLimit(). Use insert()
to insert pixmaps, find() to find them, and clear() to empty the
cache.
QPixmapCache contains no member data, only static functions to
access the global pixmap cache. It creates an internal QCache
object for caching the pixmaps.
The cache associates a pixmap with a user-provided string as a key,
or with a QPixmapCache::Key that the cache generates.
Using QPixmapCache::Key for keys is faster than using strings. The string API is
very convenient for complex keys but the QPixmapCache::Key API will be very
efficient and convenient for a one-to-one object-to-pixmap mapping - in
this case, you can store the keys as members of an object.
If two pixmaps are inserted into the cache using equal keys then the
last pixmap will replace the first pixmap in the cache. This follows the
behavior of the QHash and QCache classes.
The cache becomes full when the total size of all pixmaps in the
cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB);
you can change this by calling setCacheLimit() with the required value.
A pixmap takes roughly (\e{width} * \e{height} * \e{depth})/8 bytes of
memory.
The \e{Qt Quarterly} article
\l{http://doc.qt.io/archives/qq/qq12-qpixmapcache.html}{Optimizing
with QPixmapCache} explains how to use QPixmapCache to speed up
applications by caching the results of painting.
\note QPixmapCache is only usable from the application's main thread.
Access from other threads will be ignored and return failure.
\sa QCache, QPixmap
|
16715 |
- |
| qpixmapcache.h |
|
2245 |
- |
| qpixmapcache_p.h |
|
1673 |
- |
| qplatformpixmap.cpp |
!
\class QPlatformPixmap
\since 5.0
\internal
\preliminary
\ingroup qpa
\brief The QPlatformPixmap class provides an abstraction for native pixmaps.
|
7236 |
- |
| qplatformpixmap.h |
|
3824 |
- |
| qpnghandler.cpp |
Versions 1.4.0 to 1.5.2 of libpng declare png_longjmp_ptr to
have a noreturn attribute if PNG_PEDANTIC_WARNINGS_SUPPORTED
is enabled, but most declarations of longjmp in the wild do
not add this attribute. This causes problems when the png_jmpbuf
macro expands to calling png_set_longjmp_fn with a mismatched
longjmp, as compilers such as Clang will treat this as an error.
To work around this we override the png_jmpbuf macro to cast
longjmp to a png_longjmp_ptr.
|
37906 |
- |
| qpnghandler_p.h |
|
1204 |
- |
| qppmhandler.cpp |
PBM/PGM/PPM (ASCII and RAW) image read/write functions
*************************************************************************** |
19471 |
- |
| qppmhandler_p.h |
|
1388 |
- |
| qxbmhandler.cpp |
X bitmap image read/write functions
*************************************************************************** |
8994 |
- |
| qxbmhandler_p.h |
|
1297 |
- |
| qxpmhandler.cpp |
|
43239 |
- |
| qxpmhandler_p.h |
|
1398 |
- |