draft of settingWidget qml
[mdictionary] / src / mdictionary / gui / SettingsWidget.cpp
index 06226a9..ad16b4c 100644 (file)
 #include "SettingsWidget.h"
 #include <QDebug>
 
-SettingsWidget::SettingsWidget(GUIInterface *parent) :
-        QDialog(parent)
-{
-    guiInterface = parent;
+SettingsWidget::SettingsWidget(GUIInterface *parent) : QDialog(parent) {
 
-    setWindowTitle(tr("Settings"));
+guiInterface = parent;
 
-    initalizeUI();
+/*
+#ifndef Q_WS_MAEMO_5
+
+    view= new QDeclarativeView();
+    view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/SettingsWidget.qml"));
+    view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+    view->setAlignment(Qt::AlignCenter);
+    view->show();
+
+    mainLayout = new QVBoxLayout;
+    mainLayout->addWidget(view);
+    setLayout(mainLayout);
+
+    QGraphicsObject *rootObject = view->rootObject();
+
+ //   connect(this, SIGNAL(setUrl(QVariant)),
+ //          rootObject, SLOT(setUrl(QVariant)));
+    view->setWindowTitle(tr("Settings"));
 
+#else
+// */
+    setWindowTitle(tr("Settings"));
+    initalizeUI();
     setModal(true);
+//#endif
 }
 
 void SettingsWidget::initalizeUI() {
@@ -152,6 +171,11 @@ void SettingsWidget::initalizeUI() {
 
 void SettingsWidget::showEvent(QShowEvent *e) {
 
+/*
+#ifndef Q_WS_MAEMO_5
+    QDialog::showEvent(e);
+#else
+//*/
    #ifndef Q_WS_MAEMO_5
        _save = false;
    #endif
@@ -176,6 +200,7 @@ void SettingsWidget::showEvent(QShowEvent *e) {
 
     _changed = false;
     QDialog::showEvent(e);
+//#endif
 }
 
 void SettingsWidget::hideEvent(QHideEvent *e) {