certmanager/lib
kdhorizontalline.h
00001 /* -*- Mode: C++ -*- 00002 KD Tools - a set of useful widgets for Qt 00003 */ 00004 00005 /**************************************************************************** 00006 ** Copyright (C) 2005 Klarälvdalens Datakonsult AB. All rights reserved. 00007 ** 00008 ** This file is part of the KD Tools library. 00009 ** 00010 ** This file may be distributed and/or modified under the terms of the 00011 ** GNU General Public License version 2 as published by the Free Software 00012 ** Foundation and appearing in the file LICENSE.GPL included in the 00013 ** packaging of this file. 00014 ** 00015 ** Licensees holding valid commercial KD Tools licenses may use this file in 00016 ** accordance with the KD Tools Commercial License Agreement provided with 00017 ** the Software. 00018 ** 00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00021 ** 00022 ** See http://www.klaralvdalens-datakonsult.se/?page=products for 00023 ** information about KD Tools Commercial License Agreements. 00024 ** 00025 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this 00026 ** licensing are not clear to you. 00027 ** 00028 ** In addition, as a special exception, the copyright holders give 00029 ** permission to link the code of this program with any edition of the 00030 ** Qt library by Trolltech AS, Norway (or with modified versions of Qt 00031 ** that use the same license as Qt), and distribute linked 00032 ** combinations including the two. You must obey the GNU General 00033 ** Public License in all respects for all of the code used other than 00034 ** Qt. If you modify this file, you may extend this exception to your 00035 ** version of the file, but you are not obligated to do so. If you do 00036 ** not wish to do so, delete this exception statement from your 00037 ** version. 00038 ** 00039 **********************************************************************/ 00040 00041 #ifndef __KDTOOLS__KDHORIZONTALLINE_H__ 00042 #define __KDTOOLS__KDHORIZONTALLINE_H__ 00043 00044 #include <qframe.h> 00045 #include <qstring.h> 00046 00047 class KDHorizontalLine : public QFrame { 00048 Q_OBJECT 00049 Q_PROPERTY( QString title READ title WRITE setTitle ) 00050 public: 00051 KDHorizontalLine( QWidget * parent=0, const char * name=0, WFlags f=0 ); 00052 KDHorizontalLine( const QString & title, QWidget * parent=0, const char * name=0, WFlags f=0 ); 00053 ~KDHorizontalLine(); 00054 00055 QString title() const { return mTitle; } 00056 00058 void setFrameStyle( int style ); 00059 00060 QSize sizeHint() const; 00061 QSize minimumSizeHint() const; 00062 QSizePolicy sizePolicy() const; 00063 00064 static int indentHint(); 00065 00066 public slots: 00067 virtual void setTitle( const QString & title ); 00068 00069 protected: 00070 void paintEvent( QPaintEvent * ); 00071 00072 private: 00073 void calculateFrame(); 00074 00075 private: 00076 QString mTitle; 00077 Qt::AlignmentFlags mAlign; 00078 int mLenVisible; 00079 }; 00080 00081 #endif /* __KDTOOLS__KDHORIZONTALLINE_H__ */ 00082