summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-04 16:29:09 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-06 09:06:16 (GMT)
commit13833beb641289c45faed337848d37280195aadc (patch)
tree640401d51871f1eb4e948cf1884b810b5be4a198 /examples
parent99160bb9f851bf02fe5345b5f52217b6c77a57c4 (diff)
downloadQt-13833beb641289c45faed337848d37280195aadc.zip
Qt-13833beb641289c45faed337848d37280195aadc.tar.gz
Qt-13833beb641289c45faed337848d37280195aadc.tar.bz2
Remove the use of deprecated qFindChild(ren)
Test directory untouched. This just apply those regexp: git grep -O"sed -i 's/qF\(indChildr*e*n*<[^>]*>\)(this,* */f\\1(/'" qFindChild git grep -O"sed -i 's/qF\(indChildr*e*n*<[^>]*>\)(&\([^\(),]*\),* */\\2.f\\1(/'" qFindChild git grep -O"sed -i 's/qF\(indChildr*e*n*<[^>]*>\)(\([^\(),]*()\),* */\\2->f\\1(/'" qFindChild git grep -O"sed -i 's/qF\(indChildr*e*n*<[^>]*>\)(\([^\(),]*\):\([^\(),]*\),* */(\\2:\\3)->f\\1(/'" qFindChild git grep -O"sed -i 's/qF\(indChildr*e*n*<[^>]*>\)(\([^\(),]*\),* */\\2->f\\1(/'" qFindChild Rev-by: dev mailing list
Diffstat (limited to 'examples')
-rw-r--r--examples/activeqt/hierarchy/objects.cpp2
-rw-r--r--examples/animation/easing/window.cpp2
-rw-r--r--examples/designer/calculatorbuilder/calculatorform.cpp6
-rw-r--r--examples/script/calculator/main.cpp2
-rw-r--r--examples/script/qstetrix/main.cpp2
-rw-r--r--examples/uitools/textfinder/textfinder.cpp6
-rw-r--r--examples/xmlpatterns/recipes/querymainwindow.cpp12
7 files changed, 16 insertions, 16 deletions
diff --git a/examples/activeqt/hierarchy/objects.cpp b/examples/activeqt/hierarchy/objects.cpp
index 918f219..bb0b701 100644
--- a/examples/activeqt/hierarchy/objects.cpp
+++ b/examples/activeqt/hierarchy/objects.cpp
@@ -62,7 +62,7 @@ void QParentWidget::createSubWidget(const QString &name)
//! [1] //! [2]
QSubWidget *QParentWidget::subWidget(const QString &name)
{
- return qFindChild<QSubWidget*>(this, name);
+ return findChild<QSubWidget*>(name);
}
//! [2]
diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp
index a555024..8d9775d 100644
--- a/examples/animation/easing/window.cpp
+++ b/examples/animation/easing/window.cpp
@@ -44,7 +44,7 @@ Window::Window(QWidget *parent)
: QWidget(parent), m_iconSize(64, 64)
{
m_ui.setupUi(this);
- QButtonGroup *buttonGroup = qFindChild<QButtonGroup *>(this); // ### workaround for uic in 4.4
+ QButtonGroup *buttonGroup = findChild<QButtonGroup *>(); // ### workaround for uic in 4.4
m_ui.easingCurvePicker->setIconSize(m_iconSize);
m_ui.easingCurvePicker->setMinimumHeight(m_iconSize.height() + 50);
buttonGroup->setId(m_ui.lineRadio, 0);
diff --git a/examples/designer/calculatorbuilder/calculatorform.cpp b/examples/designer/calculatorbuilder/calculatorform.cpp
index 34c869e..fa6ccb3 100644
--- a/examples/designer/calculatorbuilder/calculatorform.cpp
+++ b/examples/designer/calculatorbuilder/calculatorform.cpp
@@ -58,9 +58,9 @@ CalculatorForm::CalculatorForm(QWidget *parent)
//! [1]
//! [2]
- ui_inputSpinBox1 = qFindChild<QSpinBox*>(this, "inputSpinBox1");
- ui_inputSpinBox2 = qFindChild<QSpinBox*>(this, "inputSpinBox2");
- ui_outputWidget = qFindChild<QLabel*>(this, "outputWidget");
+ ui_inputSpinBox1 = findChild<QSpinBox*>("inputSpinBox1");
+ ui_inputSpinBox2 = findChild<QSpinBox*>("inputSpinBox2");
+ ui_outputWidget = findChild<QLabel*>("outputWidget");
//! [2]
//! [3]
diff --git a/examples/script/calculator/main.cpp b/examples/script/calculator/main.cpp
index 8030a87..c258a9b 100644
--- a/examples/script/calculator/main.cpp
+++ b/examples/script/calculator/main.cpp
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
//! [2]
#if !defined(QT_NO_SCRIPTTOOLS)
- QLineEdit *display = qFindChild<QLineEdit*>(ui, "display");
+ QLineEdit *display = ui->findChild<QLineEdit*>("display");
QObject::connect(display, SIGNAL(returnPressed()),
debugWindow, SLOT(show()));
#endif
diff --git a/examples/script/qstetrix/main.cpp b/examples/script/qstetrix/main.cpp
index e12e26d..c802584 100644
--- a/examples/script/qstetrix/main.cpp
+++ b/examples/script/qstetrix/main.cpp
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
QScriptValue tetrix = ctor.construct(QScriptValueList() << scriptUi);
//! [3]
- QPushButton *debugButton = qFindChild<QPushButton*>(ui, "debugButton");
+ QPushButton *debugButton = ui->findChild<QPushButton*>("debugButton");
#if !defined(QT_NO_SCRIPTTOOLS)
QObject::connect(debugButton, SIGNAL(clicked()),
debugger.action(QScriptEngineDebugger::InterruptAction),
diff --git a/examples/uitools/textfinder/textfinder.cpp b/examples/uitools/textfinder/textfinder.cpp
index 4bb6600..1682acd 100644
--- a/examples/uitools/textfinder/textfinder.cpp
+++ b/examples/uitools/textfinder/textfinder.cpp
@@ -49,9 +49,9 @@ TextFinder::TextFinder(QWidget *parent)
QWidget *formWidget = loadUiFile();
//! [1]
- ui_findButton = qFindChild<QPushButton*>(this, "findButton");
- ui_textEdit = qFindChild<QTextEdit*>(this, "textEdit");
- ui_lineEdit = qFindChild<QLineEdit*>(this, "lineEdit");
+ ui_findButton = findChild<QPushButton*>("findButton");
+ ui_textEdit = findChild<QTextEdit*>("textEdit");
+ ui_lineEdit = findChild<QLineEdit*>("lineEdit");
//! [0] //! [1]
//! [2]
diff --git a/examples/xmlpatterns/recipes/querymainwindow.cpp b/examples/xmlpatterns/recipes/querymainwindow.cpp
index 0fd2483..8a4c606 100644
--- a/examples/xmlpatterns/recipes/querymainwindow.cpp
+++ b/examples/xmlpatterns/recipes/querymainwindow.cpp
@@ -49,10 +49,10 @@ QueryMainWindow::QueryMainWindow() : ui_defaultQueries(0)
{
setupUi(this);
- new XmlSyntaxHighlighter(qFindChild<QTextEdit*>(this, "inputTextEdit")->document());
- new XmlSyntaxHighlighter(qFindChild<QTextEdit*>(this, "outputTextEdit")->document());
+ new XmlSyntaxHighlighter(findChild<QTextEdit*>("inputTextEdit")->document());
+ new XmlSyntaxHighlighter(findChild<QTextEdit*>("outputTextEdit")->document());
- ui_defaultQueries = qFindChild<QComboBox*>(this, "defaultQueries");
+ ui_defaultQueries = findChild<QComboBox*>("defaultQueries");
QMetaObject::connectSlotsByName(this);
connect(ui_defaultQueries, SIGNAL(currentIndexChanged(int)), SLOT(displayQuery(int)));
@@ -71,7 +71,7 @@ void QueryMainWindow::displayQuery(int index)
QFile queryFile(QString(":files/") + ui_defaultQueries->itemText(index));
queryFile.open(QIODevice::ReadOnly);
const QString query(QString::fromLatin1(queryFile.readAll()));
- qFindChild<QTextEdit*>(this, "queryTextEdit")->setPlainText(query);
+ findChild<QTextEdit*>("queryTextEdit")->setPlainText(query);
evaluate(query);
}
@@ -90,7 +90,7 @@ void QueryMainWindow::loadInputFile()
QTextStream in(&forView);
QString inputDocument = in.readAll();
- qFindChild<QTextEdit*>(this, "inputTextEdit")->setPlainText(inputDocument);
+ findChild<QTextEdit*>("inputTextEdit")->setPlainText(inputDocument);
}
@@ -116,7 +116,7 @@ void QueryMainWindow::evaluate(const QString &str)
return;
buffer.close();
- qFindChild<QTextEdit*>(this, "outputTextEdit")->setPlainText(QString::fromUtf8(outArray.constData()));
+ findChild<QTextEdit*>("outputTextEdit")->setPlainText(QString::fromUtf8(outArray.constData()));
}
//! [2]