It appears you want the user to push button 1 to select a file. You then change the label on button 1 to the path the user selected. You then expect the user to push button 2 to process the file selected when they pushed button 1.
Quoting out of order:
Then why do you set it in the handler for the pushButton1 clicked signal? Line 5 in this chunk:
should probably be after line 16 of this chunk where the processing has been successful after the user presses button 2:This is the button that preps the path to be used to load the file from.Qt Code:
void Window::on_pushButton1_clicked() { pushButton1.setText(path); }To copy to clipboard, switch view to plain text mode
You also need to ensure that button 2 cannot be pressed unless button 1 has been AND the user did not cancel the file selection. Something has to reset button 1's label too I guess.Qt Code:
void Window::on_pushButton2_clicked() { try something... catch one exception... { output error 1... } catch second exception... { output error 2... } catch all other exceptions... { output generic error... } perform some other operations and configurations for the future... }To copy to clipboard, switch view to plain text mode
Bookmarks