简体   繁体   中英

Two buttons one window

I've got two push_buttons on dialog and both of them are meant to invoke QFileDialog window, with the difference that first button is for input files and second for output files, other than that logic is the same. What is the best way to connect those buttons to QFileDialog without doing any code repetion.

PS
Ideally those two windows (Open File) would have different titles.

IMO you should use two QFileDialog objects, one for each case. To make a difference between imput/output you should set the AcceptMode .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM