50
50
#include < QComboBox>
51
51
#include < QWebFrame>
52
52
53
- QgsWebView::QgsWebView ( QWidget *parent ) : QWebView( parent )
53
+ QgsIdentifyResultsWebView::QgsIdentifyResultsWebView ( QWidget *parent ) : QWebView( parent )
54
54
{
55
55
setSizePolicy ( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
56
56
page ()->setNetworkAccessManager ( QgsNetworkAccessManager::instance () );
@@ -65,7 +65,7 @@ QgsWebView::QgsWebView( QWidget *parent ) : QWebView( parent )
65
65
this , SLOT ( loadFinished ( bool ) ) );
66
66
}
67
67
68
- void QgsWebView ::print ( void )
68
+ void QgsIdentifyResultsWebView ::print ( void )
69
69
{
70
70
QPrinter printer;
71
71
QPrintDialog *dialog = new QPrintDialog ( &printer );
@@ -75,7 +75,7 @@ void QgsWebView::print( void )
75
75
}
76
76
}
77
77
78
- void QgsWebView ::contextMenuEvent ( QContextMenuEvent *e )
78
+ void QgsIdentifyResultsWebView ::contextMenuEvent ( QContextMenuEvent *e )
79
79
{
80
80
QMenu *menu = page ()->createStandardContextMenu ();
81
81
if ( menu )
@@ -88,16 +88,16 @@ void QgsWebView::contextMenuEvent( QContextMenuEvent *e )
88
88
}
89
89
}
90
90
91
- // QgsWebView size:
91
+ // QgsIdentifyResultsWebView size:
92
92
// ---------------
93
93
//
94
94
// 1) QTreeWidget is not able to scroll continuously through the content of large widgets
95
95
// inserted into items via setItemWidget, it always jumps to the top of next
96
96
// item and it is not able to scroll to the bottom of an inserted large
97
97
// widget (until the QTreeWidget itself is large enough to show the whole
98
- // inserted widget). => We have to keep the height of QgsWebView smaller
98
+ // inserted widget). => We have to keep the height of QgsIdentifyResultsWebView smaller
99
99
// than the height of QTreeWidget so that a user can see it entire, even if
100
- // this height is smaller than QgsWebView content (i.e. QgsWebView scroolbar
100
+ // this height is smaller than QgsIdentifyResultsWebView content (i.e. QgsIdentifyResultsWebView scroolbar
101
101
// is added). We make it even a bit smaller so that a user can see a bit of
102
102
// context (items above/below) when scrolling which is more pleasant.
103
103
//
@@ -106,25 +106,25 @@ void QgsWebView::contextMenuEvent( QContextMenuEvent *e )
106
106
// after setHtml(), otherwise the contentSize() is 0,0 until the page is
107
107
// loaded and contentsSizeChanged () is emited.
108
108
//
109
- // 3) If QgsWebView is resized (on page load) after it was inserted into
109
+ // 3) If QgsIdentifyResultsWebView is resized (on page load) after it was inserted into
110
110
// QTreeWidget, the row does not reflect that change automaticaly and
111
- // consecutive resize of QTreeWidget will cause to shrink QgsWebView to the
111
+ // consecutive resize of QTreeWidget will cause to shrink QgsIdentifyResultsWebView to the
112
112
// original row height. That is expected, Qt: "setItemWidget() should only
113
- // be used to display static content... => we must not change QgsWebView
113
+ // be used to display static content... => we must not change QgsIdentifyResultsWebView
114
114
// size after it was inserted to QTreeWidget
115
115
116
- // TODO(?): Sometimes it may happen that if multiple QgsWebView are inserted to
116
+ // TODO(?): Sometimes it may happen that if multiple QgsIdentifyResultsWebView are inserted to
117
117
// QTreeWidget for the first time, and both share the same external source
118
118
// (image) the layout gets somehow confused - wrong positions, overlapped (Qt
119
119
// bug?) until next QTreeWidget resize.
120
120
121
121
// TODO(?): if the results dialog is resized to smaller heigh, existing
122
- // QgsWebView are not (and must not be!) resized and scrolling becomes a bit
122
+ // QgsIdentifyResultsWebView are not (and must not be!) resized and scrolling becomes a bit
123
123
// unpleasant until next identify. AFAIK it could only be solved using
124
124
// QItemDelegate.
125
125
126
126
// size hint according to content
127
- QSize QgsWebView ::sizeHint () const
127
+ QSize QgsIdentifyResultsWebView ::sizeHint () const
128
128
{
129
129
QSize s = this ->page ()->mainFrame ()->contentsSize ();
130
130
QgsDebugMsg ( QString ( " content size: %1 x %2" ).arg ( s.width () ).arg ( s.height () ) );
@@ -187,7 +187,7 @@ void QgsIdentifyResultsWebViewItem::setHtml( const QString &html )
187
187
188
188
QgsIdentifyResultsWebViewItem::QgsIdentifyResultsWebViewItem ( QTreeWidget *treeWidget )
189
189
{
190
- mWebView = new QgsWebView ( treeWidget );
190
+ mWebView = new QgsIdentifyResultsWebView ( treeWidget );
191
191
mWebView ->hide ();
192
192
setText ( 0 , tr ( " Loading..." ) );
193
193
connect ( mWebView , SIGNAL ( loadFinished ( bool ) ) ,
0 commit comments