kpushbutton.h
/* This file is part of the KDE libraries
Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KPUSHBUTTON_H
#define KPUSHBUTTON_H
#include <qpoint.h>
#include <qpushbutton.h>
#include <kguiitem.h>
#include <kstdguiitem.h>
class QDragObject;
class KDEUI_EXPORT KPushButton : public QPushButton
{
Q_OBJECT
Q_PROPERTY(int stdItem READ guiItm WRITE setGuiItm )
Q_PROPERTY(bool isDragEnabled READ isDragEnabled WRITE setDragEnabled)
public:
KPushButton( QWidget *parent, const char *name=0 );
KPushButton( const QString &text, QWidget *parent, const char *name=0);
KPushButton( const QIconSet &icon, const QString &text,
QWidget *parent, const char *name=0 );
KPushButton( const KGuiItem &item, QWidget *parent, const char *name = 0 );
~KPushButton();
void setDragEnabled( bool enable );
bool isDragEnabled() const { return m_dragEnabled; }
void setGuiItem( const KGuiItem& item );
void setGuiItem( KStdGuiItem::StdItem item );
KStdGuiItem::StdItem guiItem() const;
// Hack for Qt designer
void setGuiItm(int itm ) { setGuiItem( (KStdGuiItem::StdItem)itm );}
int guiItm() const { return (int)guiItem(); }
void setIconSet( const QIconSet &iconSet );
void setText( const QString &text );
protected:
virtual QDragObject * dragObject();
virtual void mousePressEvent( QMouseEvent * );
virtual void mouseMoveEvent( QMouseEvent * );
virtual void startDrag();
private:
bool m_dragEnabled;
QPoint startPos;
private slots:
void slotSettingsChanged( int category );
private:
void init( const KGuiItem &item );
void readSettings();
static bool s_useIcons;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KPushButtonPrivate;
KPushButtonPrivate *d;
};
#endif // KPUSHBUTTON_H
KPushButton
This is nothing but a QPushButton with drag-support and KGuiItem support.
Definition: kpushbutton.h:37
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:38
KStdGuiItem::StdItem
StdItem
Definition: kstdguiitem.h:47
KPushButton::isDragEnabled
bool isDragEnabled() const
Definition: kpushbutton.h:80

KDE Home | KDE Accessibility Home | Description of Access Keys