kdhorizontalline.h
00001 /* -*- Mode: C++ -*- 00002 KD Tools - a set of useful widgets for TQt 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 ** TQt library by Trolltech AS, Norway (or with modified versions of TQt 00031 ** that use the same license as TQt), 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 ** TQt. 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 <tqframe.h> 00045 #include <tqstring.h> 00046 00047 class KDHorizontalLine : public TQFrame { 00048 Q_OBJECT 00049 00050 TQ_PROPERTY( TQString title READ title WRITE setTitle ) 00051 public: 00052 KDHorizontalLine( TQWidget * parent=0, const char * name=0, WFlags f=0 ); 00053 KDHorizontalLine( const TQString & title, TQWidget * parent=0, const char * name=0, WFlags f=0 ); 00054 ~KDHorizontalLine(); 00055 00056 TQString title() const { return mTitle; } 00057 00059 void setFrameStyle( int style ); 00060 00061 TQSize sizeHint() const; 00062 TQSize minimumSizeHint() const; 00063 TQSizePolicy sizePolicy() const; 00064 00065 static int indentHint(); 00066 00067 public slots: 00068 virtual void setTitle( const TQString & title ); 00069 00070 protected: 00071 void paintEvent( TQPaintEvent * ); 00072 00073 private: 00074 void calculateFrame(); 00075 00076 private: 00077 TQString mTitle; 00078 TQt::AlignmentFlags mAlign; 00079 int mLenVisible; 00080 }; 00081 00082 #endif /* __KDTOOLS__KDHORIZONTALLINE_H__ */ 00083