I think you are talking about the buffer cache and not the query cache. The query cache is a cache of the most recent SQL statements. These are never flushed to disk.
The flushing of the buffer cache is not as important as flushing the buffer log. The buffer log keeps track of the updates performed on data in the database. The buffer log is used to recover the database in event of a failure i.e. when the buffer cache is not flushed to disk. There are 3 ways in InnoDB to flush the log buffer and this is controlled with the parameter innodb_flush_log_at_trx_commit.