Plasma
popupapplet.cpp
Go to the documentation of this file.
244 //99% of the times q->parentWidget() is the containment, but using it we can also manage the applet-in-applet case (i.e. systray)
245 //there are also cases where the parentlayoutitem is bigger than the containment (e.g. newspaper)
255 //check if someone did the nasty trick of applets in applets, in this case we always want to be collapsed
258 //this loop should be executed normally a single time, at most 2-3 times for quite complex containments
286 if (((!parentApplet || parentApplet->isContainment() ) && icon && (!icon->svg().isEmpty() || !icon->icon().isNull()) && ((f != Plasma::Vertical && f != Plasma::Horizontal)) ||
289 (!q->parentWidget() || (q->parentWidget()->size().width() >= minimum.width() && q->parentWidget()->size().height() >= minimum.height()))))) {
366 if (oldSize.width() < q->minimumSize().width() || oldSize.height() < q->minimumSize().height()) {
425 dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (gWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
432 dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (qWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
506 if (!d->passive && watched == d->dialogPtr.data() && (event->type() == QEvent::WindowDeactivate)) {
714 QObject::connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), q, SLOT(iconSizeChanged(int)));
960 reverse = (appletPos.y() + (q->size().height() / 2)) < (dialogPos.y() + (dialog->size().height() / 2));
963 reverse = (appletPos.x() + (q->size().width() / 2)) < (dialogPos.x() + (dialog->size().width() / 2));
975 popupPlacement = reverse ? Plasma::BottomPosedLeftAlignedPopup : Plasma::BottomPosedRightAlignedPopup;
QLayout * layout() const
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void setPopupAlignment(Qt::AlignmentFlag alignment)
Sets the default alignment of the popup relative to the applet.
Definition: popupapplet.cpp:660
QGraphicsWidget * parentWidget() const
const QMimeData * mimeData() const
The applet is constrained horizontally, but can expand vertically.
Definition: plasma.h:77
const Package * package() const
Accessor for the associated Package object if any.
Definition: applet.cpp:691
void activate()
Emitted when activation is requested due to, for example, a global keyboard shortcut.
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)
void setSpacing(qreal spacing)
virtual int count() const
Definition: dialog.h:64
void animatedShow(Plasma::Direction direction)
Causes an animated show; requires compositing to work, otherwise the dialog will simply show...
Definition: dialog.cpp:829
virtual bool hasFormat(const QString &mimeType) const
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
virtual Location location() const
Returns the location of the scene which is displaying applet.
Definition: applet.cpp:1618
void timerEvent(QTimerEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:607
virtual FormFactor formFactor() const
Returns the current form factor the applet is being displayed in.
Definition: applet.cpp:1479
The applet is no wider (in horizontal formfactors) or no higher (in vertical ones) than a square...
Definition: plasma.h:215
bool isVisible() const
QPoint mapToGlobal(const QPoint &pos) const
On the planar desktop layer, extending across the full screen from edge to edge.
Definition: plasma.h:111
Popup positioned on the left, aligned to the bottom of the widget.
Definition: plasma.h:145
minimumSizeHint
void hide()
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:558
virtual bool event(QEvent *event)
QGraphicsScene * scene() const
virtual void removeAt(int index)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void setParent(QWidget *parent)
Popup positioned on the bottom, aligned to the left of the wigdet.
Definition: plasma.h:147
virtual void popupEvent(bool show)
This event handler can be reimplemented in a subclass to receive an event before the popup is shown o...
Definition: popupapplet.cpp:670
The applet is constrained vertically, but can expand horizontally.
Definition: plasma.h:75
int x() const
int y() const
void setAlignment(QGraphicsLayoutItem *item, QFlags< Qt::AlignmentFlag > alignment)
bool eventFilter(QObject *watched, QEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:504
void setOrientation(Qt::Orientation orientation)
void dropEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:577
Popup positioned on the left, aligned to the right of the wigdet.
Definition: plasma.h:143
Popup positioned on the right, aligned to the bottom of the widget.
Definition: plasma.h:153
virtual QGraphicsWidget * graphicsWidget()
Implement either this function or widget().
Definition: popupapplet.cpp:163
Popup positioned on the right, aligned to the top of the wigdet.
Definition: plasma.h:151
width
void setGraphicsWidget(QGraphicsWidget *widget)
Sets a QGraphicsWidget to be shown as the content in this dialog.
Definition: dialog.cpp:614
size
void removeWidget(QWidget *widget)
Draws no borders on the bottom extenderitem, but draws the left, bottom and right border on subsequen...
Definition: extender.h:89
QPointF pos() const
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
PopupPlacement
The popup position enumeration relatively to his attached widget.
Definition: plasma.h:137
void setLayout(QLayout *layout)
virtual QWidget * widget()
Implement either this function or graphicsWidget().
Definition: popupapplet.cpp:127
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:546
void setFocus()
void setWidth(qreal width)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:494
Plasma::PopupPlacement popupPlacement() const
Definition: popupapplet.cpp:655
Allows applets to automatically 'collapse' into an icon when put in an panel, and is a convenient bas...
Definition: popupapplet.h:52
bool isEmpty() const
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Draws no borders on the topmost extenderitem, but draws the left, top and right border on subsequent ...
Definition: extender.h:83
pos
QPoint screenPos() const
void restoreOverrideCursor()
Popup positioned on the bottom, aligned to the right of the widget.
Definition: plasma.h:149
QPoint mapFromScene(const QPointF &point) const
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition: plasma.h:64
WId winId() const
T & first()
void hide()
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Reimplemented from QGraphicsLayoutItem.
Definition: applet.cpp:2509
void setMargin(int margin)
Direction locationToDirection(Location location)
Converts a location to a direction.
Definition: plasma.cpp:51
void getContentsMargins(int *left, int *top, int *right, int *bottom) const
void setMinimumResizeLimits(int left, int top, int right, int bottom)
Sets the minimum values that each of four sides of the rect may expand to or from.
Definition: dialog.cpp:769
void hide(QGraphicsWidget *widget)
Hides the tooltip for a widget immediately.
Definition: tooltipmanager.cpp:188
void animatedHide(Plasma::Direction direction)
Causes an animated hide; requires compositing to work, otherwise the dialog will simply hide...
Definition: dialog.cpp:796
void showPopup(uint displayTime=0)
Shows the dialog showing the widget if the applet is in a panel.
Definition: popupapplet.cpp:589
void setAspectRatioMode(Plasma::AspectRatioMode mode)
Sets the preferred aspect ratio mode for placement and resizing.
Definition: dialog.cpp:877
Direction locationToInverseDirection(Location location)
Converts a location to the direction facing it.
Definition: plasma.cpp:72
Popup positioned on the top, aligned to the right of the widget.
Definition: plasma.h:141
sizeHint
Definition: dialog.h:61
void setGraphicsWidget(QGraphicsWidget *widget)
Definition: popupapplet.cpp:172
Definition: dialog.h:60
windowFlags
windowFlags
Popup positioned on the top, aligned to the left of the wigdet.
Definition: plasma.h:139
void clearFocus()
preferredSize
QPointF mapToScene(const QPointF &point) const
void addItem(QGraphicsLayoutItem *item)
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:462
QPoint toPoint() const
void setAppearance(Appearance appearance)
Use this function to instruct the extender on how to render its items.
Definition: extender.cpp:329
void setFocus(Qt::FocusReason focusReason)
Definition: dialog.h:63
bool isNull() const
Qt::MouseButtons buttons() const
QString name() const
Returns the user-visible name for the applet, as specified in the .desktop file.
Unset mode used for dev convenience when there is a need to store the aspectRatioMode somewhere...
Definition: plasma.h:209
Definition: iconwidget.h:56
int timerId() const
void setPassivePopup(bool passive)
Sets whether or not the dialog popup that gets created should be a "passive" popup that does not stea...
Definition: popupapplet.cpp:677
Definition: dialog.h:62
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition: popupapplet.cpp:482
void show()
void setAspectRatioMode(Plasma::AspectRatioMode)
Sets the preferred aspect ratio mode for placement and resizing.
Definition: applet.cpp:1636
PopupApplet(QObject *parent, const QVariantList &args)
Definition: popupapplet.cpp:59
void setLayout(QGraphicsLayout *layout)
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:72
void setResizeHandleCorners(ResizeCorners corners)
Definition: dialog.cpp:751
void show()
minimumSize
qreal height() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setHeight(qreal height)
QPointF scenePos() const
qreal width() const
void setSpacing(int spacing)
height
Definition: dialog.h:59
Qt::AlignmentFlag popupAlignment() const
QString filePath(const char *fileType, const QString &filename) const
Get the path to a given file.
Definition: package.cpp:213
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.