48 #include <private/qwidget_p.h> 63 showFrameAboveWidget =
false;
74 if (q->parentWidget()->rect().intersects(q->geometry())) {
96 QRect geom(pos.x()-hmargin, pos.y()-vmargin,
98 if(q->geometry() == geom)
101 q->setGeometry(geom);
104 q->initStyleOption(&opt);
193 d->showFrameAboveWidget =
true;
195 d->showFrameAboveWidget =
false;
197 if (widget ==
d->widget)
204 if (!
d->showFrameAboveWidget || p ==
d->frameParent)
211 d->widget->installEventFilter(
this);
214 if (
d->showFrameAboveWidget) {
221 bool isScrollArea =
false;
225 if (prev && isScrollArea)
226 d->frameParent = prev;
292 if (
d->showFrameAboveWidget) {
319 }
else if (
d->showFrameAboveWidget) {
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
#define QT_END_NAMESPACE
This macro expands to.
void initStyleOption(QStyleOption *option) const
Initialize option with the values from this QFocusFrame.
void drawControl(QStyle::ControlElement ce, const QStyleOption &opt)
Use the widget's style to draw a control element ce specified by QStyleOption option.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation...
void removeEventFilter(QObject *)
Removes an event filter object obj from this object.
void paintEvent(QPaintEvent *)
Reimplemented Function
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
QWidget * widget() const
Returns the currently monitored widget for automatically resize and update.
void setWidget(QWidget *widget)
QFocusFrame will track changes to widget and resize itself automatically.
The QObject class is the base class of all Qt objects.
bool eventFilter(QObject *, QEvent *)
Reimplemented Function
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QStyleOption class stores the parameters used by QStyle functions.
void initFrom(const QWidget *w)
const char * styleHint(const QFontDef &request)
bool showFrameAboveWidget
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
~QFocusFrame()
Destructor.
The QStyleHintReturnMask class provides style hints that return a QRegion.
#define Q_DECLARE_PUBLIC(Class)
bool event(QEvent *e)
Reimplemented Function
The QPoint class defines a point in the plane using integer precision.
void installEventFilter(QObject *)
Installs an event filter filterObj on this object.
The QRect class defines a rectangle in the plane using integer precision.
The QFocusFrame widget provides a focus frame which can be outside of a widget's normal paintable are...
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget...
QRegion region
the region for style hints that return a QRegion
The QPaintEvent class contains event parameters for paint events.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
QFocusFrame(QWidget *parent=0)
Constructs a QFocusFrame.