This forum has been archived. All content is frozen. Please use KDE Discuss instead.

The class with folder tree selector

Tags: None
(comma "," separated)
isander
Registered Member
Posts
11
Karma
0

The class with folder tree selector

Thu May 28, 2009 12:20 pm
I just starting programing using kdelibs/qt. What is the name of class with folder tree selector, something like in kdialog when you run kdialog --getexistingdirectory ~ ? How can I add such a widget to GUI? I haven't found it in qt designer.

Can modedarors move this to Libraries & API? I've posted it in this category by mistake.

Last edited by isander on Thu May 28, 2009 12:25 pm, edited 1 time in total.
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS


anda_skoa, proud to be a member of KDE forums since 2008-Oct.
isander
Registered Member
Posts
11
Karma
0
anda_skoa wrote:Have a look at this: http://api.kde.org/4.x-api/kdelibs-apid ... 2a8c8772b6

Cheers,
_


Is there any widget like folder selector, which I can embed into my program?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
isander
Registered Member
Posts
11
Karma
0
It would be used to select directory, so something like KDirSelectDialog would be better, but in form of widget. I have searched something like that but there isn't any widget form of KDirSelectDialog.

In a nutshell I need the KDirSelectDialog, but with additional controls. Is there any other way to aim this without coping whole kdirselectdialog.cpp and adding few lines of code in it's constructor?

Last edited by isander on Wed Jun 10, 2009 3:59 pm, edited 1 time in total.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Yes, you can instantiate KDirSelectDialog, then call mainWidget() on it, since it is a subclass of KDialog, which will return the widget used by the dialog. Note that it will be extremely messy however.

The KDirSelectDialog documentation for selectDirectory() recommends using KFileDialog instead however.
I would recommend using KFileWidget and setting a directory filter on it.

What is the specific reason for needing to add custom widgets to the selection dialog? I can't see how directory selection would need anything specific...


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
isander
Registered Member
Posts
11
Karma
0
I want to write sound converter run using kde service menu. On the dialog there would be some controls to choose output format, bitrate etc and the widget to choose localisation of output file(s). If the user run the program on multiple files it would be better to show something as KDirSelectDialog rather than KFileWidget.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]