Commit 2b293691 authored by Christian Kandeler's avatar Christian Kandeler

Do not use qFindChild() and qFindChildren().

These are deprecated in Qt 5 and can be trivially rewritten using
a construct compatible with Qt 4 as well.

Change-Id: I9cb9ab8b7b4ee75c7510ec2648b69dd204c87da4
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 2e81773c
......@@ -257,7 +257,7 @@ void FancyMainWindow::restoreSettings(const QHash<QString, QVariant> &settings)
QList<QDockWidget *> FancyMainWindow::dockWidgets() const
{
return qFindChildren<QDockWidget *>(this);
return findChildren<QDockWidget *>();
}
bool FancyMainWindow::isLocked() const
......@@ -275,7 +275,7 @@ static bool actionLessThan(const QAction *action1, const QAction *action2)
QMenu *FancyMainWindow::createPopupMenu()
{
QList<QAction *> actions;
QList<QDockWidget *> dockwidgets = qFindChildren<QDockWidget *>(this);
QList<QDockWidget *> dockwidgets = findChildren<QDockWidget *>();
for (int i = 0; i < dockwidgets.size(); ++i) {
QDockWidget *dockWidget = dockwidgets.at(i);
if (dockWidget->property("managed_dockwidget").isNull()
......
......@@ -68,7 +68,7 @@ SearchWidget::~SearchWidget()
void SearchWidget::zoomIn()
{
QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget);
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
if (browser && zoomCount != 10) {
zoomCount++;
browser->zoomIn();
......@@ -77,7 +77,7 @@ void SearchWidget::zoomIn()
void SearchWidget::zoomOut()
{
QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget);
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
if (browser && zoomCount != -5) {
zoomCount--;
browser->zoomOut();
......@@ -89,7 +89,7 @@ void SearchWidget::resetZoom()
if (zoomCount == 0)
return;
QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget);
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
if (browser) {
browser->zoomOut(zoomCount);
zoomCount = 0;
......@@ -136,7 +136,7 @@ void SearchWidget::showEvent(QShowEvent *event)
connect(searchEngine, SIGNAL(searchingFinished(int)), this,
SLOT(searchingFinished(int)));
QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget);
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
browser->viewport()->installEventFilter(this);
connect(searchEngine, SIGNAL(indexingStarted()), this,
......@@ -215,7 +215,7 @@ void SearchWidget::indexingFinished()
bool SearchWidget::eventFilter(QObject *o, QEvent *e)
{
QTextBrowser *browser = qFindChild<QTextBrowser *>(resultWidget);
QTextBrowser *browser = resultWidget->findChild<QTextBrowser *>();
if (browser && o == browser->viewport()
&& e->type() == QEvent::MouseButtonRelease){
QMouseEvent *me = static_cast<QMouseEvent *>(e);
......@@ -233,7 +233,7 @@ bool SearchWidget::eventFilter(QObject *o, QEvent *e)
void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent)
{
QTextBrowser *browser = qFindChild<QTextBrowser *>(resultWidget);
QTextBrowser *browser = resultWidget->findChild<QTextBrowser *>();
if (!browser)
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment