• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kalarm

Public Slots | Signals | Public Member Functions | List of all members
PickFileRadio Class Referenceabstract

#include <pickfileradio.h>

Inheritance diagram for PickFileRadio:
Inheritance graph
[legend]

Public Slots

virtual void setEnabled (bool)
 

Signals

void fileChanged ()
 

Public Member Functions

 PickFileRadio (QPushButton *button, LineEdit *edit, const QString &text, ButtonGroup *group, QWidget *parent)
 
 PickFileRadio (const QString &text, ButtonGroup *group, QWidget *parent)
 
QString file () const
 
LineEdit * fileEdit () const
 
void init (QPushButton *button, LineEdit *edit=0)
 
virtual QString pickFile ()=0
 
QPushButton * pushButton () const
 
void setFile (const QString &file)
 
virtual void setReadOnly (bool readOnly)
 
- Public Member Functions inherited from RadioButton
 RadioButton (QWidget *parent)
 
 RadioButton (const QString &text, QWidget *parent)
 
QWidget * focusWidget () const
 
bool isReadOnly () const
 
void setFocusWidget (QWidget *widget, bool enable=true)
 

Additional Inherited Members

- Protected Slots inherited from RadioButton
void slotClicked ()
 
- Protected Member Functions inherited from RadioButton
virtual void keyPressEvent (QKeyEvent *)
 
virtual void keyReleaseEvent (QKeyEvent *)
 
virtual void mouseMoveEvent (QMouseEvent *)
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 

Detailed Description

Radio button with associated file picker controls.

The PickFileRadio class is a radio button with an associated button to choose a file, and an optional file name edit box. Its purpose is to ensure that while the radio button is selected, the chosen file name is never blank.

To achieve this, whenever the button is newly selected and the file name is currently blank, the file picker dialog is displayed to choose a file. If the dialog exits without a file being chosen, the radio button selection is reverted to the previously selected button in the parent button group.

The class handles the activation of the file picker dialog (via a virtual method which must be supplied by deriving a class from this one). It also handles all enabling and disabling of the browse button and edit box when the enable state of the radio button is changed, and when the radio button selection changes.

Author
David Jarvie djarv.nosp@m.ie@k.nosp@m.de.or.nosp@m.g

Definition at line 51 of file pickfileradio.h.

Constructor & Destructor Documentation

PickFileRadio::PickFileRadio ( QPushButton *  button,
LineEdit *  edit,
const QString &  text,
ButtonGroup *  group,
QWidget *  parent 
)

Constructor.

Parameters
buttonPush button to invoke the file picker dialog.
editFile name edit widget, or null if there is none.
textRadio button's text.
parentButton group which is to be the parent object for the radio button.

Definition at line 33 of file pickfileradio.cpp.

PickFileRadio::PickFileRadio ( const QString &  text,
ButtonGroup *  group,
QWidget *  parent 
)

Constructor.

The init() method must be called before the widget can be used.

Parameters
textRadio button's text.
parentButton group which is to be the parent object for the radio button.

Definition at line 44 of file pickfileradio.cpp.

Member Function Documentation

QString PickFileRadio::file ( ) const

Returns the currently selected file name.

Definition at line 92 of file pickfileradio.cpp.

void PickFileRadio::fileChanged ( )
signal
LineEdit* PickFileRadio::fileEdit ( ) const
inline

Returns the associated file name edit widget, or null if none.

Definition at line 93 of file pickfileradio.h.

void PickFileRadio::init ( QPushButton *  button,
LineEdit *  edit = 0 
)

Initialises the widget.

Parameters
buttonPush button to invoke the file picker dialog.
editFile name edit widget, or null if there is none.

Definition at line 55 of file pickfileradio.cpp.

virtual QString PickFileRadio::pickFile ( )
pure virtual

Chooses a file, for example by displaying a file selection dialog.

This method is called when the push button is clicked - the client should not activate a file selection dialog directly.

Returns
Selected file name, or QString() if no selection made.
QPushButton* PickFileRadio::pushButton ( ) const
inline

Returns the associated file browse push button.

Definition at line 95 of file pickfileradio.h.

void PickFileRadio::setEnabled ( bool  enable)
virtualslot

Enables or disables the radio button, and adjusts the enabled state of the associated browse button and file name edit box.

Definition at line 101 of file pickfileradio.cpp.

void PickFileRadio::setFile ( const QString &  file)

Notifies the widget of the currently selected file name.

This should only be used when no file name edit box is used. It should be called to initialise the widget's data, and also any time the file name is changed without using the push button.

Definition at line 87 of file pickfileradio.cpp.

void PickFileRadio::setReadOnly ( bool  readOnly)
virtual

Sets whether the radio button and associated widgets are read-only for the user.

If read-only, their states cannot be changed by the user.

Parameters
readOnlyTrue to set the widgets read-only, false to set them read-write.

Reimplemented from RadioButton.

Definition at line 73 of file pickfileradio.cpp.


The documentation for this class was generated from the following files:
  • pickfileradio.h
  • pickfileradio.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal