diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-30 22:58:06 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-30 22:58:06 (GMT) |
commit | 27e55ed231f2afe5a775c3ea92f2ef4bf1f6a26d (patch) | |
tree | 4be868ec6a0a425044bee84f269cfee3bad7c0e6 /examples | |
parent | 50afd26a657da319bd6e3cff09ac6c8dd44405bf (diff) | |
parent | 61f2b450560887651b3350e63bdd75609e3b6752 (diff) | |
download | Qt-27e55ed231f2afe5a775c3ea92f2ef4bf1f6a26d.zip Qt-27e55ed231f2afe5a775c3ea92f2ef4bf1f6a26d.tar.gz Qt-27e55ed231f2afe5a775c3ea92f2ef4bf1f6a26d.tar.bz2 |
Merge branch '4.6' of git://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.cpp | 5 | ||||
-rw-r--r-- | examples/widgets/softkeys/softkeys.cpp | 16 | ||||
-rw-r--r-- | examples/widgets/softkeys/softkeys.h | 2 | ||||
-rw-r--r-- | examples/xml/saxbookmarks/mainwindow.cpp | 7 |
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 |