Qt 4.8
|
The QPoint class defines a point in the plane using integer precision. More...
#include <qpoint.h>
Public Functions | |
bool | isNull () const |
Returns true if both the x and y coordinates are set to 0, otherwise returns false. More... | |
int | manhattanLength () const |
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point. More... | |
QPoint & | operator*= (float c) |
QPoint & | operator*= (double c) |
QPoint & | operator*= (int c) |
QPoint & | operator+= (const QPoint &p) |
Adds the given point to this point and returns a reference to this point. More... | |
QPoint & | operator-= (const QPoint &p) |
Subtracts the given point from this point and returns a reference to this point. More... | |
QPoint & | operator/= (qreal c) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides both x and y by the given divisor, and returns a reference to this point. More... | |
QPoint () | |
Constructs a null point, i. More... | |
QPoint (int xpos, int ypos) | |
Constructs a point with the given coordinates (x, y). More... | |
int & | rx () |
Returns a reference to the x coordinate of this point. More... | |
int & | ry () |
Returns a reference to the y coordinate of this point. More... | |
void | setX (int x) |
Sets the x coordinate of this point to the given x coordinate. More... | |
void | setY (int y) |
Sets the y coordinate of this point to the given y coordinate. More... | |
int | x () const |
Returns the x coordinate of this point. More... | |
int | y () const |
Returns the y coordinate of this point. More... | |
Properties | |
int | xp |
int | yp |
Friends | |
bool | operator!= (const QPoint &, const QPoint &) |
Returns true if p1 and p2 are not equal; otherwise returns false. More... | |
const QPoint | operator* (const QPoint &, float) |
const QPoint | operator* (float, const QPoint &) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const QPoint | operator* (const QPoint &, double) |
const QPoint | operator* (double, const QPoint &) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const QPoint | operator* (const QPoint &, int) |
const QPoint | operator* (int, const QPoint &) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const QPoint | operator+ (const QPoint &, const QPoint &) |
Returns a QPoint object that is the sum of the given points, p1 and p2; each component is added separately. More... | |
const QPoint | operator- (const QPoint &, const QPoint &) |
Returns a QPoint object that is formed by subtracting p2 from p1; each component is subtracted separately. More... | |
const QPoint | operator- (const QPoint &) |
Returns a QPoint object that is formed by changing the sign of both components of the given point. More... | |
const QPoint | operator/ (const QPoint &, qreal) |
Returns the QPoint formed by dividing both components of the given point by the given divisor. More... | |
bool | operator== (const QPoint &, const QPoint &) |
Returns true if p1 and p2 are equal; otherwise returns false. More... | |
class | QTransform |
Related Functions | |
(Note that these are not member functions.) | |
QDataStream & | operator<< (QDataStream &stream, const QPoint &point) |
Writes the given point to the given stream and returns a reference to the stream. More... | |
QDataStream & | operator>> (QDataStream &stream, QPoint &point) |
Reads a point from the given stream into the given point and returns a reference to the stream. More... | |
The QPoint class defines a point in the plane using integer precision.
A point is specified by a x coordinate and an y coordinate which can be accessed using the x() and y() functions. The isNull() function returns true if both x and y are set to 0. The coordinates can be set (or altered) using the setX() and setY() functions, or alternatively the rx() and ry() functions which return references to the coordinates (allowing direct manipulation).
Given a point p, the following statements are all equivalent:
A QPoint object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A QPoint object can also be divided or multiplied by an int
or a qreal
.
In addition, the QPoint class provides the manhattanLength() function which gives an inexpensive approximation of the length of the QPoint object interpreted as a vector. Finally, QPoint objects can be streamed as well as compared.
|
inline |
Constructs a null point, i.
e. with coordinates (0, 0)
\sa isNull()
Definition at line 119 of file qpoint.h.
Referenced by operator*(), operator+(), operator-(), and operator/().
|
inline |
|
inline |
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
Definition at line 125 of file qpoint.h.
Referenced by QVGCompositionHelper::blitWindow(), QX11WindowSurface::flush(), QRasterWindowSurface::flush(), getNetWmState(), QWidgetPrivate::invalidateBuffer_resizeHelper(), make_widget_eventUPP(), QTest::mouseEvent(), and QSwipeGestureRecognizer::recognize().
int QPoint::manhattanLength | ( | ) | const |
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point.
For example:
This is a useful, and quick to calculate, approximation to the true length:
The tradition of "Manhattan length" arises because such distances apply to travelers who can only travel on a rectangular grid, like the streets of Manhattan.
Definition at line 489 of file qpoint.cpp.
Referenced by QComboBoxPrivateContainer::eventFilter(), QAbstractScrollAreaPrivate::layoutChildren(), QmlJSDebugger::LiveSelectionTool::mouseMoveEvent(), QmlJSDebugger::LiveSelectionTool::mouseReleaseEvent(), QTapGestureRecognizer::recognize(), and QTapAndHoldGestureRecognizer::recognize().
|
inline |
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy.
Definition at line 152 of file qpoint.h.
|
inline |
Multiplies this point's coordinates by the given factor, and returns a reference to this point. For example:
Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy.
Definition at line 155 of file qpoint.h.
|
inline |
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
Definition at line 158 of file qpoint.h.
Adds the given point to this point and returns a reference to this point.
For example:
Definition at line 146 of file qpoint.h.
Subtracts the given point from this point and returns a reference to this point.
For example:
Definition at line 149 of file qpoint.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides both x and y by the given divisor, and returns a reference to this point.
For example:
Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy.
Definition at line 194 of file qpoint.h.
|
inline |
Returns a reference to the x coordinate of this point.
Using a reference makes it possible to directly manipulate x. For example:
Definition at line 140 of file qpoint.h.
Referenced by QWorkspacePrivate::_q_showOperationMenu(), QPlastiqueStyle::drawComplexControl(), QWindowsCEStyle::drawControl(), QWindowsMobileStyle::drawControl(), QCleanlooksStyle::drawControl(), QGtkStyle::drawControl(), QTextDocumentLayoutPrivate::drawListItem(), QScriptDebuggerCodeView::event(), QWorkspace::eventFilter(), QWidgetResizeHandler::keyPressEvent(), QWidgetResizeHandler::mouseMoveEvent(), QWorkspaceTitleBar::mouseMoveEvent(), operator>>(), QTipLabel::placeTip(), QMenu::popup(), QMenuBarPrivate::popupAction(), QToolButtonPrivate::popupTimerDone(), rperp(), rpick(), QPlastiqueStyle::subControlRect(), QCleanlooksStyle::subControlRect(), QETWidget::translateConfigEvent(), QETWidget::translateMouseEvent(), and QETWidget::translateWheelEvent().
|
inline |
Returns a reference to the y coordinate of this point.
Using a reference makes it possible to directly manipulate y. For example:
Definition at line 143 of file qpoint.h.
Referenced by QWorkspacePrivate::_q_showOperationMenu(), QPlastiqueStyle::drawComplexControl(), QScriptDebuggerCodeView::event(), QSystemTrayIconSys::findTrayGeometry(), QWidgetResizeHandler::keyPressEvent(), QWidgetResizeHandler::mouseMoveEvent(), QWorkspaceTitleBar::mouseMoveEvent(), operator>>(), QTipLabel::placeTip(), QToolButtonPrivate::popupTimerDone(), QAccessibleTitleBar::rect(), rperp(), rpick(), QPlastiqueStyle::subControlRect(), QCleanlooksStyle::subControlRect(), QETWidget::translateConfigEvent(), QETWidget::translateMouseEvent(), and QETWidget::translateWheelEvent().
|
inline |
Sets the x coordinate of this point to the given x coordinate.
Definition at line 134 of file qpoint.h.
Referenced by QDialog::adjustPosition(), QAbstractScrollAreaPrivate::contentsOffset(), QOleDropSource::createCursors(), QSvgFont::draw(), QIconModeViewBase::filterDropEvent(), QListModeViewBase::indexToListViewItem(), QMainWindowLayout::insertIntoMacToolbar(), QTabBarPrivate::layoutTab(), QWSMouseHandler::limitToScreen(), QTransformedScreen::mapFromDevice(), QTransformedScreen::mapToDevice(), QTipLabel::placeTip(), PolygonRegion(), QMenu::popup(), QDateTimeEditPrivate::positionCalendarPopup(), QGLMaskTextureCache::quadtreeLocation(), QIntMouseListenThread::run(), QAccessiblePlainTextEdit::scrollBarPosition(), QAccessibleTextEdit::scrollBarPosition(), QDeclarativePointValueType::setX(), QCompleterPrivate::showPopup(), QComboBox::showPopup(), QWorkspace::tile(), and QWSCalibratedMouseHandler::transform().
|
inline |
Sets the y coordinate of this point to the given y coordinate.
Definition at line 137 of file qpoint.h.
Referenced by QDialog::adjustPosition(), QAbstractScrollAreaPrivate::contentsOffset(), QOleDropSource::createCursors(), QListModeViewBase::indexToListViewItem(), QTabBarPrivate::layoutTab(), QWSMouseHandler::limitToScreen(), QTransformedScreen::mapFromDevice(), QTransformedScreen::mapToDevice(), QTipLabel::placeTip(), PolygonRegion(), QMenu::popup(), QMenuBarPrivate::popupAction(), QDateTimeEditPrivate::positionCalendarPopup(), QGLMaskTextureCache::quadtreeLocation(), QIntMouseListenThread::run(), QAccessiblePlainTextEdit::scrollBarPosition(), QAccessibleTextEdit::scrollBarPosition(), QDeclarativePointValueType::setY(), QCompleterPrivate::showPopup(), QWorkspace::tile(), and QWSCalibratedMouseHandler::transform().
|
inline |
Returns the x coordinate of this point.
Definition at line 128 of file qpoint.h.
Referenced by QPushButtonPrivate::adjustedMenuPosition(), QDialog::adjustPosition(), QPainterPrivate::attachPainterPrivate(), QBalloonTip::balloon(), QPainter::begin(), blendCursor(), QAhiScreen::blit(), blit180(), blit270(), blit90(), blit_template(), QPolygon::boundingRect(), QWSCalibratedMouseHandler::calibrate(), QDirectFBCursor::changeCursor(), QPlatformSoftwareCursor::changeCursor(), QAccessibleWidget::childAt(), QAccessibleComboBox::childAt(), QAccessibleMainWindow::childAt(), clipStraightLine(), QListViewPrivate::closestIndex(), QScreen::compose(), QOpenGLPaintEnginePrivate::composite(), QRegion::contains(), QRect::contains(), QScrollBar::contextMenuEvent(), QAbstractSpinBox::contextMenuEvent(), convolute(), QSizeGripPrivate::corner(), QXlibCursor::createCursorBitmap(), QOleDropSource::createCursors(), CreateETandAET(), QDirectFBScreen::createSurface(), QLineEdit::cursorPositionAt(), QToolBarAreaLayoutInfo::distance(), QAbstractItemView::doAutoScroll(), dockPosHelper(), QIconModeViewBase::doDynamicLayout(), QWidgetResizeHandler::doResize(), QListModeViewBase::doStaticLayout(), QDragManager::drag(), QLineEdit::dragMoveEvent(), QListModeViewBase::dragMoveEvent(), QColorWell::dragMoveEvent(), QGraphicsOpacityEffect::draw(), QRenderRule::drawBackgroundImage(), QWindowsVistaStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QVGCompositionHelper::drawCursorPixmap(), QPainter::drawEllipse(), QX11PaintEngine::drawFreetype(), QPainter::drawImage(), QPainter::drawPixmap(), QX11PaintEngine::drawPoints(), QOpenGLPaintEngine::drawPoints(), QVGPaintEngine::drawPoints(), QPaintEngine::drawPoints(), QPaintEngineEx::drawPoints(), drawPoints(), QVGPaintEngine::drawPolygon(), QOpenGLPaintEngine::drawPolygon(), QPaintEngine::drawPolygon(), QPaintBufferEngine::drawPolygon(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QX11PaintEngine::drawRects(), QTreeView::drawRow(), QWindowsMobileStylePrivate::drawScrollbarGrip(), drawTextItemDecoration(), QLineEdit::dropEvent(), QColorWell::dropEvent(), QListModeViewBase::dropOn(), QLine::dx(), effectiveState(), QPlainTextEditPrivate::ensureCursorVisible(), QScrollArea::ensureWidgetVisible(), QMdiSubWindowPrivate::enterRubberBandMode(), QDockWidget::event(), QScriptEdit::extraAreaMouseEvent(), QIconModeViewBase::filterDropEvent(), QX11Data::findClientWindow(), findRealWindow(), QSystemTrayIconSys::findTrayGeometry(), flipPoint(), QDirectFBScreen::flipSurface(), QListViewPrivate::flipX(), QDirectFbWindowSurface::flush(), QX11WindowSurface::flush(), QRasterWindowSurface::flush(), QGraphicsScenePrivate::gestureEventHandler(), QWSCalibratedMouseHandler::getCalibration(), QPlatformSoftwareCursor::getCurrentRect(), QMacInputContext::globalEventProcessor(), QApplicationPrivate::globalEventProcessor(), QPixmap::grabWindow(), QBBScreenEventHandler::handlePointerEvent(), handlePositionAttribute(), QBBScreenEventHandler::handleTouchEvent(), QCommonStyle::hitTestComplexControl(), QMacStyle::hitTestComplexControl(), QColorPicker::huePt(), QColumnView::indexAt(), QTableView::indexAt(), QListView::indexAt(), QTreeView::indexAt(), QListModeViewBase::indexToListViewItem(), QBspTree::init(), QToolBarPrivate::initDrag(), QTriangulator< T >::initialize(), QBBScreenEventHandler::injectPointerMoveEvent(), QMainWindowLayout::insertIntoMacToolbar(), QMenu::internalDelayedPopup(), QWidgetPrivate::invalidateBuffer_resizeHelper(), QWidgetPrivate::isBackgroundInherited(), isServerProcess(), QTreeViewPrivate::itemDecorationAt(), Q3AccessibleTextEdit::itemRect(), QGraphicsView::items(), QWidgetResizeHandler::keyPressEvent(), QAbstractScrollAreaPrivate::layoutChildren(), QTabBarPrivate::layoutTab(), QApplicationPrivate::leaveModal_sys(), QWSMouseHandler::limitToScreen(), QHeaderView::logicalIndexAt(), make_widget_eventUPP(), manhattanLength(), QPointF::manhattanLength(), QMatrix::map(), QTransform::map(), QTransformedScreen::mapFromDevice(), QWidget::mapFromGlobal(), QWidgetPrivate::mapFromGlobal(), QMatrix4x4::mapRect(), QTextEditPrivate::mapToContents(), QPlainTextEditPrivate::mapToContents(), QTransformedScreen::mapToDevice(), QWidget::mapToGlobal(), QWidgetPrivate::mapToGlobal(), QLineEdit::mouseDoubleClickEvent(), QMenuPrivate::mouseEventTaken(), QScrollBar::mouseMoveEvent(), QWidgetResizeHandler::mouseMoveEvent(), QToolBarPrivate::mouseMoveEvent(), QVistaHelper::mouseMoveEvent(), QComboBoxPrivateScroller::mouseMoveEvent(), QLineEdit::mouseMoveEvent(), QGraphicsView::mouseMoveEvent(), QWorkspaceTitleBar::mouseMoveEvent(), QSizeGrip::mousePressEvent(), QScrollBar::mousePressEvent(), QWellArray::mousePressEvent(), QLineEdit::mousePressEvent(), QMultiScreenCursor::move(), QRubberBand::move(), QListViewItem::move(), QWidget::move(), QDirectFBScreenCursor::move(), QRect::moveBottomLeft(), QRect::moveBottomRight(), QRect::moveCenter(), QAbstractButtonPrivate::moveFocus(), QRect::moveTo(), QRect::moveTopLeft(), QRect::moveTopRight(), QAccessibleWidget::navigate(), operator*(), operator<<(), operator>>(), QTableView::paintEvent(), QColorPicker::paintEvent(), perp(), pick(), QSliderPrivate::pick(), QSplitterPrivate::pick(), QSplitterHandlePrivate::pick(), QmlJSDebugger::ColorPickerTool::pickColor(), QImage::pixel(), QImage::pixelIndex(), QMdiAreaPrivate::place(), QTipLabel::placeTip(), QPolygon::point(), QWidgetPrivate::pointToRect(), PolygonRegion(), QMenu::popup(), QMenuBarPrivate::popupAction(), QToolButtonPrivate::popupTimerDone(), QListModeViewBase::position(), QDateTimeEditPrivate::positionCalendarPopup(), QLineControl::processMouseEvent(), PtsToRegion(), QXcbShmImage::put(), PvrEglWindowSurface::PvrEglWindowSurface(), q_createNativeChildrenAndSetParent(), qDrawShadeLine(), QRect::QRect(), qstring_to_xtp(), qt_bitmapToRegion(), qt_cleanlooks_draw_buttongradient(), qt_cleanlooks_draw_gradient(), qt_cleanlooks_draw_mdibutton(), qt_cleanup(), qt_mac_get_widget_rgn(), qt_mac_nativeMapFromParent(), qt_mac_unregister_widget(), qt_mac_update_widget_position(), qt_plastique_draw_gradient(), qt_scrollRectInImage(), qt_win_getKeyboardModifiers(), qt_x11_drawImage(), QtWndProc(), QGLMaskTextureCache::quadtreeClear(), QGLMaskTextureCache::quadtreeLocation(), QVNCClientCursor::QVNCClientCursor(), QSvgIOHandler::read(), QDirectFBMouseHandlerPrivate::readMouseData(), QWSLinuxTPMouseHandlerPrivate::readMouseData(), QMdi::IconTiler::rearrange(), QWinNativePanGestureRecognizer::recognize(), QSwipeGestureRecognizer::recognize(), QAccessibleMenu::rect(), QAccessibleWidget::rect(), QAccessibleTable2::rect(), QAccessibleAbstractSpinBox::rect(), QAccessibleMenuBar::rect(), QAccessibleHeader::rect(), QAccessibleDoubleSpinBox::rect(), QAccessibleScrollBar::rect(), QAccessibleSlider::rect(), QAccessibleDial::rect(), QAccessibleTabBar::rect(), QAccessibleTable2HeaderCell::rect(), QAccessibleMdiSubWindow::rect(), QAccessibleComboBox::rect(), QAccessibleWidget::relationTo(), QWidgetPrivate::render_helper(), QBBScreen::resizeNativeWidgetWindow(), QExpandingLineEdit::resizeToContents(), QBBScreen::resizeTopLevelWindow(), QIntMouseListenThread::run(), QWhatsThisPrivate::say(), QVNCCursor::sendClientCursor(), QWSPcMouseHandlerPrivate::sendEvent(), QWSServer::sendMouseEvent(), QWSInputMethod::sendMouseEvent(), QLineEditPrivate::sendMouseEventToInputContext(), QWSServerPrivate::sendMouseEventUnfiltered(), QRect::setBottomLeft(), QRect::setBottomRight(), QWSServerPrivate::setCursor(), QWidgetPrivate::setGeometry_sys(), QMdiSubWindowPrivate::setNewGeometry(), QHeaderView::setOffset(), QXcbWindow::setParent(), QXlibWindow::setParent(), QImage::setPixel(), QCursor::setPos(), QListView::setSelection(), QRect::setTopLeft(), QRect::setTopRight(), QGLShaderProgram::setUniformValue(), QX11PaintEnginePrivate::setupAdaptedOrigin(), QDeclarativePointValueType::setValue(), QPainter::setViewTransformEnabled(), QAbstractItemViewPrivate::shouldAutoScroll(), QCompleterPrivate::showPopup(), QComboBox::showPopup(), QWhatsThis::showText(), QIconModeViewBase::snapToGrid(), QWorkspace::tile(), QPlainTextEdit::timerEvent(), QTextEdit::timerEvent(), QApplication::topLevelAt(), QTest::toString(), QSplitterPrivate::trans(), QWSCalibratedMouseHandler::transform(), QPolygon::translate(), QRegion::translate(), QRect::translate(), QPainter::translate(), QPolygon::translated(), QRegion::translated(), QRect::translated(), QETWidget::translateMouseEvent(), QImage::trueMatrix(), QWSPcMouseSubHandler_intellimouse::tryData(), QWSPcMouseSubHandler_mouseman::tryData(), QWSPcMouseSubHandler_mousesystems::tryData(), QWSPcMouseSubHandler_ms::tryData(), QXIMInputContext::update(), updateRedirectedToGraphicsProxyWidget(), QImage::valid(), QDialPrivate::valueFromPoint(), QSettingsPrivate::variantToString(), QStyle::visualPos(), QApplication::widgetAt(), QVNCClientCursor::write(), QPNGImageWriter::writeImage(), QLine::x1(), QSystemTrayIconSys::x11Event(), QApplication::x11EventFilter(), QApplication::x11ProcessEvent(), and QLine::x2().
|
inline |
Returns the y coordinate of this point.
Definition at line 131 of file qpoint.h.
Referenced by QPushButtonPrivate::adjustedMenuPosition(), QDialog::adjustPosition(), QPainterPrivate::attachPainterPrivate(), QBalloonTip::balloon(), QPainter::begin(), blendCursor(), QAhiScreen::blit(), blit180(), blit270(), blit90(), blit_template(), QPolygon::boundingRect(), QWSCalibratedMouseHandler::calibrate(), QDirectFBCursor::changeCursor(), QPlatformSoftwareCursor::changeCursor(), QAccessibleWidget::childAt(), QAccessibleComboBox::childAt(), QAccessibleMainWindow::childAt(), clipStraightLine(), QListViewPrivate::closestIndex(), QScreen::compose(), QOpenGLPaintEnginePrivate::composite(), QRegion::contains(), QRect::contains(), convolute(), QSizeGripPrivate::corner(), QXlibCursor::createCursorBitmap(), QOleDropSource::createCursors(), CreateETandAET(), QDirectFBScreen::createSurface(), QToolBarAreaLayoutInfo::distance(), QAbstractItemView::doAutoScroll(), dockPosHelper(), QIconModeViewBase::doDynamicLayout(), QWidgetResizeHandler::doResize(), QListModeViewBase::doStaticLayout(), QDragManager::drag(), QListModeViewBase::dragMoveEvent(), QColorWell::dragMoveEvent(), QGraphicsOpacityEffect::draw(), QRenderRule::drawBackgroundImage(), QWindowsVistaStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QVGCompositionHelper::drawCursorPixmap(), QPainter::drawEllipse(), QX11PaintEngine::drawFreetype(), QPainter::drawImage(), QPainter::drawPixmap(), QX11PaintEngine::drawPoints(), QOpenGLPaintEngine::drawPoints(), QVGPaintEngine::drawPoints(), QPaintEngine::drawPoints(), QPaintEngineEx::drawPoints(), QPainter::drawPoints(), drawPoints(), QVGPaintEngine::drawPolygon(), QOpenGLPaintEngine::drawPolygon(), QPaintEngine::drawPolygon(), QPaintBufferEngine::drawPolygon(), QCommonStyle::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QX11PaintEngine::drawRects(), QTreeView::drawRow(), QWindowsMobileStylePrivate::drawScrollbarGrip(), QVistaHelper::drawTitleBar(), QColorWell::dropEvent(), QListModeViewBase::dropOn(), QLine::dy(), effectiveState(), QScrollArea::ensureWidgetVisible(), QMdiSubWindowPrivate::enterRubberBandMode(), QDockWidget::event(), QScriptEdit::extraAreaMouseEvent(), QX11Data::findClientWindow(), findRealWindow(), QSystemTrayIconSys::findTrayGeometry(), flipPoint(), QDirectFBScreen::flipSurface(), QListViewPrivate::flipX(), QDirectFbWindowSurface::flush(), QX11WindowSurface::flush(), QRasterWindowSurface::flush(), QGraphicsScenePrivate::gestureEventHandler(), QWSCalibratedMouseHandler::getCalibration(), QPlatformSoftwareCursor::getCurrentRect(), QApplicationPrivate::globalEventProcessor(), QPixmap::grabWindow(), QBBScreenEventHandler::handlePointerEvent(), QBBScreenEventHandler::handleTouchEvent(), QMacStyle::hitTestComplexControl(), QColumnView::indexAt(), QTableView::indexAt(), QListView::indexAt(), QTreeView::indexAt(), QBspTree::init(), QToolBarPrivate::initDrag(), QBBScreenEventHandler::injectPointerMoveEvent(), QMenu::internalDelayedPopup(), QWidgetPrivate::invalidateBuffer_resizeHelper(), QWidgetPrivate::isBackgroundInherited(), isServerProcess(), QTreeViewPrivate::itemDecorationAt(), Q3AccessibleTextEdit::itemRect(), QGraphicsView::items(), QWidgetResizeHandler::keyPressEvent(), QMenu::keyPressEvent(), QAbstractScrollAreaPrivate::layoutChildren(), QTabBarPrivate::layoutTab(), QApplicationPrivate::leaveModal_sys(), QWSMouseHandler::limitToScreen(), QHeaderView::logicalIndexAt(), make_widget_eventUPP(), manhattanLength(), QPointF::manhattanLength(), QMatrix::map(), QTransform::map(), QTransformedScreen::mapFromDevice(), QWidget::mapFromGlobal(), QWidgetPrivate::mapFromGlobal(), QMatrix4x4::mapRect(), QTextEditPrivate::mapToContents(), QPlainTextEditPrivate::mapToContents(), QTransformedScreen::mapToDevice(), QWidget::mapToGlobal(), QWidgetPrivate::mapToGlobal(), QMenuPrivate::mouseEventTaken(), QScrollBar::mouseMoveEvent(), QWidgetResizeHandler::mouseMoveEvent(), QToolBarPrivate::mouseMoveEvent(), QVistaHelper::mouseMoveEvent(), QComboBoxPrivateScroller::mouseMoveEvent(), QGraphicsView::mouseMoveEvent(), QWorkspaceTitleBar::mouseMoveEvent(), QSizeGrip::mousePressEvent(), QScrollBar::mousePressEvent(), QWellArray::mousePressEvent(), QMultiScreenCursor::move(), QRubberBand::move(), QListViewItem::move(), QWidget::move(), QDirectFBScreenCursor::move(), QRect::moveBottomLeft(), QRect::moveBottomRight(), QRect::moveCenter(), QAbstractButtonPrivate::moveFocus(), QRect::moveTo(), QRect::moveTopLeft(), QRect::moveTopRight(), QAccessibleWidget::navigate(), operator*(), operator<<(), operator>>(), QTableView::paintEvent(), QColorPicker::paintEvent(), perp(), pick(), QSliderPrivate::pick(), QSplitterPrivate::pick(), QSplitterHandlePrivate::pick(), QmlJSDebugger::ColorPickerTool::pickColor(), QImage::pixel(), QImage::pixelIndex(), QMdiAreaPrivate::place(), QTipLabel::placeTip(), QPolygon::point(), QWidgetPrivate::pointToRect(), PolygonRegion(), QMenu::popup(), QMenuBarPrivate::popupAction(), QAbstractItemViewPrivate::position(), QDateTimeEditPrivate::positionCalendarPopup(), PtsToRegion(), QXcbShmImage::put(), PvrEglWindowSurface::PvrEglWindowSurface(), q_createNativeChildrenAndSetParent(), qDrawShadeLine(), QRect::QRect(), qstring_to_xtp(), qt_bitmapToRegion(), qt_cleanlooks_draw_buttongradient(), qt_cleanlooks_draw_gradient(), qt_cleanup(), qt_mac_get_widget_rgn(), qt_mac_nativeMapFromParent(), qt_mac_unregister_widget(), qt_mac_update_widget_position(), qt_scrollRectInImage(), qt_win_getKeyboardModifiers(), qt_x11_drawImage(), QtWndProc(), QGLMaskTextureCache::quadtreeClear(), QGLMaskTextureCache::quadtreeLocation(), QVNCClientCursor::QVNCClientCursor(), QSvgIOHandler::read(), QDirectFBMouseHandlerPrivate::readMouseData(), QWSLinuxTPMouseHandlerPrivate::readMouseData(), QMdi::IconTiler::rearrange(), QWinNativePanGestureRecognizer::recognize(), QSwipeGestureRecognizer::recognize(), QAccessibleMenu::rect(), QAccessibleWidget::rect(), QAccessibleTable2::rect(), QAccessibleAbstractSpinBox::rect(), QAccessibleMenuBar::rect(), QAccessibleHeader::rect(), QAccessibleDoubleSpinBox::rect(), QAccessibleScrollBar::rect(), QAccessibleSlider::rect(), QAccessibleDial::rect(), QAccessibleTabBar::rect(), QAccessibleTable2HeaderCell::rect(), QAccessibleMdiSubWindow::rect(), QAccessibleComboBox::rect(), QAccessibleTitleBar::rect(), QAccessibleWidget::relationTo(), QWidgetPrivate::render_helper(), QBBScreen::resizeNativeWidgetWindow(), QExpandingLineEdit::resizeToContents(), QBBScreen::resizeTopLevelWindow(), QIntMouseListenThread::run(), QColorPicker::satPt(), QWhatsThisPrivate::say(), QVNCCursor::sendClientCursor(), QWSPcMouseHandlerPrivate::sendEvent(), QWSServer::sendMouseEvent(), QWSInputMethod::sendMouseEvent(), QWSServerPrivate::sendMouseEventUnfiltered(), QRect::setBottomLeft(), QRect::setBottomRight(), QWSServerPrivate::setCursor(), QWidgetPrivate::setGeometry_sys(), QMdiSubWindowPrivate::setNewGeometry(), QHeaderView::setOffset(), QXcbWindow::setParent(), QXlibWindow::setParent(), QImage::setPixel(), QCursor::setPos(), QListView::setSelection(), QRect::setTopLeft(), QRect::setTopRight(), QGLShaderProgram::setUniformValue(), QX11PaintEnginePrivate::setupAdaptedOrigin(), QDeclarativePointValueType::setValue(), QPainter::setViewTransformEnabled(), QAbstractItemViewPrivate::shouldAutoScroll(), QCompleterPrivate::showPopup(), QComboBox::showPopup(), QWhatsThis::showText(), QIconModeViewBase::snapToGrid(), QStyleSheetStyle::subControlRect(), QCommonStyle::subElementRect(), QMacStyle::subElementRect(), QCommonStylePrivate::tabLayout(), QWorkspace::tile(), QPlainTextEdit::timerEvent(), QTextEdit::timerEvent(), QApplication::topLevelAt(), QTest::toString(), QSplitterPrivate::trans(), QWSCalibratedMouseHandler::transform(), QPolygon::translate(), QRegion::translate(), QRect::translate(), QPainter::translate(), QPolygon::translated(), QRegion::translated(), QRect::translated(), QETWidget::translateMouseEvent(), QImage::trueMatrix(), QWSPcMouseSubHandler_intellimouse::tryData(), QWSPcMouseSubHandler_mouseman::tryData(), QWSPcMouseSubHandler_mousesystems::tryData(), QWSPcMouseSubHandler_ms::tryData(), QXIMInputContext::update(), updateRedirectedToGraphicsProxyWidget(), QImage::valid(), QDialPrivate::valueFromPoint(), QSettingsPrivate::variantToString(), QStyle::visualPos(), QApplication::widgetAt(), QVNCClientCursor::write(), QPNGImageWriter::writeImage(), QSystemTrayIconSys::x11Event(), QApplication::x11EventFilter(), QApplication::x11ProcessEvent(), QLine::y1(), and QLine::y2().
Returns a copy of the given point multiplied by the given factor.
Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy.
Definition at line 173 of file qpoint.h.
Returns a copy of the given point multiplied by the given factor.
Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy.
Definition at line 176 of file qpoint.h.
Returns a copy of the given point multiplied by the given factor.
Definition at line 179 of file qpoint.h.
Returns a QPoint object that is the sum of the given points, p1 and p2; each component is added separately.
Definition at line 167 of file qpoint.h.
Returns a QPoint object that is formed by subtracting p2 from p1; each component is subtracted separately.
Definition at line 170 of file qpoint.h.
Returns a QPoint object that is formed by changing the sign of both components of the given point.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Equivalent to QPoint(0,0) - point
.
Definition at line 191 of file qpoint.h.
Returns the QPoint formed by dividing both components of the given point by the given divisor.
Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy.
Definition at line 201 of file qpoint.h.
|
related |
Writes the given point to the given stream and returns a reference to the stream.
Definition at line 435 of file qpoint.cpp.
Referenced by operator/().
|
related |
Reads a point from the given stream into the given point and returns a reference to the stream.
Definition at line 457 of file qpoint.cpp.
|
friend |
|
private |
Definition at line 98 of file qpoint.h.
Referenced by isNull(), QTransform::map(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator==(), QPoint(), rx(), setX(), and x().
|
private |
Definition at line 97 of file qpoint.h.
Referenced by isNull(), QTransform::map(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator==(), QPoint(), ry(), setY(), and y().