diff options
author | kh <qtc-committer@nokia.com> | 2009-07-01 12:49:10 (GMT) |
---|---|---|
committer | kh <qtc-committer@nokia.com> | 2009-07-01 12:49:10 (GMT) |
commit | 1813a6d2bc0ba611cecd2d74dea75cd4644a9f95 (patch) | |
tree | 51b98a668689259864aafdea9f1d9b69f43f9c28 /tools/assistant | |
parent | f6872e6b7a18b946c7428916c7096b82560a9cc6 (diff) | |
download | Qt-1813a6d2bc0ba611cecd2d74dea75cd4644a9f95.zip Qt-1813a6d2bc0ba611cecd2d74dea75cd4644a9f95.tar.gz Qt-1813a6d2bc0ba611cecd2d74dea75cd4644a9f95.tar.bz2 |
Sync with QtCreator.
Diffstat (limited to 'tools/assistant')
-rw-r--r-- | tools/assistant/tools/assistant/centralwidget.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 64c2a80..a384544 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -286,6 +286,10 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) CentralWidget::~CentralWidget() { +#ifndef QT_NO_PRINTER + delete printer; +#endif + QHelpEngineCore engine(collectionFile, 0); if (!engine.setupData()) return; @@ -357,10 +361,10 @@ void CentralWidget::findNext() void CentralWidget::nextPage() { - if(tabWidget->currentIndex() < tabWidget->count() -1) - tabWidget->setCurrentIndex(tabWidget->currentIndex() +1); - else - tabWidget->setCurrentIndex(0); + int index = tabWidget->currentIndex() + 1; + if (index >= tabWidget->count()) + index = 0; + tabWidget->setCurrentIndex(index); } void CentralWidget::resetZoom() @@ -376,10 +380,9 @@ void CentralWidget::resetZoom() void CentralWidget::previousPage() { int index = tabWidget->currentIndex() -1; - if(index >= 0) - tabWidget->setCurrentIndex(index); - else - tabWidget->setCurrentIndex(tabWidget->count() -1); + if (index < 0) + index = tabWidget->count() -1; + tabWidget->setCurrentIndex(index); } void CentralWidget::findPrevious() @@ -400,7 +403,8 @@ void CentralWidget::closeTab() void CentralWidget::setSource(const QUrl &url) { HelpViewer *viewer = currentHelpViewer(); - HelpViewer *lastViewer = qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage)); + HelpViewer *lastViewer = + qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage)); if (!viewer && !lastViewer) { viewer = new HelpViewer(helpEngine, this); |