Daily Archives: 27.08.2013

Scientists Control One Person’s Body With Another Person’s Brain

Sit down for this one. Researchers at the University of Washington have figured out how to send commands from one person’s brain to control a different person’s muscle movement. In technical terms, it’s the world’s first noninvasive human-to-human brain interface. How’d they do it? Vulcan mind meld? Nope, just the regular ol’ internet. What in the hell?

Read more…

…read more

Source: http://feeds.gawker.com/~r/gizmodo/full/~3/m2Hw_RSqs1c/scientists-control-one-persons-body-with-another-perso-1208742414

    

QSettings and QML

Suffering from absence of useful QSettings in QML?

Its pretty easy to solve (if you not afraid of some c++ code in your project)

#ifndef SETTINGS_H
#define SETTINGS_H

#include <QObject>
#include <QSettings>

class Settings : public QObject
{
    Q_OBJECT
public:
    explicit Settings(QObject *parent = 0);
    Q_INVOKABLE void setValue(const QString & key, const QVariant & value);
    Q_INVOKABLE QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const;

signals:

public slots:
private:
    QSettings settings_;
};

#endif // SETTINGS_H

 

#include "settings.h"

Settings::Settings(QObject *parent) :
    QObject(parent)
{
}

void Settings::setValue(const QString &key, const QVariant &value) {
    settings_.setValue(key, value);
}

QVariant Settings::value(const QString &key, const QVariant &defaultValue) const {
    return settings_.value(key, defaultValue);
}

register it:

    QQmlContext *context = engine->rootContext();
    context->setContextProperty("settings", &settings);

and use:

    FileDialog {
        id: fileDialog
        folder: settings.value("lastFolder", ".")
        onAccepted:  {
            settings.setValue("lastFolder", fileDialog.folder)
        }
    }

pretty easy, eh?