# HG changeset patch # User Wes Thierry # Date 1288956723 0 # Node ID a593fb7f78c0285fadcacc8f030839cc334182ac # Parent 99c3932ca5e6fcb3d31573b7c551df481902fdf1 Adding defines for magic numbers diff -r 99c3932ca5e6 -r a593fb7f78c0 MixedView/MixedView.pro --- a/MixedView/MixedView.pro Thu Oct 28 10:48:20 2010 -0700 +++ b/MixedView/MixedView.pro Fri Nov 05 11:32:03 2010 +0000 @@ -26,7 +26,7 @@ symbian { TARGET.UID3 = 0xe4cef592 LIBS += -lcone -leikcore -lavkon - TARGET.CAPABILITY += LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location ReadDeviceData + # TARGET.CAPABILITY += LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location ReadDeviceData TARGET.EPOCSTACKSIZE = 0x14000 TARGET.EPOCHEAPSIZE = 0x020000 0x10000000 } diff -r 99c3932ca5e6 -r a593fb7f78c0 MixedView/mainwindow.cpp --- a/MixedView/mainwindow.cpp Thu Oct 28 10:48:20 2010 -0700 +++ b/MixedView/mainwindow.cpp Fri Nov 05 11:32:03 2010 +0000 @@ -10,6 +10,15 @@ #include #include +// define the borders of the image +#define LEFT_EDGE -103 +#define RIGHT_EDGE 180 +#define TOP_EDGE -156 +#define BOTTOM_EDGE 145 +// The number of Hits is always at least 2 +// since there is a visible and invisible image +// on top of each other at the same coordinates +#define HITS 2 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -52,8 +61,6 @@ mPacman->setSpanAngle(4500); mScene->addItem(mPacman); - - // lets place a pause button in the view pauseButton = new QPushButton("Pause"); connect(pauseButton, SIGNAL(clicked()), this, SLOT(pause())); @@ -85,8 +92,6 @@ void MainWindow::updateGraphics() { if (mPause) return; - - // update the pacman mouth state // will eventually change this to a graphic switch (mPacState) { @@ -119,10 +124,12 @@ } + void MainWindow::checkCollisions() { + mNumHits = mPacCollider->collidingItems().count(); - if (mNumHits == 2) + if (mNumHits == HITS) mLastPt = mPacCollider->pos(); QPointF pt = mPacCollider->pos(); @@ -130,19 +137,18 @@ pt.setX(pt.x()-xAxis); pt.setY(pt.y()+yAxis); - if (pt.x()<-103) - pt.setX(-103); - else if (pt.x()>180) - pt.setX(180); + if (pt.x()< LEFT_EDGE) + pt.setX(LEFT_EDGE); + else if (pt.x()>RIGHT_EDGE) + pt.setX(RIGHT_EDGE); - if (pt.y()<-156) - pt.setY(-156); - else if (pt.y()>145) - pt.setY(145); + if (pt.y()BOTTOM_EDGE) + pt.setY(BOTTOM_EDGE); - if (mNumHits == 2) { + if (mNumHits == HITS) { mPacCollider->setPos(pt); - // mPacman->setPos(pt); } else { mPacCollider->setPos(mLastPt); diff -r 99c3932ca5e6 -r a593fb7f78c0 Mywebwidget3/mywebwidget.cpp --- a/Mywebwidget3/mywebwidget.cpp Thu Oct 28 10:48:20 2010 -0700 +++ b/Mywebwidget3/mywebwidget.cpp Fri Nov 05 11:32:03 2010 +0000 @@ -54,6 +54,7 @@ connect(m_lineEdit,SIGNAL(editingFinished()),SLOT(openUrl())); connect(m_view,SIGNAL(loadFinished(bool)),SLOT(onLoadFinished(bool))); + //connect the toolbar as well connect(m_toolbar,SIGNAL(goBack()),SLOT(loadPreviousPage())); } @@ -74,6 +75,7 @@ void MyWebWidget::openUrl() { + QString url(m_lineEdit->text()); if(!url.contains("http://",Qt::CaseInsensitive)) url.prepend("http://"); diff -r 99c3932ca5e6 -r a593fb7f78c0 Mywebwidget3/mywebwidget3.pro --- a/Mywebwidget3/mywebwidget3.pro Thu Oct 28 10:48:20 2010 -0700 +++ b/Mywebwidget3/mywebwidget3.pro Fri Nov 05 11:32:03 2010 +0000 @@ -22,7 +22,7 @@ symbian { TARGET.UID3 = 0xe1b774b2 - TARGET.CAPABILITY += LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location ReadDeviceData + TARGET.CAPABILITY += LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location TARGET.EPOCSTACKSIZE = 0x14000 TARGET.EPOCHEAPSIZE = 0x020000 0x4000000 }