#include <qpoint.h>
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.
Definition at line 33 of file qpoint.h.
Public Member Functions | |
| QPoint () | |
| QPoint (int xpos, int ypos) | |
| bool | isNull () const |
| int | x () const |
| int | y () const |
| void | setX (int x) |
| void | setY (int y) |
| int | manhattanLength () const |
| int & | rx () |
| int & | ry () |
| QPoint & | operator+= (const QPoint &p) |
| QPoint & | operator-= (const QPoint &p) |
| QPoint & | operator *= (qreal c) |
| QPoint & | operator/= (qreal c) |
Private Attributes | |
| int | xp |
| int | yp |
Friends | |
| bool | operator== (const QPoint &, const QPoint &) |
| bool | operator!= (const QPoint &, const QPoint &) |
| const QPoint | operator+ (const QPoint &, const QPoint &) |
| const QPoint | operator- (const QPoint &, const QPoint &) |
| const QPoint | operator * (const QPoint &, qreal) |
| const QPoint | operator * (qreal, const QPoint &) |
| const QPoint | operator- (const QPoint &) |
| const QPoint | operator/ (const QPoint &, qreal) |
Related Functions | |
| (Note that these are not member functions.) | |
| QDataStream & | operator<< (QDataStream &stream, const QPoint &point) |
| QDataStream & | operator>> (QDataStream &stream, QPoint &point) |
| QPoint::QPoint | ( | ) | [inline] |
| QPoint::QPoint | ( | int | x, | |
| int | y | |||
| ) | [inline] |
| bool QPoint::isNull | ( | ) | const [inline] |
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
Definition at line 96 of file qpoint.h.
Referenced by Q3ListView::doAutoScroll(), QX11WindowSurface::flush(), QDesignerMenuBar::handleMouseMoveEvent(), QDesignerMenu::handleMouseMoveEvent(), qdesigner_internal::FormWindow::handleMouseMoveEvent(), QDesignerToolBar::handleMouseMoveEvent(), QTest::mouseEvent(), SvgWindow::mouseMoveEvent(), PreviewView::mouseMoveEvent(), QPainterPrivate::updateMatrix(), and MandelbrotWidget::updatePixmap().
| int QPoint::x | ( | ) | const [inline] |
Returns the x coordinate of this point.
Definition at line 99 of file qpoint.h.
References xp.
Referenced by QPushButtonPrivate::_q_popupPressed(), OublietteLevel::addItemToTile(), Launcher::addVersionAndCopyright(), QLayoutSupport::adjustIndicator(), QDialog::adjustPosition(), QAnimationWriter::appendFrame(), QBalloonTip::balloon(), qdesigner_internal::FormWindowManager::beginDrag(), QPolygon::boundingRect(), Q3TextEdit::charAt(), QAccessibleComboBox::childAt(), QAccessibleWidget::childAt(), qdesigner_internal::classifyLine(), OublietteLevel::clearTileFlags(), Q3Table::contentsContextMenuEvent(), Q3ListView::contentsContextMenuEvent(), Q3Table::contentsDragEnterEvent(), Q3Table::contentsDragMoveEvent(), Q3Table::contentsMouseDoubleClickEvent(), Q3ListView::contentsMouseDoubleClickEvent(), Q3Table::contentsMouseMoveEvent(), Q3Table::contentsMousePressEventEx(), Q3ListView::contentsMousePressEventEx(), Q3Table::contentsMouseReleaseEvent(), Q3ListView::contentsMouseReleaseEventEx(), Q3ScrollView::contentsToViewport(), Q3Table::contentsToViewport2(), CreateETandAET(), QAbstractFormBuilder::createProperty(), QLineEdit::cursorPositionAt(), VariantDelegate::displayText(), QAbstractItemView::doAutoScroll(), Q3ListBox::doAutoScroll(), Q3IconView::doAutoScroll(), Q3Table::doAutoScroll(), dockPos(), QListViewPrivate::doDynamicLayout(), QWidgetResizeHandler::doResize(), QPolygonalProcessor::doSpans(), QListViewPrivate::doStaticLayout(), QColorWell::dragMoveEvent(), QLineEdit::dragMoveEvent(), Q3IconView::dragObject(), QPainterPrivate::draw_helper(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), ArthurStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QCleanlooksStyle::drawControl(), QWindowsStyle::drawControl(), QFrame::drawFrame(), Q3DockWindowResizeHandle::drawLine(), QPainter::drawPoints(), QPaintEngine::drawPoints(), QX11PaintEngine::drawPoints(), QCommonStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QTreeView::drawRow(), Q3Canvas::drawViewArea(), QColorWell::dropEvent(), QLineEdit::dropEvent(), QLine::dx(), ellipseSpansClipped(), Q3TextTable::enterAt(), Q3IconView::eventFilter(), QDesignerTabWidget::eventFilter(), Oubliette::fillTile(), Q3IconViewPrivate::findContainers(), QX11WindowSurface::flush(), QRasterWindowSurface::flush(), QRasterPaintEngine::flush(), Q3ScrollView::focusNextPrevChild(), QPixelTool::grabScreen(), grabWidget_helper(), qdesigner_internal::FormWindow::gridPoint(), qdesigner_internal::FormWindow::handleArrowKeyEvent(), Q3IconView::handleItemChange(), Q3TextEdit::handleMouseMove(), Q3DockWindow::handleMove(), QCommonStyle::hitTestComplexControl(), QColorPicker::huePt(), PieView::indexAt(), QTableView::indexAt(), QTreeView::indexAt(), QListViewPrivate::indexToListViewItem(), qdesigner_internal::LayoutCommand::init(), qdesigner_internal::BreakLayoutCommand::init(), QMenu::internalDelayedPopup(), QListView::internalDrop(), Q3SimpleRichText::inText(), Q3ListView::itemAt(), Q3ListBox::itemAt(), QTreeViewPrivate::itemDecorationAt(), ItemEffect::ItemEffect(), Q3AccessibleTextEdit::itemRect(), QWidgetResizeHandler::keyPressEvent(), Oubliette::keyPressEvent(), QAbstractScrollAreaPrivate::layoutChildren(), qdesigner_internal::lineEntryPos(), QHeaderView::logicalIndexAt(), manhattanLength(), QWidget::mapFromGlobal(), QTextEditPrivate::mapToContents(), QLineEdit::mouseDoubleClickEvent(), Q3Header::mouseDoubleClickEvent(), qdesigner_internal::QtGradientStopsWidget::mouseDoubleClickEvent(), QMenuPrivate::mouseEventTaken(), BasicToolsPlugin::mouseMove(), QView3DWidget::mouseMoveEvent(), qdesigner_internal::QtColorLinePrivate::mouseMoveEvent(), qdesigner_internal::QtGradientStopsWidget::mouseMoveEvent(), SvgWindow::mouseMoveEvent(), QWidgetResizeHandler::mouseMoveEvent(), CannonField::mouseMoveEvent(), PreviewView::mouseMoveEvent(), QColorWell::mouseMoveEvent(), Q3Header::mouseMoveEvent(), QLineEdit::mouseMoveEvent(), qdesigner_internal::QtGradientWidget::mouseMoveEvent(), CharacterWidget::mouseMoveEvent(), qdesigner_internal::WidgetHandle::mouseMoveEvent(), QScrollBar::mouseMoveEvent(), QToolBarHandle::mouseMoveEvent(), Q3DockWindowResizeHandle::mouseMoveEvent(), QGraphicsView::mouseMoveEvent(), QComboBoxPrivateScroller::mouseMoveEvent(), QWellArray::mousePressEvent(), qdesigner_internal::QtGradientWidget::mousePressEvent(), qdesigner_internal::QtGradientStopsWidget::mousePressEvent(), QDateTimeEdit::mousePressEvent(), Q3Header::mousePressEvent(), QLineEdit::mousePressEvent(), QScrollBar::mousePressEvent(), Q3DateTimeEditor::mousePressEvent(), Q3DockWindowResizeHandle::mouseReleaseEvent(), PageCurl::mouseReleaseEvent(), qdesigner_internal::WidgetHandle::mouseReleaseEvent(), Q3Header::mouseReleaseEvent(), MandelbrotWidget::mouseReleaseEvent(), Q3IconViewItem::move(), QDragManager::move(), Q3IconViewItem::moveBy(), Q3DockArea::moveDockWindow(), QAbstractButtonPrivate::moveFocus(), QAccessibleWidget::navigate(), Q3IconView::neighbourItem(), qdesigner_internal::QtGradientStopsWidgetPrivate::newStop(), operator<<(), Q3TextEdit::optimDoAutoScroll(), Q3TextEdit::optimMousePressEvent(), Q3TextEdit::optimMouseReleaseEvent(), PathStrokeRenderer::paint(), QColorPicker::paintEvent(), QTableView::paintEvent(), TicTacToe::paintEvent(), MandelbrotWidget::paintEvent(), QPixelTool::paintEvent(), paintGrid(), qdesigner_internal::paintGround(), perp(), QSplitterHandlePrivate::pick(), QSplitterPrivate::pick(), pick(), QSliderPrivate::pick(), pick_perp(), QImage::pixel(), QImage::pixelIndex(), Q3TextCursor::place(), qdesigner_internal::pointAboveLine(), QMenu::popup(), Q3ComboBox::popup(), PtsToRegion(), Q3CanvasPixmap::Q3CanvasPixmap(), qDrawShadeLine(), QRect::QRect(), qt_cleanlooks_draw_gradient(), qt_cleanlooks_draw_mdibutton(), Q3AccessibleHeader::rect(), QAccessibleSpinBox::rect(), QAccessibleHeader::rect(), QAccessibleWidget::rect(), QAccessibleMenu::rect(), QAccessibleMenuBar::rect(), QAccessibleWidget::relationTo(), QDockWidgetPrivate::relayout(), QToolBar::resizeEvent(), QExpandingLineEdit::resizeToContents(), QWhatsThisPrivate::say(), OublietteView::scrollToCharacter(), Q3TableHeader::sectionWidthChanged(), QLineEditPrivate::sendMouseEventToInputContext(), QMainWindowLayout::setGeometry(), QHeaderView::setOffset(), QImage::setPixel(), OublietteLevel::setTile(), qdesigner_internal::Layout::setup(), qdesigner_internal::PointProperty::setValue(), QAbstractItemViewPrivate::shouldAutoScroll(), QCompleterPrivate::showPopup(), QComboBox::showPopup(), QWhatsThis::showText(), QListViewPrivate::snapToGrid(), Q3IconView::startDrag(), qdesigner_internal::QtGradientStopsWidgetPrivate::stopAt(), qdesigner_internal::QtGradientStopsWidgetPrivate::stopsAt(), CannonField::targetRect(), PuzzleWidget::targetSquare(), OublietteLevel::tile(), qdesigner_internal::SignalSlotConnection::toUi(), QSplitterPrivate::trans(), QPolygon::translate(), QPainter::translate(), QETWidget::translateMouseEvent(), qdesigner_internal::WidgetHandle::trySetGeometry(), Q3DockWindow::undock(), Oubliette::updateExplored(), QPainterPrivate::updateMatrix(), PathStrokeRenderer::updatePoints(), Q3DockWindow::updatePosition(), ControllerWindow::updatePreview(), Q3ScrollView::updateScrollBars(), OublietteLevel::updateTileFlags(), Q3ScrollView::viewportToContents(), Q3Table::viewportToContents2(), Oubliette::visualCursorPos(), QStyle::visualPos(), QApplication::widgetAt(), qdesigner_internal::WidgetBoxDnDItem::WidgetBoxDnDItem(), QAnimationWriterMNG::writeDEFI(), QPNGImageWriter::writeImage(), QAnimationWriterMNG::writeMOVE(), QVFbMouseLinuxTP::writeToPipe(), QLine::x1(), and QLine::x2().
00100 { return xp; }
| int QPoint::y | ( | ) | const [inline] |
Returns the y coordinate of this point.
Definition at line 102 of file qpoint.h.
References yp.
Referenced by QPushButtonPrivate::_q_popupPressed(), OublietteLevel::addItemToTile(), QLayoutSupport::adjustIndicator(), QDialog::adjustPosition(), QAnimationWriter::appendFrame(), QBalloonTip::balloon(), qdesigner_internal::FormWindowManager::beginDrag(), QPolygon::boundingRect(), QAccessibleComboBox::childAt(), QAccessibleWidget::childAt(), qdesigner_internal::classifyLine(), OublietteLevel::clearTileFlags(), Q3Table::contentsContextMenuEvent(), Q3Table::contentsDragEnterEvent(), Q3Table::contentsDragMoveEvent(), Q3Table::contentsMouseDoubleClickEvent(), Q3ListView::contentsMouseMoveEvent(), Q3Table::contentsMouseMoveEvent(), Q3Table::contentsMousePressEventEx(), Q3ListView::contentsMousePressEventEx(), Q3Table::contentsMouseReleaseEvent(), Q3ListView::contentsMouseReleaseEventEx(), Q3ScrollView::contentsToViewport(), Q3Table::contentsToViewport2(), CreateETandAET(), QAbstractFormBuilder::createProperty(), VariantDelegate::displayText(), QAbstractItemView::doAutoScroll(), Q3ListView::doAutoScroll(), Q3ListBox::doAutoScroll(), Q3IconView::doAutoScroll(), Q3Table::doAutoScroll(), dockPos(), QListViewPrivate::doDynamicLayout(), QWidgetResizeHandler::doResize(), QListViewPrivate::doStaticLayout(), QColorWell::dragMoveEvent(), Q3IconView::dragObject(), QPainterPrivate::draw_helper(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsStyle::drawControl(), QCommonStyle::drawControl(), QFrame::drawFrame(), Q3DockWindowResizeHandle::drawLine(), QPainter::drawPoints(), QPaintEngine::drawPoints(), QX11PaintEngine::drawPoints(), QPaintEngine::drawPolygon(), QCommonStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QTreeView::drawRow(), Q3Canvas::drawViewArea(), QColorWell::dropEvent(), QLine::dy(), ellipseSpansClipped(), Q3TextTable::enterAt(), Q3IconView::eventFilter(), QDesignerTabWidget::eventFilter(), Oubliette::fillTile(), Q3IconViewPrivate::findContainers(), QX11WindowSurface::flush(), QRasterWindowSurface::flush(), QRasterPaintEngine::flush(), Q3ScrollView::focusNextPrevChild(), QPixelTool::grabScreen(), grabWidget_helper(), qdesigner_internal::FormWindow::gridPoint(), qdesigner_internal::FormWindow::handleArrowKeyEvent(), Q3IconView::handleItemChange(), Q3TextEdit::handleMouseMove(), Q3DockWindow::handleMove(), PieView::indexAt(), QTableView::indexAt(), QTreeView::indexAt(), qdesigner_internal::LayoutCommand::init(), qdesigner_internal::BreakLayoutCommand::init(), QMenu::internalDelayedPopup(), Q3SimpleRichText::inText(), Q3ListView::itemAt(), Q3ListBox::itemAt(), QTreeViewPrivate::itemDecorationAt(), ItemEffect::ItemEffect(), Q3AccessibleTextEdit::itemRect(), QWidgetResizeHandler::keyPressEvent(), QMenu::keyPressEvent(), Oubliette::keyPressEvent(), QAbstractScrollAreaPrivate::layoutChildren(), qdesigner_internal::lineEntryPos(), QHeaderView::logicalIndexAt(), manhattanLength(), QMatrix::map(), QWidget::mapFromGlobal(), QTextEditPrivate::mapToContents(), Q3Header::mouseDoubleClickEvent(), QMenuPrivate::mouseEventTaken(), BasicToolsPlugin::mouseMove(), QView3DWidget::mouseMoveEvent(), qdesigner_internal::QtColorLinePrivate::mouseMoveEvent(), qdesigner_internal::QtGradientStopsWidget::mouseMoveEvent(), SvgWindow::mouseMoveEvent(), QWidgetResizeHandler::mouseMoveEvent(), CannonField::mouseMoveEvent(), PreviewView::mouseMoveEvent(), QColorWell::mouseMoveEvent(), Q3Header::mouseMoveEvent(), qdesigner_internal::QtGradientWidget::mouseMoveEvent(), CharacterWidget::mouseMoveEvent(), qdesigner_internal::WidgetHandle::mouseMoveEvent(), QScrollBar::mouseMoveEvent(), QToolBarHandle::mouseMoveEvent(), Q3DockWindowResizeHandle::mouseMoveEvent(), QGraphicsView::mouseMoveEvent(), QComboBoxPrivateScroller::mouseMoveEvent(), QWellArray::mousePressEvent(), qdesigner_internal::QtGradientWidget::mousePressEvent(), QDateTimeEdit::mousePressEvent(), Q3Header::mousePressEvent(), QScrollBar::mousePressEvent(), Q3DockWindowResizeHandle::mouseReleaseEvent(), PageCurl::mouseReleaseEvent(), qdesigner_internal::WidgetHandle::mouseReleaseEvent(), Q3Header::mouseReleaseEvent(), MandelbrotWidget::mouseReleaseEvent(), Q3IconViewItem::move(), QDragManager::move(), Q3IconViewItem::moveBy(), QAbstractButtonPrivate::moveFocus(), QAccessibleWidget::navigate(), Q3IconView::neighbourItem(), operator<<(), Q3TextEdit::optimDoAutoScroll(), PathStrokeRenderer::paint(), QColorPicker::paintEvent(), QTableView::paintEvent(), MandelbrotWidget::paintEvent(), TicTacToe::paintEvent(), QPixelTool::paintEvent(), paintGrid(), qdesigner_internal::paintGround(), Q3TextEdit::paragraphAt(), perp(), QSplitterHandlePrivate::pick(), QSplitterPrivate::pick(), pick(), QSliderPrivate::pick(), pick_perp(), QImage::pixel(), QImage::pixelIndex(), Q3TextCursor::place(), qdesigner_internal::pointAboveLine(), QMenu::popup(), Q3ComboBox::popup(), QAbstractItemViewPrivate::position(), PtsToRegion(), Q3CanvasPixmap::Q3CanvasPixmap(), qDrawShadeLine(), QRect::QRect(), qt_cleanlooks_draw_gradient(), Q3AccessibleHeader::rect(), QAccessibleSpinBox::rect(), QAccessibleHeader::rect(), QAccessibleWidget::rect(), QAccessibleMenu::rect(), QAccessibleMenuBar::rect(), QAccessibleWidget::relationTo(), QDockWidgetPrivate::relayout(), QExpandingLineEdit::resizeToContents(), QColorPicker::satPt(), QWhatsThisPrivate::say(), OublietteView::scrollToCharacter(), Q3TableHeader::sectionWidthChanged(), QMainWindowLayout::setGeometry(), QHeaderView::setOffset(), QImage::setPixel(), OublietteLevel::setTile(), qdesigner_internal::Layout::setup(), qdesigner_internal::PointProperty::setValue(), QAbstractItemViewPrivate::shouldAutoScroll(), QCompleterPrivate::showPopup(), QComboBox::showPopup(), QWhatsThis::showText(), QListViewPrivate::snapToGrid(), Q3IconView::startDrag(), qdesigner_internal::QtGradientStopsWidgetPrivate::stopAt(), qdesigner_internal::QtGradientStopsWidgetPrivate::stopsAt(), QStyleSheetStyle::subControlRect(), CannonField::targetRect(), PuzzleWidget::targetSquare(), OublietteLevel::tile(), qdesigner_internal::SignalSlotConnection::toUi(), QSplitterPrivate::trans(), QPolygon::translate(), QPainter::translate(), QETWidget::translateMouseEvent(), qdesigner_internal::WidgetHandle::trySetGeometry(), Q3DockWindow::undock(), Q3TextEdit::updateCursor(), Oubliette::updateExplored(), QPainterPrivate::updateMatrix(), PathStrokeRenderer::updatePoints(), Q3DockWindow::updatePosition(), ControllerWindow::updatePreview(), Q3ScrollView::updateScrollBars(), OublietteLevel::updateTileFlags(), Q3ScrollView::viewportToContents(), Q3Table::viewportToContents2(), Oubliette::visualCursorPos(), QStyle::visualPos(), QApplication::widgetAt(), qdesigner_internal::WidgetBoxDnDItem::WidgetBoxDnDItem(), QAnimationWriterMNG::writeDEFI(), QPNGImageWriter::writeImage(), QAnimationWriterMNG::writeMOVE(), QVFbMouseLinuxTP::writeToPipe(), QLine::y1(), and QLine::y2().
00103 { return yp; }
| void QPoint::setX | ( | int | x | ) | [inline] |
Sets the x coordinate of this point to the given x coordinate.
Definition at line 105 of file qpoint.h.
References xp.
Referenced by QAbstractScrollAreaPrivate::contentsOffset(), QListViewPrivate::indexToListViewItem(), QListView::internalDrop(), qdesigner_internal::QtColorLinePrivate::mouseMoveEvent(), CannonField::mouseMoveEvent(), QToolBarHandle::mouseMoveEvent(), QDateTimeEdit::mousePressEvent(), Q3TextEdit::optimDoAutoScroll(), Q3TextCursor::place(), PolygonRegion(), QMenu::popup(), set_perp(), QCompleterPrivate::showPopup(), QComboBox::showPopup(), PathStrokeRenderer::updatePoints(), Q3DockWindow::updatePosition(), and ControllerWindow::updatePreview().
00106 { xp = xpos; }
| void QPoint::setY | ( | int | y | ) | [inline] |
Sets the y coordinate of this point to the given y coordinate.
Definition at line 108 of file qpoint.h.
References yp.
Referenced by QAbstractScrollAreaPrivate::contentsOffset(), QListViewPrivate::indexToListViewItem(), QMatrix::map(), qdesigner_internal::QtColorLinePrivate::mouseMoveEvent(), CannonField::mouseMoveEvent(), QDateTimeEdit::mousePressEvent(), Q3TextEdit::optimDoAutoScroll(), Q3TextCursor::place(), PolygonRegion(), QMenu::popup(), set_perp(), QCompleterPrivate::showPopup(), PathStrokeRenderer::updatePoints(), Q3DockWindow::updatePosition(), and ControllerWindow::updatePreview().
00109 { yp = ypos; }
| 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:
QPoint oldPosition; MyWidget::mouseMoveEvent(QMouseEvent *event) { QPoint point = event->pos() - oldPosition; if (point.manhattanLength() > 3) // the mouse has moved more than 3 pixels since the oldPosition }
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 381 of file qpoint.cpp.
Referenced by QDesignerTabWidget::canMove(), and QAbstractScrollAreaPrivate::layoutChildren().
Here is the call graph for this function:

| int & QPoint::rx | ( | ) | [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 111 of file qpoint.h.
References xp.
Referenced by Q3ListView::contentsMousePressEventEx(), QCommonStyle::drawControl(), QTextDocumentLayoutPrivate::drawListItem(), QWidgetResizeHandler::keyPressEvent(), Oubliette::keyPressEvent(), QWidgetResizeHandler::mouseMoveEvent(), PreviewView::mousePressEvent(), SvgWindow::mousePressEvent(), Q3DockArea::moveDockWindow(), operator>>(), rperp(), rpick(), QPlastiqueStyle::subControlRect(), QCleanlooksStyle::subControlRect(), QETWidget::translateConfigEvent(), and QETWidget::translateMouseEvent().
00112 { return xp; }
| int & QPoint::ry | ( | ) | [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 114 of file qpoint.h.
References yp.
Referenced by QWidgetResizeHandler::keyPressEvent(), Oubliette::keyPressEvent(), QWidgetResizeHandler::mouseMoveEvent(), PreviewView::mousePressEvent(), SvgWindow::mousePressEvent(), operator>>(), rperp(), rpick(), QPlastiqueStyle::subControlRect(), QCleanlooksStyle::subControlRect(), QETWidget::translateConfigEvent(), and QETWidget::translateMouseEvent().
00115 { return yp; }
| QPoint & QPoint::operator *= | ( | qreal | factor | ) | [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 123 of file qpoint.h.
References qRound(), xp, and yp.
Here is the call graph for this function:

| QPoint & QPoint::operator/= | ( | qreal | divisor | ) | [inline] |
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 147 of file qpoint.h.
References qRound(), xp, and yp.
00148 { 00149 Q_ASSERT(!qFuzzyCompare(c, 0)); 00150 xp = qRound(xp/c); 00151 yp = qRound(yp/c); 00152 return *this; 00153 }
Here is the call graph for this function:

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 138 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.
Returns a QPoint object that is formed by changing the sign of both components of the given point.
Equivalent to {QPoint(0,0) - point}.
Definition at line 144 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 155 of file qpoint.h.
00156 { 00157 Q_ASSERT(!qFuzzyCompare(c, 0)); 00158 return QPoint(qRound(p.xp/c), qRound(p.yp/c)); 00159 }
| QDataStream & operator<< | ( | QDataStream & | stream, | |
| const QPoint & | point | |||
| ) | [related] |
Writes the given point to the given stream and returns a reference to the stream.
Definition at line 319 of file qpoint.cpp.
00320 { 00321 if (s.version() == 1) 00322 s << (qint16)p.x() << (qint16)p.y(); 00323 else 00324 s << (qint32)p.x() << (qint32)p.y(); 00325 return s; 00326 }
| QDataStream & operator>> | ( | QDataStream & | stream, | |
| QPoint & | point | |||
| ) | [related] |
Reads a point from the given stream into the given point and returns a reference to the stream.
Definition at line 338 of file qpoint.cpp.
00339 { 00340 if (s.version() == 1) { 00341 qint16 x, y; 00342 s >> x; p.rx() = x; 00343 s >> y; p.ry() = y; 00344 } 00345 else { 00346 qint32 x, y; 00347 s >> x; p.rx() = x; 00348 s >> y; p.ry() = y; 00349 } 00350 return s; 00351 }
int QPoint::xp [private] |
Definition at line 71 of file qpoint.h.
Referenced by isNull(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator/=(), operator==(), QPoint(), rx(), setX(), and x().
int QPoint::yp [private] |
Definition at line 72 of file qpoint.h.
Referenced by isNull(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator/=(), operator==(), QPoint(), ry(), setY(), and y().
1.5.1