summaryrefslogtreecommitdiffstats
path: root/kspread/tests/inspector.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kspread/tests/inspector.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspread/tests/inspector.cc')
-rw-r--r--kspread/tests/inspector.cc152
1 files changed, 76 insertions, 76 deletions
diff --git a/kspread/tests/inspector.cc b/kspread/tests/inspector.cc
index 8996d285..ad186817 100644
--- a/kspread/tests/inspector.cc
+++ b/kspread/tests/inspector.cc
@@ -19,9 +19,9 @@
#include "inspector.h"
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qtextstream.h>
+#include <tqlayout.h>
+#include <tqlistview.h>
+#include <tqtextstream.h>
#include <kdialogbase.h>
@@ -40,11 +40,11 @@ public:
Format* format;
Sheet* sheet;
- QListView *cellView;
- QListView *formatView;
- QListView *sheetView;
- QListView *styleView;
- QListView* depView;
+ TQListView *cellView;
+ TQListView *formatView;
+ TQListView *sheetView;
+ TQListView *styleView;
+ TQListView* depView;
void handleCell();
void handleFormat();
@@ -57,20 +57,20 @@ public:
using namespace KSpread;
-static QString boolAsString( bool b )
+static TQString boolAsString( bool b )
{
- if( b ) return QString( "True" );
- else return QString( "False" );
+ if( b ) return TQString( "True" );
+ else return TQString( "False" );
}
-static QString longAsHexstring( long l )
+static TQString longAsHexstring( long l )
{
- return QString("%1").arg(l, 8, 16);
+ return TQString("%1").tqarg(l, 8, 16);
}
-static QString dirAsString( Sheet::LayoutDirection dir )
+static TQString dirAsString( Sheet::LayoutDirection dir )
{
- QString str;
+ TQString str;
switch( dir )
{
case Sheet::LeftToRight: str = "Left to Right"; break;
@@ -82,32 +82,32 @@ static QString dirAsString( Sheet::LayoutDirection dir )
void Inspector::Private::handleCell()
{
- QString str;
+ TQString str;
cellView->clear();
- new QListViewItem( cellView, "Column", QString::number( cell->column() ) );
- new QListViewItem( cellView, "Row", QString::number( cell->row() ) );
- new QListViewItem( cellView, "Name", cell->name() );
- new QListViewItem( cellView, "Full Name", cell->fullName() );
-
- new QListViewItem( cellView, "Default", boolAsString( cell->isDefault() ) );
- new QListViewItem( cellView, "Empty", boolAsString( cell->isEmpty() ) );
- new QListViewItem( cellView, "Formula", boolAsString( cell->isFormula() ) );
- new QListViewItem( cellView, "Format Properties", longAsHexstring( static_cast<long>( cell->format()->propertiesMask() ) ) );
- new QListViewItem( cellView, "Style Properties", longAsHexstring( static_cast<long>( cell->format()->style()->features() ) ) );
- new QListViewItem( cellView, "Text", cell->text() );
- new QListViewItem( cellView, "Text (Displayed)",
- cell->strOutText().replace( QChar('\n'), "\\n" ) );
-
- QTextStream ts( &str, IO_WriteOnly );
+ new TQListViewItem( cellView, "Column", TQString::number( cell->column() ) );
+ new TQListViewItem( cellView, "Row", TQString::number( cell->row() ) );
+ new TQListViewItem( cellView, "Name", cell->name() );
+ new TQListViewItem( cellView, "Full Name", cell->fullName() );
+
+ new TQListViewItem( cellView, "Default", boolAsString( cell->isDefault() ) );
+ new TQListViewItem( cellView, "Empty", boolAsString( cell->isEmpty() ) );
+ new TQListViewItem( cellView, "Formula", boolAsString( cell->isFormula() ) );
+ new TQListViewItem( cellView, "Format Properties", longAsHexstring( static_cast<long>( cell->format()->propertiesMask() ) ) );
+ new TQListViewItem( cellView, "Style Properties", longAsHexstring( static_cast<long>( cell->format()->style()->features() ) ) );
+ new TQListViewItem( cellView, "Text", cell->text() );
+ new TQListViewItem( cellView, "Text (Displayed)",
+ cell->strOutText().tqreplace( TQChar('\n'), "\\n" ) );
+
+ TQTextStream ts( &str, IO_WriteOnly );
ts << cell->value();
- new QListViewItem( cellView, "Value", str );
+ new TQListViewItem( cellView, "Value", str );
- new QListViewItem( cellView, "Link", cell->link() );
+ new TQListViewItem( cellView, "Link", cell->link() );
- new QListViewItem( cellView, "Width", QString::number( cell->dblWidth() ) );
- new QListViewItem( cellView, "Height", QString::number( cell->dblHeight() ) );
+ new TQListViewItem( cellView, "Width", TQString::number( cell->dblWidth() ) );
+ new TQListViewItem( cellView, "Height", TQString::number( cell->dblHeight() ) );
}
void Inspector::Private::handleFormat()
@@ -116,33 +116,33 @@ void Inspector::Private::handleFormat()
int col = cell->column();
int row = cell->row();
- new QListViewItem( formatView, "Angle", QString::number( format->getAngle(col, row) ) );
- new QListViewItem( formatView, "Multirow", boolAsString( format->multiRow(col, row) ) );
- new QListViewItem( formatView, "Protected", format->hasProperty( Format::PVerticalText )
+ new TQListViewItem( formatView, "Angle", TQString::number( format->getAngle(col, row) ) );
+ new TQListViewItem( formatView, "Multirow", boolAsString( format->multiRow(col, row) ) );
+ new TQListViewItem( formatView, "Protected", format->hasProperty( Format::PVerticalText )
? "Not specified" : boolAsString( format->isProtected(col, row) ) );
- new QListViewItem( formatView, "Vertical Text", boolAsString( format->verticalText(col, row ) ) );
+ new TQListViewItem( formatView, "Vertical Text", boolAsString( format->verticalText(col, row ) ) );
Format::Currency currrency;
bool valid = format->currencyInfo(currrency);
- new QListViewItem( formatView, "Currency symbol", valid ? currrency.symbol : "Invalid" );
+ new TQListViewItem( formatView, "Currency symbol", valid ? currrency.symbol : "Invalid" );
bool ok = false;
- QString currencyType;
+ TQString currencyType;
if (valid)
currencyType = Currency::getChooseString(currrency.type, ok);
- new QListViewItem( formatView, "Currency type", valid && ok ? currencyType : "Invalid" );
+ new TQListViewItem( formatView, "Currency type", valid && ok ? currencyType : "Invalid" );
- QListViewItem* flags = new QListViewItem( formatView, "Flags" );
- new QListViewItem( flags, "Border (left)",
+ TQListViewItem* flags = new TQListViewItem( formatView, "Flags" );
+ new TQListViewItem( flags, "Border (left)",
boolAsString( format->hasProperty(Format::PLeftBorder, true) ) );
- new QListViewItem( flags, "Border (right)",
+ new TQListViewItem( flags, "Border (right)",
boolAsString( format->hasProperty(Format::PRightBorder, true) ) );
- new QListViewItem( flags, "Border (top)",
+ new TQListViewItem( flags, "Border (top)",
boolAsString( format->hasProperty(Format::PTopBorder, true) ) );
- new QListViewItem( flags, "Border (bottom)",
+ new TQListViewItem( flags, "Border (bottom)",
boolAsString( format->hasProperty(Format::PBottomBorder, true) ) );
- new QListViewItem( formatView, "Border pen width (bottom)",
- QString::number( format->bottomBorderPen(col,row).width() ) );
+ new TQListViewItem( formatView, "Border pen width (bottom)",
+ TQString::number( format->bottomBorderPen(col,row).width() ) );
}
void Inspector::Private::handleStyle() // direct style access
@@ -150,26 +150,26 @@ void Inspector::Private::handleStyle() // direct style access
styleView->clear();
const Style* style = cell->format()->style();
- QListViewItem* flags = new QListViewItem( styleView, "Flags" );
- new QListViewItem( flags, "Border (left)",
+ TQListViewItem* flags = new TQListViewItem( styleView, "Flags" );
+ new TQListViewItem( flags, "Border (left)",
boolAsString( style->hasFeature(Style::SLeftBorder, true) ) );
- new QListViewItem( flags, "Border (right)",
+ new TQListViewItem( flags, "Border (right)",
boolAsString( style->hasFeature(Style::SRightBorder, true) ) );
- new QListViewItem( flags, "Border (top)",
+ new TQListViewItem( flags, "Border (top)",
boolAsString( style->hasFeature(Style::STopBorder, true) ) );
- new QListViewItem( flags, "Border (bottom)",
+ new TQListViewItem( flags, "Border (bottom)",
boolAsString( style->hasFeature(Style::SBottomBorder, true) ) );
- new QListViewItem( styleView, "Border pen width (bottom)",
- QString::number( style->bottomBorderPen().width() ) );
+ new TQListViewItem( styleView, "Border pen width (bottom)",
+ TQString::number( style->bottomBorderPen().width() ) );
}
void Inspector::Private::handleSheet()
{
sheetView->clear();
- new QListViewItem( sheetView, "Name", sheet->sheetName() ) ;
- new QListViewItem( sheetView, "Layout Direction", dirAsString( sheet->layoutDirection() ) );
+ new TQListViewItem( sheetView, "Name", sheet->sheetName() ) ;
+ new TQListViewItem( sheetView, "Layout Direction", dirAsString( sheet->tqlayoutDirection() ) );
}
void Inspector::Private::handleDep()
@@ -180,19 +180,19 @@ void Inspector::Private::handleDep()
cellPoint.setColumn( cell->column() );
DependencyManager* manager = sheet->dependencies();
- QValueList<Point> deps = manager->getDependants( cellPoint );
+ TQValueList<Point> deps = manager->getDependants( cellPoint );
depView->clear();
for( unsigned i = 0; i < deps.count(); i++ )
{
- QString k1, k2;
+ TQString k1, k2;
Point point = deps[i];
int row = point.row();
int column = point.column();
k1 = Cell::fullName( point.sheet(), column, row );
- new QListViewItem( depView, k1, k2 );
+ new TQListViewItem( depView, k1, k2 );
}
}
@@ -207,37 +207,37 @@ Inspector::Inspector( Cell* cell ):
d->format = cell->format();
d->sheet = cell->sheet();
- QFrame* cellPage = addPage( QString("Cell") );
- QVBoxLayout* cellLayout = new QVBoxLayout( cellPage, 0 );
- d->cellView = new QListView( cellPage );
+ TQFrame* cellPage = addPage( TQString("Cell") );
+ TQVBoxLayout* cellLayout = new TQVBoxLayout( cellPage, 0 );
+ d->cellView = new TQListView( cellPage );
cellLayout->addWidget( d->cellView );
d->cellView->addColumn( "Key", 150 );
d->cellView->addColumn( "Value" );
- QFrame* formatPage = addPage( QString("Format") );
- QVBoxLayout* formatLayout = new QVBoxLayout( formatPage, 0 );
- d->formatView = new QListView( formatPage );
+ TQFrame* formatPage = addPage( TQString("Format") );
+ TQVBoxLayout* formatLayout = new TQVBoxLayout( formatPage, 0 );
+ d->formatView = new TQListView( formatPage );
formatLayout->addWidget( d->formatView );
d->formatView->addColumn( "Key", 150 );
d->formatView->addColumn( "Value" );
- QFrame* stylePage = addPage( QString("Style") );
- QVBoxLayout* styleLayout = new QVBoxLayout( stylePage, 0 );
- d->styleView = new QListView( stylePage );
+ TQFrame* stylePage = addPage( TQString("Style") );
+ TQVBoxLayout* styleLayout = new TQVBoxLayout( stylePage, 0 );
+ d->styleView = new TQListView( stylePage );
styleLayout->addWidget( d->styleView );
d->styleView->addColumn( "Key", 150 );
d->styleView->addColumn( "Value" );
- QFrame* sheetPage = addPage( QString("Sheet") );
- QVBoxLayout* sheetLayout = new QVBoxLayout( sheetPage, 0 );
- d->sheetView = new QListView( sheetPage );
+ TQFrame* sheetPage = addPage( TQString("Sheet") );
+ TQVBoxLayout* sheetLayout = new TQVBoxLayout( sheetPage, 0 );
+ d->sheetView = new TQListView( sheetPage );
sheetLayout->addWidget( d->sheetView );
d->sheetView->addColumn( "Key", 150 );
d->sheetView->addColumn( "Value" );
- QFrame* depPage = addPage( QString("Dependencies") );
- QVBoxLayout* depLayout = new QVBoxLayout( depPage, 0 );
- d->depView = new QListView( depPage );
+ TQFrame* depPage = addPage( TQString("Dependencies") );
+ TQVBoxLayout* depLayout = new TQVBoxLayout( depPage, 0 );
+ d->depView = new TQListView( depPage );
depLayout->addWidget( d->depView );
d->depView->addColumn( "Cell", 150 );
d->depView->addColumn( "Content" );