Based on PbS quantum dots and single-walled carbon nanotube, we have successfully demonstrated a Er-doped fiber laser capable of switching between two different types of output pulses. By finely adjusting both the pump power and the states of polarization controller, flexible switchable Q-switched and mode-locked pulses can be achieved. At pump power of 29 mW, Q-switched pulses are obtained at a central wavelength of 1560.2 nm. When the pump power increases from 29 mW to 92 mW, the Q-switched rate varies from 25 kHz to 75.22 kHz. Accordingly, the output pulse energy rises from 3 nJ to 5.46 nJ, and the output power changes from 0.08 mW to 0.41 mW. When the pump power is set in the ranges of 92 mW to 107 mW, the fiber laser enters the transition region of Q-switching operation. In this region, evident Q-switched instability with large fluctuations is observed, which is independent of the polarization states. When the laser pump power exceeds 107 mW, the Q-switched pulse disappears, and mode-locked pulses are obtained by altering the state of the polarization controller. The central wavelength of the mode-locked pulses output spectrum is 1561.1 nm, and the corresponding 3 dB spectral bandwidth is 4.22 nm. Coupled Ginzburg-Landau equation are provided to reveal the underlying principles of the transition of these pulse trains. Our work provides a new prospect for achieving fiber lasers capable of flexibly switching output pulse types, further expanding their applications in fields such as laser microprocessing, optical communication and medical lasers.