![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore\reentrant More...
#include <qpoint.h>
Public Member Functions | |
constexpr | QPoint () noexcept |
Constructs a null point, i.e. | |
constexpr | QPoint (int xpos, int ypos) noexcept |
Constructs a point with the given coordinates (xpos, ypos). | |
constexpr bool | isNull () const noexcept |
Returns true if both the x and y coordinates are set to 0, otherwise returns false . | |
constexpr int | x () const noexcept |
Returns the x coordinate of this point. | |
constexpr int | y () const noexcept |
Returns the y coordinate of this point. | |
constexpr void | setX (int x) noexcept |
Sets the x coordinate of this point to the given x coordinate. | |
constexpr void | setY (int y) noexcept |
Sets the y coordinate of this point to the given y coordinate. | |
constexpr 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. | |
constexpr QPoint | transposed () const noexcept |
constexpr int & | rx () noexcept |
Returns a reference to the x coordinate of this point. | |
constexpr int & | ry () noexcept |
Returns a reference to the y coordinate of this point. | |
constexpr QPoint & | operator+= (const QPoint &p) |
Adds the given point to this point and returns a reference to this point. | |
constexpr QPoint & | operator-= (const QPoint &p) |
Subtracts the given point from this point and returns a reference to this point. | |
constexpr QPoint & | operator*= (float factor) |
Multiplies this point's coordinates by the given factor, and returns a reference to this point. | |
constexpr QPoint & | operator*= (double factor) |
Multiplies this point's coordinates by the given factor, and returns a reference to this point. | |
constexpr QPoint & | operator*= (int factor) |
Multiplies this point's coordinates by the given factor, and returns a reference to this point. | |
constexpr QPoint & | operator/= (qreal divisor) |
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. | |
constexpr QPointF | toPointF () const noexcept |
Static Public Member Functions | |
static constexpr int | dotProduct (const QPoint &p1, const QPoint &p2) |
Friends | |
class | QTransform |
constexpr bool | operator== (const QPoint &p1, const QPoint &p2) noexcept |
Returns true if p1 and p2 are equal; otherwise returns false. | |
constexpr bool | operator!= (const QPoint &p1, const QPoint &p2) noexcept |
Returns true if p1 and p2 are not equal; otherwise returns false . | |
constexpr QPoint | operator+ (const QPoint &p1, const QPoint &p2) noexcept |
Returns a QPoint object that is the sum of the given points, p1 and p2; each component is added separately. | |
constexpr QPoint | operator- (const QPoint &p1, const QPoint &p2) noexcept |
Returns a QPoint object that is formed by subtracting p2 from p1; each component is subtracted separately. | |
constexpr QPoint | operator* (const QPoint &p, float factor) |
Returns a copy of the given point multiplied by the given factor. | |
constexpr QPoint | operator* (const QPoint &p, double factor) |
Returns a copy of the given point multiplied by the given factor. | |
constexpr QPoint | operator* (const QPoint &p, int factor) noexcept |
Returns a copy of the given point multiplied by the given factor. | |
constexpr QPoint | operator* (float factor, const QPoint &p) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a copy of the given point multiplied by the given factor. | |
constexpr QPoint | operator* (double factor, const QPoint &p) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a copy of the given point multiplied by the given factor. | |
constexpr QPoint | operator* (int factor, const QPoint &p) noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a copy of the given point multiplied by the given factor. | |
constexpr QPoint | operator+ (const QPoint &p) noexcept |
constexpr QPoint | operator- (const QPoint &p) noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a QPoint object that is formed by changing the sign of both components of the given point. | |
constexpr QPoint | operator/ (const QPoint &p, qreal c) |
Returns the QPoint formed by dividing both components of the given point by the given divisor. | |
template<std::size_t I, typename P , std::enable_if_t<(I< 2), bool > = true, std::enable_if_t< std::is_same_v< q20::remove_cvref_t< P >, QPoint >, bool > = true> | |
constexpr decltype(auto) | get (P &&p) noexcept |
Related Symbols | |
(Note that these are not member symbols.) | |
QDataStream & | operator<< (QDataStream &stream, const QPoint &point) |
Writes the given point to the given stream and returns a reference to the stream. | |
QDataStream & | operator>> (QDataStream &stream, QPoint &point) |
Reads a point from the given stream into the given point and returns a reference to the stream. | |
\inmodule QtCore
\reentrant
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.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Returns the dot product of p1 and p2.
|
inlineconstexprnoexcept |
Returns true
if both the x and y coordinates are set to 0, otherwise returns false
.
Definition at line 122 of file qpoint.h.
Referenced by QGraphicsViewPrivate::canStartScrollingAt(), QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), QWindowSystemInterface::handleWheelEvent(), QRhiVulkan::prepareUploadSubres(), and QWaylandSurfacePrivate::surface_commit().
|
inlineconstexpr |
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 147 of file qpoint.h.
References qAbs().
Referenced by moveToVirtualScreen(), QTapGestureRecognizer::recognize(), and QTapAndHoldGestureRecognizer::recognize().
|
inlineconstexpr |
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 183 of file qpoint.h.
References qRound().
|
inlineconstexpr |
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 176 of file qpoint.h.
References qRound().
|
inlineconstexpr |
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
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 197 of file qpoint.h.
References qRound().
|
inlineconstexprnoexcept |
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 152 of file qpoint.h.
Referenced by QQuickTableViewPrivate::calculateTopLeft(), QWidgetResizeHandler::keyPressEvent(), makeDistanceField(), QGraphicsView::mapToScene(), QWidgetResizeHandler::mouseMoveEvent(), QQuickTableViewPrivate::normalizeSelection(), operator>>(), and QQuickTableViewPrivate::selectionRectangle().
|
inlineconstexprnoexcept |
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 157 of file qpoint.h.
Referenced by QQuickTableViewPrivate::calculateTopLeft(), QWidgetResizeHandler::keyPressEvent(), makeDistanceField(), QWidgetResizeHandler::mouseMoveEvent(), QQuickTableViewPrivate::normalizeSelection(), operator>>(), and QQuickTableViewPrivate::selectionRectangle().
|
inlineconstexprnoexcept |
Sets the x coordinate of this point to the given x coordinate.
Definition at line 137 of file qpoint.h.
Referenced by QWindowGeometrySpecification::applyTo(), QtWaylandClient::QWaylandIviShellIntegration::createShellSurface(), QSvgFont::draw(), QXcbWindow::handleButtonPressEvent(), QDateTimeEditPrivate::positionCalendarPopup(), HIDDeviceHandler::process_event(), QLibInputPointer::processAbsMotion(), QLibInputPointer::processAxis(), QLibInputPointer::processMotion(), QEvdevMouseHandler::readMouseData(), QPlatformCursorImage::set(), QPlatformCursorImage::set(), QLibInputPointer::setPos(), QComboBox::showPopup(), QWindowsMouseHandler::translateMouseEvent(), QWindowsPointerHandler::translateMouseEvent(), and QAndroidInputContext::updateSelectionHandles().
|
inlineconstexprnoexcept |
Sets the y coordinate of this point to the given y coordinate.
Definition at line 142 of file qpoint.h.
Referenced by QWindowGeometrySpecification::applyTo(), QtWaylandClient::QWaylandIviShellIntegration::createShellSurface(), QXcbWindow::handleButtonPressEvent(), QAndroidInputContext::handleLocationChanged(), HIDDeviceHandler::process_event(), QLibInputPointer::processAbsMotion(), QLibInputPointer::processAxis(), QLibInputPointer::processMotion(), QEvdevMouseHandler::readMouseData(), QPlatformCursorImage::set(), QPlatformCursorImage::set(), and QLibInputPointer::setPos().
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Returns a point with x and y coordinates exchanged:
Definition at line 37 of file qpoint.h.
Referenced by QXcbWindow::handleButtonPressEvent().
|
inlineconstexprnoexcept |
Returns the x coordinate of this point.
Definition at line 127 of file qpoint.h.
Referenced by QDialog::adjustPosition(), QQuickTableViewPrivate::TableEdgeLoadRequest::begin(), QPainter::begin(), QPolygon::boundingRect(), calcPosition(), QQuickTableViewPrivate::calculateTopLeft(), QQuickTableViewPrivate::cellIsValid(), QLine::center(), QLineF::center(), QDirectFBCursor::changeCursor(), QFbCursor::changeCursor(), QEglFSKmsGbmCursor::changeCursor(), QQuickDeliveryAgentPrivate::checkIfDoubleTapped(), clipStraightLine(), QListViewPrivate::closestIndex(), convolute(), QSizeGripPrivate::corner(), QWindowsOleDropSource::createCursors(), QWindowsCursor::createPixmapCursor(), QtWaylandClient::QWaylandIviShellIntegration::createShellSurface(), QLineEdit::cursorPositionAt(), QQuickDeliveryAgentPrivate::deliverTouchAsMouse(), QWidgetResizeHandler::doResize(), QXcbWindow::doStartSystemMoveResize(), QCocoaDrag::drag(), QQC2::QWindowsXPStyle::drawComplexControl(), QWindowsVistaStyle::drawComplexControl(), QMacStyle::drawControl(), QX11PaintEngine::drawPoints(), QQC2_NAMESPACE::QMacStyle::drawPrimitive(), QQC2::QCommonStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), drawRectangle(), QX11PaintEngine::drawRects(), drawTextItemDecoration(), QLine::dx(), QLineF::dx(), QRhiGles2::enqueueResourceUpdates(), QRhiVulkan::enqueueResourceUpdates(), QRhiD3D11::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), QPlainTextEditPrivate::ensureCursorVisible(), QScrollArea::ensureVisible(), QScrollArea::ensureWidgetVisible(), QDockWidget::event(), QWindowsContext::findPlatformWindowAt(), QXcbDrag::findXdndAwareTarget(), QBackingStore::flush(), QGraphicsScenePrivate::gestureEventHandler(), QScreen::grabWindow(), QQuickTableViewHoverHandler::handleEventPoint(), QWidgetWindow::handleMouseEvent(), QWindowsWindow::handleNonClientHitTest(), QWindowSystemInterface::handleWheelEvent(), QQC2_NAMESPACE::QMacStyle::hitTestComplexControl(), QMacStyle::hitTestComplexControl(), QTreeView::indexAt(), QToolBarPrivate::initDrag(), QWidgetPrivate::invalidateBackingStore_resizeHelper(), invisibleMargins(), QLineF::isNull(), QQuickTableViewPrivate::layoutTopLeftItem(), QQuickVisualTestUtils::lerpPoints(), QQuickTableViewPrivate::loadInitialTable(), QHeaderView::logicalIndexAt(), makeDistanceField(), QTransform::map(), QMatrix4x4::map(), QTransform::map(), QWindowsGeometryHint::mapFromGlobal(), QMatrix4x4::mapRect(), QDoubleMatrix4x4::mapRect(), QPlainTextEditPrivate::mapToContents(), QTextEditPrivate::mapToContents(), QWindowsGeometryHint::mapToGlobal(), mapToGlobalTransform(), QQuickTreeView::modelIndex(), QQuickTableViewPrivate::modelIndexAtCell(), QScrollBar::mouseMoveEvent(), QSizeGrip::mouseMoveEvent(), QToolBarPrivate::mouseMoveEvent(), QWidgetResizeHandler::mouseMoveEvent(), QtPrivate::QColorWell::mouseMoveEvent(), QComboBoxPrivateScroller::mouseMoveEvent(), QDockWidgetPrivate::mouseMoveEvent(), QGraphicsView::mouseMoveEvent(), QtPrivate::QWellArray::mousePressEvent(), QScrollBar::mousePressEvent(), QXcbDrag::move(), QAbstractButtonPrivate::moveFocus(), QQuickTableViewPrivate::normalizeSelection(), operator<<(), QCursor::operator>>(), QtPrivate::QColorPicker::paintEvent(), QSliderPrivate::pick(), QImage::pixel(), QImage::pixelColor(), QImage::pixelIndex(), QMdiAreaPrivate::place(), QLineF::pointAt(), QMenuPrivate::popup(), QDateTimeEditPrivate::positionCalendarPopup(), QQuickTableView::positionViewAtCell(), QRhiVulkan::prepareUploadSubres(), HIDDeviceHandler::process_event(), QLibInputPointer::processMotion(), qt_gtk_menu_position_func(), qt_xcb_createCursorXRender(), QEglFSKmsScreen::rawGeometry(), QSvgIOHandler::read(), QPdfIOHandler::read(), QMdi::IconTiler::rearrange(), QWidgetPrivate::render_helper(), QWidgetPrivate::safeAreaMargins(), QQuickTableViewPrivate::selection(), QQuickTableViewPrivate::selectionRectangle(), QWaylandOutputPrivate::sendGeometry(), QWaylandOutput::setAvailableGeometry(), QQuickTableViewPrivate::setCurrentIndexFromKeyEvent(), QWidgetPrivate::setGeometry_sys(), QLineF::setLength(), QMdiSubWindowPrivate::setNewGeometry(), QHeaderView::setOffset(), QXcbWindow::setParent(), QImage::setPixel(), QImage::setPixelColor(), QPolygon::setPoint(), QEglFSKmsGbmCursor::setPos(), QWindowsCursor::setPos(), QXcbCursor::setPos(), QCocoaCursor::setPos(), QQuickTableViewPrivate::setSelectionEndPos(), QQuickTableViewPrivate::setSelectionStartPos(), QSGDefaultSpriteNode::setSheetSize(), QOpenGLShaderProgram::setUniformValue(), QComboBox::showPopup(), QWindowsPopupMenu::showPopup(), QMenu::showTearOffMenu(), QRhiNull::simulateTextureUpload(), QWaylandSurfacePrivate::surface_commit(), QPlainTextEdit::timerEvent(), QTextEdit::timerEvent(), glyph_metrics_t::transformed(), QWindowsMouseHandler::translateMouseEvent(), QWindowsPointerHandler::translateMouseEvent(), QColorDialogPrivate::updateColorLabelText(), QQuickTableViewPrivate::updateCurrentRowAndColumn(), QtAndroidInput::updateHandles(), QQuickTreeViewPrivate::updateRequiredProperties(), QAndroidInputContext::updateSelectionHandles(), QtWaylandClient::QWaylandEglWindow::updateSurface(), QQuickScreenInfo::virtualX(), QStyle::visualPos(), QQC2::QStyle::visualPos(), QApplication::widgetAt(), QWindowsSystemTrayIcon::winEvent(), QLine::x1(), QLineF::x1(), QLine::x2(), QLineF::x2(), and QWaylandXdgOutputV1Private::zxdg_output_v1_bind_resource().
|
inlineconstexprnoexcept |
Returns the y coordinate of this point.
Definition at line 132 of file qpoint.h.
Referenced by QDialog::adjustPosition(), QQuickTableViewPrivate::TableEdgeLoadRequest::begin(), QPainter::begin(), QPolygon::boundingRect(), calcPosition(), QQuickTableViewPrivate::calculateTopLeft(), QQuickTableViewPrivate::cellIsValid(), QLine::center(), QLineF::center(), QDirectFBCursor::changeCursor(), QFbCursor::changeCursor(), QEglFSKmsGbmCursor::changeCursor(), QQuickDeliveryAgentPrivate::checkIfDoubleTapped(), clipStraightLine(), QListViewPrivate::closestIndex(), convolute(), QSizeGripPrivate::corner(), QWindowsOleDropSource::createCursors(), QWindowsCursor::createPixmapCursor(), QtWaylandClient::QWaylandIviShellIntegration::createShellSurface(), QQuickDeliveryAgentPrivate::deliverTouchAsMouse(), QWidgetResizeHandler::doResize(), QXcbWindow::doStartSystemMoveResize(), QCocoaDrag::drag(), QQC2::QWindowsXPStyle::drawComplexControl(), QWindowsVistaStyle::drawComplexControl(), QMacStyle::drawControl(), QX11PaintEngine::drawPoints(), QQC2_NAMESPACE::QMacStyle::drawPrimitive(), QQC2::QCommonStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), drawRectangle(), QX11PaintEngine::drawRects(), QLine::dy(), QLineF::dy(), QRhiGles2::enqueueResourceUpdates(), QRhiVulkan::enqueueResourceUpdates(), QRhiD3D11::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), QScrollArea::ensureWidgetVisible(), QDockWidget::event(), QWindowsContext::findPlatformWindowAt(), QXcbDrag::findXdndAwareTarget(), QBackingStore::flush(), QGraphicsScenePrivate::gestureEventHandler(), QScreen::grabWindow(), QQuickTableViewHoverHandler::handleEventPoint(), QAndroidInputContext::handleLocationChanged(), QWidgetWindow::handleMouseEvent(), QWindowsWindow::handleNonClientHitTest(), QWindowSystemInterface::handleWheelEvent(), QQC2_NAMESPACE::QMacStyle::hitTestComplexControl(), QMacStyle::hitTestComplexControl(), QTreeView::indexAt(), QToolBarPrivate::initDrag(), QWidgetPrivate::invalidateBackingStore_resizeHelper(), invisibleMargins(), QLineF::isNull(), QMenu::keyPressEvent(), QQuickTreeView::keyPressEvent(), QQuickTableViewPrivate::layoutTopLeftItem(), QQuickVisualTestUtils::lerpPoints(), QQuickTableViewPrivate::loadInitialTable(), QHeaderView::logicalIndexAt(), makeDistanceField(), QMatrix4x4::map(), QWindowsGeometryHint::mapFromGlobal(), QMatrix4x4::mapRect(), QDoubleMatrix4x4::mapRect(), QPlainTextEditPrivate::mapToContents(), QTextEditPrivate::mapToContents(), QWindowsGeometryHint::mapToGlobal(), mapToGlobalTransform(), QQuickTreeView::modelIndex(), QQuickTableViewPrivate::modelIndexAtCell(), QScrollBar::mouseMoveEvent(), QSizeGrip::mouseMoveEvent(), QToolBarPrivate::mouseMoveEvent(), QWidgetResizeHandler::mouseMoveEvent(), QtPrivate::QColorWell::mouseMoveEvent(), QComboBoxPrivateScroller::mouseMoveEvent(), QGraphicsView::mouseMoveEvent(), QtPrivate::QWellArray::mousePressEvent(), QScrollBar::mousePressEvent(), QXcbDrag::move(), QAbstractButtonPrivate::moveFocus(), QQuickTableViewPrivate::normalizeSelection(), operator<<(), QCursor::operator>>(), QtPrivate::QColorPicker::paintEvent(), QSliderPrivate::pick(), QImage::pixel(), QImage::pixelColor(), QImage::pixelIndex(), QMdiAreaPrivate::place(), QTipLabel::placeTip(), QLineF::pointAt(), QMenuPrivate::popup(), QDateTimeEditPrivate::positionCalendarPopup(), QQuickTableView::positionViewAtCell(), QRhiVulkan::prepareUploadSubres(), HIDDeviceHandler::process_event(), QLibInputPointer::processMotion(), QMenuSloppyState::processMouseEvent(), qt_gtk_menu_position_func(), qt_xcb_createCursorXRender(), QEglFSKmsScreen::rawGeometry(), QSvgIOHandler::read(), QPdfIOHandler::read(), QMdi::IconTiler::rearrange(), QWidgetPrivate::render_helper(), QWidgetPrivate::safeAreaMargins(), QQuickTableViewPrivate::selection(), QQuickTableViewPrivate::selectionRectangle(), QWaylandOutputPrivate::sendGeometry(), QWaylandOutput::setAvailableGeometry(), QQuickTableViewPrivate::setCurrentIndexFromKeyEvent(), QWidgetPrivate::setGeometry_sys(), QLineF::setLength(), QMdiSubWindowPrivate::setNewGeometry(), QHeaderView::setOffset(), QXcbWindow::setParent(), QImage::setPixel(), QImage::setPixelColor(), QPolygon::setPoint(), QEglFSKmsGbmCursor::setPos(), QWindowsCursor::setPos(), QXcbCursor::setPos(), QCocoaCursor::setPos(), QSplitter::setRubberBand(), QQuickTableViewPrivate::setSelectionEndPos(), QQuickTableViewPrivate::setSelectionStartPos(), QSGDefaultSpriteNode::setSheetSize(), QOpenGLShaderProgram::setUniformValue(), QComboBox::showPopup(), QCocoaMenu::showPopup(), QWindowsPopupMenu::showPopup(), QMenu::showTearOffMenu(), QRhiNull::simulateTextureUpload(), QQC2_NAMESPACE::QMacStyle::subElementRect(), QMacStyle::subElementRect(), QPlainTextEdit::timerEvent(), QTextEdit::timerEvent(), toBottomLeftRect(), toBottomLeftRect(), QColorDialogPrivate::updateColorLabelText(), QQuickTableViewPrivate::updateCurrentRowAndColumn(), QtAndroidInput::updateHandles(), QTabBarPrivate::updateMacBorderMetrics(), QToolBarLayout::updateMacBorderMetrics(), QQuickTreeViewPrivate::updateRequiredProperties(), QAndroidInputContext::updateSelectionHandles(), QtWaylandClient::QWaylandEglWindow::updateSurface(), QQuickScreenInfo::virtualY(), QStyle::visualPos(), QQC2::QStyle::visualPos(), QApplication::widgetAt(), QWindowsSystemTrayIcon::winEvent(), QLine::y1(), QLineF::y1(), QLine::y2(), QLineF::y2(), and QWaylandXdgOutputV1Private::zxdg_output_v1_bind_resource().
|
friend |
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.
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.
Returns a copy of the given point multiplied by the given factor.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.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.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.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.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a copy of the given point multiplied by the given factor.
Returns a QPoint object that is the sum of the given points, p1 and p2; each component is added separately.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a QPoint object that is formed by changing the sign of both components of the given point.
Equivalent to {QPoint(0,0) - point}.
Returns a QPoint object that is formed by subtracting p2 from p1; each component is subtracted separately.
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.
|
related |
Writes the given point to the given stream and returns a reference to the stream.
Definition at line 371 of file qpoint.cpp.
|
related |
Reads a point from the given stream into the given point and returns a reference to the stream.
Definition at line 390 of file qpoint.cpp.
|
friend |