Skip to content

Commit ea694c7

Browse files
committedApr 15, 2013
QgsWebView renamed to QgsIdentifyResultsWebView
1 parent ce4ab58 commit ea694c7

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed
 

‎src/app/qgsidentifyresultsdialog.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include <QComboBox>
5151
#include <QWebFrame>
5252

53-
QgsWebView::QgsWebView( QWidget *parent ) : QWebView( parent )
53+
QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QWebView( parent )
5454
{
5555
setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
5656
page()->setNetworkAccessManager( QgsNetworkAccessManager::instance() );
@@ -65,7 +65,7 @@ QgsWebView::QgsWebView( QWidget *parent ) : QWebView( parent )
6565
this, SLOT( loadFinished( bool ) ) );
6666
}
6767

68-
void QgsWebView::print( void )
68+
void QgsIdentifyResultsWebView::print( void )
6969
{
7070
QPrinter printer;
7171
QPrintDialog *dialog = new QPrintDialog( &printer );
@@ -75,7 +75,7 @@ void QgsWebView::print( void )
7575
}
7676
}
7777

78-
void QgsWebView::contextMenuEvent( QContextMenuEvent *e )
78+
void QgsIdentifyResultsWebView::contextMenuEvent( QContextMenuEvent *e )
7979
{
8080
QMenu *menu = page()->createStandardContextMenu();
8181
if ( menu )
@@ -88,16 +88,16 @@ void QgsWebView::contextMenuEvent( QContextMenuEvent *e )
8888
}
8989
}
9090

91-
// QgsWebView size:
91+
// QgsIdentifyResultsWebView size:
9292
// ---------------
9393
//
9494
// 1) QTreeWidget is not able to scroll continuously through the content of large widgets
9595
// inserted into items via setItemWidget, it always jumps to the top of next
9696
// item and it is not able to scroll to the bottom of an inserted large
9797
// 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
9999
// 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
101101
// is added). We make it even a bit smaller so that a user can see a bit of
102102
// context (items above/below) when scrolling which is more pleasant.
103103
//
@@ -106,25 +106,25 @@ void QgsWebView::contextMenuEvent( QContextMenuEvent *e )
106106
// after setHtml(), otherwise the contentSize() is 0,0 until the page is
107107
// loaded and contentsSizeChanged () is emited.
108108
//
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
110110
// 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
112112
// 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
114114
// size after it was inserted to QTreeWidget
115115

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
117117
// QTreeWidget for the first time, and both share the same external source
118118
// (image) the layout gets somehow confused - wrong positions, overlapped (Qt
119119
// bug?) until next QTreeWidget resize.
120120

121121
// 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
123123
// unpleasant until next identify. AFAIK it could only be solved using
124124
// QItemDelegate.
125125

126126
// size hint according to content
127-
QSize QgsWebView::sizeHint() const
127+
QSize QgsIdentifyResultsWebView::sizeHint() const
128128
{
129129
QSize s = this->page()->mainFrame()->contentsSize();
130130
QgsDebugMsg( QString( "content size: %1 x %2" ).arg( s.width() ).arg( s.height() ) );
@@ -187,7 +187,7 @@ void QgsIdentifyResultsWebViewItem::setHtml( const QString &html )
187187

188188
QgsIdentifyResultsWebViewItem::QgsIdentifyResultsWebViewItem( QTreeWidget *treeWidget )
189189
{
190-
mWebView = new QgsWebView( treeWidget );
190+
mWebView = new QgsIdentifyResultsWebView( treeWidget );
191191
mWebView->hide();
192192
setText( 0, tr( "Loading..." ) );
193193
connect( mWebView, SIGNAL( loadFinished( bool ) ) ,

‎src/app/qgsidentifyresultsdialog.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,16 @@ class QgsRasterLayer;
4141
class QgsHighlight;
4242
class QgsMapCanvas;
4343
class QDockWidget;
44-
class QgsWebView;
4544

4645
/**
4746
*@author Gary E.Sherman
4847
*/
4948

50-
class QgsWebView : public QWebView
49+
class QgsIdentifyResultsWebView : public QWebView
5150
{
5251
Q_OBJECT;
5352
public:
54-
QgsWebView( QWidget *parent = 0 );
53+
QgsIdentifyResultsWebView( QWidget *parent = 0 );
5554
QSize sizeHint() const;
5655
public slots:
5756
void print( void );
@@ -79,14 +78,14 @@ class QgsIdentifyResultsWebViewItem: public QObject, public QTreeWidgetItem
7978

8079
public:
8180
QgsIdentifyResultsWebViewItem( QTreeWidget *treeWidget = 0 );
82-
QgsWebView *webView() { return mWebView; }
81+
QgsIdentifyResultsWebView *webView() { return mWebView; }
8382
void setHtml( const QString &html );
8483

8584
public slots:
8685
void loadFinished( bool ok );
8786

8887
private:
89-
QgsWebView *mWebView;
88+
QgsIdentifyResultsWebView *mWebView;
9089
};
9190

9291
class QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdentifyResultsBase

0 commit comments

Comments
 (0)
Please sign in to comment.