summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kjanuswidget.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kdeui/kjanuswidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kjanuswidget.cpp140
1 files changed, 74 insertions, 66 deletions
diff --git a/microkde/kdeui/kjanuswidget.cpp b/microkde/kdeui/kjanuswidget.cpp
index 462c44f..3d9173d 100644
--- a/microkde/kdeui/kjanuswidget.cpp
+++ b/microkde/kdeui/kjanuswidget.cpp
@@ -24,11 +24,19 @@
#include <qlabel.h>
-#include <qwidgetstack.h>
+#include <q3widgetstack.h>
#include <qtabwidget.h>
-#include <qlistview.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qgrid.h>
+#include <q3listview.h>
+#include <q3hbox.h>
+#include <q3vbox.h>
+#include <q3grid.h>
#include <qpainter.h>
-#include <qobjectlist.h>
+#include <qobject.h>
#include <qstringlist.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3GridLayout>
+#include <Q3PtrList>
+#include <Q3Frame>
+#include <QEvent>
+#include <Q3VBoxLayout>
+#include <QShowEvent>
/*US
@@ -67,9 +75,9 @@
-class KJanusWidget::IconListItem : public QListBoxItem
+class KJanusWidget::IconListItem : public Q3ListBoxItem
{
public:
- IconListItem( QListBox *listbox, const QPixmap &pixmap,
+ IconListItem( Q3ListBox *listbox, const QPixmap &pixmap,
const QString &text );
- virtual int height( const QListBox *lb ) const;
- virtual int width( const QListBox *lb ) const;
+ virtual int height( const Q3ListBox *lb ) const;
+ virtual int width( const Q3ListBox *lb ) const;
int expandMinimumWidth( int width );
@@ -100,3 +108,3 @@ public:
-template class QPtrList<QListViewItem>;
+template class Q3PtrList<Q3ListViewItem>;
@@ -109,3 +117,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
{
- QVBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3VBoxLayout *topLayout = new Q3VBoxLayout( this );
if( mFace == TreeList || mFace == IconList )
@@ -114,3 +122,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
- QFrame *page = 0;
+ Q3Frame *page = 0;
if( mFace == TreeList )
@@ -147,3 +155,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
{
- QHBoxLayout *hbox = new QHBoxLayout( topLayout );
+ Q3HBoxLayout *hbox = new Q3HBoxLayout( topLayout );
mIconList = new IconListBox( this );
@@ -158,3 +166,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
hbox->addSpacing( KDialog::marginHint() );
- page = new QFrame( this );
+ page = new Q3Frame( this );
hbox->addWidget( page, 10 );
@@ -167,3 +175,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
- QVBoxLayout *vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() );
+ Q3VBoxLayout *vbox = new Q3VBoxLayout( page, 0, KDialog::spacingHint() );
@@ -177,6 +185,6 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
mTitleSep = new KSeparator( page );
- mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain );
+ mTitleSep->setFrameStyle( Q3Frame::HLine|Q3Frame::Plain );
vbox->addWidget( mTitleSep );
- mPageStack = new QWidgetStack( page );
+ mPageStack = new Q3WidgetStack( page );
connect(mPageStack, SIGNAL(aboutToShow(QWidget *)),
@@ -201,3 +209,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
mFace = Plain;
- mPlainPage = new QFrame( this );
+ mPlainPage = new Q3Frame( this );
topLayout->addWidget( mPlainPage, 10 );
@@ -247,3 +255,3 @@ bool KJanusWidget::isValid() const
-QFrame *KJanusWidget::plainPage()
+Q3Frame *KJanusWidget::plainPage()
{
@@ -268,3 +276,3 @@ QWidget *KJanusWidget::FindParent()
-QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header,
+Q3Frame *KJanusWidget::addPage( const QStringList &items, const QString &header,
const QPixmap &pixmap )
@@ -277,3 +285,3 @@ QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header,
- QFrame *page = new QFrame( FindParent(), "page" );
+ Q3Frame *page = new Q3Frame( FindParent(), "page" );
addPageWidget( page, items, header, pixmap );
@@ -289,3 +297,3 @@ void KJanusWidget::pageGone( QObject *obj )
-void KJanusWidget::slotReopen( QListViewItem * item )
+void KJanusWidget::slotReopen( Q3ListViewItem * item )
{
@@ -295,3 +303,3 @@ void KJanusWidget::slotReopen( QListViewItem * item )
-QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header,
+Q3Frame *KJanusWidget::addPage( const QString &itemName, const QString &header,
const QPixmap &pixmap )
@@ -306,3 +314,3 @@ QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header,
-QVBox *KJanusWidget::addVBoxPage( const QStringList &items,
+Q3VBox *KJanusWidget::addVBoxPage( const QStringList &items,
const QString &header,
@@ -317,3 +325,3 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items,
- QVBox *page = new QVBox(FindParent() , "vbox_page" );
+ Q3VBox *page = new Q3VBox(FindParent() , "vbox_page" );
page->setSpacing( KDialog::spacingHintSmall() );
@@ -324,3 +332,3 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items,
-QVBox *KJanusWidget::addVBoxPage( const QString &itemName,
+Q3VBox *KJanusWidget::addVBoxPage( const QString &itemName,
const QString &header,
@@ -333,3 +341,3 @@ QVBox *KJanusWidget::addVBoxPage( const QString &itemName,
-QHBox *KJanusWidget::addHBoxPage( const QStringList &items,
+Q3HBox *KJanusWidget::addHBoxPage( const QStringList &items,
const QString &header,
@@ -342,3 +350,3 @@ QHBox *KJanusWidget::addHBoxPage( const QStringList &items,
- QHBox *page = new QHBox(FindParent(), "hbox_page");
+ Q3HBox *page = new Q3HBox(FindParent(), "hbox_page");
page->setSpacing( KDialog::spacingHint() );
@@ -349,3 +357,3 @@ QHBox *KJanusWidget::addHBoxPage( const QStringList &items,
-QHBox *KJanusWidget::addHBoxPage( const QString &itemName,
+Q3HBox *KJanusWidget::addHBoxPage( const QString &itemName,
const QString &header,
@@ -358,3 +366,3 @@ QHBox *KJanusWidget::addHBoxPage( const QString &itemName,
-QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir,
+Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir,
const QStringList &items,
@@ -369,3 +377,3 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir,
- QGrid *page = new QGrid( n, dir, FindParent(), "page" );
+ Q3Grid *page = new Q3Grid( n, dir, FindParent(), "page" );
page->setSpacing( KDialog::spacingHint() );
@@ -377,3 +385,3 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir,
-QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir,
+Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir,
const QString &itemName,
@@ -387,6 +395,6 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir,
-void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page)
+void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page)
{
bool isTop = true;
- QListViewItem *curTop = 0, *child, *last, *newChild;
+ Q3ListViewItem *curTop = 0, *child, *last, *newChild;
unsigned int index = 1;
@@ -414,5 +422,5 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p
if (isTop)
- newChild = new QListViewItem(mTreeList, name);
+ newChild = new Q3ListViewItem(mTreeList, name);
else
- newChild = new QListViewItem(curTop, name);
+ newChild = new Q3ListViewItem(curTop, name);
@@ -433,5 +441,5 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p
if (isTop)
- newChild = new QListViewItem(mTreeList, last, name);
+ newChild = new Q3ListViewItem(mTreeList, last, name);
else
- newChild = new QListViewItem(curTop, last, name);
+ newChild = new Q3ListViewItem(curTop, last, name);
}
@@ -461,3 +469,3 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p
-void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items,
+void KJanusWidget::addPageWidget( Q3Frame *page, const QStringList &items,
const QString &header,const QPixmap &pixmap )
@@ -552,3 +560,3 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget )
}
- QGridLayout *gbox = new QGridLayout( mSwallowPage, 1, 1, 0 );
+ Q3GridLayout *gbox = new Q3GridLayout( mSwallowPage, 1, 1, 0 );
@@ -557,6 +565,6 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget )
//
- QObjectList *l = (QObjectList*)mSwallowPage->children(); // silence please
- for( uint i=0; i < l->count(); i++ )
+ QObjectList l = mSwallowPage->children(); // silence please
+ for( uint i=0; i < l.count(); i++ )
{
- QObject *o = l->at(i);
+ QObject *o = l.at(i);
if( o->isWidgetType() )
@@ -599,3 +607,3 @@ bool KJanusWidget::slotShowPage()
{
- QListViewItem *node = mTreeList->selectedItem();
+ Q3ListViewItem *node = mTreeList->selectedItem();
if( node == 0 ) { return( false ); }
@@ -608,3 +616,3 @@ bool KJanusWidget::slotShowPage()
{
- QListBoxItem *node = mIconList->item( mIconList->currentItem() );
+ Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() );
if( node == 0 ) { return( false ); }
@@ -648,5 +656,5 @@ bool KJanusWidget::showPage( QWidget *w )
{
- QMap<QListViewItem *, QWidget *>::Iterator it;
+ QMap<Q3ListViewItem *, QWidget *>::Iterator it;
for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){
- QListViewItem *key = it.key();
+ Q3ListViewItem *key = it.key();
QWidget *val = it.data();
@@ -660,5 +668,5 @@ bool KJanusWidget::showPage( QWidget *w )
{
- QMap<QListBoxItem *, QWidget *>::Iterator it;
+ QMap<Q3ListBoxItem *, QWidget *>::Iterator it;
for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){
- QListBoxItem *key = it.key();
+ Q3ListBoxItem *key = it.key();
QWidget *val = it.data();
@@ -688,3 +696,3 @@ int KJanusWidget::activePageIndex() const
if( mFace == TreeList) {
- QListViewItem *node = mTreeList->selectedItem();
+ Q3ListViewItem *node = mTreeList->selectedItem();
if( node == 0 ) { return -1; }
@@ -694,3 +702,3 @@ int KJanusWidget::activePageIndex() const
else if (mFace == IconList) {
- QListBoxItem *node = mIconList->item( mIconList->currentItem() );
+ Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() );
if( node == 0 ) { return( false ); }
@@ -763,3 +771,3 @@ void KJanusWidget::slotFontChanged()
// makes the treelist behave like the list of kcontrol
-void KJanusWidget::slotItemClicked(QListViewItem *it)
+void KJanusWidget::slotItemClicked(Q3ListViewItem *it)
{
@@ -897,7 +905,7 @@ void KJanusWidget::unfoldTreeList( bool persist )
if( persist )
- connect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) );
+ connect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) );
else
- disconnect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) );
+ disconnect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) );
- for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() )
+ for( Q3ListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() )
item->setOpen( true );
@@ -955,3 +963,3 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e )
KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name,
- WFlags f )
+ Qt::WFlags f )
:KListBox( parent, name, f ), mShowAll(false), mHeightValid(false),
@@ -967,3 +975,3 @@ void KJanusWidget::IconListBox::updateMinimumHeight()
int h = frameWidth()*2;
- for( QListBoxItem *i = item(0); i != 0; i = i->next() )
+ for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() )
{
@@ -982,3 +990,3 @@ void KJanusWidget::IconListBox::updateWidth()
int maxWidth = 10;
- for( QListBoxItem *i = item(0); i != 0; i = i->next() )
+ for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() )
{
@@ -988,3 +996,3 @@ void KJanusWidget::IconListBox::updateWidth()
- for( QListBoxItem *i = item(0); i != 0; i = i->next() )
+ for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() )
{
@@ -1024,5 +1032,5 @@ void KJanusWidget::IconListBox::setShowAll( bool showAll )
-KJanusWidget::IconListItem::IconListItem( QListBox *listbox, const QPixmap &pixmap,
+KJanusWidget::IconListItem::IconListItem( Q3ListBox *listbox, const QPixmap &pixmap,
const QString &text )
- : QListBoxItem( listbox )
+ : Q3ListBoxItem( listbox )
{
@@ -1085,3 +1093,3 @@ void KJanusWidget::IconListItem::paint( QPainter *painter )
-int KJanusWidget::IconListItem::height( const QListBox *lb ) const
+int KJanusWidget::IconListItem::height( const Q3ListBox *lb ) const
{
@@ -1098,3 +1106,3 @@ int KJanusWidget::IconListItem::height( const QListBox *lb ) const
-int KJanusWidget::IconListItem::width( const QListBox *lb ) const
+int KJanusWidget::IconListItem::width( const Q3ListBox *lb ) const
{
@@ -1124,3 +1132,3 @@ void KJanusWidget::removePage( QWidget *page )
{
- QMap<QListViewItem*, QWidget *>::Iterator i;
+ QMap<Q3ListViewItem*, QWidget *>::Iterator i;
for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i )
@@ -1139,3 +1147,3 @@ void KJanusWidget::removePage( QWidget *page )
{
- QMap<QListBoxItem*, QWidget *>::Iterator i;
+ QMap<Q3ListBoxItem*, QWidget *>::Iterator i;
for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i )