Here's an example:

Replace /path/to/windows3.1.iso with the path to your Windows 3.1 installation ISO or disk image.

qemu-system-i386 -hda windows3.1.qcow2 -cdrom /path/to/windows3.1.iso -m 16