buttongroup.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "kalarm.h"
00025
00026 #include <qlayout.h>
00027 #include <kdialog.h>
00028
00029 #include "buttongroup.moc"
00030
00031
00032 ButtonGroup::ButtonGroup(QWidget* parent, const char* name)
00033 : QButtonGroup(parent, name)
00034 #if QT_VERSION < 300
00035 , defaultAlignment(-1)
00036 #endif
00037 {
00038 connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int)));
00039 }
00040
00041 ButtonGroup::ButtonGroup(const QString& title, QWidget* parent, const char* name)
00042 : QButtonGroup(title, parent, name)
00043 #if QT_VERSION < 300
00044 , defaultAlignment(-1)
00045 #endif
00046 {
00047 connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int)));
00048 }
00049
00050 ButtonGroup::ButtonGroup(int strips, Qt::Orientation orient, QWidget* parent, const char* name)
00051 : QButtonGroup(strips, orient, parent, name)
00052 #if QT_VERSION < 300
00053 , defaultAlignment(orient == Qt::Horizontal ? Qt::AlignLeft : 0)
00054 #endif
00055 {
00056 connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int)));
00057 }
00058
00059 ButtonGroup::ButtonGroup(int strips, Qt::Orientation orient, const QString& title, QWidget* parent, const char* name)
00060 : QButtonGroup(strips, orient, title, parent, name)
00061 #if QT_VERSION < 300
00062 , defaultAlignment(orient == Qt::Horizontal ? Qt::AlignLeft : 0)
00063 #endif
00064 {
00065 connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int)));
00066 }
00067
00068 #if QT_VERSION < 300
00069
00070
00071
00072
00073 void ButtonGroup::childEvent(QChildEvent *ce)
00074 {
00075 if (defaultAlignment != -1 && ce->inserted() && ce->child()->isWidgetType())
00076 {
00077 QWidget* child = (QWidget*)ce->child();
00078 if (!child->isTopLevel())
00079 {
00080 ((QBoxLayout*)layout())->addWidget(child, 0, defaultAlignment);
00081 QApplication::postEvent(this, new QEvent(QEvent::LayoutHint));
00082 }
00083 }
00084 }
00085 #endif
This file is part of the documentation for kdelibs Version 3.1.5.