diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-03-08 01:43:00 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-03-08 01:43:00 (GMT) |
commit | 56768688cc49c2dd2234598b41ebbfd046937ac5 (patch) | |
tree | 029ced5da670e8b64901827508502454e0a167aa /examples | |
parent | 038f6fc10092da1414fd2efff353671dbf862995 (diff) | |
parent | 9bc81769eb6ebc9bd62fe3c1d86e67ddccbed8b6 (diff) | |
download | Qt-56768688cc49c2dd2234598b41ebbfd046937ac5.zip Qt-56768688cc49c2dd2234598b41ebbfd046937ac5.tar.gz Qt-56768688cc49c2dd2234598b41ebbfd046937ac5.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'examples')
-rw-r--r-- | examples/multimedia/audioinput/audioinput.cpp | 6 | ||||
-rw-r--r-- | examples/multimedia/audioinput/audioinput.h | 2 | ||||
-rw-r--r-- | examples/network/qftp/sym_iap_util.h | 16 | ||||
-rw-r--r-- | examples/openvg/star/starwidget.cpp | 5 | ||||
-rw-r--r-- | examples/threads/waitconditions/waitconditions.pro | 2 | ||||
-rw-r--r-- | examples/tutorials/addressbook/part3/addressbook.cpp | 2 | ||||
-rw-r--r-- | examples/tutorials/addressbook/part4/addressbook.cpp | 2 | ||||
-rw-r--r-- | examples/widgets/softkeys/softkeys.cpp | 38 | ||||
-rw-r--r-- | examples/widgets/softkeys/softkeys.h | 19 | ||||
-rw-r--r-- | examples/widgets/windowflags/controllerwindow.cpp | 2 |
10 files changed, 73 insertions, 21 deletions
diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index b01a396..af72385 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -76,6 +76,8 @@ AudioInfo::AudioInfo(const QAudioFormat &format, QObject *parent) case QAudioFormat::SignedInt: m_maxAmplitude = 127; break; + default: + break; } break; case 16: @@ -86,8 +88,12 @@ AudioInfo::AudioInfo(const QAudioFormat &format, QObject *parent) case QAudioFormat::SignedInt: m_maxAmplitude = 32767; break; + default: + break; } break; + default: + break; } } diff --git a/examples/multimedia/audioinput/audioinput.h b/examples/multimedia/audioinput/audioinput.h index f87c682..be721de 100644 --- a/examples/multimedia/audioinput/audioinput.h +++ b/examples/multimedia/audioinput/audioinput.h @@ -119,8 +119,8 @@ private: QPushButton *m_suspendResumeButton; QComboBox *m_deviceBox; - AudioInfo *m_audioInfo; QAudioDeviceInfo m_device; + AudioInfo *m_audioInfo; QAudioFormat m_format; QAudioInput *m_audioInput; QIODevice *m_input; diff --git a/examples/network/qftp/sym_iap_util.h b/examples/network/qftp/sym_iap_util.h index 41e43a9..445036a 100644 --- a/examples/network/qftp/sym_iap_util.h +++ b/examples/network/qftp/sym_iap_util.h @@ -60,6 +60,7 @@ //#include <QTextCodec> _LIT(KIapNameSetting, "IAP\\Name"); // text - mandatory +_LIT(KIapTableIdField, "IAP\Id"); _LIT(KIapDialogPref, "IAP\\DialogPref"); // TUnit32 - optional _LIT(KIapService, "IAP\\IAPService"); // TUnit32 - mandatory _LIT(KIapServiceType, "IAP\\IAPServiceType"); // text - mandatory @@ -367,20 +368,25 @@ static QString qt_OfferIapDialog() { CleanupClosePushL(connection); socketServ.Connect(); + + TCommDbConnPref prefs; + prefs.SetDialogPreference(ECommDbDialogPrefPrompt); + connection.Open(socketServ); - connection.Start(); + connection.Start(prefs); connection.GetDesSetting(TPtrC(KIapNameSetting), iapName); - //connection.Stop(); iapName.ZeroTerminate(); QString strIapName((char*)iapName.Ptr()); int error = 0; - if(!qt_SetDefaultIapName(strIapName, error)) { - //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error); - strIapName = QString(""); + if(!strIapName.isEmpty()) { + if(!qt_SetDefaultIapName(strIapName, error)) { + //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error); + strIapName = QString(""); + } } CleanupStack::PopAndDestroy(&connection); diff --git a/examples/openvg/star/starwidget.cpp b/examples/openvg/star/starwidget.cpp index bde0719..794ede9 100644 --- a/examples/openvg/star/starwidget.cpp +++ b/examples/openvg/star/starwidget.cpp @@ -93,8 +93,9 @@ void StarWidget::paintEvent(QPaintEvent *) // and prepare to perform raw OpenVG calls. painter.beginNativePainting(); - // Cache the path if we haven't already. - if (path == VG_INVALID_HANDLE) { + // Cache the path if we haven't already or if the path has + // become invalid because the window's context has changed. + if (path == VG_INVALID_HANDLE || !vgGetPathCapabilities(path)) { path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, // scale diff --git a/examples/threads/waitconditions/waitconditions.pro b/examples/threads/waitconditions/waitconditions.pro index b07b413..c2be6cd 100644 --- a/examples/threads/waitconditions/waitconditions.pro +++ b/examples/threads/waitconditions/waitconditions.pro @@ -10,8 +10,6 @@ INCLUDEPATH += . # Input SOURCES += waitconditions.cpp CONFIG += qt warn_on create_prl link_prl console -OBJECTS_DIR=obj/debug-shared -MOC_DIR=moc/debug-shared # install target.path = $$[QT_INSTALL_EXAMPLES]/threads/waitconditions diff --git a/examples/tutorials/addressbook/part3/addressbook.cpp b/examples/tutorials/addressbook/part3/addressbook.cpp index 59b297a..5b39159 100644 --- a/examples/tutorials/addressbook/part3/addressbook.cpp +++ b/examples/tutorials/addressbook/part3/addressbook.cpp @@ -91,7 +91,7 @@ AddressBook::AddressBook(QWidget *parent) mainLayout->addWidget(addressText, 1, 1); mainLayout->addLayout(buttonLayout1, 1, 2); //! [adding navigation layout] - mainLayout->addLayout(buttonLayout2, 3, 1); + mainLayout->addLayout(buttonLayout2, 2, 1); //! [adding navigation layout] setLayout(mainLayout); setWindowTitle(tr("Simple Address Book")); diff --git a/examples/tutorials/addressbook/part4/addressbook.cpp b/examples/tutorials/addressbook/part4/addressbook.cpp index e4e451f..a4bf459 100644 --- a/examples/tutorials/addressbook/part4/addressbook.cpp +++ b/examples/tutorials/addressbook/part4/addressbook.cpp @@ -100,7 +100,7 @@ AddressBook::AddressBook(QWidget *parent) mainLayout->addWidget(addressLabel, 1, 0, Qt::AlignTop); mainLayout->addWidget(addressText, 1, 1); mainLayout->addLayout(buttonLayout1, 1, 2); - mainLayout->addLayout(buttonLayout2, 3, 1); + mainLayout->addLayout(buttonLayout2, 2, 1); setLayout(mainLayout); setWindowTitle(tr("Simple Address Book")); diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index cbd227c9..e5c2e73 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -70,6 +70,12 @@ MainWindow::MainWindow(QWidget *parent) toggleButton->setContextMenuPolicy(Qt::NoContextMenu); toggleButton->setCheckable(true); + modeButton = new QPushButton(tr("Loop SK window type"), this); + modeButton->setContextMenuPolicy(Qt::NoContextMenu); + + modeLabel = new QLabel(tr("Normal maximized"), this); + modeLabel->setContextMenuPolicy(Qt::NoContextMenu); + pushButton = new QPushButton(tr("File Dialog"), this); pushButton->setContextMenuPolicy(Qt::NoContextMenu); @@ -87,6 +93,8 @@ MainWindow::MainWindow(QWidget *parent) layout->addWidget(toggleButton, 2, 0); layout->addWidget(pushButton, 2, 1); layout->addWidget(comboBox, 3, 0, 1, 2); + layout->addWidget(modeButton, 4, 0, 1, 2); + layout->addWidget(modeLabel, 5, 0, 1, 2); central->setLayout(layout); fileMenu = menuBar()->addMenu(tr("&File")); @@ -97,6 +105,7 @@ MainWindow::MainWindow(QWidget *parent) connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog())); connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication())); connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys())); + connect(modeButton, SIGNAL(clicked()), this, SLOT(setMode())); pushButton->setFocus(); } @@ -133,6 +142,35 @@ void MainWindow::setCustomSoftKeys() } } +void MainWindow::setMode() +{ + if(isMaximized()) { + showFullScreen(); + modeLabel->setText(tr("Normal Fullscreen")); + } else { + Qt::WindowFlags flags = windowFlags(); + if(flags & Qt::WindowSoftkeysRespondHint) { + flags |= Qt::WindowSoftkeysVisibleHint; + flags &= ~Qt::WindowSoftkeysRespondHint; + setWindowFlags(flags); // Hides visible window + showFullScreen(); + modeLabel->setText(tr("Fullscreen with softkeys")); + } else if(flags & Qt::WindowSoftkeysVisibleHint) { + flags &= ~Qt::WindowSoftkeysVisibleHint; + flags &= ~Qt::WindowSoftkeysRespondHint; + setWindowFlags(flags); // Hides visible window + showMaximized(); + modeLabel->setText(tr("Normal Maximized")); + } else { + flags &= ~Qt::WindowSoftkeysVisibleHint; + flags |= Qt::WindowSoftkeysRespondHint; + setWindowFlags(flags); // Hides visible window + showFullScreen(); + modeLabel->setText(tr("Fullscreen with SK respond")); + } + } +} + void MainWindow::exitApplication() { qApp->exit(); diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h index bae31e7..d533484 100644 --- a/examples/widgets/softkeys/softkeys.h +++ b/examples/widgets/softkeys/softkeys.h @@ -57,21 +57,24 @@ private slots: void okPressed(); void cancelPressed(); void setCustomSoftKeys(); + void setMode(); public: MainWindow(QWidget *parent = 0); ~MainWindow(); private: QGridLayout *layout; QWidget *central; - QTextEdit* textEditor; + QTextEdit *textEditor; QLabel *infoLabel; - QPushButton* toggleButton; - QPushButton* pushButton; - QMenu* fileMenu; - QAction* addSoftKeysAct; - QAction* exit; - QAction* ok; - QAction* cancel; + QPushButton *toggleButton; + QPushButton *pushButton; + QPushButton *modeButton; + QLabel *modeLabel; + QMenu *fileMenu; + QAction *addSoftKeysAct; + QAction *exit; + QAction *ok; + QAction *cancel; }; //! [0] diff --git a/examples/widgets/windowflags/controllerwindow.cpp b/examples/widgets/windowflags/controllerwindow.cpp index 0277794..fb82b8f 100644 --- a/examples/widgets/windowflags/controllerwindow.cpp +++ b/examples/widgets/windowflags/controllerwindow.cpp @@ -58,7 +58,7 @@ ControllerWindow::ControllerWindow() bottomLayout->addStretch(); bottomLayout->addWidget(quitButton); - QVBoxLayout *mainLayout = new QVBoxLayout; + QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->addWidget(typeGroupBox); mainLayout->addWidget(hintsGroupBox); mainLayout->addLayout(bottomLayout); |