Look at "Config Dialog Example" in Qt examples.