CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
ctkFileDialog Class Reference

#include <Libs/Widgets/ctkFileDialog.h>

Inheritance diagram for ctkFileDialog:
Inheritance graph
[legend]
Collaboration diagram for ctkFileDialog:
Collaboration graph
[legend]

Public Types

typedef QFileDialog Superclass
 

Public Slots

void clearSelection ()
 Deselect all selected directories or files. More...
 
void setAcceptButtonEnable (bool enable)
 

Signals

void fileSelectionChanged (const QStringList &selected)
 

Public Member Functions

Q_INVOKABLE QWidget * bottomWidget () const
 Return the extra widget if any. More...
 
 ctkFileDialog (QWidget *parent=0, const QString &caption=QString(), const QString &directory=QString(), const QString &filter=QString())
 
bool eventFilter (QObject *obj, QEvent *event)
 Internally used. More...
 
QAbstractItemView::SelectionMode selectionMode () const
 
Q_INVOKABLE void setBottomWidget (QWidget *widget, const QString &label=QString())
 
void setSelectionMode (QAbstractItemView::SelectionMode mode)
 
virtual ~ctkFileDialog ()
 

Protected Slots

void onSelectionChanged ()
 

Protected Member Functions

virtual void accept ()
 Reimplemented to override the return key behavior. More...
 

Protected Attributes

QScopedPointer< ctkFileDialogPrivate > d_ptr
 

Properties

QAbstractItemView::SelectionMode SelectionMode
 

Detailed Description

Customizable QFileDialog. An extra widget can be added at the bottom of the dialog under the file format combobox. The Accept button is also controllable using setAcceptButtonEnable(). The behavior of the "return" key is the following:

Definition at line 42 of file ctkFileDialog.h.

Member Typedef Documentation

◆ Superclass

typedef QFileDialog ctkFileDialog::Superclass

Definition at line 49 of file ctkFileDialog.h.

Constructor & Destructor Documentation

◆ ctkFileDialog()

ctkFileDialog::ctkFileDialog ( QWidget *  parent = 0,
const QString &  caption = QString(),
const QString &  directory = QString(),
const QString &  filter = QString() 
)
explicit

Constructor By default, behaves like a QFileDialog

See also
QFileDialog()

◆ ~ctkFileDialog()

virtual ctkFileDialog::~ctkFileDialog ( )
virtual

Member Function Documentation

◆ accept()

virtual void ctkFileDialog::accept ( )
protectedvirtual

Reimplemented to override the return key behavior.

◆ bottomWidget()

Q_INVOKABLE QWidget* ctkFileDialog::bottomWidget ( ) const

Return the extra widget if any.

◆ clearSelection

void ctkFileDialog::clearSelection ( )
slot

Deselect all selected directories or files.

◆ eventFilter()

bool ctkFileDialog::eventFilter ( QObject *  obj,
QEvent *  event 
)

Internally used.

◆ fileSelectionChanged

void ctkFileDialog::fileSelectionChanged ( const QStringList &  selected)
signal

Signals QFileDialog::file[s]Selected() are fired only when the Ok button is pressed, fileSelectionChanged(QStringList) is emitted when the selection is changed, not just when the dialog is accepted.

◆ onSelectionChanged

void ctkFileDialog::onSelectionChanged ( )
protectedslot

◆ selectionMode()

QAbstractItemView::SelectionMode ctkFileDialog::selectionMode ( ) const

Get the selection mode of the views.

See also
setSelectionMode(QAbstractItemView::SelectionMode)

◆ setAcceptButtonEnable

void ctkFileDialog::setAcceptButtonEnable ( bool  enable)
slot

Can be used to prevent the accept button to be enabled. It's typically a slot that can be connected to assure that the user doesn't accept the dialog if a value is not set in the extra bottom widget.

◆ setBottomWidget()

Q_INVOKABLE void ctkFileDialog::setBottomWidget ( QWidget *  widget,
const QString &  label = QString() 
)

Add an extra widget under the file format combobox. If a label is given, it will appear in the first column. The widget is reparented to ctkFileDialog

◆ setSelectionMode()

void ctkFileDialog::setSelectionMode ( QAbstractItemView::SelectionMode  mode)

Set the selection mode the views operate in.

Warning
The selection mode must explicitly be set each time QFileDialog::setFileMode(FileMode mode) is invoked. This is required because the QFileDialog::setFileMode(FileMode mode) method is not virtual and it internally resets the selection mode.
See also
clearSelection()

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkFileDialogPrivate> ctkFileDialog::d_ptr
protected

Definition at line 104 of file ctkFileDialog.h.

Property Documentation

◆ SelectionMode

QAbstractItemView::SelectionMode ctkFileDialog::SelectionMode
readwrite

Definition at line 1 of file ctkFileDialog.h.


The documentation for this class was generated from the following file: