Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QPoint QWidget::mapToGlobal ( const QPoint pos  )  const [inherited]

Translates the widget coordinate pos to global screen coordinates. For example, {mapToGlobal(QPoint(0,0))} would give the global coordinates of the top-left pixel of the widget.

See also:
mapFromGlobal() mapTo() mapToParent()

Definition at line 928 of file qwidget_x11.cpp.

References QApplication::desktop(), QWidget::internalWinId(), QWidget::isWindow(), QWidget::mapToGlobal(), QWidget::parentWidget(), QWidget::testAttribute(), QPoint::x(), QWidget::x, QPoint::y(), and QWidget::y.

Referenced by QDialog::adjustPosition(), QAccessibleComboBox::childAt(), QAccessibleWidget::childAt(), Q3IconView::contentsContextMenuEvent(), Q3ListBox::contentsContextMenuEvent(), Q3Table::contentsContextMenuEvent(), Q3ListView::contentsContextMenuEvent(), Q3ListView::contentsMouseDoubleClickEvent(), QAbstractSpinBox::contextMenuEvent(), QDialog::contextMenuEvent(), QWidget::event(), QWorkspace::eventFilter(), Q3ScrollView::focusNextPrevChild(), QMenu::internalDelayedPopup(), QWidget::mapToGlobal(), QTest::mouseEvent(), QSizeGrip::mouseMoveEvent(), QDateTimeEdit::mousePressEvent(), Q3ComboBox::popup(), QAccessibleSpinBox::rect(), QAccessibleHeader::rect(), QAccessibleTabBar::rect(), QAccessibleTextEdit::rect(), QAccessibleWidget::rect(), QAccessibleSlider::rect(), QAccessibleComboBox::rect(), QAccessibleToolButton::rect(), QAccessibleScrollBar::rect(), and QComboBox::showPopup().

{
    Q_D(const QWidget);
    if (!testAttribute(Qt::WA_WState_Created)) {
        QPoint p = pos + data->crect.topLeft();
        //cannot trust that !isWindow() implies parentWidget() before create
        return (isWindow() || !parentWidget()) ?  p : parentWidget()->mapToGlobal(p);
    }
    int           x, y;
    Window child;
    QPoint p = d->mapToWS(pos);
    XTranslateCoordinates(X11->display, internalWinId(),
                          QApplication::desktop()->screen(d->xinfo.screen())->internalWinId(),
                          p.x(), p.y(), &x, &y, &child);
    return QPoint(x, y);
}


Generated by  Doxygen 1.6.0   Back to index