summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-04 01:14:49 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-04 01:14:49 (GMT)
commite042014961636d459dc84df93ad2cca96049e2d1 (patch)
tree483fac9c3e0e88d60527c9675fd0789253204fb4 /examples
parent25e7b091c44c1cff2f74551a0603e85b4c286260 (diff)
parent8caacf51667d4cf770b18a8b59e46f842861210e (diff)
downloadQt-e042014961636d459dc84df93ad2cca96049e2d1.zip
Qt-e042014961636d459dc84df93ad2cca96049e2d1.tar.gz
Qt-e042014961636d459dc84df93ad2cca96049e2d1.tar.bz2
Merge branch '4.6' of git://scm.dev.nokia.troll.no/qt/qt into kinetic-declarativeui
Conflicts: configure.exe src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'examples')
-rw-r--r--examples/mainwindows/mdi/mainwindow.cpp2
-rw-r--r--examples/mainwindows/sdi/mainwindow.h2
-rw-r--r--examples/script/customclass/bytearrayclass.cpp17
3 files changed, 6 insertions, 15 deletions
diff --git a/examples/mainwindows/mdi/mainwindow.cpp b/examples/mainwindows/mdi/mainwindow.cpp
index 712d91f..edb33b7 100644
--- a/examples/mainwindows/mdi/mainwindow.cpp
+++ b/examples/mainwindows/mdi/mainwindow.cpp
@@ -71,7 +71,7 @@ MainWindow::MainWindow()
void MainWindow::closeEvent(QCloseEvent *event)
{
mdiArea->closeAllSubWindows();
- if (activeMdiChild()) {
+ if (mdiArea->currentSubWindow()) {
event->ignore();
} else {
writeSettings();
diff --git a/examples/mainwindows/sdi/mainwindow.h b/examples/mainwindows/sdi/mainwindow.h
index ca478df..a925e2f 100644
--- a/examples/mainwindows/sdi/mainwindow.h
+++ b/examples/mainwindows/sdi/mainwindow.h
@@ -50,12 +50,14 @@ class QMenu;
class QTextEdit;
QT_END_NAMESPACE
+//! [class definition with macro]
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
+//! [class definition with macro]
MainWindow(const QString &fileName);
protected:
diff --git a/examples/script/customclass/bytearrayclass.cpp b/examples/script/customclass/bytearrayclass.cpp
index 7291b97..bce69e4 100644
--- a/examples/script/customclass/bytearrayclass.cpp
+++ b/examples/script/customclass/bytearrayclass.cpp
@@ -72,18 +72,6 @@ private:
int m_last;
};
-static qint32 toArrayIndex(const QString &str)
-{
- QByteArray bytes = str.toUtf8();
- char *eptr;
- quint32 pos = strtoul(bytes.constData(), &eptr, 10);
- if ((eptr == bytes.constData() + bytes.size())
- && (QByteArray::number(pos) == bytes)) {
- return pos;
- }
- return -1;
-}
-
//! [0]
ByteArrayClass::ByteArrayClass(QScriptEngine *engine)
: QObject(engine), QScriptClass(engine)
@@ -120,8 +108,9 @@ QScriptClass::QueryFlags ByteArrayClass::queryProperty(const QScriptValue &objec
if (name == length) {
return flags;
} else {
- qint32 pos = toArrayIndex(name);
- if (pos == -1)
+ bool isArrayIndex;
+ qint32 pos = name.toArrayIndex(&isArrayIndex);
+ if (!isArrayIndex)
return 0;
*id = pos;
if ((flags & HandlesReadAccess) && (pos >= ba->size()))