Qt logo

qtoolbutton.h


This is the verbatim text of the qtoolbutton.h include file. It is is provided only for illustration; the copyright remains with Troll Tech.
/****************************************************************************
** $Id: qtoolbutton.h,v 2.6.2.1 1998/08/19 16:02:44 agulbra Exp $
**
** Definition of a buttom customized for tool bar use
**
** Created : 979899
**
** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
**
** This file is part of Troll Tech's internal development tree for Qt.
**
** This header text will be replaced by an appropriate text by the
** mkdist script which generates external distributions.
**
** If you are using the Qt Professional Edition or the Qt Free Edition,
** please notify Troll Tech at <info@troll.no> if you see this text.
**
** To Troll Tech developers: This header was generated by the script
** fixcopyright-int. It has the same number of text lines as the free
** and professional editions to avoid line number inconsistency.
**
*****************************************************************************/

#ifndef QTOOLBUTTON_H
#define QTOOLBUTTON_H

#ifndef QT_H
#include "qbutton.h"
#include "qstring.h"
#include "qpixmap.h"
#include "qiconset.h"
#endif // QT_H


class QToolButtonPrivate;

class QToolBar;


class Q_EXPORT QToolButton: public QButton
{
    Q_OBJECT
public:
    QToolButton( QWidget * parent = 0, const char * name = 0 );
    QToolButton( const QPixmap & pm, const char * textLabel,
                 const char * grouptext,
                 QObject * receiver, const char * slot,
                 QToolBar * parent, const char * name = 0 );
    QToolButton( QIconSet s, const char * textLabel,
                 const char * grouptext,
                 QObject * receiver, const char * slot,
                 QToolBar * parent, const char * name = 0 );
    ~QToolButton();

    QSize sizeHint() const;

    void setIconSet( const QIconSet & );
    QIconSet iconSet() const;

    bool usesBigPixmap() const { return ubp; }
    bool usesTextLabel() const { return utl; }
    const char * textLabel() const { return tl; }

public slots:
    virtual void setUsesBigPixmap( bool enable );
    virtual void setUsesTextLabel( bool enable );
    virtual void setTextLabel( const char *, bool = TRUE );

    void setToggleButton( bool enable );

    void setOn( bool enable );
    void toggle();

protected:
    void drawButton( QPainter * );
    void drawButtonLabel( QPainter * );

    void enterEvent( QEvent * );
    void leaveEvent( QEvent * );

    bool uses3D() const;

private:
    void init();

    QPixmap bp;
    int bpID;
    QPixmap sp;
    int spID;

    QString tl;

    QToolButtonPrivate * d;
    QIconSet * s;

    uint utl: 1;
    uint ubp: 1;
};


#endif


Copyright © 1998 Troll TechTrademarks
Qt version 1.41