D10792: Raise annotation window when clicking on annotation

Simone Gaiarin noreply at phabricator.kde.org
Sat Mar 31 19:52:11 UTC 2018


simgunz added a comment.


  I have few questions regarding the internal structure of okular and how to write autotests:
  
  1. To click on an annotation to open the annotation window I though to do the following (partially copied from other tests):
  
    const int width =  part.m_pageView->horizontalScrollBar()->maximum() +
                           part.m_pageView->viewport()->width();
    const int height = part.m_pageView->verticalScrollBar()->maximum() +
                           part.m_pageView->viewport()->height();
    
    NormalizedPoint pt = annot1->boundingRectangle().center();
    
    QTest::mouseDClick(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(width * pt.x,  height * pt.y));
  
  but in this way I don't correctly click on the annotation. For now I manually set the QPoint to hit correctly the annotation.
  
  I don't understand what the normalized area where a NormalizedPoint can be corresponds to. Can someone explain me better this mechanics?
  
  Why is width equal to the maximum value of the scrollbar plus the viewport?
  
  2. When I run an autotest I saw a window appearing showing the file opened in okular. I cannot interact with this window though. What is the purpose of that? How can I have a visual feedback on the code I am writing in the autotest?

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D10792

To: simgunz, #okular, aacid
Cc: ngraham, #okular, michaelweghorn, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180331/ca547d11/attachment.html>


More information about the Okular-devel mailing list