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

kalarm

  • sources
  • kde-4.14
  • kdepim
  • kalarm
pickfileradio.h
Go to the documentation of this file.
1 /*
2  * pickfileradio.h - radio button with an associated file picker
3  * Program: kalarm
4  * Copyright © 2005,2009 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef PICKFILERADIO_H
22 #define PICKFILERADIO_H
23 
26 #include "radiobutton.h"
27 
28 class QPushButton;
29 class ButtonGroup;
30 class LineEdit;
31 
51 class PickFileRadio : public RadioButton
52 {
53  Q_OBJECT
54  public:
61  PickFileRadio(QPushButton* button, LineEdit* edit, const QString& text, ButtonGroup* group, QWidget* parent);
67  PickFileRadio(const QString& text, ButtonGroup* group, QWidget* parent);
72  void init(QPushButton* button, LineEdit* edit = 0);
77  virtual void setReadOnly(bool readOnly);
83  virtual QString pickFile() = 0;
89  void setFile(const QString& file);
91  QString file() const;
93  LineEdit* fileEdit() const { return mEdit; }
95  QPushButton* pushButton() const { return mButton; }
96 
97  public slots:
101  virtual void setEnabled(bool);
102 
103  signals:
104  void fileChanged(); // emitted whenever the selected file changes
105 
106  private slots:
107  void slotSelectionChanged(QAbstractButton*);
108  QString slotPickFile();
109  void setLastButton();
110 
111  private:
112  bool pickFileIfNone();
113 
114  ButtonGroup* mGroup; // button group which radio button is in
115  LineEdit* mEdit; // file name edit box, or null if none
116  QPushButton* mButton; // push button to pick a file
117  QString mFile; // saved file name (if mEdit is null)
118  QAbstractButton* mLastButton; // previous radio button selected
119  bool mRevertButton; // true to revert to the previous radio button selection
120 };
121 
122 #endif // PICKFILERADIO_H
123 
124 // vim: et sw=4:
PickFileRadio::init
void init(QPushButton *button, LineEdit *edit=0)
Initialises the widget.
Definition: pickfileradio.cpp:55
QWidget
QAbstractButton::group
QButtonGroup * group() const
PickFileRadio::fileChanged
void fileChanged()
RadioButton
PickFileRadio::pushButton
QPushButton * pushButton() const
Returns the associated file browse push button.
Definition: pickfileradio.h:95
PickFileRadio::fileEdit
LineEdit * fileEdit() const
Returns the associated file name edit widget, or null if none.
Definition: pickfileradio.h:93
PickFileRadio::pickFile
virtual QString pickFile()=0
Chooses a file, for example by displaying a file selection dialog.
LineEdit
PickFileRadio::setEnabled
virtual void setEnabled(bool)
Enables or disables the radio button, and adjusts the enabled state of the associated browse button a...
Definition: pickfileradio.cpp:101
PickFileRadio::file
QString file() const
Returns the currently selected file name.
Definition: pickfileradio.cpp:92
QString
PickFileRadio::setReadOnly
virtual void setReadOnly(bool readOnly)
Sets whether the radio button and associated widgets are read-only for the user.
Definition: pickfileradio.cpp:73
PickFileRadio
Radio button with associated file picker controls.
Definition: pickfileradio.h:51
PickFileRadio::PickFileRadio
PickFileRadio(QPushButton *button, LineEdit *edit, const QString &text, ButtonGroup *group, QWidget *parent)
Constructor.
Definition: pickfileradio.cpp:33
QAbstractButton
PickFileRadio::setFile
void setFile(const QString &file)
Notifies the widget of the currently selected file name.
Definition: pickfileradio.cpp:87
QAbstractButton::text
QString text() const
QPushButton
QObject::parent
QObject * parent() const
radiobutton.h
ButtonGroup
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 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
  • pimprint

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