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
src_gui_image_qicon.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QIcon>
4#include <QPainter>
5#include <QToolButton>
6
8
9struct MyWidget : public QWidget
10{
11 void drawIcon(QPainter *painter, const QRect &rect);
12 bool isChecked() { return true; }
14};
15
16void wrapper0() {
17
20button->setIcon(QIcon("open.png"));
22
24QIcon openIcon("open.png");
25openIcon.addFile("open-disabled.png", QIcon::Disabled);
27
31
32} // wrapper0
33
34
44
45
53
54
58
59
60void wrapper2(){
64
65} // wrapper2
66} // src_gui_image_qicon
void setIcon(const QIcon &icon)
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment=Qt::AlignCenter, Mode mode=Normal, State state=Off) const
Uses the painter to paint the icon with specified alignment, required mode, and state into the rectan...
Definition qicon.cpp:977
static void setFallbackSearchPaths(const QStringList &paths)
Definition qicon.cpp:1234
static QStringList fallbackSearchPaths()
Definition qicon.cpp:1213
@ Disabled
Definition qicon.h:22
@ Normal
Definition qicon.h:22
@ Off
Definition qicon.h:23
@ On
Definition qicon.h:23
static QIcon fromTheme(const QString &name)
Definition qicon.cpp:1344
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qrect.h:30
The QToolButton class provides a quick-access button to commands or options, usually used inside a QT...
Definition qtoolbutton.h:20
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QRect rect
the internal geometry of the widget excluding any window frame
Definition qwidget.h:116
bool isEnabled() const
Definition qwidget.h:814
QPushButton * button
[2]
rect
[4]
@ AlignCenter
Definition qnamespace.h:163
QPainter painter(this)
[7]
void drawIcon(QPainter *painter, const QRect &rect)
[2]