KDEUI
kpagedialog.cpp
Go to the documentation of this file.
00001 /* 00002 * This file is part of the KDE Libraries 00003 * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and 00004 * Espen Sand (espen@kde.org) 00005 * Holger Freyther <freyther@kde.org> 00006 * 2005-2006 Olivier Goffart <ogoffart at kde.org> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Library General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Library General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Library General Public License 00019 * along with this library; see the file COPYING.LIB. If not, write to 00020 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00021 * Boston, MA 02110-1301, USA. 00022 * 00023 */ 00024 00025 #include "kpagedialog.h" 00026 #include "kpagedialog_p.h" 00027 00028 #include <QTimer> 00029 #include <QLayout> 00030 00031 KPageDialog::KPageDialog( QWidget *parent, Qt::WFlags flags ) 00032 : KDialog(*new KPageDialogPrivate, parent, flags) 00033 { 00034 Q_D(KPageDialog); 00035 d->mPageWidget = new KPageWidget( this ); 00036 00037 d->init(); 00038 } 00039 00040 KPageDialog::KPageDialog( KPageWidget *widget, QWidget *parent, Qt::WFlags flags ) 00041 : KDialog(*new KPageDialogPrivate, parent, flags) 00042 { 00043 Q_D(KPageDialog); 00044 Q_ASSERT(widget); 00045 widget->setParent(this); 00046 d->mPageWidget = widget; 00047 00048 d->init(); 00049 } 00050 00051 KPageDialog::KPageDialog(KPageDialogPrivate &dd, KPageWidget *widget, QWidget *parent, Qt::WFlags flags) 00052 : KDialog(dd, parent, flags) 00053 { 00054 Q_D(KPageDialog); 00055 if (widget) { 00056 widget->setParent(this); 00057 d->mPageWidget = widget; 00058 } else { 00059 d->mPageWidget = new KPageWidget(this); 00060 } 00061 d->init(); 00062 } 00063 00064 KPageDialog::~KPageDialog() 00065 { 00066 } 00067 00068 void KPageDialog::setFaceType( FaceType faceType ) 00069 { 00070 d_func()->mPageWidget->setFaceType(static_cast<KPageWidget::FaceType>(faceType)); 00071 } 00072 00073 KPageWidgetItem* KPageDialog::addPage( QWidget *widget, const QString &name ) 00074 { 00075 return d_func()->mPageWidget->addPage(widget, name); 00076 } 00077 00078 void KPageDialog::addPage( KPageWidgetItem *item ) 00079 { 00080 d_func()->mPageWidget->addPage(item); 00081 } 00082 00083 KPageWidgetItem* KPageDialog::insertPage( KPageWidgetItem *before, QWidget *widget, const QString &name ) 00084 { 00085 return d_func()->mPageWidget->insertPage(before, widget, name); 00086 } 00087 00088 void KPageDialog::insertPage( KPageWidgetItem *before, KPageWidgetItem *item ) 00089 { 00090 d_func()->mPageWidget->insertPage(before, item); 00091 } 00092 00093 KPageWidgetItem* KPageDialog::addSubPage( KPageWidgetItem *parent, QWidget *widget, const QString &name ) 00094 { 00095 return d_func()->mPageWidget->addSubPage(parent, widget, name); 00096 } 00097 00098 void KPageDialog::addSubPage( KPageWidgetItem *parent, KPageWidgetItem *item ) 00099 { 00100 d_func()->mPageWidget->addSubPage(parent, item); 00101 } 00102 00103 void KPageDialog::removePage( KPageWidgetItem *item ) 00104 { 00105 d_func()->mPageWidget->removePage(item); 00106 } 00107 00108 void KPageDialog::setCurrentPage( KPageWidgetItem *item ) 00109 { 00110 d_func()->mPageWidget->setCurrentPage(item); 00111 } 00112 00113 KPageWidgetItem* KPageDialog::currentPage() const 00114 { 00115 return d_func()->mPageWidget->currentPage(); 00116 } 00117 00118 KPageWidget* KPageDialog::pageWidget() 00119 { 00120 return d_func()->mPageWidget; 00121 } 00122 00123 void KPageDialog::setPageWidget(KPageWidget *widget) 00124 { 00125 delete d_func()->mPageWidget; 00126 d_func()->mPageWidget = widget; 00127 d_func()->init(); 00128 } 00129 00130 const KPageWidget* KPageDialog::pageWidget() const 00131 { 00132 return d_func()->mPageWidget; 00133 } 00134 00135 #include "kpagedialog.moc"
KDE 4.6 API Reference