summaryrefslogtreecommitdiffstats
path: root/tools/qml/qmlruntime.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin+qt@viroteck.net>2012-06-18 18:12:50 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-19 13:59:54 +0200
commited0250efca989b330dc4838ed996810f4d75574a (patch)
tree4bed073c449ee9c4b2cc07038b66f49023ab7705 /tools/qml/qmlruntime.cpp
parent81a75bde3fb71ced76c975ff9ec9b75bbcc70bcf (diff)
Strip out Maemo5 code.
Change-Id: Ia4315c32ba35f9ec7bd7b4e935bfcdbc21c1410d Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tools/qml/qmlruntime.cpp')
-rw-r--r--tools/qml/qmlruntime.cpp147
1 files changed, 1 insertions, 146 deletions
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 965fc765..0aaeb066 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -44,15 +44,7 @@
#ifdef hz
#undef hz
#endif
-#ifdef Q_WS_MAEMO_5
-# include <QMaemo5ValueButton>
-# include <QMaemo5ListPickSelector>
-# include <QWidgetAction>
-# include <QStringListModel>
-# include "ui_recopts_maemo5.h"
-#else
-# include "ui_recopts.h"
-#endif
+#include "ui_recopts.h"
#include "qmlruntime.h"
#include <qdeclarativecontext.h>
@@ -195,58 +187,6 @@ private:
-#if defined(Q_WS_MAEMO_5)
-
-class Maemo5PickerAction : public QWidgetAction {
- Q_OBJECT
-public:
- Maemo5PickerAction(const QString &text, QActionGroup *actions, QObject *parent)
- : QWidgetAction(parent), m_text(text), m_actions(actions)
- { }
-
- QWidget *createWidget(QWidget *parent)
- {
- QMaemo5ValueButton *button = new QMaemo5ValueButton(m_text, parent);
- button->setValueLayout(QMaemo5ValueButton::ValueUnderTextCentered);
- QMaemo5ListPickSelector *pick = new QMaemo5ListPickSelector(button);
- button->setPickSelector(pick);
- if (m_actions) {
- QStringList sl;
- int curIdx = -1, idx = 0;
- foreach (QAction *a, m_actions->actions()) {
- sl << a->text();
- if (a->isChecked())
- curIdx = idx;
- idx++;
- }
- pick->setModel(new QStringListModel(sl));
- pick->setCurrentIndex(curIdx);
- } else {
- button->setEnabled(false);
- }
- connect(pick, SIGNAL(selected(QString)), this, SLOT(emitTriggered()));
- return button;
- }
-
-private slots:
- void emitTriggered()
- {
- QMaemo5ListPickSelector *pick = qobject_cast<QMaemo5ListPickSelector *>(sender());
- if (!pick)
- return;
- int idx = pick->currentIndex();
-
- if (m_actions && idx >= 0 && idx < m_actions->actions().count())
- m_actions->actions().at(idx)->trigger();
- }
-
-private:
- QString m_text;
- QPointer<QActionGroup> m_actions;
-};
-
-#endif // Q_WS_MAEMO_5
-
static struct { const char *name, *args; } ffmpegprofiles[] = {
{"Maximum Quality", "-sameq"},
{"High Quality", "-qmax 2"},
@@ -263,9 +203,7 @@ public:
RecordingDialog(QWidget *parent) : QDialog(parent)
{
setupUi(this);
-#ifndef Q_WS_MAEMO_5
hz->setValidator(new QDoubleValidator(hz));
-#endif
for (int i=0; ffmpegprofiles[i].name; ++i) {
profile->addItem(QString::fromLatin1(ffmpegprofiles[i].name));
}
@@ -296,59 +234,25 @@ public:
{
QString str = tr("Original (%1x%2)").arg(s.width()).arg(s.height());
-#ifdef Q_WS_MAEMO_5
- sizeCombo->setItemText(0, str);
-#else
sizeOriginal->setText(str);
if (sizeWidth->value()<=1) {
sizeWidth->setValue(s.width());
sizeHeight->setValue(s.height());
}
-#endif
}
void showffmpegOptions(bool b)
{
-#ifdef Q_WS_MAEMO_5
- profileLabel->setVisible(b);
- profile->setVisible(b);
- ffmpegHelp->setVisible(b);
- args->setVisible(b);
-#else
ffmpegOptions->setVisible(b);
-#endif
}
void showRateOptions(bool b)
{
-#ifdef Q_WS_MAEMO_5
- rateLabel->setVisible(b);
- rateCombo->setVisible(b);
-#else
rateOptions->setVisible(b);
-#endif
}
void setVideoRate(int rate)
{
-#ifdef Q_WS_MAEMO_5
- int idx;
- if (rate >= 60)
- idx = 0;
- else if (rate >= 50)
- idx = 2;
- else if (rate >= 25)
- idx = 3;
- else if (rate >= 24)
- idx = 4;
- else if (rate >= 20)
- idx = 5;
- else if (rate >= 15)
- idx = 6;
- else
- idx = 7;
- rateCombo->setCurrentIndex(idx);
-#else
if (rate == 24)
hz24->setChecked(true);
else if (rate == 25)
@@ -361,23 +265,10 @@ public:
hzCustom->setChecked(true);
hz->setText(QString::number(rate));
}
-#endif
}
int videoRate() const
{
-#ifdef Q_WS_MAEMO_5
- switch (rateCombo->currentIndex()) {
- case 0: return 60;
- case 1: return 50;
- case 2: return 25;
- case 3: return 24;
- case 4: return 20;
- case 5: return 15;
- case 7: return 10;
- default: return 60;
- }
-#else
if (hz24->isChecked())
return 24;
else if (hz25->isChecked())
@@ -389,20 +280,10 @@ public:
else {
return hz->text().toInt();
}
-#endif
}
QSize videoSize() const
{
-#ifdef Q_WS_MAEMO_5
- switch (sizeCombo->currentIndex()) {
- case 0: return QSize();
- case 1: return QSize(640,480);
- case 2: return QSize(320,240);
- case 3: return QSize(1280,720);
- default: return QSize();
- }
-#else
if (sizeOriginal->isChecked())
return QSize();
else if (size720p->isChecked())
@@ -413,7 +294,6 @@ public:
return QSize(320,240);
else
return QSize(sizeWidth->value(), sizeHeight->value());
-#endif
}
@@ -616,10 +496,6 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
{
QDeclarativeViewer::registerTypes();
setWindowTitle(tr("Qt QML Viewer"));
-#ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5StackedWindow);
-// setPalette(QApplication::palette("QLabel"));
-#endif
devicemode = false;
canvas = 0;
@@ -788,27 +664,6 @@ void QDeclarativeViewer::createMenu()
if (!menu)
return;
-#if defined(Q_WS_MAEMO_5)
- menu->addAction(openAction);
- menu->addAction(openUrlAction);
- menu->addAction(reloadAction);
-
- menu->addAction(snapshotAction);
- menu->addAction(recordAction);
-
- menu->addAction(recordOptions);
- menu->addAction(proxyAction);
-
- menu->addAction(slowAction);
- menu->addAction(showWarningsWindow);
-
- orientation->addAction(landscapeAction);
- orientation->addAction(portraitAction);
- menu->addAction(new Maemo5PickerAction(tr("Set orientation"), orientation, this));
- menu->addAction(fullscreenAction);
- return;
-#endif // Q_WS_MAEMO_5
-
QMenu *fileMenu = menu->addMenu(tr("&File"));
fileMenu->addAction(openAction);
fileMenu->addAction(openUrlAction);