diff options
author | Girish Ramakrishnan <girish@forwardbias.in> | 2009-11-25 13:24:57 +0530 |
---|---|---|
committer | Girish Ramakrishnan <girish@forwardbias.in> | 2009-11-25 13:31:04 +0530 |
commit | d88e5626e242a62df92ee8c1adadde70a75ec9cc (patch) | |
tree | 829ca2ba1570c667ac8a8c9e351cb2b2ab18ffef | |
parent | 06920cd2b7396936cf55b17d0f91d4797067a2d9 (diff) |
const correctness
-rw-r--r-- | mainwindow.cpp | 4 | ||||
-rw-r--r-- | mainwindow.h | 2 | ||||
-rw-r--r-- | resizeuihelper.cpp | 2 | ||||
-rw-r--r-- | resizeuihelper.h | 4 | ||||
-rw-r--r-- | webscrap.cpp | 4 | ||||
-rw-r--r-- | webscrap.h | 4 | ||||
-rw-r--r-- | webview.cpp | 4 | ||||
-rw-r--r-- | webview.h | 6 |
8 files changed, 15 insertions, 15 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index a87ad25..f8ac34a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -75,8 +75,8 @@ MainWindow::MainWindow(QWidget *parent) m_stateMachine.start(); } -void MainWindow::addScrap(QUrl url, QSize pageSize, - QRect scrapRect, QPoint position, +void MainWindow::addScrap(const QUrl &url, const QSize &pageSize, + const QRect &scrapRect, const QPoint &position, qreal xScale, qreal yScale, int refreshIntervalMins) { diff --git a/mainwindow.h b/mainwindow.h index abca69d..6b5b42b 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -62,7 +62,7 @@ public slots: void adjustLocation(); void changeLocation(); void adjustTitle(); - void addScrap(QUrl url, QSize pageSize, QRect scrapRect, QPoint position, qreal xScale = 1.0, qreal yScale = 1.0, int refreshMins = 60); + void addScrap(const QUrl &url, const QSize &pageSize, const QRect &scrapRect, const QPoint &position, qreal xScale = 1.0, qreal yScale = 1.0, int refreshMins = 60); void bubbleUpScrap(QGraphicsWidget *scrap = 0); void removeSenderScrap(); void updateDropDownList(); diff --git a/resizeuihelper.cpp b/resizeuihelper.cpp index 0907b79..4d6f0e8 100644 --- a/resizeuihelper.cpp +++ b/resizeuihelper.cpp @@ -41,7 +41,7 @@ void ResizeUiHelper::reset() m_isResizeInProgress = false; } -void ResizeUiHelper::setRect(QRectF rect) +void ResizeUiHelper::setRect(const QRectF &rect) { m_rect = rect; } diff --git a/resizeuihelper.h b/resizeuihelper.h index 1f4a1ef..18ebb22 100644 --- a/resizeuihelper.h +++ b/resizeuihelper.h @@ -52,10 +52,10 @@ public: public slots: void setResizeEnabled(bool enabled); - void setRect(QRectF rect); + void setRect(const QRectF &rect); signals: - void rectResized(QRectF rect); + void rectResized(const QRectF &rect); private: void setWatchedCursor(QCursor cursor); diff --git a/webscrap.cpp b/webscrap.cpp index 0ea3968..d99ed38 100644 --- a/webscrap.cpp +++ b/webscrap.cpp @@ -52,7 +52,7 @@ WebScrap::WebScrap(QUrl url, QSize pageSize, QRect scrapRect, QGraphicsItem * pa m_scalePix = QPixmap(":/icons/scale.png").scaled(20, 20, Qt::KeepAspectRatio, Qt::SmoothTransformation); } -void WebScrap::setScrapRect(QRect r) +void WebScrap::setScrapRect(const QRect &r) { m_scrapRect = r; if (! m_isLoading) @@ -138,7 +138,7 @@ void WebScrap::onRefresh() reload(); } -void WebScrap::openUrlInExternalBrowser(QUrl url) +void WebScrap::openUrlInExternalBrowser(const QUrl &url) { QDesktopServices::openUrl(url); } @@ -39,8 +39,8 @@ public slots: void onLoadFinished(); void onLoadStarted(); void onRefresh(); - void setScrapRect(QRect rect); - void openUrlInExternalBrowser(QUrl url); + void setScrapRect(const QRect &rect); + void openUrlInExternalBrowser(const QUrl &url); void setDimensionsFixed(bool fixed); protected: diff --git a/webview.cpp b/webview.cpp index 0fbe6bc..29bfefc 100644 --- a/webview.cpp +++ b/webview.cpp @@ -57,14 +57,14 @@ void WebView::hideAddScrapToolbar() m_addScrapToolbar->setVisible(false); } -void WebView::setScrapRect(QRect rect) +void WebView::setScrapRect(const QRect &rect) { QRect updateRect = m_scrapRect.united(rect); m_scrapRect = rect; update(updateRect.translated(-page()->mainFrame()->scrollPosition())); } -void WebView::setScrolledScrapRect(QRectF rect) +void WebView::setScrolledScrapRect(const QRectF &rect) { setScrapRect(rect.translated(page()->mainFrame()->scrollPosition()).toRect()); } @@ -27,13 +27,13 @@ public slots: void addScrap(); void show(); void hide(); - void setScrapRect(QRect rect); - void setScrolledScrapRect(QRectF rect); + void setScrapRect(const QRect &rect); + void setScrolledScrapRect(const QRectF &rect); void enableCachedMode(); void disableCachedMode(); signals: - void scrapAdded(QUrl url, QSize pageSize, QRect scrapRect, QPoint position); + void scrapAdded(const QUrl &url, const QSize &pageSize, const QRect &scrapRect, const QPoint &position); protected: void hoverMoveEvent(QGraphicsSceneHoverEvent* event); |