13#include "private/qpushbutton_p.h"
114 int resolve_mask =
font.resolve_mask;
116 modifiedFont.detach();
117 modifiedFont.resolve_mask = resolve_mask;
129 int resolve_mask =
font.resolve_mask;
131 modifiedFont.detach();
132 modifiedFont.resolve_mask = resolve_mask;
143 r.setTop(
r.top() +
qMax(0, (
q->icon().actualSize(
q->iconSize()).height()
160 return q->icon().actualSize(
q->iconSize()).width() +
leftMargin() + 6;
174 return q->property(
"_qt_usingVistaStyle").toBool()
189 q->setIconSize(
QSize(20, 20));
191 q->initStyleOption(&
opt);
201 qreal descriptionheight = 0;
210 line.setLineWidth(lineWidth);
212 descriptionheight +=
line.height();
216 return qCeil(descriptionheight);
293 int buttonWidth = textWidth +
d->textOffset() +
d->rightMargin();
294 int heightWithoutDescription =
d->descriptionOffset() +
d->bottomMargin();
297 size.setHeight(
qMax(
d->description.isEmpty() ? 41 : 60,
298 heightWithoutDescription +
d->descriptionHeight(buttonWidth)));
306 int heightWithoutDescription =
d->descriptionOffset() +
d->bottomMargin();
308 return qMax(heightWithoutDescription +
d->descriptionHeight(
width),
327 const int vOffset =
isDown()
329 const int hOffset =
isDown()
334 if (!
icon().isNull())
335 p.drawPixmap(
d->leftMargin() + hOffset,
d->topMargin() + vOffset,
342 textColor =
option.palette.buttonText().color();
344 textColor =
option.palette.brightText().color();
346 d->currentColor =
d->mergedColors(textColor,
d->currentColor, 60);
354 p.setFont(
d->titleFont());
355 p.drawItemText(
d->titleRect().translated(hOffset, vOffset),
360 p.setFont(
d->descriptionFont());
361 p.drawItemText(
d->descriptionRect().translated(hOffset, vOffset), textflags,
377 return d->description;
382#include "moc_qcommandlinkbutton.cpp"
const QColor & color() const
Returns the brush color.
The QColor class provides colors based on RGB, HSV or CMYK values.
void setGreen(int green)
Sets the green color component of this color to green.
void setBlue(int blue)
Sets the blue color component of this color to blue.
int red() const noexcept
Returns the red color component of this color.
int blue() const noexcept
Returns the blue color component of this color.
int green() const noexcept
Returns the green color component of this color.
void setRed(int red)
Sets the red color component of this color to red.
\reentrant \inmodule QtGui
int height() const
Returns the height of the font.
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
void setPointSizeF(qreal)
Sets the point size to pointSize.
The QIcon class provides scalable icons in different modes and states.
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
The QPaintEvent class contains event parameters for paint events.
const QBrush & buttonText() const
Returns the button text foreground brush of the current color group.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr void setHeightForWidth(bool b) noexcept
Sets the flag determining whether the widget's preferred height depends on its width,...
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
@ PM_ButtonShiftHorizontal
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble q
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent