Changing release and debug build folders of a Qt application

You can use following settings in your .pro file:

CONFIG(release, debug|release){
    DESTDIR = ./
    OBJECTS_DIR = .obj
    MOC_DIR = .moc
    RCC_DIR = .rcc
    UI_DIR = .ui
}

CONFIG(debug, debug|release){
    DESTDIR = ./debug
    OBJECTS_DIR = debug/.obj
    MOC_DIR = debug/.moc
    RCC_DIR = debug/.rcc
    UI_DIR = debug/.ui
}

With above configuration, output of the release builds will remain in the source code directory. All the generated temprorary object codes will be in .obj, .moc, .rcc and .ui hidden directories.

Debug builds are also have similar folders with the difference of debug subfolder.