diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kate/part/kateschema.cpp | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/part/kateschema.cpp')
-rw-r--r-- | kate/part/kateschema.cpp | 480 |
1 files changed, 240 insertions, 240 deletions
diff --git a/kate/part/kateschema.cpp b/kate/part/kateschema.cpp index e0a5d5dba..6e73a9f75 100644 --- a/kate/part/kateschema.cpp +++ b/kate/part/kateschema.cpp @@ -42,35 +42,35 @@ #include <kaboutdata.h> #include <ktexteditor/markinterface.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qptrcollection.h> -#include <qdialog.h> -#include <qgrid.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qtextcodec.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qheader.h> -#include <qlistbox.h> -#include <qhbox.h> -#include <qpainter.h> -#include <qobjectlist.h> -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qstringlist.h> -#include <qtabwidget.h> -#include <qvbox.h> -#include <qvgroupbox.h> -#include <qwhatsthis.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqptrcollection.h> +#include <tqdialog.h> +#include <tqgrid.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqtextcodec.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqheader.h> +#include <tqlistbox.h> +#include <tqhbox.h> +#include <tqpainter.h> +#include <tqobjectlist.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqstringlist.h> +#include <tqtabwidget.h> +#include <tqvbox.h> +#include <tqvgroupbox.h> +#include <tqwhatsthis.h> //END //BEGIN KateStyleListViewItem decl /* - QListViewItem subclass to display/edit a style, bold/italic is check boxes, + TQListViewItem subclass to display/edit a style, bold/italic is check boxes, normal and selected colors are boxes, which will display a color chooser when activated. The context name for the style will be drawn using the editor default font and @@ -83,9 +83,9 @@ class KateStyleListItem : public QListViewItem { public: - KateStyleListItem( QListViewItem *parent=0, const QString & stylename=0, + KateStyleListItem( TQListViewItem *parent=0, const TQString & stylename=0, class KateAttribute* defaultstyle=0, class KateHlItemData *data=0 ); - KateStyleListItem( QListView *parent, const QString & stylename=0, + KateStyleListItem( TQListView *parent, const TQString & stylename=0, class KateAttribute* defaultstyle=0, class KateHlItemData *data=0 ); ~KateStyleListItem() { if (st) delete is; }; @@ -97,9 +97,9 @@ class KateStyleListItem : public QListViewItem /* updates the hldata's style */ void updateStyle(); /* reimp */ - virtual int width ( const QFontMetrics & fm, const QListView * lv, int c ) const; + virtual int width ( const TQFontMetrics & fm, const TQListView * lv, int c ) const; /* calls changeProperty() if it makes sense considering pos. */ - void activate( int column, const QPoint &localPos ); + void activate( int column, const TQPoint &localPos ); /* For bool fields, toggles them, for color fields, display a color chooser */ void changeProperty( Property p ); /** unset a color. @@ -107,7 +107,7 @@ class KateStyleListItem : public QListViewItem */ void unsetColor( int c ); /* style context name */ - QString contextName() { return text(0); }; + TQString contextName() { return text(0); }; /* only true for a hl mode item using it's default style */ bool defStyle(); /* true for default styles */ @@ -118,7 +118,7 @@ class KateStyleListItem : public QListViewItem protected: /* reimp */ - void paintCell(QPainter *p, const QColorGroup& cg, int col, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup& cg, int col, int width, int align); private: /* private methods to change properties */ @@ -144,23 +144,23 @@ class KateStyleListItem : public QListViewItem class KateStyleListCaption : public QListViewItem { public: - KateStyleListCaption( QListView *parent, const QString & name ); + KateStyleListCaption( TQListView *parent, const TQString & name ); ~KateStyleListCaption() {}; protected: - void paintCell(QPainter *p, const QColorGroup& cg, int col, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup& cg, int col, int width, int align); }; //END //BEGIN KateSchemaManager -QString KateSchemaManager::normalSchema () +TQString KateSchemaManager::normalSchema () { - return KApplication::kApplication()->aboutData()->appName () + QString (" - Normal"); + return KApplication::kApplication()->aboutData()->appName () + TQString (" - Normal"); } -QString KateSchemaManager::printingSchema () +TQString KateSchemaManager::printingSchema () { - return KApplication::kApplication()->aboutData()->appName () + QString (" - Printing"); + return KApplication::kApplication()->aboutData()->appName () + TQString (" - Printing"); } KateSchemaManager::KateSchemaManager () @@ -206,7 +206,7 @@ KConfig *KateSchemaManager::schema (uint number) return &m_config; } -void KateSchemaManager::addSchema (const QString &t) +void KateSchemaManager::addSchema (const TQString &t) { m_config.setGroup (t); m_config.writeEntry("Color Background", KGlobalSettings::baseColor()); @@ -235,7 +235,7 @@ bool KateSchemaManager::validSchema (uint number) return false; } -uint KateSchemaManager::number (const QString &name) +uint KateSchemaManager::number (const TQString &name) { if (name == normalSchema()) return 0; @@ -250,7 +250,7 @@ uint KateSchemaManager::number (const QString &name) return 0; } -QString KateSchemaManager::name (uint number) +TQString KateSchemaManager::name (uint number) { if ((number>1) && (number < m_schemas.count())) return m_schemas[number]; @@ -266,38 +266,38 @@ QString KateSchemaManager::name (uint number) // //BEGIN KateSchemaConfigColorTab -- 'Colors' tab -KateSchemaConfigColorTab::KateSchemaConfigColorTab( QWidget *parent, const char * ) - : QWidget (parent) +KateSchemaConfigColorTab::KateSchemaConfigColorTab( TQWidget *parent, const char * ) + : TQWidget (parent) { m_schema = -1; - QHBox *b; - QLabel *label; + TQHBox *b; + TQLabel *label; - QVBoxLayout *blay=new QVBoxLayout(this, 0, KDialog::spacingHint()); + TQVBoxLayout *blay=new TQVBoxLayout(this, 0, KDialog::spacingHint()); - QVGroupBox *gbTextArea = new QVGroupBox(i18n("Text Area Background"), this); + TQVGroupBox *gbTextArea = new TQVGroupBox(i18n("Text Area Background"), this); - b = new QHBox (gbTextArea); + b = new TQHBox (gbTextArea); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Normal text:"), b); + label = new TQLabel( i18n("Normal text:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_back = new KColorButton(b); - b = new QHBox (gbTextArea); + b = new TQHBox (gbTextArea); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Selected text:"), b); + label = new TQLabel( i18n("Selected text:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_selected = new KColorButton(b); - b = new QHBox (gbTextArea); + b = new TQHBox (gbTextArea); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Current line:"), b); + label = new TQLabel( i18n("Current line:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_current = new KColorButton(b); // Markers from kdelibs/interfaces/ktextinterface/markinterface.h - b = new QHBox (gbTextArea); + b = new TQHBox (gbTextArea); b->setSpacing(KDialog::spacingHint()); m_combobox = new KComboBox(b, "color_combo_box"); // add the predefined mark types as defined in markinterface.h @@ -310,39 +310,39 @@ KateSchemaConfigColorTab::KateSchemaConfigColorTab( QWidget *parent, const char m_combobox->insertItem(i18n("Error")); // markType07 m_combobox->setCurrentItem(0); m_markers = new KColorButton(b, "marker_color_button"); - connect( m_combobox, SIGNAL( activated( int ) ), SLOT( slotComboBoxChanged( int ) ) ); + connect( m_combobox, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotComboBoxChanged( int ) ) ); blay->addWidget(gbTextArea); - QVGroupBox *gbBorder = new QVGroupBox(i18n("Additional Elements"), this); + TQVGroupBox *gbBorder = new TQVGroupBox(i18n("Additional Elements"), this); - b = new QHBox (gbBorder); + b = new TQHBox (gbBorder); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Left border background:"), b); + label = new TQLabel( i18n("Left border background:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_iconborder = new KColorButton(b); - b = new QHBox (gbBorder); + b = new TQHBox (gbBorder); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Line numbers:"), b); + label = new TQLabel( i18n("Line numbers:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_linenumber = new KColorButton(b); - b = new QHBox (gbBorder); + b = new TQHBox (gbBorder); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Bracket highlight:"), b); + label = new TQLabel( i18n("Bracket highlight:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_bracket = new KColorButton(b); - b = new QHBox (gbBorder); + b = new TQHBox (gbBorder); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Word wrap markers:"), b); + label = new TQLabel( i18n("Word wrap markers:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_wwmarker = new KColorButton(b); - b = new QHBox (gbBorder); + b = new TQHBox (gbBorder); b->setSpacing(KDialog::spacingHint()); - label = new QLabel( i18n("Tab markers:"), b); + label = new TQLabel( i18n("Tab markers:"), b); label->setAlignment( AlignLeft|AlignVCenter); m_tmarker = new KColorButton(b); @@ -351,32 +351,32 @@ KateSchemaConfigColorTab::KateSchemaConfigColorTab( QWidget *parent, const char blay->addStretch(); // connect signal changed(); changed is emitted by a ColorButton change! - connect( this, SIGNAL( changed() ), parent->parentWidget(), SLOT( slotChanged() ) ); + connect( this, TQT_SIGNAL( changed() ), parent->parentWidget(), TQT_SLOT( slotChanged() ) ); - // QWhatsThis help - QWhatsThis::add(m_back, i18n("<p>Sets the background color of the editing area.</p>")); - QWhatsThis::add(m_selected, i18n("<p>Sets the background color of the selection.</p>" + // TQWhatsThis help + TQWhatsThis::add(m_back, i18n("<p>Sets the background color of the editing area.</p>")); + TQWhatsThis::add(m_selected, i18n("<p>Sets the background color of the selection.</p>" "<p>To set the text color for selected text, use the \"<b>Configure " "Highlighting</b>\" dialog.</p>")); - QWhatsThis::add(m_markers, i18n("<p>Sets the background color of the selected " + TQWhatsThis::add(m_markers, i18n("<p>Sets the background color of the selected " "marker type.</p><p><b>Note</b>: The marker color is displayed lightly because " "of transparency.</p>")); - QWhatsThis::add(m_combobox, i18n("<p>Select the marker type you want to change.</p>")); - QWhatsThis::add(m_current, i18n("<p>Sets the background color of the currently " + TQWhatsThis::add(m_combobox, i18n("<p>Select the marker type you want to change.</p>")); + TQWhatsThis::add(m_current, i18n("<p>Sets the background color of the currently " "active line, which means the line where your cursor is positioned.</p>")); - QWhatsThis::add( m_linenumber, i18n( + TQWhatsThis::add( m_linenumber, i18n( "<p>This color will be used to draw the line numbers (if enabled) and the " "lines in the code-folding pane.</p>" ) ); - QWhatsThis::add(m_bracket, i18n("<p>Sets the bracket matching color. This means, " + TQWhatsThis::add(m_bracket, i18n("<p>Sets the bracket matching color. This means, " "if you place the cursor e.g. at a <b>(</b>, the matching <b>)</b> will " "be highlighted with this color.</p>")); - QWhatsThis::add(m_wwmarker, i18n( + TQWhatsThis::add(m_wwmarker, i18n( "<p>Sets the color of Word Wrap-related markers:</p>" "<dl><dt>Static Word Wrap</dt><dd>A vertical line which shows the column where " "text is going to be wrapped</dd>" "<dt>Dynamic Word Wrap</dt><dd>An arrow shown to the left of " "visually-wrapped lines</dd></dl>")); - QWhatsThis::add(m_tmarker, i18n( + TQWhatsThis::add(m_tmarker, i18n( "<p>Sets the color of the tabulator marks:</p>")); } @@ -405,31 +405,31 @@ void KateSchemaConfigColorTab::schemaChanged ( int newSchema ) m_schema = newSchema; // first disconnect all signals otherwise setColor emits changed - m_back ->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_selected ->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_current ->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_bracket ->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_wwmarker ->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_iconborder->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_tmarker ->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_markers ->disconnect( SIGNAL( changed( const QColor & ) ) ); - m_linenumber->disconnect( SIGNAL( changed( const QColor & ) ) ); + m_back ->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_selected ->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_current ->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_bracket ->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_wwmarker ->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_iconborder->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_tmarker ->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_markers ->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); + m_linenumber->disconnect( TQT_SIGNAL( changed( const TQColor & ) ) ); // If we havent this schema, read in from config file if ( ! m_schemas.contains( newSchema ) ) { // fallback defaults - QColor tmp0 (KGlobalSettings::baseColor()); - QColor tmp1 (KGlobalSettings::highlightColor()); - QColor tmp2 (KGlobalSettings::alternateBackgroundColor()); - QColor tmp3 ( "#FFFF99" ); - QColor tmp4 (tmp2.dark()); - QColor tmp5 ( KGlobalSettings::textColor() ); - QColor tmp6 ( "#EAE9E8" ); - QColor tmp7 ( "#000000" ); + TQColor tmp0 (KGlobalSettings::baseColor()); + TQColor tmp1 (KGlobalSettings::highlightColor()); + TQColor tmp2 (KGlobalSettings::alternateBackgroundColor()); + TQColor tmp3 ( "#FFFF99" ); + TQColor tmp4 (tmp2.dark()); + TQColor tmp5 ( KGlobalSettings::textColor() ); + TQColor tmp6 ( "#EAE9E8" ); + TQColor tmp7 ( "#000000" ); // same std colors like in KateDocument::markColor - QValueVector <QColor> mark(KTextEditor::MarkInterface::reservedMarkersCount()); + TQValueVector <TQColor> mark(KTextEditor::MarkInterface::reservedMarkersCount()); Q_ASSERT(mark.size() > 6); mark[0] = Qt::blue; mark[1] = Qt::red; @@ -452,7 +452,7 @@ void KateSchemaConfigColorTab::schemaChanged ( int newSchema ) c.linenumber = config->readColorEntry("Color Line Number", &tmp7); for (int i = 0; i < KTextEditor::MarkInterface::reservedMarkersCount(); i++) - c.markerColors[i] = config->readColorEntry( QString("Color MarkType%1").arg(i+1), &mark[i] ); + c.markerColors[i] = config->readColorEntry( TQString("Color MarkType%1").arg(i+1), &mark[i] ); m_schemas[ newSchema ] = c; } @@ -469,27 +469,27 @@ void KateSchemaConfigColorTab::schemaChanged ( int newSchema ) // map from 0..reservedMarkersCount()-1 - the same index as in markInterface for (int i = 0; i < KTextEditor::MarkInterface::reservedMarkersCount(); i++) { - QPixmap pix(16, 16); + TQPixmap pix(16, 16); pix.fill( m_schemas [ newSchema ].markerColors[i]); m_combobox->changeItem(pix, m_combobox->text(i), i); } m_markers->setColor( m_schemas [ newSchema ].markerColors[ m_combobox->currentItem() ] ); - connect( m_back , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_selected , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_current , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_bracket , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_wwmarker , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_iconborder, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_tmarker , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_linenumber, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( m_markers , SIGNAL( changed( const QColor& ) ), SLOT( slotMarkerColorChanged( const QColor& ) ) ); + connect( m_back , TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_selected , TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_current , TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_bracket , TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_wwmarker , TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_iconborder, TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_tmarker , TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_linenumber, TQT_SIGNAL( changed( const TQColor& ) ), TQT_SIGNAL( changed() ) ); + connect( m_markers , TQT_SIGNAL( changed( const TQColor& ) ), TQT_SLOT( slotMarkerColorChanged( const TQColor& ) ) ); } void KateSchemaConfigColorTab::apply () { schemaChanged( m_schema ); - QMap<int,SchemaColors>::Iterator it; + TQMap<int,SchemaColors>::Iterator it; for ( it = m_schemas.begin(); it != m_schemas.end(); ++it ) { kdDebug(13030)<<"APPLY scheme = "<<it.key()<<endl; @@ -508,16 +508,16 @@ void KateSchemaConfigColorTab::apply () for (int i = 0; i < KTextEditor::MarkInterface::reservedMarkersCount(); i++) { - config->writeEntry(QString("Color MarkType%1").arg(i + 1), c.markerColors[i]); + config->writeEntry(TQString("Color MarkType%1").arg(i + 1), c.markerColors[i]); } } } -void KateSchemaConfigColorTab::slotMarkerColorChanged( const QColor& color) +void KateSchemaConfigColorTab::slotMarkerColorChanged( const TQColor& color) { int index = m_combobox->currentItem(); m_schemas[ m_schema ].markerColors[ index ] = color; - QPixmap pix(16, 16); + TQPixmap pix(16, 16); pix.fill(color); m_combobox->changeItem(pix, m_combobox->text(index), index); @@ -527,25 +527,25 @@ void KateSchemaConfigColorTab::slotMarkerColorChanged( const QColor& color) void KateSchemaConfigColorTab::slotComboBoxChanged(int index) { // temporarily disconnect the changed-signal because setColor emits changed as well - m_markers->disconnect( SIGNAL( changed( const QColor& ) ) ); + m_markers->disconnect( TQT_SIGNAL( changed( const TQColor& ) ) ); m_markers->setColor( m_schemas[m_schema].markerColors[index] ); - connect( m_markers, SIGNAL( changed( const QColor& ) ), SLOT( slotMarkerColorChanged( const QColor& ) ) ); + connect( m_markers, TQT_SIGNAL( changed( const TQColor& ) ), TQT_SLOT( slotMarkerColorChanged( const TQColor& ) ) ); } //END KateSchemaConfigColorTab //BEGIN FontConfig -- 'Fonts' tab -KateSchemaConfigFontTab::KateSchemaConfigFontTab( QWidget *parent, const char * ) - : QWidget (parent) +KateSchemaConfigFontTab::KateSchemaConfigFontTab( TQWidget *parent, const char * ) + : TQWidget (parent) { // sizemanagment - QGridLayout *grid = new QGridLayout( this, 1, 1 ); + TQGridLayout *grid = new TQGridLayout( this, 1, 1 ); - m_fontchooser = new KFontChooser ( this, 0L, false, QStringList(), false ); + m_fontchooser = new KFontChooser ( this, 0L, false, TQStringList(), false ); m_fontchooser->enableColumn(KFontChooser::StyleList, false); grid->addWidget( m_fontchooser, 0, 0); - connect (this, SIGNAL( changed()), parent->parentWidget(), SLOT (slotChanged())); + connect (this, TQT_SIGNAL( changed()), parent->parentWidget(), TQT_SLOT (slotChanged())); m_schema = -1; } @@ -553,7 +553,7 @@ KateSchemaConfigFontTab::~KateSchemaConfigFontTab() { } -void KateSchemaConfigFontTab::slotFontSelected( const QFont &font ) +void KateSchemaConfigFontTab::slotFontSelected( const TQFont &font ) { if ( m_schema > -1 ) { @@ -578,30 +578,30 @@ void KateSchemaConfigFontTab::schemaChanged( int newSchema ) m_schema = newSchema; - QFont f (KGlobalSettings::fixedFont()); + TQFont f (KGlobalSettings::fixedFont()); m_fontchooser->disconnect ( this ); m_fontchooser->setFont ( KateFactory::self()->schemaManager()->schema( newSchema )->readFontEntry("Font", &f) ); m_fonts[ newSchema ] = m_fontchooser->font(); - connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & ))); + connect (m_fontchooser, TQT_SIGNAL (fontSelected( const TQFont & )), this, TQT_SLOT (slotFontSelected( const TQFont & ))); } //END FontConfig //BEGIN FontColorConfig -- 'Normal Text Styles' tab -KateSchemaConfigFontColorTab::KateSchemaConfigFontColorTab( QWidget *parent, const char * ) - : QWidget (parent) +KateSchemaConfigFontColorTab::KateSchemaConfigFontColorTab( TQWidget *parent, const char * ) + : TQWidget (parent) { m_defaultStyleLists.setAutoDelete(true); // sizemanagment - QGridLayout *grid = new QGridLayout( this, 1, 1 ); + TQGridLayout *grid = new TQGridLayout( this, 1, 1 ); m_defaultStyles = new KateStyleListView( this, false ); grid->addWidget( m_defaultStyles, 0, 0); - connect (m_defaultStyles, SIGNAL (changed()), parent->parentWidget(), SLOT (slotChanged())); + connect (m_defaultStyles, TQT_SIGNAL (changed()), parent->parentWidget(), TQT_SLOT (slotChanged())); - QWhatsThis::add( m_defaultStyles, i18n( + TQWhatsThis::add( m_defaultStyles, i18n( "This list displays the default styles for the current schema and " "offers the means to edit them. The style name reflects the current " "style settings." @@ -634,17 +634,17 @@ void KateSchemaConfigFontColorTab::schemaChanged (uint schema) KateAttributeList *l = attributeList (schema); // set colors - QPalette p ( m_defaultStyles->palette() ); - QColor _c ( KGlobalSettings::baseColor() ); - p.setColor( QColorGroup::Base, + TQPalette p ( m_defaultStyles->palette() ); + TQColor _c ( KGlobalSettings::baseColor() ); + p.setColor( TQColorGroup::Base, KateFactory::self()->schemaManager()->schema(schema)-> readColorEntry( "Color Background", &_c ) ); _c = KGlobalSettings::highlightColor(); - p.setColor( QColorGroup::Highlight, + p.setColor( TQColorGroup::Highlight, KateFactory::self()->schemaManager()->schema(schema)-> readColorEntry( "Color Selection", &_c ) ); _c = l->at(0)->textColor(); // not quite as much of an assumption ;) - p.setColor( QColorGroup::Text, _c ); + p.setColor( TQColorGroup::Text, _c ); m_defaultStyles->viewport()->setPalette( p ); // insert the default styles backwards to get them in the right order @@ -662,15 +662,15 @@ void KateSchemaConfigFontColorTab::reload () void KateSchemaConfigFontColorTab::apply () { - for ( QIntDictIterator<KateAttributeList> it( m_defaultStyleLists ); it.current(); ++it ) + for ( TQIntDictIterator<KateAttributeList> it( m_defaultStyleLists ); it.current(); ++it ) KateHlManager::self()->setDefaults(it.currentKey(), *(it.current())); } //END FontColorConfig //BEGIN KateSchemaConfigHighlightTab -- 'Highlighting Text Styles' tab -KateSchemaConfigHighlightTab::KateSchemaConfigHighlightTab( QWidget *parent, const char *, KateSchemaConfigFontColorTab *page, uint hl ) - : QWidget (parent) +KateSchemaConfigHighlightTab::KateSchemaConfigHighlightTab( TQWidget *parent, const char *, KateSchemaConfigFontColorTab *page, uint hl ) + : TQWidget (parent) { m_defaults = page; @@ -679,22 +679,22 @@ KateSchemaConfigHighlightTab::KateSchemaConfigHighlightTab( QWidget *parent, con m_hlDict.setAutoDelete (true); - QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); + TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint() ); // hl chooser - QHBox *hbHl = new QHBox( this ); + TQHBox *hbHl = new TQHBox( this ); layout->add (hbHl); hbHl->setSpacing( KDialog::spacingHint() ); - QLabel *lHl = new QLabel( i18n("H&ighlight:"), hbHl ); - hlCombo = new QComboBox( false, hbHl ); + TQLabel *lHl = new TQLabel( i18n("H&ighlight:"), hbHl ); + hlCombo = new TQComboBox( false, hbHl ); lHl->setBuddy( hlCombo ); - connect( hlCombo, SIGNAL(activated(int)), - this, SLOT(hlChanged(int)) ); + connect( hlCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(hlChanged(int)) ); for( int i = 0; i < KateHlManager::self()->highlights(); i++) { if (KateHlManager::self()->hlSection(i).length() > 0) - hlCombo->insertItem(KateHlManager::self()->hlSection(i) + QString ("/") + KateHlManager::self()->hlNameTranslated(i)); + hlCombo->insertItem(KateHlManager::self()->hlSection(i) + TQString ("/") + KateHlManager::self()->hlNameTranslated(i)); else hlCombo->insertItem(KateHlManager::self()->hlNameTranslated(i)); } @@ -707,7 +707,7 @@ KateSchemaConfigHighlightTab::KateSchemaConfigHighlightTab( QWidget *parent, con hlCombo->setCurrentItem ( hl ); hlChanged ( hl ); - QWhatsThis::add( m_styles, i18n( + TQWhatsThis::add( m_styles, i18n( "This list displays the contexts of the current syntax highlight mode and " "offers the means to edit them. The context name reflects the current " "style settings.<p>To edit using the keyboard, press " @@ -716,7 +716,7 @@ KateSchemaConfigHighlightTab::KateSchemaConfigHighlightTab( QWidget *parent, con "to edit from the popup menu.<p>You can unset the Background and Selected " "Background colors from the context menu when appropriate.") ); - connect (m_styles, SIGNAL (changed()), parent->parentWidget(), SLOT (slotChanged())); + connect (m_styles, TQT_SIGNAL (changed()), parent->parentWidget(), TQT_SLOT (slotChanged())); } KateSchemaConfigHighlightTab::~KateSchemaConfigHighlightTab() @@ -742,7 +742,7 @@ void KateSchemaConfigHighlightTab::schemaChanged (uint schema) { kdDebug(13030) << "NEW SCHEMA, create dict" << endl; - m_hlDict.insert (schema, new QIntDict<KateHlItemDataList>); + m_hlDict.insert (schema, new TQIntDict<KateHlItemDataList>); m_hlDict[m_schema]->setAutoDelete (true); } @@ -761,20 +761,20 @@ void KateSchemaConfigHighlightTab::schemaChanged (uint schema) // We do that now, because we can now get the "normal text" color. // TODO this reads of the KConfig object, which should be changed when // the color tab is fixed. - QPalette p ( m_styles->palette() ); - QColor _c ( KGlobalSettings::baseColor() ); - p.setColor( QColorGroup::Base, + TQPalette p ( m_styles->palette() ); + TQColor _c ( KGlobalSettings::baseColor() ); + p.setColor( TQColorGroup::Base, KateFactory::self()->schemaManager()->schema(m_schema)-> readColorEntry( "Color Background", &_c ) ); _c = KGlobalSettings::highlightColor(); - p.setColor( QColorGroup::Highlight, + p.setColor( TQColorGroup::Highlight, KateFactory::self()->schemaManager()->schema(m_schema)-> readColorEntry( "Color Selection", &_c ) ); _c = l->at(0)->textColor(); // not quite as much of an assumption ;) - p.setColor( QColorGroup::Text, _c ); + p.setColor( TQColorGroup::Text, _c ); m_styles->viewport()->setPalette( p ); - QDict<KateStyleListCaption> prefixes; + TQDict<KateStyleListCaption> prefixes; for ( KateHlItemData *itemData = m_hlDict[m_schema]->find(m_hl)->last(); itemData != 0L; itemData = m_hlDict[m_schema]->find(m_hl)->prev()) @@ -785,8 +785,8 @@ void KateSchemaConfigHighlightTab::schemaChanged (uint schema) // split them and put them into nice substructures. int c = itemData->name.find(':'); if ( c > 0 ) { - QString prefix = itemData->name.left(c); - QString name = itemData->name.mid(c+1); + TQString prefix = itemData->name.left(c); + TQString name = itemData->name.mid(c+1); KateStyleListCaption *parent = prefixes.find( prefix ); if ( ! parent ) @@ -812,8 +812,8 @@ void KateSchemaConfigHighlightTab::reload () void KateSchemaConfigHighlightTab::apply () { - for ( QIntDictIterator< QIntDict<KateHlItemDataList> > it( m_hlDict ); it.current(); ++it ) - for ( QIntDictIterator< KateHlItemDataList > it2( *it.current() ); it2.current(); ++it2 ) + for ( TQIntDictIterator< TQIntDict<KateHlItemDataList> > it( m_hlDict ); it.current(); ++it ) + for ( TQIntDictIterator< KateHlItemDataList > it2( *it.current() ); it2.current(); ++it2 ) { KateHlManager::self()->getHl( it2.currentKey() )->setKateHlItemDataList (it.currentKey(), *(it2.current())); } @@ -822,32 +822,32 @@ void KateSchemaConfigHighlightTab::apply () //END KateSchemaConfigHighlightTab //BEGIN KateSchemaConfigPage -- Main dialog page -KateSchemaConfigPage::KateSchemaConfigPage( QWidget *parent, KateDocument *doc ) +KateSchemaConfigPage::KateSchemaConfigPage( TQWidget *parent, KateDocument *doc ) : KateConfigPage( parent ), m_lastSchema (-1) { - QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); + TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint() ); - QHBox *hbHl = new QHBox( this ); + TQHBox *hbHl = new TQHBox( this ); layout->add (hbHl); hbHl->setSpacing( KDialog::spacingHint() ); - QLabel *lHl = new QLabel( i18n("&Schema:"), hbHl ); - schemaCombo = new QComboBox( false, hbHl ); + TQLabel *lHl = new TQLabel( i18n("&Schema:"), hbHl ); + schemaCombo = new TQComboBox( false, hbHl ); lHl->setBuddy( schemaCombo ); - connect( schemaCombo, SIGNAL(activated(int)), - this, SLOT(schemaChanged(int)) ); + connect( schemaCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(schemaChanged(int)) ); - QPushButton *btnnew = new QPushButton( i18n("&New..."), hbHl ); - connect( btnnew, SIGNAL(clicked()), this, SLOT(newSchema()) ); + TQPushButton *btnnew = new TQPushButton( i18n("&New..."), hbHl ); + connect( btnnew, TQT_SIGNAL(clicked()), this, TQT_SLOT(newSchema()) ); - btndel = new QPushButton( i18n("&Delete"), hbHl ); - connect( btndel, SIGNAL(clicked()), this, SLOT(deleteSchema()) ); + btndel = new TQPushButton( i18n("&Delete"), hbHl ); + connect( btndel, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteSchema()) ); - m_tabWidget = new QTabWidget ( this ); + m_tabWidget = new TQTabWidget ( this ); m_tabWidget->setMargin (KDialog::marginHint()); layout->add (m_tabWidget); - connect (m_tabWidget, SIGNAL (currentChanged (QWidget *)), this, SLOT (newCurrentPage (QWidget *))); + connect (m_tabWidget, TQT_SIGNAL (currentChanged (TQWidget *)), this, TQT_SLOT (newCurrentPage (TQWidget *))); m_colorTab = new KateSchemaConfigColorTab (m_tabWidget); m_tabWidget->addTab (m_colorTab, i18n("Colors")); @@ -862,11 +862,11 @@ KateSchemaConfigPage::KateSchemaConfigPage( QWidget *parent, KateDocument *doc ) m_highlightTab = new KateSchemaConfigHighlightTab (m_tabWidget, "", m_fontColorTab, hl ); m_tabWidget->addTab (m_highlightTab, i18n("Highlighting Text Styles")); - hbHl = new QHBox( this ); + hbHl = new TQHBox( this ); layout->add (hbHl); hbHl->setSpacing( KDialog::spacingHint() ); - lHl = new QLabel( i18n("&Default schema for %1:").arg(KApplication::kApplication()->aboutData()->programName ()), hbHl ); - defaultSchemaCombo = new QComboBox( false, hbHl ); + lHl = new TQLabel( i18n("&Default schema for %1:").arg(KApplication::kApplication()->aboutData()->programName ()), hbHl ); + defaultSchemaCombo = new TQComboBox( false, hbHl ); lHl->setBuddy( defaultSchemaCombo ); @@ -874,8 +874,8 @@ KateSchemaConfigPage::KateSchemaConfigPage( QWidget *parent, KateDocument *doc ) reload(); - connect( defaultSchemaCombo, SIGNAL(activated(int)), - this, SLOT(slotChanged()) ); + connect( defaultSchemaCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotChanged()) ); } KateSchemaConfigPage::~KateSchemaConfigPage () @@ -963,7 +963,7 @@ void KateSchemaConfigPage::deleteSchema () void KateSchemaConfigPage::newSchema () { - QString t = KInputDialog::getText (i18n("Name for New Schema"), i18n ("Name:"), i18n("New Schema"), 0, this); + TQString t = KInputDialog::getText (i18n("Name for New Schema"), i18n ("Name:"), i18n("New Schema"), 0, this); KateFactory::self()->schemaManager()->addSchema (t); @@ -991,7 +991,7 @@ void KateSchemaConfigPage::schemaChanged (int schema) m_lastSchema = schema; } -void KateSchemaConfigPage::newCurrentPage (QWidget *w) +void KateSchemaConfigPage::newCurrentPage (TQWidget *w) { if (w == m_highlightTab) m_highlightTab->schemaChanged (m_lastSchema); @@ -1004,7 +1004,7 @@ void KateViewSchemaAction::init() m_view = 0; last = 0; - connect(popupMenu(),SIGNAL(aboutToShow()),this,SLOT(slotAboutToShow())); + connect(popupMenu(),TQT_SIGNAL(aboutToShow()),this,TQT_SLOT(slotAboutToShow())); } void KateViewSchemaAction::updateMenu (KateView *view) @@ -1019,12 +1019,12 @@ void KateViewSchemaAction::slotAboutToShow() for (int z=0; z<count; z++) { - QString hlName = KateFactory::self()->schemaManager()->list().operator[](z); + TQString hlName = KateFactory::self()->schemaManager()->list().operator[](z); if (names.contains(hlName) < 1) { names << hlName; - popupMenu()->insertItem ( hlName, this, SLOT(setSchema(int)), 0, z+1); + popupMenu()->insertItem ( hlName, this, TQT_SLOT(setSchema(int)), 0, z+1); } } @@ -1046,25 +1046,25 @@ void KateViewSchemaAction::setSchema (int mode) //END SCHEMA ACTION //BEGIN KateStyleListView -KateStyleListView::KateStyleListView( QWidget *parent, bool showUseDefaults ) - : QListView( parent ) +KateStyleListView::KateStyleListView( TQWidget *parent, bool showUseDefaults ) + : TQListView( parent ) { setSorting( -1 ); // disable sorting, let the styles appear in their defined order addColumn( i18n("Context") ); - addColumn( SmallIconSet("text_bold"), QString::null ); - addColumn( SmallIconSet("text_italic"), QString::null ); - addColumn( SmallIconSet("text_under"), QString::null ); - addColumn( SmallIconSet("text_strike"), QString::null ); + addColumn( SmallIconSet("text_bold"), TQString::null ); + addColumn( SmallIconSet("text_italic"), TQString::null ); + addColumn( SmallIconSet("text_under"), TQString::null ); + addColumn( SmallIconSet("text_strike"), TQString::null ); addColumn( i18n("Normal") ); addColumn( i18n("Selected") ); addColumn( i18n("Background") ); addColumn( i18n("Background Selected") ); if ( showUseDefaults ) addColumn( i18n("Use Default Style") ); - connect( this, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)), - this, SLOT(slotMousePressed(int, QListViewItem*, const QPoint&, int)) ); - connect( this, SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)), - this, SLOT(showPopupMenu(QListViewItem*, const QPoint&)) ); + connect( this, TQT_SIGNAL(mouseButtonPressed(int, TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(slotMousePressed(int, TQListViewItem*, const TQPoint&, int)) ); + connect( this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&, int)), + this, TQT_SLOT(showPopupMenu(TQListViewItem*, const TQPoint&)) ); // grap the bg color, selected color and default font normalcol = KGlobalSettings::textColor(); bgcol = KateRendererConfig::global()->backgroundColor(); @@ -1074,7 +1074,7 @@ KateStyleListView::KateStyleListView( QWidget *parent, bool showUseDefaults ) viewport()->setPaletteBackgroundColor( bgcol ); } -void KateStyleListView::showPopupMenu( KateStyleListItem *i, const QPoint &globalPos, bool showtitle ) +void KateStyleListView::showPopupMenu( KateStyleListItem *i, const TQPoint &globalPos, bool showtitle ) { if ( !dynamic_cast<KateStyleListItem*>(i) ) return; @@ -1083,32 +1083,32 @@ void KateStyleListView::showPopupMenu( KateStyleListItem *i, const QPoint &globa int id; // the title is used, because the menu obscures the context name when // displayed on behalf of spacePressed(). - QPixmap cl(16,16); + TQPixmap cl(16,16); cl.fill( i->style()->textColor() ); - QPixmap scl(16,16); + TQPixmap scl(16,16); scl.fill( i->style()->selectedTextColor() ); - QPixmap bgcl(16,16); + TQPixmap bgcl(16,16); bgcl.fill( i->style()->itemSet(KateAttribute::BGColor) ? i->style()->bgColor() : viewport()->colorGroup().base() ); - QPixmap sbgcl(16,16); + TQPixmap sbgcl(16,16); sbgcl.fill( i->style()->itemSet(KateAttribute::SelectedBGColor) ? i->style()->selectedBGColor() : viewport()->colorGroup().base() ); if ( showtitle ) m.insertTitle( i->contextName(), KateStyleListItem::ContextName ); - id = m.insertItem( i18n("&Bold"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Bold ); + id = m.insertItem( i18n("&Bold"), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Bold ); m.setItemChecked( id, is->bold() ); - id = m.insertItem( i18n("&Italic"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Italic ); + id = m.insertItem( i18n("&Italic"), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Italic ); m.setItemChecked( id, is->italic() ); - id = m.insertItem( i18n("&Underline"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Underline ); + id = m.insertItem( i18n("&Underline"), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Underline ); m.setItemChecked( id, is->underline() ); - id = m.insertItem( i18n("S&trikeout"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Strikeout ); + id = m.insertItem( i18n("S&trikeout"), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Strikeout ); m.setItemChecked( id, is->strikeOut() ); m.insertSeparator(); - m.insertItem( QIconSet(cl), i18n("Normal &Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Color ); - m.insertItem( QIconSet(scl), i18n("&Selected Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::SelColor ); - m.insertItem( QIconSet(bgcl), i18n("&Background Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::BgColor ); - m.insertItem( QIconSet(sbgcl), i18n("S&elected Background Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::SelBgColor ); + m.insertItem( TQIconSet(cl), i18n("Normal &Color..."), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Color ); + m.insertItem( TQIconSet(scl), i18n("&Selected Color..."), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::SelColor ); + m.insertItem( TQIconSet(bgcl), i18n("&Background Color..."), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::BgColor ); + m.insertItem( TQIconSet(sbgcl), i18n("S&elected Background Color..."), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::SelBgColor ); // Unset [some] colors. I could show one only if that button was clicked, but that // would disable setting this with the keyboard (how many aren't doing just @@ -1119,20 +1119,20 @@ void KateStyleListView::showPopupMenu( KateStyleListItem *i, const QPoint &globa { m.insertSeparator(); if ( style->itemSet( KateAttribute::BGColor) ) - m.insertItem( i18n("Unset Background Color"), this, SLOT(unsetColor(int)), 0, 100 ); + m.insertItem( i18n("Unset Background Color"), this, TQT_SLOT(unsetColor(int)), 0, 100 ); if ( style->itemSet( KateAttribute::SelectedBGColor ) ) - m.insertItem( i18n("Unset Selected Background Color"), this, SLOT(unsetColor(int)), 0, 101 ); + m.insertItem( i18n("Unset Selected Background Color"), this, TQT_SLOT(unsetColor(int)), 0, 101 ); } if ( ! i->isDefault() && ! i->defStyle() ) { m.insertSeparator(); - id = m.insertItem( i18n("Use &Default Style"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::UseDefStyle ); + id = m.insertItem( i18n("Use &Default Style"), this, TQT_SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::UseDefStyle ); m.setItemChecked( id, i->defStyle() ); } m.exec( globalPos ); } -void KateStyleListView::showPopupMenu( QListViewItem *i, const QPoint &pos ) +void KateStyleListView::showPopupMenu( TQListViewItem *i, const TQPoint &pos ) { if ( dynamic_cast<KateStyleListItem*>(i) ) showPopupMenu( (KateStyleListItem*)i, pos, true ); @@ -1149,14 +1149,14 @@ void KateStyleListView::unsetColor( int c ) emitChanged(); } -// Because QListViewItem::activatePos() is going to become deprecated, +// Because TQListViewItem::activatePos() is going to become deprecated, // and also because this attempt offers more control, I connect mousePressed to this. -void KateStyleListView::slotMousePressed(int btn, QListViewItem* i, const QPoint& pos, int c) +void KateStyleListView::slotMousePressed(int btn, TQListViewItem* i, const TQPoint& pos, int c) { if ( dynamic_cast<KateStyleListItem*>(i) ) { if ( btn == Qt::LeftButton && c > 0 ) { // map pos to item/column and call KateStyleListItem::activate(col, pos) - ((KateStyleListItem*)i)->activate( c, viewport()->mapFromGlobal( pos ) - QPoint( 0, itemRect(i).top() ) ); + ((KateStyleListItem*)i)->activate( c, viewport()->mapFromGlobal( pos ) - TQPoint( 0, itemRect(i).top() ) ); } } } @@ -1167,18 +1167,18 @@ void KateStyleListView::slotMousePressed(int btn, QListViewItem* i, const QPoint static const int BoxSize = 16; static const int ColorBtnWidth = 32; -KateStyleListItem::KateStyleListItem( QListViewItem *parent, const QString & stylename, +KateStyleListItem::KateStyleListItem( TQListViewItem *parent, const TQString & stylename, KateAttribute *style, KateHlItemData *data ) - : QListViewItem( parent, stylename ), + : TQListViewItem( parent, stylename ), ds( style ), st( data ) { initStyle(); } -KateStyleListItem::KateStyleListItem( QListView *parent, const QString & stylename, +KateStyleListItem::KateStyleListItem( TQListView *parent, const TQString & stylename, KateAttribute *style, KateHlItemData *data ) - : QListViewItem( parent, stylename ), + : TQListViewItem( parent, stylename ), ds( style ), st( data ) { @@ -1275,14 +1275,14 @@ bool KateStyleListItem::defStyle() { return st && st->itemsSet() != ds->itemsSet /* true for default styles */ bool KateStyleListItem::isDefault() { return st ? false : true; } -int KateStyleListItem::width( const QFontMetrics & /*fm*/, const QListView * lv, int col ) const +int KateStyleListItem::width( const TQFontMetrics & /*fm*/, const TQListView * lv, int col ) const { int m = lv->itemMargin() * 2; switch ( col ) { case ContextName: // FIXME: width for name column should reflect bold/italic // (relevant for non-fixed fonts only - nessecary?) - return QListViewItem::width( QFontMetrics( ((KateStyleListView*)lv)->docfont), lv, col); + return TQListViewItem::width( TQFontMetrics( ((KateStyleListView*)lv)->docfont), lv, col); case Bold: case Italic: case UseDefStyle: @@ -1297,9 +1297,9 @@ int KateStyleListItem::width( const QFontMetrics & /*fm*/, const QListView * lv, } } -void KateStyleListItem::activate( int column, const QPoint &localPos ) +void KateStyleListItem::activate( int column, const TQPoint &localPos ) { - QListView *lv = listView(); + TQListView *lv = listView(); int x = 0; for( int c = 0; c < column-1; c++ ) x += lv->columnWidth( c ); @@ -1321,7 +1321,7 @@ void KateStyleListItem::activate( int column, const QPoint &localPos ) default: return; } - if ( !QRect( x, 0, w, BoxSize ).contains( localPos ) ) + if ( !TQRect( x, 0, w, BoxSize ).contains( localPos ) ) changeProperty( (Property)column ); } @@ -1363,8 +1363,8 @@ void KateStyleListItem::toggleDefStyle() void KateStyleListItem::setColor( int column ) { - QColor c; // use this - QColor d; // default color + TQColor c; // use this + TQColor d; // default color if ( column == Color) { c = is->textColor(); @@ -1386,7 +1386,7 @@ void KateStyleListItem::setColor( int column ) d = ds->selectedBGColor(); } - if ( KColorDialog::getColor( c, d, listView() ) != QDialog::Accepted) return; + if ( KColorDialog::getColor( c, d, listView() ) != TQDialog::Accepted) return; bool def = ! c.isValid(); @@ -1453,49 +1453,49 @@ void KateStyleListItem::unsetColor( int c ) updateStyle(); } -void KateStyleListItem::paintCell( QPainter *p, const QColorGroup& /*cg*/, int col, int width, int align ) +void KateStyleListItem::paintCell( TQPainter *p, const TQColorGroup& /*cg*/, int col, int width, int align ) { if ( !p ) return; - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv ) return; Q_ASSERT( lv ); //### // use a private color group and set the text/highlighted text colors - QColorGroup mcg = lv->viewport()->colorGroup(); + TQColorGroup mcg = lv->viewport()->colorGroup(); if ( col ) // col 0 is drawn by the superclass method - p->fillRect( 0, 0, width, height(), QBrush( mcg.base() ) ); + p->fillRect( 0, 0, width, height(), TQBrush( mcg.base() ) ); int marg = lv->itemMargin(); - QColor c; + TQColor c; switch ( col ) { case ContextName: { - mcg.setColor(QColorGroup::Text, is->textColor()); - mcg.setColor(QColorGroup::HighlightedText, is->selectedTextColor()); + mcg.setColor(TQColorGroup::Text, is->textColor()); + mcg.setColor(TQColorGroup::HighlightedText, is->selectedTextColor()); // text background color c = is->bgColor(); if ( c.isValid() && is->itemSet(KateAttribute::BGColor) ) - mcg.setColor( QColorGroup::Base, c ); + mcg.setColor( TQColorGroup::Base, c ); if ( isSelected() && is->itemSet(KateAttribute::SelectedBGColor) ) { c = is->selectedBGColor(); if ( c.isValid() ) - mcg.setColor( QColorGroup::Highlight, c ); + mcg.setColor( TQColorGroup::Highlight, c ); } - QFont f ( ((KateStyleListView*)lv)->docfont ); + TQFont f ( ((KateStyleListView*)lv)->docfont ); p->setFont( is->font(f) ); // FIXME - repainting when text is cropped, and the column is enlarged is buggy. // Maybe I need painting the string myself :( // (wilbert) it depends on the font used - QListViewItem::paintCell( p, mcg, col, width, align ); + TQListViewItem::paintCell( p, mcg, col, width, align ); } break; case Bold: @@ -1510,9 +1510,9 @@ void KateStyleListItem::paintCell( QPainter *p, const QColorGroup& /*cg*/, int c int y = (height() - BoxSize) / 2; if ( isEnabled() ) - p->setPen( QPen( mcg.text(), 2 ) ); + p->setPen( TQPen( mcg.text(), 2 ) ); else - p->setPen( QPen( lv->palette().color( QPalette::Disabled, QColorGroup::Text ), 2 ) ); + p->setPen( TQPen( lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ), 2 ) ); p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); x++; @@ -1523,7 +1523,7 @@ void KateStyleListItem::paintCell( QPainter *p, const QColorGroup& /*cg*/, int c (col == Strikeout && is->strikeOut()) || (col == UseDefStyle && *is == *ds ) ) { - QPointArray a( 7*2 ); + TQPointArray a( 7*2 ); int i, xx, yy; xx = x+1+marg; yy = y+5; @@ -1573,12 +1573,12 @@ void KateStyleListItem::paintCell( QPainter *p, const QColorGroup& /*cg*/, int c int x = 0; int y = (height() - BoxSize) / 2; if ( isEnabled() ) - p->setPen( QPen( mcg.text(), 2 ) ); + p->setPen( TQPen( mcg.text(), 2 ) ); else - p->setPen( QPen( lv->palette().color( QPalette::Disabled, QColorGroup::Text ), 2 ) ); + p->setPen( TQPen( lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ), 2 ) ); p->drawRect( x+marg, y+2, ColorBtnWidth-4, BoxSize-4 ); - p->fillRect( x+marg+1,y+3,ColorBtnWidth-7,BoxSize-7,QBrush( c ) ); + p->fillRect( x+marg+1,y+3,ColorBtnWidth-7,BoxSize-7,TQBrush( c ) ); // if this item is unset, draw a diagonal line over the button if ( ! set ) p->drawLine( x+marg-1, BoxSize-3, ColorBtnWidth-4, y+1 ); @@ -1589,22 +1589,22 @@ void KateStyleListItem::paintCell( QPainter *p, const QColorGroup& /*cg*/, int c //END //BEGIN KateStyleListCaption -KateStyleListCaption::KateStyleListCaption( QListView *parent, const QString & name ) - : QListViewItem( parent, name ) +KateStyleListCaption::KateStyleListCaption( TQListView *parent, const TQString & name ) + : TQListViewItem( parent, name ) { } -void KateStyleListCaption::paintCell( QPainter *p, const QColorGroup& /*cg*/, int col, int width, int align ) +void KateStyleListCaption::paintCell( TQPainter *p, const TQColorGroup& /*cg*/, int col, int width, int align ) { - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv ) return; Q_ASSERT( lv ); //### // use the same colorgroup as the other items in the viewport - QColorGroup mcg = lv->viewport()->colorGroup(); + TQColorGroup mcg = lv->viewport()->colorGroup(); - QListViewItem::paintCell( p, mcg, col, width, align ); + TQListViewItem::paintCell( p, mcg, col, width, align ); } //END |