summaryrefslogtreecommitdiffabout
path: root/microkde/kdialogbase.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdialogbase.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdialogbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdialogbase.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp
index d5c7e61..a40bad6 100644
--- a/microkde/kdialogbase.cpp
+++ b/microkde/kdialogbase.cpp
@@ -1,20 +1,24 @@
1#include <qtabwidget.h> 1#include <qtabwidget.h>
2#include <qpushbutton.h> 2#include <qpushbutton.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qframe.h> 4#include <q3frame.h>
5//Added by qt3to4:
6#include <QPixmap>
7#include <Q3HBoxLayout>
8#include <Q3VBoxLayout>
5 9
6 10
7#include "klocale.h" 11#include "klocale.h"
8#include "kdebug.h" 12#include "kdebug.h"
9 13
10#include "kdialogbase.h" 14#include "kdialogbase.h"
11 15
12KDialogBase::KDialogBase() 16KDialogBase::KDialogBase()
13{ 17{
14} 18}
15 19
16KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, 20KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal,
17 const QString &caption, 21 const QString &caption,
18 int buttonMask, ButtonCode defaultButton, 22 int buttonMask, ButtonCode defaultButton,
19 bool separator, 23 bool separator,
20 const QString &user1, 24 const QString &user1,
@@ -122,61 +126,61 @@ QTabWidget *KDialogBase::tabWidget()
122 126
123void KDialogBase::hideButtons() 127void KDialogBase::hideButtons()
124{ 128{
125 if ( mUser1Button ) mUser1Button->hide() ; 129 if ( mUser1Button ) mUser1Button->hide() ;
126 if ( mUser2Button ) mUser2Button->hide() ; 130 if ( mUser2Button ) mUser2Button->hide() ;
127 if ( mOkButton ) mOkButton->hide() ; 131 if ( mOkButton ) mOkButton->hide() ;
128 if ( mApplyButton ) mApplyButton->hide() ; 132 if ( mApplyButton ) mApplyButton->hide() ;
129 if ( mDefaultButton ) mDefaultButton->hide(); 133 if ( mDefaultButton ) mDefaultButton->hide();
130 if ( mCancelButton ) mCancelButton->hide() ; 134 if ( mCancelButton ) mCancelButton->hide() ;
131 if ( mCloseButton ) mCloseButton->hide() ; 135 if ( mCloseButton ) mCloseButton->hide() ;
132 136
133} 137}
134void KDialogBase::initLayout() 138void KDialogBase::initLayout()
135{ 139{
136 140
137 delete mTopLayout; 141 delete mTopLayout;
138 mTopLayout = new QVBoxLayout( this ); 142 mTopLayout = new Q3VBoxLayout( this );
139 mTopLayout->setMargin( marginHintSmall() ); 143 mTopLayout->setMargin( marginHintSmall() );
140 mTopLayout->setSpacing( spacingHintSmall() ); 144 mTopLayout->setSpacing( spacingHintSmall() );
141 145
142 mTopLayout->addWidget( mMainWidget ); 146 mTopLayout->addWidget( mMainWidget );
143 147
144 QBoxLayout *buttonLayout = new QHBoxLayout; 148 Q3BoxLayout *buttonLayout = new Q3HBoxLayout;
145 mTopLayout->addLayout( buttonLayout ); 149 mTopLayout->addLayout( buttonLayout );
146 150
147 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); 151 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button );
148 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); 152 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button );
149 if ( mOkButton ) buttonLayout->addWidget( mOkButton ); 153 if ( mOkButton ) buttonLayout->addWidget( mOkButton );
150 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); 154 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton );
151 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); 155 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton );
152 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); 156 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton );
153 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); 157 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton );
154 buttonLayout->setMargin( marginHintSmall() ); 158 buttonLayout->setMargin( marginHintSmall() );
155 buttonLayout->setSpacing( spacingHintSmall() ); 159 buttonLayout->setSpacing( spacingHintSmall() );
156} 160}
157 161
158QFrame *KDialogBase::addPage( const QString &name ) 162Q3Frame *KDialogBase::addPage( const QString &name )
159{ 163{
160// kdDebug() << "KDialogBase::addPage(): " << name << endl; 164// kdDebug() << "KDialogBase::addPage(): " << name << endl;
161 QFrame *frame = new QFrame( tabWidget() ); 165 Q3Frame *frame = new Q3Frame( tabWidget() );
162 tabWidget()->addTab( frame, name ); 166 tabWidget()->addTab( frame, name );
163 return frame; 167 return frame;
164} 168}
165 169
166QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) 170Q3Frame *KDialogBase::addPage( const QString &name, int, const QPixmap & )
167{ 171{
168 return addPage( name ); 172 return addPage( name );
169} 173}
170 174
171 175
172void KDialogBase::setMainWidget( QWidget *widget ) 176void KDialogBase::setMainWidget( QWidget *widget )
173{ 177{
174 kdDebug() << "KDialogBase::setMainWidget()" << endl; 178 kdDebug() << "KDialogBase::setMainWidget()" << endl;
175 179
176 mMainWidget = widget; 180 mMainWidget = widget;
177 initLayout(); 181 initLayout();
178} 182}
179 183
180void KDialogBase::setButtonText( ButtonCode id, const QString &text ) 184void KDialogBase::setButtonText( ButtonCode id, const QString &text )
181{ 185{
182 QPushButton *button = findButton( id ); 186 QPushButton *button = findButton( id );
@@ -241,36 +245,36 @@ void KDialogBase::showButton( ButtonCode id, bool show )
241 if ( show ) button->show(); 245 if ( show ) button->show();
242 else button->hide(); 246 else button->hide();
243 } 247 }
244} 248}
245 249
246int KDialogBase::pageIndex( QWidget *widget ) const 250int KDialogBase::pageIndex( QWidget *widget ) const
247{ 251{
248 return 0; 252 return 0;
249} 253}
250 254
251 255
252bool KDialogBase::showPage( int index ) 256bool KDialogBase::showPage( int index )
253{ 257{
254 tabWidget()->setCurrentPage( index );return false; 258 tabWidget()->setCurrentPage( index );return false;
255} 259}
256 260
257QFrame *KDialogBase::plainPage() 261Q3Frame *KDialogBase::plainPage()
258{ 262{
259 if ( !mPlainPage ) { 263 if ( !mPlainPage ) {
260 mPlainPage = new QFrame( this ); 264 mPlainPage = new Q3Frame( this );
261 setMainWidget( mPlainPage ); 265 setMainWidget( mPlainPage );
262 } 266 }
263 return mPlainPage; 267 return mPlainPage;
264} 268}
265 269
266void KDialogBase::slotOk() 270void KDialogBase::slotOk()
267{ 271{
268 emit okClicked(); 272 emit okClicked();
269 accept(); 273 accept();
270} 274}
271 275
272void KDialogBase::slotApply() 276void KDialogBase::slotApply()
273{ 277{
274 emit applyClicked(); 278 emit applyClicked();
275} 279}
276 280