[page] Add method to get all links in a given page

helm-link
Jacopo De Simoi 6 years ago
parent 944be4d93d
commit c0217257d4
  1. 16
      core/page.cpp
  2. 7
      core/page.h

@ -464,6 +464,22 @@ QLinkedList< const ObjectRect * > Page::objectRects( ObjectRect::ObjectType type
return result;
}
QLinkedList< const ObjectRect * > Page::objectRects( ObjectRect::ObjectType type) const
{
QLinkedList< const ObjectRect * > result;
QLinkedListIterator< ObjectRect * > it( m_rects );
it.toBack();
while ( it.hasPrevious() )
{
const ObjectRect *objrect = it.previous();
if ( ( objrect->objectType() == type ) )
result.append( objrect );
}
return result;
}
const ObjectRect* Page::nearestObjectRect( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double * distance ) const
{

@ -234,6 +234,13 @@ class OKULARCORE_EXPORT Page
*/
QLinkedList< const ObjectRect * > objectRects( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale ) const;
/**
* Returns all object rects of the given @p type
*
* @since 0.xxxx
*/
QLinkedList< const ObjectRect * > objectRects( ObjectRect::ObjectType type) const;
/**
* Returns the object rect of the given @p type which is nearest to the point (@p x, @p y) at scale (@p xScale, @p yScale).
*

Loading…
Cancel
Save