Posted by: developer | March 26, 2012

Camera Feeder

Very nice and simple Android app. Use Android Camera as an IP Camera in your local network. You can find this app here.

Posted by: developer | February 7, 2012

Foscam Viewer Lite in Google Android Market

I wrote a simple Foscam IP/network camera viewer android app. It is called “Foscam Viewer Lite”.

Nothing complicated, just a simple Foscam Pan/Tilt Viewer which allows user to remotely view his/her IP camera and control the Pan/Tilt motion from android phone.

Check this out: here

Posted by: developer | August 11, 2011

Make Android UI looks like iPhone UI

I made my Android app looks like iPhone app. See the image below.

iPhone UI on Android

iPhone UI on Android

Posted by: developer | July 13, 2011

Make iOS UISwitch style in Qt4.

QSlider and UISwitch

This is how to write Qt stylesheet code to make QSlider just like iPhone UISwitch on/off toggle button.

1. In QDesigner, drag QSlider into your form.
2. Modify properties. Make “minimum” to be “0”, “maximum” to be “1”, “orientation” to be “Horizontal”, etc.
3. Insert following code into the stylesheet field.


QSlider {
min-width:80px;
min-height:27px;
max-width:80px;
max-height:27px;
}
QSlider::groove:horizontal {
background-image: url(:/images/slider_bg.png);
background-repeat: no-repeat;
background-position:center;
margin:0px;
border:0px;
padding:0px;
}

QSlider::sub-page:horizontal {
background-image: url(:/images/slider_on.png);
background-repeat: no-repeat;
background-position:left;
background-origin:content;
margin:0px;
border:0px;
padding-left:0px;
}

QSlider::add-page:horizontal {
background-image: url(:/images/slider_off.png);
background-repeat: no-repeat;
background-position:right;
background-origin:content;
margin:0px;
border:0px;
padding-right:0px;
}

QSlider::handle:horizontal {
background-image: url(:/images/slider_handle.png);
width:39px;
height:27px;
margin:0px;
border:0px;
padding:0px;
}

QSlider::sub-page:horizontal:disabled {
background-image: url(:/images/slider_on_disabled.png);
background-repeat: no-repeat;
background-position:left;
background-origin:content;
margin:0px;
border:0px;
padding-left:0px;
}

QSlider::add-page:horizontal:disabled {
background-image: url(:/images/slider_off_disabled.png);
background-repeat: no-repeat;
background-position:right;
background-origin:content;
margin:0px;
border:0px;
padding-right:0px;
}

QSlider::handle:horizontal:disabled {
background-image: url(:/images/slider_handle.png);
width:39px;
height:27px;
margin:0px;
border:0px;
padding:0px;
}

4. Create your own png files like following images.

slider_bg.png

 

slider_on.png

 

slider_off.png

 

slider_handle.png

 

5. Done.

Posted by: developer | May 18, 2011

Recursively remove a directory in Qt4

Today I wrote a code to remove a directory and all its sub-directories and files.


bool MyUtil::removeDir(const QString& dirName)
{
    bool result = true;
    QDir dir(dirName);

    if (dir.exists(dirName))
    {
        Q_FOREACH(QFileInfo info, dir.entryInfoList(QDir::NoDotAndDotDot|QDir::AllDirs|QDir::Files, QDir::DirsFirst))
        {
            if (info.isDir())
                result = removeDir(info.absoluteFilePath());
            else
                result = QFile::remove(info.absoluteFilePath());

            if (!result)
                return result;
        }
        result = dir.rmdir(dirName);
    }
    else
    {
        QFile file(dirName);
        if (file.exists())
            result = file.remove();
    }

    return result;
}//removeDir()

Older Posts »

Categories

Follow

Get every new post delivered to your Inbox.