43 #ifndef QT_NO_WORKSPACE 64 #include <private/qwidget_p.h> 65 #include <private/qwidgetresizehandler_p.h> 66 #include <private/qlayoutengine_p.h> 108 #ifndef QT_NO_TOOLTIP 111 helpEvent->
pos(),
this);
120 #endif // QT_NO_TOOLTIP 239 bool isActive() const;
240 bool usesActiveColor() const;
242 bool isMovable() const;
243 void setMovable(
bool);
245 bool autoRaise() const;
246 void setAutoRaise(
bool);
255 void setActive(
bool);
264 void showOperationMenu();
265 void popupOperationMenu(const
QPoint&);
266 void doubleClicked();
270 #ifndef QT_NO_CONTEXTMENU 292 lastControl(
QStyle::SC_None),
296 act(0),
window(0), movable(1), pressed(0), autoraise(0), moving(0)
304 #ifndef QT_NO_TOOLTIP 314 int titleBarState()
const;
332 option->
text =
d->window->windowTitle();
333 QIcon icon =
d->window->windowIcon();
374 return qRgb(GetRValue(col),GetGValue(col),GetBValue(col));
383 bool colorsInitialized =
false;
385 #ifdef Q_WS_WIN // ask system properties on windows 386 #ifndef SPI_GETGRADIENTCAPTIONS 387 #define SPI_GETGRADIENTCAPTIONS 0x1008 389 #ifndef COLOR_GRADIENTACTIVECAPTION 390 #define COLOR_GRADIENTACTIVECAPTION 27 392 #ifndef COLOR_GRADIENTINACTIVECAPTION 393 #define COLOR_GRADIENTINACTIVECAPTION 28 401 colorsInitialized =
true;
402 BOOL gradient =
false;
414 if (!colorsInitialized) {
472 d->buttonDown = ctrl;
476 d->buttonDown = ctrl;
481 d->buttonDown = ctrl;
486 d->buttonDown = ctrl;
491 d->buttonDown = ctrl;
495 d->buttonDown = ctrl;
508 #ifndef QT_NO_CONTEXTMENU 522 #endif // QT_NO_CONTEXTMENU 551 if (ctrl ==
d->buttonDown) {
567 if (
d->window &&
d->window->isMinimized())
576 if(
d->window &&
d->window->isMaximized())
614 if(under_mouse !=
d->lastControl) {
615 d->lastControl = under_mouse;
619 switch (
d->buttonDown) {
626 if (
d->moving || (
d->moveOffset -
mapToParent(e->
pos())).manhattanLength() >= 4) {
631 if(parent && parent->inherits(
"QWorkspaceChild")) {
639 if (p.
x() > workspace->
width())
641 if (p.
y() > workspace->
height())
685 if (
d->window->isMinimized())
691 if(
d->window &&
d->window->isMinimized())
703 if ((
d->buttonDown == under_mouse) &&
d->pressed) {
760 if (
d->act == active)
915 void adjustToFullscreen();
928 int frameWidth()
const;
932 bool isWindowOrIconVisible()
const;
944 void internalRaise();
945 void titleBarDoubleClicked();
1001 enum WSActs { RestoreAct, MoveAct, ResizeAct, MinimizeAct, MaximizeAct, CloseAct, StaysOnTopAct, ShadeAct, NCountAct };
1015 void showMaximizeControls();
1016 void hideMaximizeControls();
1020 void maximizeWindow(
QWidget* w);
1021 void minimizeWindow(
QWidget* w);
1022 void normalizeWindow(
QWidget* w);
1024 QRect updateWorkspace();
1027 void _q_normalizeActiveWindow();
1028 void _q_minimizeActiveWindow();
1029 void _q_showOperationMenu();
1030 void _q_popupOperationMenu(
const QPoint&);
1031 void _q_operationMenuActivated(
QAction *);
1032 void _q_scrollBarChanged();
1033 void _q_updateActions();
1039 if (!parent || !child)
1042 while(w && w != parent)
1069 #endif // QT3_SUPPORT 1086 popup =
new QMenu(q);
1087 toolPopup =
new QMenu(q);
1088 popup->setObjectName(
QLatin1String(
"qt_internal_mdi_popup"));
1089 toolPopup->setObjectName(
QLatin1String(
"qt_internal_mdi_tool_popup"));
1101 #ifndef QT_NO_SHORTCUT 1118 popup->addSeparator();
1119 popup->addAction(actions[QWorkspacePrivate::CloseAct]);
1123 toolPopup->addAction(actions[QWorkspacePrivate::MoveAct]);
1124 toolPopup->addAction(actions[QWorkspacePrivate::ResizeAct]);
1126 toolPopup->addSeparator();
1128 toolPopup->addAction(actions[QWorkspacePrivate::CloseAct]);
1130 #ifndef QT_NO_SHORTCUT 1134 shortcutMap.insert(q->grabShortcut(seq),
"activateNextWindow");
1138 shortcutMap.insert(q->grabShortcut(seq),
"activatePreviousWindow");
1142 shortcutMap.insert(q->grabShortcut(seq),
"closeActiveWindow");
1145 #endif // QT_NO_SHORTCUT 1148 q->setAutoFillBackground(
true);
1153 xoffset = yoffset = 0;
1155 q->window()->installEventFilter(q);
1157 inTitleChange =
false;
1182 void QWorkspace::setPaletteBackgroundColor(
const QColor &
c)
1191 void QWorkspace::setPaletteBackgroundPixmap(
const QPixmap & pm)
1195 #endif // QT3_SUPPORT 1209 return d->background;
1258 this,
SLOT(_q_showOperationMenu()));
1259 d->windows.append(child);
1261 d->focus.append(child);
1276 else if (wasMinimized)
1278 else if (!hasBeenHidden)
1279 d->activateWindow(w);
1281 d->updateWorkspace();
1291 if (
d->windows.removeAll(static_cast<QWorkspaceChild*>(e->
child()))) {
1292 d->focus.removeAll(static_cast<QWorkspaceChild*>(e->
child()));
1293 if (
d->maxWindow == e->
child())
1295 d->updateWorkspace();
1301 #ifndef QT_NO_WHEELEVENT 1314 else if (
d->hbar &&
d->hbar->isVisible())
1324 emit q->windowActivated(0);
1327 if (!q->isVisible()) {
1332 if (active && active->windowWidget() == w) {
1334 active->setActive(
true);
1341 while (
it != windows.end()) {
1354 active->setActive(
true);
1359 if (maxWindow && maxWindow != active && active->windowWidget() &&
1361 active->showMaximized();
1363 active->internalRaise();
1366 int from =
focus.indexOf(active);
1372 emit q->windowActivated(w);
1385 return d->active?
d->active->windowWidget() : 0;
1396 d->activateWindow(w,
true);
1410 int overlap, minOverlap = 0;
1413 QRect r1(0, 0, 0, 0);
1414 QRect r2(0, 0, 0, 0);
1415 QRect maxRect = q->rect();
1416 int x = maxRect.
left(),
y = maxRect.
top();
1419 bool firstPass =
true;
1424 }
else if(x + w->
width() > maxRect.
right()) {
1433 while (
it != widgets.
end()) {
1443 if (r2.intersects(r1)) {
1444 r2.setCoords(
qMax(r1.
left(), r2.left()),
1450 overlap += (r2.right() - r2.left()) *
1451 (r2.bottom() - r2.top());
1463 minOverlap = overlap;
1464 }
else if (overlap >= 0 && overlap < minOverlap) {
1465 minOverlap = overlap;
1470 possible = maxRect.
right();
1471 if (possible - w->
width() >
x) possible -= w->
width();
1475 while (
it != widgets.
end()) {
1484 if((
y < r2.bottom()) && (r2.top() < w->
height() +
y)) {
1486 possible = possible < r2.right() ?
1487 possible : r2.right();
1489 if(r2.left() - w->
width() >
x)
1490 possible = possible < r2.left() - w->
width() ?
1491 possible : r2.left() - w->
width();
1496 }
else if (overlap == -2) {
1498 possible = maxRect.
bottom();
1504 while (
it != widgets.
end()) {
1514 possible = possible < r2.bottom() ?
1515 possible : r2.bottom();
1517 if(r2.top() - w->
height() >
y)
1518 possible = possible < r2.top() - w->
height() ?
1519 possible : r2.top() - w->
height();
1525 while(overlap != 0 && overlap != -1);
1537 if (!w || icons.contains(w))
1544 QRect cr = updateWorkspace();
1549 while (
it != icons.end()) {
1563 if (q->isVisibleTo(q->parentWidget())) {
1573 if (icons.removeAll(w))
1583 d->maxWindow->adjustToFullscreen();
1584 if (
d->maxWindow->windowWidget())
1587 d->updateWorkspace();
1595 d->showMaximizeControls();
1597 if (
d->becomeActive) {
1598 d->activateWindow(
d->becomeActive);
1599 d->becomeActive = 0;
1600 }
else if (
d->windows.count() > 0 && !
d->active) {
1601 d->activateWindow(
d->windows.first()->windowWidget());
1612 d->updateWorkspace();
1620 d->hideMaximizeControls();
1642 bool wasMax =
false;
1643 if (c == maxWindow) {
1646 hideMaximizeControls();
1657 if (!
focus.contains(c))
1679 hideMaximizeControls();
1689 if (c == maxWindow) {
1698 hideMaximizeControls();
1719 if (!c || c == maxWindow)
1723 q->setUpdatesEnabled(
false);
1731 showMaximizeControls();
1736 if (oldMaxWindow != c) {
1738 oldMaxWindow->setGeometry(maxRestore);
1740 if(oldMaxWindow->windowWidget())
1749 if (!active && becomeActive) {
1751 active->setActive(
true);
1753 emit q->windowActivated(active->windowWidget());
1763 q->setUpdatesEnabled(updatesEnabled);
1777 maxWindow->internalRaise();
1785 while (
it != windows.end()) {
1807 for (
int i = 0; i < cl.
size(); ++i) {
1814 while (
it !=
d->windows.end()) {
1828 #ifndef QT_NO_SHORTCUT 1832 const char *theSlot =
d->shortcutMap.value(se->
shortcutId(), 0);
1849 if (o ==
d->maxtools) {
1850 switch (e->
type()) {
1859 p.
rx() -=
d->popup->sizeHint().width();
1860 d->_q_popupOperationMenu(p);
1877 switch (e->
type()) {
1882 if (!
d->focus.contains(c))
1884 d->updateWorkspace();
1887 if (!
d->inTitleChange) {
1890 if (
d->maxWindow &&
d->maxWindow->windowWidget() &&
d->topTitle.size()) {
1891 d->inTitleChange =
true;
1893 .arg(
d->topTitle).
arg(
d->maxWindow->windowWidget()->windowTitle()));
1894 d->inTitleChange =
false;
1900 if (o ==
d->maxWindow)
1908 while (
it !=
d->windows.end()) {
1914 }
else if (qobject_cast<QWorkspaceChild*>(o)) {
1917 d->updateWorkspace();
1931 for (
int i = 0; i < children.
count(); ++i) {
1945 if (!topTitle.size())
1946 topTitle = q->window()->windowTitle();
1948 if (maxWindow->windowWidget()) {
1949 QString docTitle = maxWindow->windowWidget()->windowTitle();
1950 if (topTitle.size() && docTitle.
size()) {
1951 inTitleChange =
true;
1952 q->window()->setWindowTitle(
QWorkspace::tr(
"%1 - [%2]").arg(topTitle).arg(docTitle));
1953 inTitleChange =
false;
1955 q->window()->setWindowModified(maxWindow->windowWidget()->isWindowModified());
1981 q,
SLOT(_q_minimizeActiveWindow()));
1983 q,
SLOT(_q_normalizeActiveWindow()));
1990 maxcontrols->show();
1991 if (!active && becomeActive) {
1993 active->setActive(
true);
1995 emit q->windowActivated(active->windowWidget());
1999 maxtools =
new QLabel(q->window());
2001 maxtools->installEventFilter(q);
2003 if (active->windowWidget() && !active->windowWidget()->windowIcon().isNull()) {
2004 QIcon icon = active->windowWidget()->windowIcon();
2005 int iconSize = maxcontrols->size().height();
2006 maxtools->setPixmap(icon.
pixmap(
QSize(iconSize, iconSize)));
2013 maxtools->setPixmap(pm);
2032 maxcontrols->deleteLater();
2036 maxtools->deleteLater();
2042 if (topTitle.size()) {
2043 inTitleChange =
true;
2044 q->window()->setWindowTitle(topTitle);
2045 inTitleChange =
false;
2047 q->window()->setWindowModified(
false);
2058 if (
d->maxWindow &&
d->maxWindow->windowWidget())
2059 d->maxWindow->windowWidget()->close();
2060 else if (
d->active &&
d->active->windowWidget())
2061 d->active->windowWidget()->close();
2062 d->updateWorkspace();
2076 bool did_close =
true;
2078 while (it !=
d->windows.constEnd() && did_close) {
2089 maxWindow->showNormal();
2091 active->showNormal();
2097 maxWindow->showMinimized();
2099 active->showMinimized();
2105 if (!active || !active->windowWidget())
2109 QMenu *popup = (active->titlebar && active->titlebar->isTool()) ? toolPopup : this->popup;
2110 if (q->isRightToLeft()) {
2111 p =
QPoint(active->windowWidget()->mapToGlobal(
QPoint(active->windowWidget()->width(),0)));
2114 p =
QPoint(active->windowWidget()->mapToGlobal(
QPoint(0,0)));
2116 if (!active->isVisible()) {
2117 p = active->iconWidget()->mapToGlobal(
QPoint(0,0));
2120 _q_popupOperationMenu(p);
2127 if (active->titlebar && active->titlebar->isTool())
2128 toolPopup->popup(p);
2136 for (
int i = 1; i < NCountAct-1; i++) {
2137 bool enable = active != 0;
2138 actions[i]->setEnabled(enable);
2141 if (!active || !active->windowWidget())
2144 QWidget *windowWidget = active->windowWidget();
2150 if (active == maxWindow) {
2155 }
else if (active->isVisible()){
2163 if (active->shademode) {
2182 active->showNormal();
2186 if (active->shademode)
2187 active->showShaded();
2190 active->showMinimized();
2192 active->showMaximized();
2194 active->showShaded();
2196 if(
QWidget* w = active->windowWidget()) {
2201 w->parentWidget()->raise();
2217 restore = maxRestore;
2220 q->activatePreviousWindow();
2224 if (maxWindow == c) {
2225 hideMaximizeControls();
2244 if (
d->focus.isEmpty())
2247 if (
d->focus.first())
2248 d->activateWindow(
d->focus.first()->windowWidget(),
false);
2252 int a =
d->focus.indexOf(
d->active) + 1;
2254 a = a %
d->focus.count();
2257 d->activateWindow(
d->focus.at(a)->windowWidget(),
false);
2259 d->activateWindow(0);
2272 if (
d->focus.isEmpty())
2275 if (
d->focus.last())
2276 d->activateWindow(
d->focus.first()->windowWidget(),
false);
2278 d->activateWindow(0);
2282 int a =
d->focus.indexOf(
d->active) - 1;
2284 a =
d->focus.count()-1;
2287 d->activateWindow(
d->focus.at(a)->windowWidget(),
false);
2289 d->activateWindow(0);
2313 d->maxWindow->showNormal();
2316 d->vbar->blockSignals(
true);
2317 d->vbar->setValue(0);
2318 d->vbar->blockSignals(
false);
2319 d->hbar->blockSignals(
true);
2320 d->hbar->setValue(0);
2321 d->hbar->blockSignals(
false);
2322 d->_q_scrollBarChanged();
2325 const int xoffset = 13;
2326 const int yoffset = 20;
2333 for (
it =
d->focus.begin();
it !=
d->focus.end(); ++
it) {
2335 if (wc->windowWidget()->isVisibleTo(
this) && !(wc->titlebar && wc->titlebar->isTool()))
2343 while (
it != widgets.
end()) {
2354 int w = prefSize.
width();
2355 int h = prefSize.
height();
2360 if (x + w >
width())
2367 d->updateWorkspace();
2380 QWidget *oldActive =
d->active ?
d->active->windowWidget() : 0;
2382 d->maxWindow->showNormal();
2385 d->vbar->blockSignals(
true);
2386 d->vbar->setValue(0);
2387 d->vbar->blockSignals(
false);
2388 d->hbar->blockSignals(
true);
2389 d->hbar->setValue(0);
2390 d->hbar->blockSignals(
false);
2391 d->_q_scrollBarChanged();
2400 while (
it !=
d->windows.end()) {
2409 while (rows * cols < n) {
2415 int add = cols * rows - n;
2416 bool* used =
new bool[cols*rows];
2417 for (
int i = 0; i < rows*cols; i++)
2422 int w =
width() / cols;
2425 it =
d->windows.begin();
2426 while (
it !=
d->windows.end()) {
2437 if (p.
x()+c->
width() < 0)
2447 c->QWidget::move(p);
2450 used[row*cols+col] =
true;
2457 if (sz.height() == h + bsize.height())
2459 used[(row+1)*cols+col] =
true;
2463 c->
setGeometry(col*w + col*bsize.width(), row*h + row*bsize.height(), sz.width(), sz.height());
2465 while(row < rows && col < cols && used[row*cols+col]) {
2476 d->activateWindow(oldActive);
2477 d->updateWorkspace();
2490 QRect cr =
d->updateWorkspace();
2495 while (
it !=
d->icons.end()) {
2507 d->updateWorkspace();
2575 if (!hasBeenResized)
2629 workspace->d_func()->focus.removeAll(
this);
2630 if (workspace->d_func()->active ==
this)
2632 if (workspace->d_func()->active ==
this)
2634 if (workspace->d_func()->maxWindow ==
this) {
2635 workspace->d_func()->hideMaximizeControls();
2636 workspace->d_func()->maxWindow = 0;
2678 if (doContentsResize)
2743 switch (e->
type()) {
2755 if (static_cast<QWindowStateChangeEvent*>(e)->isOverride())
2795 if (ws->d_func()->maxtools && ws->d_func()->maxWindow ==
this) {
2796 int iconSize = ws->d_func()->maxtools->
size().
height();
2873 #ifndef QT_NO_CURSOR 2920 if (
act == b && (
act == hasFocus))
2933 for (
int i = 0; i < wl.
size(); ++i) {
2945 for (
int i = 0; i < wl.
size(); ++i) {
2958 for (
int i = 0; i < wl.
size(); ++i) {
2999 titleBarOptions.
rect = frame->
rect();
3029 frame->
resize(iconSize, th);
3130 setGeometry(-fw, (noBorder ? 0 : -fw) - th, w, h);
3139 QWidget *stackUnderWidget = 0;
3149 if (stackUnderWidget)
3153 stackUnderWidget =
c;
3158 if (stackUnderWidget) {
3180 return d->vbar != 0;
3203 if ((
d->vbar != 0) == enable)
3206 d->xoffset =
d->yoffset = 0;
3217 d->updateWorkspace();
3222 d->vbar =
d->hbar = 0;
3227 while (
it !=
d->windows.end()) {
3237 QRect cr(q->rect());
3239 if (q->scrollBarsEnabled() && !maxWindow) {
3244 maxWindow->internalRaise();
3246 QRect r(0, 0, 0, 0);
3248 while (
it != windows.end()) {
3254 vbar->blockSignals(
true);
3255 hbar->blockSignals(
true);
3257 int hsbExt = hbar->sizeHint().
height();
3258 int vsbExt = vbar->sizeHint().width();
3261 bool showv = yoffset || yoffset + r.
bottom() - q->height() + 1 > 0 || yoffset + r.
top() < 0;
3262 bool showh = xoffset || xoffset + r.
right() - q->width() + 1 > 0 || xoffset + r.
left() < 0;
3264 if (showh && !showv)
3265 showv = yoffset + r.
bottom() - q->height() + hsbExt + 1 > 0;
3266 if (showv && !showh)
3267 showh = xoffset + r.
right() - q->width() + vsbExt + 1 > 0;
3275 vbar->setSingleStep(
qMax(q->height() / 12, 30));
3276 vbar->setPageStep(q->height() - hsbExt);
3277 vbar->setMinimum(
qMin(0, yoffset +
qMin(0, r.
top())));
3278 vbar->setMaximum(
qMax(0, yoffset +
qMax(0, r.
bottom() - q->height() + hsbExt + 1)));
3279 vbar->setGeometry(q->width() - vsbExt, 0, vsbExt, q->height() - hsbExt);
3280 vbar->setValue(yoffset);
3287 hbar->setSingleStep(
qMax(q->width() / 12, 30));
3288 hbar->setPageStep(q->width() - vsbExt);
3289 hbar->setMinimum(
qMin(0, xoffset +
qMin(0, r.
left())));
3290 hbar->setMaximum(
qMax(0, xoffset +
qMax(0, r.
right() - q->width() + vsbExt + 1)));
3291 hbar->setGeometry(0, q->height() - hsbExt, q->width() - vsbExt, hsbExt);
3292 hbar->setValue(xoffset);
3298 if (showh && showv) {
3299 corner->setGeometry(q->width() - vsbExt, q->height() - hsbExt, vsbExt, hsbExt);
3305 vbar->blockSignals(
false);
3306 hbar->blockSignals(
false);
3308 cr.setRect(0, 0, q->width() - vsbExt, q->height() - hsbExt);
3312 while (ii != icons.end()) {
3318 if (x+w->
width() > cr.width()) {
3320 x = cr.width() - w->
width();
3322 if (y+w->
height() > cr.height()) {
3323 y = cr.height() - w->
height();
3340 int ver = yoffset - vbar->value();
3341 int hor = xoffset - hbar->value();
3342 yoffset = vbar->value();
3343 xoffset = hbar->value();
3346 while (
it != windows.end()) {
3372 if (
isVisible() &&
d->maxWindow &&
d->maxmenubar) {
3374 d->hideMaximizeControls();
3375 d->showMaximizeControls();
3384 #include "moc_qworkspace.cpp" 3386 #include "qworkspace.moc" 3388 #endif // QT_NO_WORKSPACE
void enterEvent(QEvent *e)
This event handler can be reimplemented in a subclass to receive widget enter events which are passed...
The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
void resizeEvent(QResizeEvent *)
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
QStyle::SubControl activeControl
QPointer< QWorkspaceTitleBar > iconw
void contextMenuEvent(QContextMenuEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive widget context men...
static QRgb colorref2qrgb(COLORREF col)
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
void mousePressEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
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 ...
void mouseMoveEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
SubControl
This enum describes the available sub controls.
void showEvent(QShowEvent *e)
Reimplemented Function
QWorkspaceChild * findChild(QWidget *w)
void adjustToFullscreen()
bool scrollBarsEnabled
whether the workspace provides scroll bars
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define COLOR_GRADIENTINACTIVECAPTION
#define QT_END_NAMESPACE
This macro expands to.
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
QPointer< QWidget > widget
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
void activateNextWindow()
Gives the input focus to the next window in the list of child windows.
QStyle::SubControl hoverControl
const QBrush & dark() const
Returns the dark brush of the current color group.
QStyle::State state
the style flags that are used when drawing the control
#define it(className, varName)
friend class QWorkspaceChild
int titleBarState() const
void moveEvent(QMoveEvent *)
This event handler can be reimplemented in a subclass to receive widget move events which are passed ...
The QWheelEvent class contains parameters that describe a wheel event.
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=0) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
void mouseReleaseEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
QIcon icon
the icon for the title bar
void initStyleOption(QStyleOptionTitleBar *option) const
bool event(QEvent *)
This is the main event handler; it handles event event.
void minimizeWindow(QWidget *w)
void removeEventFilter(QObject *)
Removes an event filter object obj from this object.
The QStyleOptionTitleBar class is used to describe the parameters for drawing a title bar...
void arrangeIcons()
Arranges all iconified windows at the bottom of the workspace.
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
void _q_minimizeActiveWindow()
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...
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
int left() const
Returns the x-coordinate of the rectangle's left edge.
QHash< int, const char * > shortcutMap
int width() const
Returns the width of the rectangle.
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
int & ry()
Returns a reference to the y coordinate of this point.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
QString text
the text of the title bar
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
void moveTo(int x, int t)
Moves the rectangle, leaving the top-left corner at the given position (x, y).
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
static QList< QKeySequence > keyBindings(StandardKey key)
Returns a list of key bindings for the given key.
static QMenuBar * findMenuBar(QWidget *w)
int height() const
Returns the height of the rectangle.
QBrush background() const
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
The QHash class is a template class that provides a hash-table-based dictionary.
void showMaximizeControls()
The QObject class is the base class of all Qt objects.
void removeIcon(QWidget *w)
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=0)
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment...
The QElapsedTimer class provides a fast way to calculate elapsed times.
bool removed() const
Returns true if type() is QEvent::ChildRemoved; otherwise returns false.
QSize boundedTo(const QSize &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
void popupOperationMenu(const QPoint &)
bool event(QEvent *e)
Reimplemented Function
qint64 elapsed() const
Returns the number of milliseconds since this QElapsedTimer was last started.
QWidgetList windowList(WindowOrder order=CreationOrder) const
Returns a list of all visible or minimized child windows.
QRect unite(const QRect &r) const
Use united(rectangle) instead.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags=0) const
If the string text is wider than width, returns an elided version of the string (i.
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
void setObjectName(const QString &name)
WindowOrder
Specifies the order in which child windows are returned from windowList().
The QWorkspace widget provides a workspace window that can be used in an MDI application.
bool eventFilter(QObject *, QEvent *)
Reimplemented Function
void setCurrentColorGroup(ColorGroup cg)
Set the palette's current color group to cg.
void hideEvent(QHideEvent *e)
Reimplemented Function
int lineWidth
the line width for drawing the frame
int width() const
Returns the width.
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void hideMaximizeControls()
The QMoveEvent class contains event parameters for move events.
static bool isEmpty(const char *str)
bool usesActiveColor() const
void _q_operationMenuActivated(QAction *)
void popupOperationMenu(const QPoint &)
int size() const
Returns the number of characters in this string.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
virtual void childEvent(QChildEvent *)
This event handler can be reimplemented in a subclass to receive child events.
void initFrom(const QWidget *w)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
void enterEvent(QEvent *)
This event handler can be reimplemented in a subclass to receive widget enter events which are passed...
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
The QHideEvent class provides an event which is sent after a widget is hidden.
void paintEvent(QPaintEvent *event)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
void activateWindow(QWidget *w, bool change_focus=true)
void wheelEvent(QWheelEvent *e)
Reimplemented Function
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
The QResizeEvent class contains event parameters for resize events.
const char * styleHint(const QFontDef &request)
int & rx()
Returns a reference to the x coordinate of this point.
#define SPI_GETGRADIENTCAPTIONS
QWidgetResizeHandler * widgetResizeHandler
void tile()
Arranges all child windows in a tile pattern.
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
T findChild(const QString &aName=QString()) const
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object.
QWorkspace(QWidget *parent=0)
Constructs a workspace with the given parent.
void changeEvent(QEvent *)
Reimplemented Function
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QList< QWorkspaceChild * > windows
bool isWindowOrIconVisible() const
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget=0) const =0
Draws the given control using the provided painter with the style options specified by option...
void resizeEvent(QResizeEvent *)
Reimplemented Function
void mouseReleaseEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
bool event(QEvent *event)
This is the main event handler; it handles event event.
Qt::BrushStyle style() const
Returns the brush style.
void activatePreviousWindow()
Gives the input focus to the previous window in the list of child windows.
The QShowEvent class provides an event that is sent when a widget is shown.
QPointer< QLabel > maxtools
Qt::MouseButton button() const
Returns the button that caused the event.
#define COLOR_GRADIENTACTIVECAPTION
void leaveEvent(QEvent *event)
This event handler can be reimplemented in a subclass to receive widget leave events which are passed...
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
void _q_scrollBarChanged()
void paintEvent(QPaintEvent *)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
void normalizeWindow(QWidget *w)
The QMouseEvent class contains parameters that describe a mouse event.
void paintEvent(QPaintEvent *p)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
The QChildEvent class contains event parameters for child object events.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=0) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
QPointer< QMenuBar > maxmenubar
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
QPalette palette
the palette that should be used when painting the control
The QBrush class defines the fill pattern of shapes drawn by QPainter.
void mouseDoubleClickEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse double click...
int shortcutId()
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QStyleHintReturnMask class provides style hints that return a QRegion.
void _q_showOperationMenu()
QSize minimumSizeHint() const
void setY(int y)
Sets the y coordinate of this point to the given y coordinate.
int top() const
Returns the y-coordinate of the rectangle's top edge.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction...
void changeEvent(QEvent *)
This event handler can be reimplemented to handle state changes.
#define Q_DECLARE_PUBLIC(Class)
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
int right() const
Returns the x-coordinate of the rectangle's right edge.
QWidget * iconWidget() const
int y() const
Returns the y-coordinate of the rectangle's top edge.
void setBackground(const QBrush &background)
void insertIcon(QWidget *w)
const QSize & size() const
Returns the new size of the widget.
int midLineWidth
the mid-line width for drawing the frame
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.
QWorkspaceTitleBar(QWidget *w, QWidget *parent, Qt::WindowFlags f=0)
bool scrollBarsEnabled() const
QWorkspaceTitleBarPrivate()
QMDIControl(QWidget *widget)
int x() const
Returns the x-coordinate of the rectangle's left edge.
QObject * parent() const
Returns a pointer to the parent object.
void setRect(int x, int y, int w, int h)
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
void closeActiveWindow()
Closes the child window that is currently active.
The QPoint class defines a point in the plane using integer precision.
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
void childEvent(QChildEvent *)
This event handler can be reimplemented in a subclass to receive child events.
void setFrameStyle(int)
Sets the frame style to style.
void installEventFilter(QObject *)
Installs an event filter filterObj on this object.
QWorkspaceTitleBar * titlebar
int size() const
Returns the number of items in the list.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
static bool desktopSettingsAware()
Returns true if Qt is set to use the system's standard colors, fonts, etc.
int & rheight()
Returns a reference to the height.
int height() const
Returns the height.
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
friend class QWorkspaceTitleBar
The QRect class defines a rectangle in the plane using integer precision.
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
The QLabel widget provides a text or image display.
const QObjectList & children() const
Returns a list of child objects.
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=0) const =0
Returns the sub control at the given position in the given complex control (with the style options sp...
void leaveEvent(QEvent *)
This event handler can be reimplemented in a subclass to receive widget leave events which are passed...
int y() const
Returns the y coordinate of this point.
QStyle::SubControl lastControl
The QPixmap class is an off-screen image representation that can be used as a paint device...
return(isPopup||isToolTip)
virtual void polish(QWidget *)
Initializes the appearance of the given widget.
QWorkspaceChild(QWidget *window, QWorkspace *parent=0, Qt::WindowFlags flags=0)
void titleBarDoubleClicked()
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QSize class defines the size of a two-dimensional object using integer point precision.
QWidget * windowWidget() const
QList< QWorkspaceChild * > focus
#define Q_DECLARE_PRIVATE(Class)
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
void closeAllWindows()
Closes all child windows.
Qt::WindowFlags titleBarFlags
the widget flags for the title bar
void mousePressEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
int x() const
Returns the x coordinate of this point.
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
QWorkspaceChild * maxWindow
The QVBoxLayout class lines up widgets vertically.
void setActiveWindow(QWidget *w)
Makes the child window that contains w the active child window.
QRegion region
the region for style hints that return a QRegion
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
QPointer< QMDIControl > maxcontrols
void showWindow(QWidget *w)
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
void initStyleOption(QStyleOptionComplex *option) const
void _q_popupOperationMenu(const QPoint &)
~QWorkspace()
Destroys the workspace and frees any allocated resources.
The QPaintEvent class contains event parameters for paint events.
int frameWidth
the width of the frame that is drawn.
int titleBarState
the state of the title bar
QPointer< QWidget > window
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
The QFrame class is the base class of widgets that can have a frame.
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
void setX(int x)
Sets the x coordinate of this point to the given x coordinate.
static int doubleClickInterval()
void childEvent(QChildEvent *)
Reimplemented Function
bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
static bool isChildOf(QWidget *child, QWidget *parent)
QSize sizeHint() const
Reimplemented Function
QString qt_setWindowTitle_helperHelper(const QString &, const QWidget *)
Returns a modified window title with the [*] place holder replaced according to the rules described i...
void start()
Starts this timer.
QList< T > findChildren(const QString &aName=QString()) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QRect rect
the area that should be used for various calculations and painting
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
void maximizeWindow(QWidget *w)
void cascade()
Arranges all the child windows in a cascade pattern.
void _q_normalizeActiveWindow()
QWidget * addWindow(QWidget *w, Qt::WindowFlags flags=0)
Adds widget w as new sub window to the workspace.
The QAction class provides an abstract user interface action that can be inserted into widgets...
QObject * child() const
Returns the child object that was added or removed.
QStyle::SubControl buttonDown
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
void leaveEvent(QEvent *e)
This event handler can be reimplemented in a subclass to receive widget leave events which are passed...
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
void setScrollBarsEnabled(bool enable)
void hideChild(QWorkspaceChild *c)
The QList class is a template class that provides lists.
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
void mouseMoveEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
The QHelpEvent class provides an event that is used to request helpful information about a particular...
void paintEvent(QPaintEvent *e)
Reimplemented Function
QWidget * activeWindow() const
Returns a pointer to the widget corresponding to the active child window, or 0 if no window is active...
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.
const QPoint & pos() const
Returns the mouse cursor position when the event was generated, relative to the widget to which the e...