PDA

View Full Version : QFileDialog in Qt designer



tpf80
17th May 2007, 00:30
I was working with Qt designer and I wanted to be able to add a QFileDialog from within it.

Since I didn't see the QFileDialog as one of the items in the widget box, I tried the following to see if I could get it to work:

1) added a QLineEdit where the QFileDialog should be
2) promoted it and entered the following:
cusomclassname = QFileDialog
header file = qfiledialog.h
3) saved the ui file.

When I did this and compiled the program, it worked with no errors, however there is nothing showing where the QFileDialog should be, not even a QLineEdit.

What is the correct method I should use to have access to other widgets that are not in the designer by default? Also is there a way I can add QFileDialog to the widget box so I can drag and drop it like the other included widgets?

tpf80
17th May 2007, 00:41
Actually I think I understand why It's now working. for some reason I thought that the QFileDialog included the line edit and button to press to activate it together, but in fact it is a seperate dialog that I can get the results from and place in the line edit. So in fact I do not need a custom widget for it afterall, and that is why it wouldnt show up in my program when I compiled it. =)