Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 1.35 KB | Hits: 41 | Expires: Never
Copy text to clipboard
  1. Index: webbrowser.cpp
  2. ===================================================================
  3. --- webbrowser.cpp      (revision 1087155)
  4. +++ webbrowser.cpp      (working copy)
  5.  -27,6 +27,7 @@
  6.  #include <QStandardItemModel>
  7.  #include <QModelIndex>
  8.  #include <QAction>
  9. +#include <QPainter>
  10.  #include <QTimer>
  11.  #include <QTreeView>
  12.  #include <QWebPage>
  13.  -522,4 +523,14 @@
  14.      emit configNeedsSaving();
  15.  }
  16.  
  17. +void WebBrowser::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
  18. +{
  19. +    p->save();
  20. +    p->setBrush(QApplication::palette().window());
  21. +    p->setRenderHint(QPainter::Antialiasing);
  22. +    p->setPen(Qt::NoPen);
  23. +    p->drawRoundedRect(m_browser->pos().x() + contentsRect.x() - 2, m_browser->pos().y() + contentsRect.y() - 2,  m_browser->geometry().width() + 4, m_browser->geometry().height() + 4, 2, 2);
  24. +    p->restore();
  25. +}
  26. +
  27.  #include "webbrowser.moc"
  28. Index: webbrowser.h
  29. ===================================================================
  30. --- webbrowser.h        (revision 1087155)
  31. +++ webbrowser.h        (working copy)
  32.  -58,7 +58,8 @@
  33.      ~WebBrowser();
  34.  
  35.      QGraphicsWidget *graphicsWidget();
  36. -
  37. +    void paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
  38. +    
  39.      //TODO: put in a separate file
  40.      enum BookmarkRoles
  41.      {