summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-30 09:17:14 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-30 09:17:14 (GMT)
commit12d8d306444d638b9d1668bf5692f02ff47d12b8 (patch)
treeb7b09f681d029bfad3d60d69f92e58155793bc19 /examples
parentbd2ba54d85415047a581b7b441309572a756dcc5 (diff)
parentc2c31f30830a4e1e455a13321dd7bae6ac8b360f (diff)
downloadQt-12d8d306444d638b9d1668bf5692f02ff47d12b8.zip
Qt-12d8d306444d638b9d1668bf5692f02ff47d12b8.tar.gz
Qt-12d8d306444d638b9d1668bf5692f02ff47d12b8.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts: src/corelib/animation/qabstractanimation.cpp
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/scribble/scribblearea.cpp5
-rw-r--r--examples/widgets/softkeys/softkeys.cpp16
-rw-r--r--examples/widgets/softkeys/softkeys.h2
-rw-r--r--examples/xml/saxbookmarks/mainwindow.cpp7
4 files changed, 17 insertions, 13 deletions
diff --git a/examples/widgets/scribble/scribblearea.cpp b/examples/widgets/scribble/scribblearea.cpp
index 6c9d8aa..2bc2a69 100644
--- a/examples/widgets/scribble/scribblearea.cpp
+++ b/examples/widgets/scribble/scribblearea.cpp
@@ -139,11 +139,12 @@ void ScribbleArea::mouseReleaseEvent(QMouseEvent *event)
}
//! [12] //! [13]
-void ScribbleArea::paintEvent(QPaintEvent * /* event */)
+void ScribbleArea::paintEvent(QPaintEvent *event)
//! [13] //! [14]
{
QPainter painter(this);
- painter.drawImage(QPoint(0, 0), image);
+ QRect dirtyRect = event->rect();
+ painter.drawImage(dirtyRect, image, dirtyRect);
}
//! [14]
diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp
index 69b4941..d1586a5 100644
--- a/examples/widgets/softkeys/softkeys.cpp
+++ b/examples/widgets/softkeys/softkeys.cpp
@@ -66,11 +66,11 @@ MainWindow::MainWindow(QWidget *parent)
infoLabel = new QLabel(tr(""), this);
infoLabel->setContextMenuPolicy(Qt::NoContextMenu);
- toggleButton = new QPushButton(tr("Custom softkeys"), this);
+ toggleButton = new QPushButton(tr("Custom"), this);
toggleButton->setContextMenuPolicy(Qt::NoContextMenu);
toggleButton->setCheckable(true);
- pushButton = new QPushButton(tr("Open File Dialog"), this);
+ pushButton = new QPushButton(tr("File Dialog"), this);
pushButton->setContextMenuPolicy(Qt::NoContextMenu);
QComboBox* comboBox = new QComboBox(this);
@@ -81,12 +81,12 @@ MainWindow::MainWindow(QWidget *parent)
<< QApplication::translate("MainWindow", "Selection3", 0, QApplication::UnicodeUTF8)
);
- layout = new QVBoxLayout;
- layout->addWidget(textEditor);
- layout->addWidget(infoLabel);
- layout->addWidget(toggleButton);
- layout->addWidget(pushButton);
- layout->addWidget(comboBox);
+ layout = new QGridLayout;
+ layout->addWidget(textEditor, 0, 0, 1, 2);
+ layout->addWidget(infoLabel, 1, 0, 1, 2);
+ layout->addWidget(toggleButton, 2, 0);
+ layout->addWidget(pushButton, 2, 1);
+ layout->addWidget(comboBox, 3, 0, 1, 2);
central->setLayout(layout);
fileMenu = menuBar()->addMenu(tr("&File"));
diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h
index 178ae64..1372fa4 100644
--- a/examples/widgets/softkeys/softkeys.h
+++ b/examples/widgets/softkeys/softkeys.h
@@ -61,7 +61,7 @@ public:
MainWindow(QWidget *parent = 0);
~MainWindow();
private:
- QVBoxLayout *layout;
+ QGridLayout *layout;
QWidget *central;
QTextEdit* textEditor;
QLabel *infoLabel;
diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp
index 49cb468..ff3cf11 100644
--- a/examples/xml/saxbookmarks/mainwindow.cpp
+++ b/examples/xml/saxbookmarks/mainwindow.cpp
@@ -67,8 +67,11 @@ MainWindow::MainWindow()
void MainWindow::open()
{
#if defined(Q_OS_SYMBIAN)
- // Always look for bookmarks on the same drive where the application is installed to.
- QString bookmarksFolder = QCoreApplication::applicationFilePath().left(1);
+ // Look for bookmarks on the same drive where the application is installed to,
+ // if drive is not read only. QDesktopServices::DataLocation does this check,
+ // and returns writable drive.
+ QString bookmarksFolder =
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1);
bookmarksFolder.append(":/Data/qt/saxbookmarks");
QDir::setCurrent(bookmarksFolder);
#endif