
Public Member Functions | |
| SourceView (int role) | |
| Constructor. | |
| void | setIndex (const WModelIndex &index) |
| Set model index. | |
| virtual WWidget * | renderView () |
| Return the widget that renders the view. | |
Private Attributes | |
| WModelIndex | index_ |
| The index that is currently displayed. | |
| int | role_ |
| The role that is currently displayed. | |
A view class is used so that no server-side memory is used while displaying a potentially large file.
Definition at line 37 of file GitView.C.
| SourceView::SourceView | ( | int | role | ) | [inline] |
| void SourceView::setIndex | ( | const WModelIndex & | index | ) | [inline] |
| virtual WWidget* SourceView::renderView | ( | ) | [inline, virtual] |
Return the widget that renders the view.
Returns he view contents: renders the file to a WText widget. WViewWidget deletes this widget after every rendering step.
Implements Wt::WViewWidget.
Definition at line 66 of file GitView.C.
00066 { 00067 WText *result = new WText(); 00068 result->setInline(false); 00069 00070 if (!index_.isValid()) 00071 return result; 00072 00073 boost::any d = index_.data(role_); 00074 const std::string& t = boost::any_cast<const std::string&>(d); 00075 00076 result->setTextFormat(PlainText); 00077 result->setText(t); 00078 00079 return result; 00080 }
WModelIndex SourceView::index_ [private] |
int SourceView::role_ [private] |
1.5.6