KDEUI
kseparator.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kseparator.h"
00021 #include <QStyle>
00022 #include <QStyleOption>
00023 #include <QPainter>
00024
00025 KSeparator::KSeparator(QWidget* parent, Qt::WFlags f) : QFrame(parent, f)
00026 {
00027 setLineWidth(1);
00028 setMidLineWidth(0);
00029 setOrientation( Qt::Horizontal );
00030 }
00031
00032
00033 KSeparator::KSeparator(Qt::Orientation orientation, QWidget* parent, Qt::WFlags f)
00034 : QFrame(parent, f)
00035 {
00036 setLineWidth(1);
00037 setMidLineWidth(0);
00038 setOrientation( orientation );
00039 }
00040
00041
00042 void KSeparator::setOrientation(Qt::Orientation orientation)
00043 {
00044 if (orientation == Qt::Vertical) {
00045 setFrameShape ( QFrame::VLine );
00046 setFrameShadow( QFrame::Sunken );
00047 setMinimumSize(2, 0);
00048 }
00049 else {
00050 setFrameShape ( QFrame::HLine );
00051 setFrameShadow( QFrame::Sunken );
00052 setMinimumSize(0, 2);
00053 }
00054 }
00055
00056 Qt::Orientation KSeparator::orientation() const
00057 {
00058 return ( frameStyle() & VLine ) ? Qt::Vertical : Qt::Horizontal;
00059 }
00060
00061 #include "kseparator.moc"