smallB
smallB

Reputation: 17118

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.

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

Upvotes: 1

Views: 183

Answers (1)

Ioan Paul Pirau
Ioan Paul Pirau

Reputation: 2833

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

Upvotes: 4

Related Questions