summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/listvieweditorimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/listvieweditorimpl.cpp')
-rw-r--r--kdevdesigner/designer/listvieweditorimpl.cpp200
1 files changed, 100 insertions, 100 deletions
diff --git a/kdevdesigner/designer/listvieweditorimpl.cpp b/kdevdesigner/designer/listvieweditorimpl.cpp
index 78055f92..60e7e155 100644
--- a/kdevdesigner/designer/listvieweditorimpl.cpp
+++ b/kdevdesigner/designer/listvieweditorimpl.cpp
@@ -33,23 +33,23 @@
#include "listboxdnd.h"
#include "listboxrename.h"
-#include <qlistview.h>
-#include <qheader.h>
-#include <qlistbox.h>
-#include <qlineedit.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qtabwidget.h>
-#include <qspinbox.h>
-#include <qpushbutton.h>
-#include <qptrstack.h>
+#include <tqlistview.h>
+#include <tqheader.h>
+#include <tqlistbox.h>
+#include <tqlineedit.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqtabwidget.h>
+#include <tqspinbox.h>
+#include <tqpushbutton.h>
+#include <tqptrstack.h>
#include <klocale.h>
-ListViewEditor::ListViewEditor( QWidget *parent, QListView *lv, FormWindow *fw )
+ListViewEditor::ListViewEditor( TQWidget *parent, TQListView *lv, FormWindow *fw )
: ListViewEditorBase( parent, 0, TRUE ), listview( lv ), formwindow( fw )
{
- connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
itemText->setEnabled( FALSE );
itemChoosePixmap->setEnabled( FALSE );
itemDeletePixmap->setEnabled( FALSE );
@@ -71,55 +71,55 @@ ListViewEditor::ListViewEditor( QWidget *parent, QListView *lv, FormWindow *fw )
// Clamp on drag and drop to QListView
ListViewDnd *itemsDnd = new ListViewDnd( itemsPreview );
itemsDnd->setDragMode( ListViewDnd::Internal | ListViewDnd::Move );
- QObject::connect( itemsDnd, SIGNAL( dropped( QListViewItem * ) ),
- itemsDnd, SLOT( confirmDrop( QListViewItem * ) ) );
+ TQObject::connect( itemsDnd, TQT_SIGNAL( dropped( TQListViewItem * ) ),
+ itemsDnd, TQT_SLOT( confirmDrop( TQListViewItem * ) ) );
// Enable rename for all QListViewItems
- QListViewItemIterator it = ((QListView *)itemsPreview)->firstChild();
+ TQListViewItemIterator it = ((TQListView *)itemsPreview)->firstChild();
for ( ; *it; it++ )
(*it)->setRenameEnabled( 0, TRUE );
// Connect listview signal to signal-relay
- QObject::connect( itemsPreview,
- SIGNAL( itemRenamed( QListViewItem*, int, const QString & ) ),
+ TQObject::connect( itemsPreview,
+ TQT_SIGNAL( itemRenamed( TQListViewItem*, int, const TQString & ) ),
this,
- SLOT( emitItemRenamed(QListViewItem*, int, const QString&) ) );
+ TQT_SLOT( emitItemRenamed(TQListViewItem*, int, const TQString&) ) );
- // Connect signal-relay to QLineEdit "itemText"
- QObjectList *l = parent->queryList( "QLineEdit", "itemText" );
- QObject *obj;
- QObjectListIt itemsLineEditIt( *l );
+ // Connect signal-relay to TQLineEdit "itemText"
+ TQObjectList *l = parent->queryList( "TQLineEdit", "itemText" );
+ TQObject *obj;
+ TQObjectListIt itemsLineEditIt( *l );
while ( (obj = itemsLineEditIt.current()) != 0 ) {
++itemsLineEditIt;
- QObject::connect( this,
- SIGNAL( itemRenamed( const QString & ) ),
+ TQObject::connect( this,
+ TQT_SIGNAL( itemRenamed( const TQString & ) ),
obj,
- SLOT( setText( const QString & ) ) );
+ TQT_SLOT( setText( const TQString & ) ) );
}
delete l;
// Clamp on drag and drop to QListBox
ListBoxDnd *columnsDnd = new ListBoxDnd( colPreview );
columnsDnd->setDragMode( ListBoxDnd::Internal | ListBoxDnd::Move );
- QObject::connect( columnsDnd, SIGNAL( dropped( QListBoxItem * ) ),
- columnsDnd, SLOT( confirmDrop( QListBoxItem * ) ) );
+ TQObject::connect( columnsDnd, TQT_SIGNAL( dropped( TQListBoxItem * ) ),
+ columnsDnd, TQT_SLOT( confirmDrop( TQListBoxItem * ) ) );
// Clamp on rename to QListBox
ListBoxRename *columnsRename = new ListBoxRename( colPreview );
- QObject::connect( columnsRename,
- SIGNAL( itemTextChanged( const QString & ) ),
+ TQObject::connect( columnsRename,
+ TQT_SIGNAL( itemTextChanged( const TQString & ) ),
this,
- SLOT( columnTextChanged( const QString & ) ) );
+ TQT_SLOT( columnTextChanged( const TQString & ) ) );
- // Find QLineEdit "colText" and connect
- l = parent->queryList( "QLineEdit", "colText" );
- QObjectListIt columnsLineEditIt( *l );
+ // Find TQLineEdit "colText" and connect
+ l = parent->queryList( "TQLineEdit", "colText" );
+ TQObjectListIt columnsLineEditIt( *l );
while ( (obj = columnsLineEditIt.current()) != 0 ) {
++columnsLineEditIt;
- QObject::connect( columnsRename,
- SIGNAL( itemTextChanged( const QString & ) ),
+ TQObject::connect( columnsRename,
+ TQT_SIGNAL( itemTextChanged( const TQString & ) ),
obj,
- SLOT( setText( const QString & ) ) );
+ TQT_SLOT( setText( const TQString & ) ) );
}
delete l;
}
@@ -154,8 +154,8 @@ void ListViewEditor::columnDownClicked()
return;
colPreview->clearSelection();
- QListBoxItem *i = colPreview->item( colPreview->currentItem() );
- QListBoxItem *below = i->next();
+ TQListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ TQListBoxItem *below = i->next();
colPreview->takeItem( i );
colPreview->insertItem( i, below );
@@ -170,11 +170,11 @@ void ListViewEditor::columnPixmapChosen()
if ( !c )
return;
- QPixmap pix;
+ TQPixmap pix;
if ( colPixmap->pixmap() )
pix = qChoosePixmap( this, formwindow, *colPixmap->pixmap() );
else
- pix = qChoosePixmap( this, formwindow, QPixmap() );
+ pix = qChoosePixmap( this, formwindow, TQPixmap() );
if ( pix.isNull() )
return;
@@ -197,7 +197,7 @@ void ListViewEditor::columnPixmapDeleted()
if ( !c )
return;
- c->pixmap = QPixmap();
+ c->pixmap = TQPixmap();
colPreview->blockSignals( TRUE );
if ( !c->pixmap.isNull() )
colPreview->changeItem( c->pixmap, c->text, colPreview->index( c->item ) );
@@ -217,7 +217,7 @@ void ListViewEditor::columnResizable( bool b )
c->resizable = b;
}
-void ListViewEditor::columnTextChanged( const QString &txt )
+void ListViewEditor::columnTextChanged( const TQString &txt )
{
Column *c = findColumn( colPreview->item( colPreview->currentItem() ) );
if ( !c )
@@ -239,8 +239,8 @@ void ListViewEditor::columnUpClicked()
return;
colPreview->clearSelection();
- QListBoxItem *i = colPreview->item( colPreview->currentItem() );
- QListBoxItem *above = i->prev();
+ TQListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ TQListBoxItem *above = i->prev();
colPreview->takeItem( above );
colPreview->insertItem( above, i );
@@ -249,7 +249,7 @@ void ListViewEditor::columnUpClicked()
colPreview->setSelected( i, TRUE );
}
-void ListViewEditor::currentColumnChanged( QListBoxItem *i )
+void ListViewEditor::currentColumnChanged( TQListBoxItem *i )
{
Column *c = findColumn( i );
if ( !i || !c ) {
@@ -285,13 +285,13 @@ void ListViewEditor::newColumnClicked()
{
Column col;
col.text = i18n( "New Column" );
- col.pixmap = QPixmap();
+ col.pixmap = TQPixmap();
col.clickable = TRUE;
col.resizable = TRUE;
if ( !col.pixmap.isNull() )
- col.item = new QListBoxPixmap( colPreview, col.pixmap, col.text );
+ col.item = new TQListBoxPixmap( colPreview, col.pixmap, col.text );
else
- col.item = new QListBoxText( colPreview, col.text );
+ col.item = new TQListBoxText( colPreview, col.text );
columns.append( col );
colPreview->setCurrentItem( col.item );
colPreview->setSelected( col.item, TRUE );
@@ -299,11 +299,11 @@ void ListViewEditor::newColumnClicked()
void ListViewEditor::deleteColumnClicked()
{
- QListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ TQListBoxItem *i = colPreview->item( colPreview->currentItem() );
if ( !i )
return;
- for ( QValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
+ for ( TQValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
if ( ( *it ).item == i ) {
delete (*it).item;
columns.remove( it );
@@ -315,7 +315,7 @@ void ListViewEditor::deleteColumnClicked()
colPreview->setSelected( colPreview->currentItem(), TRUE );
}
-void ListViewEditor::currentItemChanged( QListViewItem *i )
+void ListViewEditor::currentItemChanged( TQListViewItem *i )
{
if ( !i ) {
itemText->setEnabled( FALSE );
@@ -334,7 +334,7 @@ void ListViewEditor::currentItemChanged( QListViewItem *i )
displayItem( i, itemColumn->value() );
}
-void ListViewEditor::displayItem( QListViewItem *i, int col )
+void ListViewEditor::displayItem( TQListViewItem *i, int col )
{
itemText->blockSignals( TRUE );
itemText->setText( i->text( col ) );
@@ -350,7 +350,7 @@ void ListViewEditor::displayItem( QListViewItem *i, int col )
void ListViewEditor::itemColChanged( int col )
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
@@ -360,7 +360,7 @@ void ListViewEditor::itemColChanged( int col )
void ListViewEditor::itemDeleteClicked()
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
@@ -373,12 +373,12 @@ void ListViewEditor::itemDeleteClicked()
void ListViewEditor::itemDownClicked()
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
- QListViewItemIterator it( i );
- QListViewItem *parent = i->parent();
+ TQListViewItemIterator it( i );
+ TQListViewItem *parent = i->parent();
it++;
while ( it.current() ) {
if ( it.current()->parent() == parent )
@@ -388,14 +388,14 @@ void ListViewEditor::itemDownClicked()
if ( !it.current() )
return;
- QListViewItem *other = it.current();
+ TQListViewItem *other = it.current();
i->moveItem( other );
}
void ListViewEditor::itemNewClicked()
{
- QListViewItem *item = new QListViewItem( itemsPreview );
+ TQListViewItem *item = new TQListViewItem( itemsPreview );
item->setText( 0, i18n( "Item" ) );
item->setRenameEnabled( 0, TRUE );
itemsPreview->setCurrentItem( item );
@@ -406,13 +406,13 @@ void ListViewEditor::itemNewClicked()
void ListViewEditor::itemNewSubClicked()
{
- QListViewItem *parent = itemsPreview->currentItem();
- QListViewItem *item = 0;
+ TQListViewItem *parent = itemsPreview->currentItem();
+ TQListViewItem *item = 0;
if ( parent ) {
- item = new QListViewItem( parent );
+ item = new TQListViewItem( parent );
parent->setOpen( TRUE );
} else {
- item = new QListViewItem( itemsPreview );
+ item = new TQListViewItem( itemsPreview );
}
item->setText( 0, i18n( "Subitem" ) );
item->setRenameEnabled( 0, TRUE );
@@ -422,38 +422,38 @@ void ListViewEditor::itemNewSubClicked()
void ListViewEditor::itemPixmapChoosen()
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
- QPixmap pix;
+ TQPixmap pix;
if ( itemPixmap->pixmap() )
pix = qChoosePixmap( this, formwindow, *itemPixmap->pixmap() );
else
- pix = qChoosePixmap( this, formwindow, QPixmap() );
+ pix = qChoosePixmap( this, formwindow, TQPixmap() );
if ( pix.isNull() )
return;
- i->setPixmap( itemColumn->value(), QPixmap( pix ) );
+ i->setPixmap( itemColumn->value(), TQPixmap( pix ) );
itemPixmap->setPixmap( pix );
itemDeletePixmap->setEnabled( TRUE );
}
void ListViewEditor::itemPixmapDeleted()
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
- i->setPixmap( itemColumn->value(), QPixmap() );
+ i->setPixmap( itemColumn->value(), TQPixmap() );
itemPixmap->setText( "" );
itemDeletePixmap->setEnabled( FALSE );
}
-void ListViewEditor::itemTextChanged( const QString &txt )
+void ListViewEditor::itemTextChanged( const TQString &txt )
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
i->setText( itemColumn->value(), txt );
@@ -461,12 +461,12 @@ void ListViewEditor::itemTextChanged( const QString &txt )
void ListViewEditor::itemUpClicked()
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
- QListViewItemIterator it( i );
- QListViewItem *parent = i->parent();
+ TQListViewItemIterator it( i );
+ TQListViewItem *parent = i->parent();
--it;
while ( it.current() ) {
if ( it.current()->parent() == parent )
@@ -476,19 +476,19 @@ void ListViewEditor::itemUpClicked()
if ( !it.current() )
return;
- QListViewItem *other = it.current();
+ TQListViewItem *other = it.current();
other->moveItem( i );
}
void ListViewEditor::itemRightClicked()
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
- QListViewItemIterator it( i );
- QListViewItem *parent = i->parent();
+ TQListViewItemIterator it( i );
+ TQListViewItem *parent = i->parent();
parent = parent ? parent->firstChild() : itemsPreview->firstChild();
if ( !parent )
return;
@@ -501,19 +501,19 @@ void ListViewEditor::itemRightClicked()
if ( !it.current() )
return;
- QListViewItem *other = it.current();
+ TQListViewItem *other = it.current();
for ( int c = 0; c < itemsPreview->columns(); ++c ) {
- QString s = i->text( c );
+ TQString s = i->text( c );
i->setText( c, other->text( c ) );
other->setText( c, s );
- QPixmap pix;
+ TQPixmap pix;
if ( i->pixmap( c ) )
pix = *i->pixmap( c );
if ( other->pixmap( c ) )
i->setPixmap( c, *other->pixmap( c ) );
else
- i->setPixmap( c, QPixmap() );
+ i->setPixmap( c, TQPixmap() );
other->setPixmap( c, pix );
}
@@ -523,12 +523,12 @@ void ListViewEditor::itemRightClicked()
void ListViewEditor::itemLeftClicked()
{
- QListViewItem *i = itemsPreview->currentItem();
+ TQListViewItem *i = itemsPreview->currentItem();
if ( !i )
return;
- QListViewItemIterator it( i );
- QListViewItem *parent = i->parent();
+ TQListViewItemIterator it( i );
+ TQListViewItem *parent = i->parent();
if ( !parent )
return;
parent = parent->parent();
@@ -541,19 +541,19 @@ void ListViewEditor::itemLeftClicked()
if ( !it.current() )
return;
- QListViewItem *other = it.current();
+ TQListViewItem *other = it.current();
for ( int c = 0; c < itemsPreview->columns(); ++c ) {
- QString s = i->text( c );
+ TQString s = i->text( c );
i->setText( c, other->text( c ) );
other->setText( c, s );
- QPixmap pix;
+ TQPixmap pix;
if ( i->pixmap( c ) )
pix = *i->pixmap( c );
if ( other->pixmap( c ) )
i->setPixmap( c, *other->pixmap( c ) );
else
- i->setPixmap( c, QPixmap() );
+ i->setPixmap( c, TQPixmap() );
other->setPixmap( c, pix );
}
@@ -563,19 +563,19 @@ void ListViewEditor::itemLeftClicked()
void ListViewEditor::setupColumns()
{
- QHeader *h = listview->header();
+ TQHeader *h = listview->header();
for ( int i = 0; i < (int)h->count(); ++i ) {
Column col;
col.text = h->label( i );
- col.pixmap = QPixmap();
+ col.pixmap = TQPixmap();
if ( h->iconSet( i ) )
col.pixmap = h->iconSet( i )->pixmap();
col.clickable = h->isClickEnabled( i );
col.resizable = h->isResizeEnabled( i );
if ( !col.pixmap.isNull() )
- col.item = new QListBoxPixmap( colPreview, col.pixmap, col.text );
+ col.item = new TQListBoxPixmap( colPreview, col.pixmap, col.text );
else
- col.item = new QListBoxText( colPreview, col.text );
+ col.item = new TQListBoxText( colPreview, col.text );
columns.append( col );
}
@@ -594,8 +594,8 @@ void ListViewEditor::setupItems()
itemColumn->setMinValue( 0 );
itemColumn->setMaxValue( QMAX( numColumns - 1, 0 ) );
int i = 0;
- QHeader *header = itemsPreview->header();
- for ( QListBoxItem *item = colPreview->firstItem(); item; item = item->next() ) {
+ TQHeader *header = itemsPreview->header();
+ for ( TQListBoxItem *item = colPreview->firstItem(); item; item = item->next() ) {
Column *col = findColumn( item );
if ( !col )
continue;
@@ -612,12 +612,12 @@ void ListViewEditor::setupItems()
itemColumn->setValue( QMIN( numColumns - 1, itemColumn->value() ) );
}
-ListViewEditor::Column *ListViewEditor::findColumn( QListBoxItem *i )
+ListViewEditor::Column *ListViewEditor::findColumn( TQListBoxItem *i )
{
if ( !i )
return 0;
- for ( QValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
+ for ( TQValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
if ( ( *it ).item == i )
return &( *it );
}
@@ -625,7 +625,7 @@ ListViewEditor::Column *ListViewEditor::findColumn( QListBoxItem *i )
return 0;
}
-void ListViewEditor::initTabPage( const QString &page )
+void ListViewEditor::initTabPage( const TQString &page )
{
numColumns = colPreview->count();
if ( page == i18n( "&Items" ) ) {
@@ -644,7 +644,7 @@ void ListViewEditor::initTabPage( const QString &page )
}
}
-void ListViewEditor::emitItemRenamed( QListViewItem *, int, const QString & text )
+void ListViewEditor::emitItemRenamed( TQListViewItem *, int, const TQString & text )
{
- emit itemRenamed( text ); // Relay signal ( to QLineEdit )
+ emit itemRenamed( text ); // Relay signal ( to TQLineEdit )
}