Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, March 2002
Re: how to change the text in ok/save/open button of a qfiledialog ?


Message 1 in thread

On Thursday 28 February 2002 17:34, you wrote:

> indeed, it would be nice if QFileDialog could handle this.
> FWIW: the workaround is to provide a translation, i.e.:
>
>     QTranslator* save2ok = new QTranslator (0);
>     if (save2ok)
>     {
>         save2ok->insert ("QFileDialog", "Save", "OK");
>         qApp->installTranslator (save2ok);
>     }
>
> > the user should choose a file using a qfiledialog.
> > if the file exists the file is opened, if the file doesn't exits a new
> > file is created.
> >
> > if i choose 'AnyFile' as mode the button is labeled with 'Save' which i
> > actually don't want. i want 'ok' or something else. how can i change the
> > text of this button ? if i choose 'ExistingFile' i cannot choose a file
> > which doesn't exist.

i got this answer from the trolls:

> You can do this by iterating over the children() for the QFileDialog and 
> looking for the pushbutton and calling setText() on the button.  As for making 
> it more accessible, we will consider this for 3.1.

cool.

stay free
jochen

-- 
 [ signature omitted ]