From eba47f8f0637f451e21348187591e1f1fd58ac74 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 2 Aug 2010 19:23:46 +0000 Subject: TQt conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcoloredit/color.cpp | 6 +- kcoloredit/color.h | 8 +-- kcoloredit/colorselector.cpp | 70 ++++++++++----------- kcoloredit/colorselector.h | 16 ++--- kcoloredit/gradientselection.cpp | 52 ++++++++-------- kcoloredit/gradientselection.h | 18 +++--- kcoloredit/imageselection.cpp | 2 +- kcoloredit/imageselection.h | 6 +- kcoloredit/kcolorchooser.cpp | 4 +- kcoloredit/kcoloredit.cpp | 64 +++++++++---------- kcoloredit/kcoloredit.h | 6 +- kcoloredit/kcoloreditdoc.cpp | 42 ++++++------- kcoloredit/kcoloreditdoc.h | 32 +++++----- kcoloredit/kcoloreditview.cpp | 110 ++++++++++++++++----------------- kcoloredit/kcoloreditview.h | 36 +++++------ kcoloredit/kxycolorselector.cpp | 36 +++++------ kcoloredit/kxycolorselector.h | 18 +++--- kcoloredit/kzcolorselector.cpp | 30 ++++----- kcoloredit/kzcolorselector.h | 20 +++--- kcoloredit/loadpalettedlg.cpp | 42 ++++++------- kcoloredit/loadpalettedlg.h | 14 ++--- kcoloredit/main.h | 10 +-- kcoloredit/palette.cpp | 62 +++++++++---------- kcoloredit/palette.h | 28 ++++----- kcoloredit/paletteview.cpp | 24 +++---- kcoloredit/paletteview.h | 12 ++-- kcoloredit/paletteviewscrolledarea.cpp | 74 +++++++++++----------- kcoloredit/paletteviewscrolledarea.h | 34 +++++----- kcoloredit/texteditselection.cpp | 80 ++++++++++++------------ kcoloredit/texteditselection.h | 18 +++--- kcoloredit/textselection.cpp | 2 +- 31 files changed, 488 insertions(+), 488 deletions(-) (limited to 'kcoloredit') diff --git a/kcoloredit/color.cpp b/kcoloredit/color.cpp index db18a5a5..eb06444b 100644 --- a/kcoloredit/color.cpp +++ b/kcoloredit/color.cpp @@ -21,7 +21,7 @@ Color::Color(){ setComponents(0, 0, 0); setName(""); } -Color::Color(const int red, const int green, const int blue, const QString& name) { +Color::Color(const int red, const int green, const int blue, const TQString& name) { setComponents(red, green, blue); setName(name); } @@ -38,7 +38,7 @@ void Color::setComponents(const int red, const int green, const int blue) { setComponent(BLUE_INDEX, blue); } -void Color::setName(const QString& name) { +void Color::setName(const TQString& name) { m_name = name; } @@ -50,7 +50,7 @@ const int* Color::components() const{ return m_components; } -const QString& Color::name() const { +const TQString& Color::name() const { return m_name; } diff --git a/kcoloredit/color.h b/kcoloredit/color.h index 723ba2f0..e20bc1de 100644 --- a/kcoloredit/color.h +++ b/kcoloredit/color.h @@ -39,7 +39,7 @@ class Color { Color(); /** constructs a color with given components and a name */ - Color(const int red, const int green, const int blue, const QString& name); + Color(const int red, const int green, const int blue, const TQString& name); ~Color(); /** sets a component */ @@ -49,7 +49,7 @@ class Color { void setComponents(const int red, const int green, const int blue); /** sets a name */ - void setName(const QString& name); + void setName(const TQString& name); /** @return a component */ int component(const int index) const; @@ -58,7 +58,7 @@ class Color { const int* components() const; /** @return a color name */ - const QString& name() const; + const TQString& name() const; /** @return if is equal to color */ bool equals(const Color& color); @@ -75,7 +75,7 @@ class Color { int m_components[COMPONENTS_NUM]; /** a color name */ - QString m_name; + TQString m_name; }; #endif diff --git a/kcoloredit/colorselector.cpp b/kcoloredit/colorselector.cpp index 2b0530d3..50288313 100644 --- a/kcoloredit/colorselector.cpp +++ b/kcoloredit/colorselector.cpp @@ -17,11 +17,11 @@ #include -#include -/* #include */ -#include -#include -#include +#include +/* #include */ +#include +#include +#include #include #include @@ -30,59 +30,59 @@ #include "texteditselection.h" #include "colorselector.h" -ColorSelector::ColorSelector(QWidget *parent, const char *name ) : QWidget(parent, name) { +ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(parent, name) { fComponentsMode = false; - QVBoxLayout* topLayout = new QVBoxLayout(this, 4); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, 4); /* - QTabWidget* pages = new QTabWidget(this); + TQTabWidget* pages = new TQTabWidget(this); */ gradientSelection = new GradientSelection(this); - connect(gradientSelection, SIGNAL( valueChanged(Color*) ), - SLOT( slotGradientSelectionChangeColor(Color*) )); - connect(gradientSelection, SIGNAL( synchronizeColor() ), - SLOT( slotGradientSelectionSynchronizeColor() )); - connect(this, SIGNAL( valueChanged(Color*) ), gradientSelection, SLOT( slotSetValue(Color*) )); + connect(gradientSelection, TQT_SIGNAL( valueChanged(Color*) ), + TQT_SLOT( slotGradientSelectionChangeColor(Color*) )); + connect(gradientSelection, TQT_SIGNAL( synchronizeColor() ), + TQT_SLOT( slotGradientSelectionSynchronizeColor() )); + connect(this, TQT_SIGNAL( valueChanged(Color*) ), gradientSelection, TQT_SLOT( slotSetValue(Color*) )); /* pages->addTab(gradientSelection, i18n( "Gradient" )); ImageSelection* imageSelection = new ImageSelection(this); - connect(imageSelection, SIGNAL( valueChanged(Color*) ), SLOT( slotSetColor(Color*) )); - connect(this, SIGNAL( valueChanged(Color*) ), imageSelection, SLOT( slotSetValue(Color*) )); + connect(imageSelection, TQT_SIGNAL( valueChanged(Color*) ), TQT_SLOT( slotSetColor(Color*) )); + connect(this, TQT_SIGNAL( valueChanged(Color*) ), imageSelection, TQT_SLOT( slotSetValue(Color*) )); pages->addTab(imageSelection, i18n( "Image" )); topLayout->addWidget(pages, 10); */ topLayout->addWidget(gradientSelection, 10); KSeparator* hLine = new KSeparator(KSeparator::HLine, this); topLayout->addWidget(hLine); - QHBoxLayout* layout = new QHBoxLayout(); + TQHBoxLayout* layout = new TQHBoxLayout(); TextEditSelection* textEditSelection = new TextEditSelection(this); - connect(textEditSelection, SIGNAL( valueChanged(Color*) ), SLOT( slotSetColor(Color*) )); - connect(this, SIGNAL( valueChanged(Color*) ), textEditSelection, SLOT( slotSetValue(Color*) )); - QVBoxLayout* colorChangeLayout = new QVBoxLayout(); + connect(textEditSelection, TQT_SIGNAL( valueChanged(Color*) ), TQT_SLOT( slotSetColor(Color*) )); + connect(this, TQT_SIGNAL( valueChanged(Color*) ), textEditSelection, TQT_SLOT( slotSetValue(Color*) )); + TQVBoxLayout* colorChangeLayout = new TQVBoxLayout(); colorChangeLayout->setMargin(2); - QRadioButton* replaceButton = new QRadioButton(i18n( "Replace" ), this); - connect(replaceButton, SIGNAL( clicked() ), SLOT( slotColorReplace() )); + TQRadioButton* replaceButton = new TQRadioButton(i18n( "Replace" ), this); + connect(replaceButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotColorReplace() )); replaceButton->setChecked(true); colorChangeButtons.insert(replaceButton); colorChangeLayout->addWidget(replaceButton); - QRadioButton* changeButton = new QRadioButton(i18n( "Change" ) + ":", this); - connect(changeButton, SIGNAL( clicked() ), SLOT( slotColorChange() )); + TQRadioButton* changeButton = new TQRadioButton(i18n( "Change" ) + ":", this); + connect(changeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotColorChange() )); colorChangeButtons.insert(changeButton); colorChangeLayout->addWidget(changeButton); colorChangeValue = 0; - colorChangeSliderWidget = new QWidget(this); - QVBoxLayout* colorChangeSliderLayout = new QVBoxLayout(colorChangeSliderWidget, 1); + colorChangeSliderWidget = new TQWidget(this); + TQVBoxLayout* colorChangeSliderLayout = new TQVBoxLayout(colorChangeSliderWidget, 1); colorChangeSliderLayout->setMargin(0); - QSlider* colorChangeSlider = new QSlider(0, MAX_COLOR_CHANGE_VALUE, - MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, QSlider::Horizontal, colorChangeSliderWidget); + TQSlider* colorChangeSlider = new TQSlider(0, MAX_COLOR_CHANGE_VALUE, + MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, TQSlider::Horizontal, colorChangeSliderWidget); colorChangeSlider->setTickInterval(colorChangeSlider->pageStep()); - colorChangeSlider->setTickmarks(QSlider::Above); - connect(colorChangeSlider, SIGNAL( valueChanged(int) ), SLOT( slotColorChangeValueChanged(int) )); + colorChangeSlider->setTickmarks(TQSlider::Above); + connect(colorChangeSlider, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotColorChangeValueChanged(int) )); colorChangeSliderLayout->addWidget(colorChangeSlider); - QHBoxLayout* colorChangeSliderLabelsLayout = new QHBoxLayout(0); - QLabel* subtractLabel = new QLabel(i18n( "0" ), colorChangeSliderWidget); + TQHBoxLayout* colorChangeSliderLabelsLayout = new TQHBoxLayout(0); + TQLabel* subtractLabel = new TQLabel(i18n( "0" ), colorChangeSliderWidget); colorChangeSliderLabelsLayout->addWidget(subtractLabel); colorChangeSliderLabelsLayout->addStretch(10); - QLabel* addLabel = new QLabel(" " + i18n( "Replace" ), colorChangeSliderWidget); + TQLabel* addLabel = new TQLabel(" " + i18n( "Replace" ), colorChangeSliderWidget); colorChangeSliderLabelsLayout->addWidget(addLabel); colorChangeSliderLayout->addLayout(colorChangeSliderLabelsLayout); colorChangeLayout->addStretch(10); @@ -95,7 +95,7 @@ ColorSelector::ColorSelector(QWidget *parent, const char *name ) : QWidget(paren layout->addWidget(vLine); layout->addWidget(textEditSelection, 1); colorPatch = new KColorPatch(this); - connect(colorPatch, SIGNAL( colorChanged(const QColor&) ), SLOT( slotSetColor(const QColor&) )); + connect(colorPatch, TQT_SIGNAL( colorChanged(const TQColor&) ), TQT_SLOT( slotSetColor(const TQColor&) )); colorPatch->setMinimumSize(80, 64); layout->addWidget(colorPatch, 10); topLayout->addLayout(layout); @@ -105,7 +105,7 @@ ColorSelector::~ColorSelector() { void ColorSelector::slotSetColor(Color color) { m_color = color; - colorPatch->setColor(QColor( m_color.component(Color::RED_INDEX), + colorPatch->setColor(TQColor( m_color.component(Color::RED_INDEX), m_color.component(Color::GREEN_INDEX), m_color.component(Color::BLUE_INDEX) )); fComponentsMode = false; @@ -116,7 +116,7 @@ void ColorSelector::slotSetColor(Color* color) { slotSetColor(*color); } -void ColorSelector::slotSetColor(const QColor& color) { +void ColorSelector::slotSetColor(const TQColor& color) { m_color.setComponent(Color::RED_INDEX, color.red()); m_color.setComponent(Color::GREEN_INDEX, color.green()); m_color.setComponent(Color::BLUE_INDEX, color.blue()); diff --git a/kcoloredit/colorselector.h b/kcoloredit/colorselector.h index 21b5902b..72d62ef6 100644 --- a/kcoloredit/colorselector.h +++ b/kcoloredit/colorselector.h @@ -18,9 +18,9 @@ #ifndef COLORSELECTOR_H #define COLORSELECTOR_H -#include -#include -#include +#include +#include +#include #include #include "color.h" @@ -29,12 +29,12 @@ /** Color selector widget * @author Artur Rataj */ -class ColorSelector : public QWidget { +class ColorSelector : public TQWidget { Q_OBJECT public: /** constructs a color selector widget */ - ColorSelector(QWidget *parent=0, const char *name=0); + ColorSelector(TQWidget *parent=0, const char *name=0); ~ColorSelector(); /** @return the selected color */ const Color& color(); @@ -49,7 +49,7 @@ public slots: /** Called if a color changed */ void slotSetColor(Color* color); /** called if a color changed in the color patch */ - void slotSetColor(const QColor& color); + void slotSetColor(const TQColor& color); /** Called by the gradient selection, to replace or modify a color */ void slotGradientSelectionChangeColor(Color* gradientSelectionColor); /** Called by the gradient selection, to synchronize its color */ @@ -69,9 +69,9 @@ private: MAX_COLOR_CHANGE_VALUE = 16 }; /** A color change slider widget */ - QWidget* colorChangeSliderWidget; + TQWidget* colorChangeSliderWidget; /** Color change buttons button group widget */ - QButtonGroup colorChangeButtons; + TQButtonGroup colorChangeButtons; /** A color patch widget */ KColorPatch* colorPatch; /** A gradient selection widget */ diff --git a/kcoloredit/gradientselection.cpp b/kcoloredit/gradientselection.cpp index a8927c7d..f75547c1 100644 --- a/kcoloredit/gradientselection.cpp +++ b/kcoloredit/gradientselection.cpp @@ -15,39 +15,39 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include "main.h" #include "gradientselection.h" -GradientSelection::GradientSelection(QWidget *parent, const char *name ) : QWidget(parent,name) { - QGridLayout* topLayout = new QGridLayout(this, 2, 2, 0); - QHBoxLayout* layout = new QHBoxLayout(0); +GradientSelection::GradientSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { + TQGridLayout* topLayout = new TQGridLayout(this, 2, 2, 0); + TQHBoxLayout* layout = new TQHBoxLayout(0); layout->setMargin(3); xyColorSelector = new KXYColorSelector(this); - connect(xyColorSelector, SIGNAL( valueChanged(int, int) ), - SLOT( slotXyColorSelectorPosChanged(int, int) )); + connect(xyColorSelector, TQT_SIGNAL( valueChanged(int, int) ), + TQT_SLOT( slotXyColorSelectorPosChanged(int, int) )); layout->addWidget(xyColorSelector); topLayout->addLayout(layout, 0, 0); topLayout->setRowStretch(0, 10); topLayout->setRowStretch(1, 0); - QVBoxLayout* xyColorSelectorLayout = new QVBoxLayout(); - QHBoxLayout* checkBoxLayout = new QHBoxLayout(); + TQVBoxLayout* xyColorSelectorLayout = new TQVBoxLayout(); + TQHBoxLayout* checkBoxLayout = new TQHBoxLayout(); checkBoxLayout->setMargin(0); - variableCheckBox = new QCheckBox(i18n( "Variable" ), this); + variableCheckBox = new TQCheckBox(i18n( "Variable" ), this); variableGlobalComponent = false; - connect(variableCheckBox, SIGNAL( toggled(bool) ), SLOT( slotSetVariableGlobalComponent(bool) )); + connect(variableCheckBox, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotSetVariableGlobalComponent(bool) )); checkBoxLayout->addSpacing(2); checkBoxLayout->addWidget(variableCheckBox); xyColorSelectorLayout->addLayout(checkBoxLayout); xyColorSelectorLayout->addStretch(10); - QHBoxLayout* buttonsLayout = new QHBoxLayout(); - synchronizeColorButton = new QPushButton(i18n( "Synchronize" ), this); - connect(synchronizeColorButton, SIGNAL( clicked() ), SLOT( slotSynchronizeColor() )); + TQHBoxLayout* buttonsLayout = new TQHBoxLayout(); + synchronizeColorButton = new TQPushButton(i18n( "Synchronize" ), this); + connect(synchronizeColorButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotSynchronizeColor() )); buttonsLayout->addSpacing(2); buttonsLayout->addWidget(synchronizeColorButton); buttonsLayout->addStretch(10); @@ -55,19 +55,19 @@ GradientSelection::GradientSelection(QWidget *parent, const char *name ) : QWidg xyColorSelectorLayout->addSpacing(2); topLayout->addLayout(xyColorSelectorLayout, 1, 0); zColorSelector = new KZColorSelector(KZColorSelector::Vertical, this); - connect(zColorSelector, SIGNAL( valueChanged(int) ), - SLOT( slotZColorSelectorPosChanged(int) )); + connect(zColorSelector, TQT_SIGNAL( valueChanged(int) ), + TQT_SLOT( slotZColorSelectorPosChanged(int) )); zColorSelector->setFixedWidth(36); topLayout->addWidget(zColorSelector, 0, 1); - QVBoxLayout* zColorSelectorLayout = new QVBoxLayout(0); - connect(&hsvButtons, SIGNAL( clicked(int) ), SLOT( slotSetColorSelectionMode(int) )); - QRadioButton* hRadioButton = new QRadioButton("H", this); + TQVBoxLayout* zColorSelectorLayout = new TQVBoxLayout(0); + connect(&hsvButtons, TQT_SIGNAL( clicked(int) ), TQT_SLOT( slotSetColorSelectionMode(int) )); + TQRadioButton* hRadioButton = new TQRadioButton("H", this); hsvButtons.insert(hRadioButton, H_COMPONENT); zColorSelectorLayout->addWidget(hRadioButton); - QRadioButton* sRadioButton = new QRadioButton("S", this); + TQRadioButton* sRadioButton = new TQRadioButton("S", this); hsvButtons.insert(sRadioButton, S_COMPONENT); zColorSelectorLayout->addWidget(sRadioButton); - QRadioButton* vRadioButton = new QRadioButton("V", this); + TQRadioButton* vRadioButton = new TQRadioButton("V", this); hsvButtons.insert(vRadioButton, V_COMPONENT); vRadioButton->toggle(); zColorSelectorLayout->addWidget(vRadioButton); @@ -88,7 +88,7 @@ void GradientSelection::slotSetValue(Color* color) { int newHComponent; int newSComponent; int newVComponent; - QColor hsvColor(this->color.component(Color::RED_INDEX), + TQColor hsvColor(this->color.component(Color::RED_INDEX), this->color.component(Color::GREEN_INDEX), this->color.component(Color::BLUE_INDEX)); hsvColor.hsv(&newHComponent, &newSComponent, &newVComponent); @@ -210,7 +210,7 @@ void GradientSelection::slotXyColorSelectorPosChanged(int x, int y) { break; } - QColor rgbColor; + TQColor rgbColor; rgbColor.setHsv(hComponent, sComponent, vComponent); color.setComponents(rgbColor.red(), rgbColor.green(), rgbColor.blue()); updateZColorSelector(); @@ -233,7 +233,7 @@ void GradientSelection::slotZColorSelectorPosChanged(int y) { break; } - QColor rgbColor; + TQColor rgbColor; rgbColor.setHsv(hComponent, sComponent, vComponent); color.setComponents(rgbColor.red(), rgbColor.green(), rgbColor.blue()); updateXyColorSelector(false); diff --git a/kcoloredit/gradientselection.h b/kcoloredit/gradientselection.h index 24a3c5e1..0197f706 100644 --- a/kcoloredit/gradientselection.h +++ b/kcoloredit/gradientselection.h @@ -18,10 +18,10 @@ #ifndef GRADIENTSELECTION_H #define GRADIENTSELECTION_H -#include -#include -#include -#include +#include +#include +#include +#include #include "kxycolorselector.h" #include "kzcolorselector.h" @@ -30,12 +30,12 @@ /** A widget for selecting colors from gradients * @author Artur Rataj */ -class GradientSelection : public QWidget { +class GradientSelection : public TQWidget { Q_OBJECT public: /** Constructs the widget */ - GradientSelection(QWidget *parent=0, const char *name=0); + GradientSelection(TQWidget *parent=0, const char *name=0); ~GradientSelection(); /** Enables or disables the color synchronize button */ void enableSynchronizeColorButton(bool enable); @@ -62,11 +62,11 @@ protected: V_COMPONENT = KXYColorSelector::TYPE_HS }; /** Variable global component checkbox */ - QCheckBox* variableCheckBox; + TQCheckBox* variableCheckBox; /** Synchronize color button */ - QPushButton* synchronizeColorButton; + TQPushButton* synchronizeColorButton; /** HSV buttons button group widget */ - QButtonGroup hsvButtons; + TQButtonGroup hsvButtons; /** The two components selector */ KXYColorSelector* xyColorSelector; /** The gradient selector */ diff --git a/kcoloredit/imageselection.cpp b/kcoloredit/imageselection.cpp index 39a8f2f0..b6d47c47 100644 --- a/kcoloredit/imageselection.cpp +++ b/kcoloredit/imageselection.cpp @@ -17,7 +17,7 @@ #include "imageselection.h" -ImageSelection::ImageSelection(QWidget *parent, const char *name ) : QWidget(parent,name) { +ImageSelection::ImageSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { } ImageSelection::~ImageSelection(){ } diff --git a/kcoloredit/imageselection.h b/kcoloredit/imageselection.h index 3137fec7..dd6a9364 100644 --- a/kcoloredit/imageselection.h +++ b/kcoloredit/imageselection.h @@ -18,19 +18,19 @@ #ifndef IMAGESELECTION_H #define IMAGESELECTION_H -#include +#include #include "color.h" /** This is a widget for selecting colors from an image * @author Artur Rataj */ -class ImageSelection : public QWidget { +class ImageSelection : public TQWidget { Q_OBJECT public: /** constructs the widget */ - ImageSelection(QWidget *parent=0, const char *name=0); + ImageSelection(TQWidget *parent=0, const char *name=0); ~ImageSelection(); signals: diff --git a/kcoloredit/kcolorchooser.cpp b/kcoloredit/kcolorchooser.cpp index bf1204fb..cbd5292b 100644 --- a/kcoloredit/kcolorchooser.cpp +++ b/kcoloredit/kcolorchooser.cpp @@ -57,13 +57,13 @@ int main(int argc, char *argv[]) dlg.setColor(Qt::blue); // Just a color - app.connect(&dlg, SIGNAL(finished()), SLOT(quit())); + app.connect(&dlg, TQT_SIGNAL(finished()), TQT_SLOT(quit())); dlg.show(); app.exec(); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - const QColor c = dlg.color(); + const TQColor c = dlg.color(); if ( args->isSet("print") && c.isValid() ) { std::cout << c.name().utf8().data() << std::endl; } diff --git a/kcoloredit/kcoloredit.cpp b/kcoloredit/kcoloredit.cpp index a5582436..9b093722 100644 --- a/kcoloredit/kcoloredit.cpp +++ b/kcoloredit/kcoloredit.cpp @@ -16,9 +16,9 @@ ***************************************************************************/ // include files for QT -#include -#include -#include +#include +#include +#include // include files for KDE #include @@ -64,40 +64,40 @@ KColorEditApp::~KColorEditApp() { void KColorEditApp::initActions() { // File actiojns - KStdAction::openNew( this, SLOT( slotFileNew() ), actionCollection() ); - KStdAction::open( this, SLOT( slotFileOpen() ), actionCollection() ); - KStdAction::saveAs( this, SLOT( slotFileSaveAs() ), actionCollection() ); - KStdAction::close( this, SLOT( slotClose() ), actionCollection() ); - KStdAction::quit( this, SLOT( slotQuit() ), actionCollection() ); - m_actSave = KStdAction::save( this, SLOT( slotFileSave() ), + KStdAction::openNew( this, TQT_SLOT( slotFileNew() ), actionCollection() ); + KStdAction::open( this, TQT_SLOT( slotFileOpen() ), actionCollection() ); + KStdAction::saveAs( this, TQT_SLOT( slotFileSaveAs() ), actionCollection() ); + KStdAction::close( this, TQT_SLOT( slotClose() ), actionCollection() ); + KStdAction::quit( this, TQT_SLOT( slotQuit() ), actionCollection() ); + m_actSave = KStdAction::save( this, TQT_SLOT( slotFileSave() ), actionCollection() ); m_actRecent = KStdAction::openRecent( this, - SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() ); + TQT_SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() ); ( void ) new KAction( i18n("New &Window"), kapp->miniIcon(), KShortcut(), - this, SLOT( slotFileNewWindow() ), actionCollection(), + this, TQT_SLOT( slotFileNewWindow() ), actionCollection(), "file_new_window" ); // Edit actions - m_actCut = KStdAction::cut( this, SLOT( slotEditCut() ), + m_actCut = KStdAction::cut( this, TQT_SLOT( slotEditCut() ), actionCollection() ); - m_actCopy = KStdAction::copy( this, SLOT( slotEditCopy() ), + m_actCopy = KStdAction::copy( this, TQT_SLOT( slotEditCopy() ), actionCollection() ); - m_actPaste = KStdAction::paste( this, SLOT( slotEditPaste() ), + m_actPaste = KStdAction::paste( this, TQT_SLOT( slotEditPaste() ), actionCollection() ); m_actPaste->setEnabled( false ); // Color Menu m_actNames = new KToggleAction( i18n("Show &Color Names"), KShortcut(), this, - SLOT( slotViewColorNames() ), actionCollection(), + TQT_SLOT( slotViewColorNames() ), actionCollection(), "color_view_names" ); m_actNames->setCheckedState(i18n("Hide &Color Names")); m_actPalette = new KAction( i18n("From &Palette"), KShortcut(), this, - SLOT( slotColorFromPalette() ), actionCollection(), + TQT_SLOT( slotColorFromPalette() ), actionCollection(), "color_from_palette" ); ( void ) new KAction( i18n("From &Screen"), KShortcut(), this, - SLOT( slotColorFromScreen() ), actionCollection(), + TQT_SLOT( slotColorFromScreen() ), actionCollection(), "color_from_screen" ); } @@ -112,14 +112,14 @@ void KColorEditApp::initDocument() doc = new KColorEditDoc(this); doc->newDocument(); - connect( doc, SIGNAL( selectionChanged( int, int ) ), - SLOT( slotSelectionChanged( int, int ) ) ); - connect( doc, SIGNAL( clipboardChanged() ), - SLOT( slotClipboardChanged() ) ); - connect( doc, SIGNAL( modified( bool ) ), - SLOT( slotModified( bool ) ) ); - connect( doc, SIGNAL( paletteAvailable( bool ) ), - SLOT( slotPaletteAvailable( bool ) ) ); + connect( doc, TQT_SIGNAL( selectionChanged( int, int ) ), + TQT_SLOT( slotSelectionChanged( int, int ) ) ); + connect( doc, TQT_SIGNAL( clipboardChanged() ), + TQT_SLOT( slotClipboardChanged() ) ); + connect( doc, TQT_SIGNAL( modified( bool ) ), + TQT_SLOT( slotModified( bool ) ) ); + connect( doc, TQT_SIGNAL( paletteAvailable( bool ) ), + TQT_SLOT( slotPaletteAvailable( bool ) ) ); } void KColorEditApp::initView() @@ -178,7 +178,7 @@ bool KColorEditApp::queryExit() } ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// void KColorEditApp::slotSelectionChanged( int begin, int end ) @@ -221,7 +221,7 @@ void KColorEditApp::slotFileOpen() { if(doc->saveModified()) { LoadPaletteDlg dialog(this); if(dialog.exec()) { - QString fileToOpen = dialog.getFileName(); + TQString fileToOpen = dialog.getFileName(); if(!fileToOpen.isEmpty()) { if(!doc->openDocument( fileToOpen )) { @@ -255,12 +255,12 @@ bool KColorEditApp::slotFileSaveAs() bool result = true; while(result) { - QString newName=KFileDialog::getSaveFileName(lastSavePaletteAsFileDir, + TQString newName=KFileDialog::getSaveFileName(lastSavePaletteAsFileDir, "*|" + i18n("All Files"), this, i18n("Save As")); if(newName.isEmpty()) result = false; else { - QFileInfo saveAsInfo(newName); + TQFileInfo saveAsInfo(newName); if(!saveAsInfo.exists() || KMessageBox::questionYesNo( this, i18n("A Document with this name already exists.\n" @@ -291,7 +291,7 @@ void KColorEditApp::slotClose() void KColorEditApp::slotFilePrint() { - QPrinter printer; + TQPrinter printer; if (printer.setup(this)) { view->print(&printer); @@ -348,12 +348,12 @@ void KColorEditApp::slotViewColorNames() doc->slotChangeViewMode(viewColorNames); } -void KColorEditApp::mouseReleaseEvent(QMouseEvent* event) { +void KColorEditApp::mouseReleaseEvent(TQMouseEvent* event) { if(gettingColorFromScreen) { gettingColorFromScreen = false; releaseMouse(); releaseKeyboard(); - QColor rgbColor = KColorDialog::grabColor(event->globalPos()); + TQColor rgbColor = KColorDialog::grabColor(event->globalPos()); color.setComponents(rgbColor.red(), rgbColor.green(), rgbColor.blue()); view->chooseColor(&color); } else diff --git a/kcoloredit/kcoloredit.h b/kcoloredit/kcoloredit.h index cd69cdaf..e30fff18 100644 --- a/kcoloredit/kcoloredit.h +++ b/kcoloredit/kcoloredit.h @@ -22,8 +22,8 @@ #include // include files for Qt -#include -#include +#include +#include // include files for KDE #include @@ -109,7 +109,7 @@ class KColorEditApp : public KMainWindow */ virtual bool queryExit(); - void mouseReleaseEvent(QMouseEvent* event); + void mouseReleaseEvent(TQMouseEvent* event); public slots: diff --git a/kcoloredit/kcoloreditdoc.cpp b/kcoloredit/kcoloreditdoc.cpp index 536300a5..ea9a0433 100644 --- a/kcoloredit/kcoloreditdoc.cpp +++ b/kcoloredit/kcoloreditdoc.cpp @@ -16,10 +16,10 @@ ***************************************************************************/ // include files for Qt -#include -#include -#include -#include +#include +#include +#include +#include // include files for KDE #include @@ -31,9 +31,9 @@ #include "kcoloreditview.h" #include "resource.h" -KColorEditDoc::KColorEditDoc(QWidget *parent, const char *name) : QObject(parent, name), +KColorEditDoc::KColorEditDoc(TQWidget *parent, const char *name) : TQObject(parent, name), m_palette(), m_paletteHistory(&m_palette, 0) { - m_pViewList = new QPtrList(); + m_pViewList = new TQPtrList(); m_pViewList->setAutoDelete(true); } @@ -57,22 +57,22 @@ void KColorEditDoc::setModified(bool b) { emit modified( b ); } -void KColorEditDoc::setAbsFilePath(const QString &filename) +void KColorEditDoc::setAbsFilePath(const TQString &filename) { m_absFilePath=filename; } -const QString &KColorEditDoc::absFilePath() const +const TQString &KColorEditDoc::absFilePath() const { return m_absFilePath; } -void KColorEditDoc::setTitle(const QString &_t) +void KColorEditDoc::setTitle(const TQString &_t) { m_title=_t; } -const QString &KColorEditDoc::title() const +const TQString &KColorEditDoc::title() const { return m_title; } @@ -109,7 +109,7 @@ bool KColorEditDoc::saveModified() KColorEditApp *window=(KColorEditApp *) parent(); int want_save = KMessageBox::warningYesNoCancel(window, i18n("The current file has been modified.\n" - "Do you want to save it?"), QString::null, KStdGuiItem::save(), i18n("Do Not Save")); + "Do you want to save it?"), TQString::null, KStdGuiItem::save(), i18n("Do Not Save")); switch(want_save) { case KMessageBox::Yes: @@ -151,7 +151,7 @@ bool KColorEditDoc::newDocument() { deleteContents(); setModified(false); - setAbsFilePath( QDir::homeDirPath() ); + setAbsFilePath( TQDir::homeDirPath() ); setTitle( i18n("Untitled") ); setPaletteCursorPos(0); setPaletteSelection(0, 0); @@ -159,12 +159,12 @@ bool KColorEditDoc::newDocument() return true; } -bool KColorEditDoc::openDocument(const QString& filename) { +bool KColorEditDoc::openDocument(const TQString& filename) { if(filename.isEmpty()) return newDocument(); else { deleteContents(); - QFileInfo fileInfo(filename); + TQFileInfo fileInfo(filename); setAbsFilePath( fileInfo.absFilePath() ); if(!m_palette.load( absFilePath() )) { setErrorString(m_palette.errorString()); @@ -181,7 +181,7 @@ bool KColorEditDoc::openDocument(const QString& filename) { return true; } -bool KColorEditDoc::saveDocument(const QString& filename) { +bool KColorEditDoc::saveDocument(const TQString& filename) { if(!m_palette.save( filename )) { setErrorString(m_palette.errorString()); return false; @@ -194,11 +194,11 @@ void KColorEditDoc::deleteContents() { m_palette.deleteContents(); } -void KColorEditDoc::setErrorString(const QString& string) { +void KColorEditDoc::setErrorString(const TQString& string) { m_errorString = string; } -const QString& KColorEditDoc::errorString() const { +const TQString& KColorEditDoc::errorString() const { return m_errorString; } @@ -232,8 +232,8 @@ int KColorEditDoc::paletteSelectionEnd() const { } void KColorEditDoc::copyToClipboard(Palette& palette) { - QString text; - QTextOStream stream(&text); + TQString text; + TQTextOStream stream(&text); palette.save(stream, 0, false); KApplication::clipboard()->setText(text); @@ -258,8 +258,8 @@ void KColorEditDoc::cut() { void KColorEditDoc::paste() { Palette palettePaste; - QString text; - QTextIStream stream(&text); + TQString text; + TQTextIStream stream(&text); text = KApplication::clipboard()->text(); if(palettePaste.load( stream, false )) { m_paletteHistory.paste(paletteCursorPos(), palettePaste); diff --git a/kcoloredit/kcoloreditdoc.h b/kcoloredit/kcoloreditdoc.h index 1d209f46..03d5ce70 100644 --- a/kcoloredit/kcoloreditdoc.h +++ b/kcoloredit/kcoloreditdoc.h @@ -23,9 +23,9 @@ #endif // include files for QT -#include -#include -#include +#include +#include +#include // application specific includes #include "palette.h" @@ -50,7 +50,7 @@ class KColorEditDoc : public QObject public: /** Constructor for the fileclass of the application */ - KColorEditDoc(QWidget *parent, const char *name=0); + KColorEditDoc(TQWidget *parent, const char *name=0); /** Destructor for the fileclass of the application */ ~KColorEditDoc(); @@ -71,19 +71,19 @@ class KColorEditDoc : public QObject /** closes the actual document */ void closeDocument(); /** loads the document */ - bool openDocument(const QString& filename); + bool openDocument(const TQString& filename); /** saves the document */ - bool saveDocument(const QString& filename); + bool saveDocument(const TQString& filename); /** sets the path to the file connected with the document */ - void setAbsFilePath(const QString &filename); + void setAbsFilePath(const TQString &filename); /** returns the pathname of the current document file*/ - const QString& absFilePath() const; + const TQString& absFilePath() const; /** sets the filename of the document */ - void setTitle(const QString &_t); + void setTitle(const TQString &_t); /** returns the title of the document */ - const QString& title() const; + const TQString& title() const; /** @return a description of a possible unsuccessfull IO operation */ - const QString& errorString() const; + const TQString& errorString() const; /** returns a pointer to paletteHistory */ PaletteHistory* paletteHistory(); /** sets a palette cursor position */ @@ -115,7 +115,7 @@ class KColorEditDoc : public QObject protected: /** Sets an error string if an IO operation was unsuccesfull */ - void setErrorString(const QString& string); + void setErrorString(const TQString& string); /** Copies a palette to clipboard */ void copyToClipboard(Palette& palette); @@ -136,14 +136,14 @@ class KColorEditDoc : public QObject public: /** the list of the views currently connected to the document */ - QPtrList *m_pViewList; + TQPtrList *m_pViewList; private: /** the modified flag of the current document */ bool m_modified; - QString m_title; - QString m_absFilePath; - QString m_errorString; + TQString m_title; + TQString m_absFilePath; + TQString m_errorString; protected: Palette m_palette; diff --git a/kcoloredit/kcoloreditview.cpp b/kcoloredit/kcoloreditview.cpp index fe22f136..10484fe8 100644 --- a/kcoloredit/kcoloreditview.cpp +++ b/kcoloredit/kcoloreditview.cpp @@ -16,13 +16,13 @@ ***************************************************************************/ // include files for Qt -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // include files for KDE #include @@ -35,28 +35,28 @@ #include "kcoloredit.h" #include "palette.h" -KColorEditView::KColorEditView(QWidget *parent, const char *name) : QSplitter(parent, name) { +KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter(parent, name) { colorSelector = new ColorSelector(this); colorSelector->slotSetColor( Color( RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, "" )); - QWidget* paletteViewArea = new QWidget(this); - QVBoxLayout* paletteLayout = new QVBoxLayout(paletteViewArea); + TQWidget* paletteViewArea = new TQWidget(this); + TQVBoxLayout* paletteLayout = new TQVBoxLayout(paletteViewArea); paletteView = new PaletteView(16, 16, 2, this, paletteViewArea); paletteLayout->addWidget(paletteView, 10); - QHBoxLayout* layout = new QHBoxLayout(); - QVBoxLayout* addColorLayout = new QVBoxLayout(4); + TQHBoxLayout* layout = new TQHBoxLayout(); + TQVBoxLayout* addColorLayout = new TQVBoxLayout(4); addColorLayout->setMargin(8); - QHBoxLayout* buttonsLayout = new QHBoxLayout(4); - QPushButton* addColorButton = new QPushButton(i18n( "Add Color" ), paletteViewArea); - connect(addColorButton, SIGNAL( clicked() ), SLOT( slotAddColor() )); + TQHBoxLayout* buttonsLayout = new TQHBoxLayout(4); + TQPushButton* addColorButton = new TQPushButton(i18n( "Add Color" ), paletteViewArea); + connect(addColorButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotAddColor() )); buttonsLayout->addWidget(addColorButton); buttonsLayout->addStretch(10); addColorLayout->addLayout(buttonsLayout); - QCheckBox* atCursorCheckBox = new QCheckBox(i18n( "At cursor" ), paletteViewArea); - connect(atCursorCheckBox, SIGNAL( toggled(bool) ), SLOT( slotAddColorAtCursor(bool) )); + TQCheckBox* atCursorCheckBox = new TQCheckBox(i18n( "At cursor" ), paletteViewArea); + connect(atCursorCheckBox, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotAddColorAtCursor(bool) )); addColorLayout->addWidget(atCursorCheckBox); - overwriteCheckBox = new QCheckBox(i18n( "Overwrite" ), paletteViewArea); - connect(overwriteCheckBox, SIGNAL( toggled(bool) ), SLOT( slotAddColorOverwrite(bool) )); + overwriteCheckBox = new TQCheckBox(i18n( "Overwrite" ), paletteViewArea); + connect(overwriteCheckBox, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotAddColorOverwrite(bool) )); slotAddColorAtCursor(false); slotAddColorOverwrite(false); addColorLayout->addWidget(overwriteCheckBox); @@ -64,66 +64,66 @@ KColorEditView::KColorEditView(QWidget *parent, const char *name) : QSplitter(pa //KSeparator* hLine = new KSeparator(KSeparator::HLine, paletteViewArea); //addColorLayout->addWidget(hLine); //addColorLayout->addStretch(10); - //QCheckBox* cursorFollowsChosenColor = new QCheckBox(i18n( "Cursor follows" ), paletteViewArea); + //TQCheckBox* cursorFollowsChosenColor = new TQCheckBox(i18n( "Cursor follows" ), paletteViewArea); //addColorLayout->addWidget(cursorFollowsChosenColor); - //connect(cursorFollowsChosenColor, SIGNAL( toggled(bool) ), - // paletteView, SLOT( slotCursorFollowsChosenColor(bool) )); + //connect(cursorFollowsChosenColor, TQT_SIGNAL( toggled(bool) ), + // paletteView, TQT_SLOT( slotCursorFollowsChosenColor(bool) )); //cursorFollowsChosenColor->toggle(); paletteView->slotCursorFollowsChosenColor(true); layout->addLayout(addColorLayout, 0); - QVGroupBox* colorAtCursorFrame = new QVGroupBox(i18n("Color at Cursor"), paletteViewArea); - QWidget* colorAtCursorFrameArea = new QWidget(colorAtCursorFrame); - QVBoxLayout* colorAtCursorLayout = new QVBoxLayout(colorAtCursorFrameArea, 4); - QHBoxLayout* colorNameLayout = new QHBoxLayout(0); - QLabel* nameLabel = new QLabel(i18n( "Name" ) + ": ", colorAtCursorFrameArea); + TQVGroupBox* colorAtCursorFrame = new TQVGroupBox(i18n("Color at Cursor"), paletteViewArea); + TQWidget* colorAtCursorFrameArea = new TQWidget(colorAtCursorFrame); + TQVBoxLayout* colorAtCursorLayout = new TQVBoxLayout(colorAtCursorFrameArea, 4); + TQHBoxLayout* colorNameLayout = new TQHBoxLayout(0); + TQLabel* nameLabel = new TQLabel(i18n( "Name" ) + ": ", colorAtCursorFrameArea); colorNameLayout->addWidget(nameLabel, 0); - colorName = new QLineEdit(colorAtCursorFrameArea); - connect(colorName, SIGNAL( textChanged(const QString&) ), SLOT( slotSetColorName(const QString&) )); + colorName = new TQLineEdit(colorAtCursorFrameArea); + connect(colorName, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotSetColorName(const TQString&) )); colorNameLayout->addWidget(colorName, 10); colorAtCursorLayout->addLayout(colorNameLayout); - QGridLayout* colorAtCursorComponentsLayout = new QGridLayout(3, 6, 4); + TQGridLayout* colorAtCursorComponentsLayout = new TQGridLayout(3, 6, 4); colorAtCursorLayout->addLayout(colorAtCursorComponentsLayout); colorAtCursorComponentsLayout->setColStretch(1, 10); colorAtCursorComponentsLayout->addColSpacing(2, 8); colorAtCursorComponentsLayout->setColStretch(4, 10); colorAtCursorComponentsLayout->setColStretch(5, 10); - QLabel* hLabel = new QLabel("H: ", colorAtCursorFrameArea); + TQLabel* hLabel = new TQLabel("H: ", colorAtCursorFrameArea); colorAtCursorComponentsLayout->addWidget(hLabel, 0, 0); - colorAtCursorHValueLabel = new QLabel("", colorAtCursorFrameArea); + colorAtCursorHValueLabel = new TQLabel("", colorAtCursorFrameArea); setColorAtCursorComponentValueLabelSizes(colorAtCursorHValueLabel); colorAtCursorComponentsLayout->addWidget(colorAtCursorHValueLabel, 0, 1); - QLabel* sLabel = new QLabel("S: ", colorAtCursorFrameArea); + TQLabel* sLabel = new TQLabel("S: ", colorAtCursorFrameArea); colorAtCursorComponentsLayout->addWidget(sLabel, 1, 0); - colorAtCursorSValueLabel = new QLabel("", colorAtCursorFrameArea); + colorAtCursorSValueLabel = new TQLabel("", colorAtCursorFrameArea); setColorAtCursorComponentValueLabelSizes(colorAtCursorSValueLabel); colorAtCursorComponentsLayout->addWidget(colorAtCursorSValueLabel, 1, 1); - QLabel* vLabel = new QLabel("V: ", colorAtCursorFrameArea); + TQLabel* vLabel = new TQLabel("V: ", colorAtCursorFrameArea); colorAtCursorComponentsLayout->addWidget(vLabel, 2, 0); - colorAtCursorVValueLabel = new QLabel("", colorAtCursorFrameArea); + colorAtCursorVValueLabel = new TQLabel("", colorAtCursorFrameArea); setColorAtCursorComponentValueLabelSizes(colorAtCursorVValueLabel); colorAtCursorComponentsLayout->addWidget(colorAtCursorVValueLabel, 2, 1); - QLabel* rLabel = new QLabel("R: ", colorAtCursorFrameArea); + TQLabel* rLabel = new TQLabel("R: ", colorAtCursorFrameArea); colorAtCursorComponentsLayout->addWidget(rLabel, 0, 3); - colorAtCursorRValueLabel = new QLabel("", colorAtCursorFrameArea); + colorAtCursorRValueLabel = new TQLabel("", colorAtCursorFrameArea); setColorAtCursorComponentValueLabelSizes(colorAtCursorRValueLabel); colorAtCursorComponentsLayout->addWidget(colorAtCursorRValueLabel, 0, 4); - QLabel* gLabel = new QLabel("G: ", colorAtCursorFrameArea); + TQLabel* gLabel = new TQLabel("G: ", colorAtCursorFrameArea); colorAtCursorComponentsLayout->addWidget(gLabel, 1, 3); - colorAtCursorGValueLabel = new QLabel("", colorAtCursorFrameArea); + colorAtCursorGValueLabel = new TQLabel("", colorAtCursorFrameArea); setColorAtCursorComponentValueLabelSizes(colorAtCursorGValueLabel); colorAtCursorComponentsLayout->addWidget(colorAtCursorGValueLabel, 1, 4); - QLabel* bLabel = new QLabel("B: ", colorAtCursorFrameArea); + TQLabel* bLabel = new TQLabel("B: ", colorAtCursorFrameArea); colorAtCursorComponentsLayout->addWidget(bLabel, 2, 3); - colorAtCursorBValueLabel = new QLabel("", colorAtCursorFrameArea); + colorAtCursorBValueLabel = new TQLabel("", colorAtCursorFrameArea); setColorAtCursorComponentValueLabelSizes(colorAtCursorBValueLabel); colorAtCursorComponentsLayout->addWidget(colorAtCursorBValueLabel, 2, 4); - QHBoxLayout* colorAtCursorRgbStringLayout = new QHBoxLayout(); - QLabel* colorAtCursorRgbStringLabel = - new QLabel("RGB " + i18n( "hex." ) + ": ", colorAtCursorFrameArea); + TQHBoxLayout* colorAtCursorRgbStringLayout = new TQHBoxLayout(); + TQLabel* colorAtCursorRgbStringLabel = + new TQLabel("RGB " + i18n( "hex." ) + ": ", colorAtCursorFrameArea); colorAtCursorRgbStringLayout->addWidget(colorAtCursorRgbStringLabel); - colorAtCursorRgbStringValueLabel = new QLabel("", colorAtCursorFrameArea); + colorAtCursorRgbStringValueLabel = new TQLabel("", colorAtCursorFrameArea); colorAtCursorRgbStringValueLabel->setFixedWidth( - colorAtCursorRgbStringValueLabel->fontMetrics().width( QString("8888888") )); + colorAtCursorRgbStringValueLabel->fontMetrics().width( TQString("8888888") )); colorAtCursorRgbStringLayout->addWidget(colorAtCursorRgbStringValueLabel); colorAtCursorRgbStringLayout->addStretch(); colorAtCursorLayout->addLayout(colorAtCursorRgbStringLayout); @@ -139,9 +139,9 @@ KColorEditView::KColorEditView(QWidget *parent, const char *name) : QSplitter(pa KColorEditView::~KColorEditView() { } -void KColorEditView::setColorAtCursorComponentValueLabelSizes(QLabel* const label) { - label->setMinimumWidth(label->fontMetrics().width( QString("888") )); - label->setMaximumWidth(label->fontMetrics().width( QString("88888") )); +void KColorEditView::setColorAtCursorComponentValueLabelSizes(TQLabel* const label) { + label->setMinimumWidth(label->fontMetrics().width( TQString("888") )); + label->setMaximumWidth(label->fontMetrics().width( TQString("88888") )); } KColorEditDoc *KColorEditView::document() const { @@ -150,8 +150,8 @@ KColorEditDoc *KColorEditView::document() const { return theApp->document(); } -void KColorEditView::print(QPrinter *pPrinter) { - QPainter printpainter; +void KColorEditView::print(TQPrinter *pPrinter) { + TQPainter printpainter; printpainter.begin(pPrinter); // TODO: add your printing code here @@ -167,7 +167,7 @@ void KColorEditView::slotCursorPosChanged(int position) { Palette* palette = document()->paletteHistory()->editableStream(); if(position < palette->length()) { Color* color = palette->color(position); - QString string; + TQString string; inColorNameChanging = true; colorName->setText(color->name()); colorName->setEnabled(true); @@ -178,7 +178,7 @@ void KColorEditView::slotCursorPosChanged(int position) { colorAtCursorRValueLabel->setText(string.setNum( rComponent )); colorAtCursorGValueLabel->setText(string.setNum( gComponent )); colorAtCursorBValueLabel->setText(string.setNum( bComponent )); - QColor hsvColor(rComponent, gComponent, bComponent); + TQColor hsvColor(rComponent, gComponent, bComponent); int hComponent; int sComponent; int vComponent; @@ -254,7 +254,7 @@ void KColorEditView::slotAddColorOverwrite(bool overwrite) { addColorMode = INSERT_COLOR; } -void KColorEditView::slotSetColorName(const QString& name) { +void KColorEditView::slotSetColorName(const TQString& name) { if(!inColorNameChanging) { /* Palette* palette = getDocument()->getPaletteHistory()->getEditableStream(); diff --git a/kcoloredit/kcoloreditview.h b/kcoloredit/kcoloreditview.h index ec0ca17f..0bc2a569 100644 --- a/kcoloredit/kcoloreditview.h +++ b/kcoloredit/kcoloreditview.h @@ -23,9 +23,9 @@ #endif // include files for Qt -#include -#include -#include +#include +#include +#include // application specific includes #include "colorselector.h" @@ -34,19 +34,19 @@ class KColorEditDoc; /** The KColorEditView class provides the view widget for the KColorEditApp instance. - * The View instance inherits QWidget as a base class and represents the view object of a KMainWindow. As KColorEditView is part of the + * The View instance inherits TQWidget as a base class and represents the view object of a KMainWindow. As KColorEditView is part of the * docuement-view model, it needs a reference to the document object connected with it by the KColorEditApp class to manipulate and display * the document structure provided by the KColorEditDoc class. * * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 0.4 code generation */ -class KColorEditView : public QSplitter { +class KColorEditView : public TQSplitter { Q_OBJECT public: /** Constructor for the main view */ - KColorEditView(QWidget *parent = 0, const char *name = 0); + KColorEditView(TQWidget *parent = 0, const char *name = 0); /** Destructor for the main view */ ~KColorEditView(); @@ -58,7 +58,7 @@ class KColorEditView : public QSplitter { KColorEditDoc *document() const; /** Contains the implementation for printing functionality */ - void print(QPrinter *pPrinter); + void print(TQPrinter *pPrinter); /** Chooses a color to the color selector */ void chooseColor(Color* const color); /** Updates the view after the document has been changed */ @@ -84,7 +84,7 @@ class KColorEditView : public QSplitter { /** Sets whether insert or replace a color */ void slotAddColorOverwrite(bool overwrite); /** Sets a color name */ - void slotSetColorName(const QString& name); + void slotSetColorName(const TQString& name); protected: /** Add color mode constants */ @@ -92,23 +92,23 @@ class KColorEditView : public QSplitter { REPLACE_COLOR = 1 }; /** Color mode widget */ - QCheckBox* overwriteCheckBox; + TQCheckBox* overwriteCheckBox; /** Color name widget */ - QLineEdit* colorName; + TQLineEdit* colorName; /** H component value label of the color at cursor */ - QLabel* colorAtCursorHValueLabel; + TQLabel* colorAtCursorHValueLabel; /** S component value label of the color at cursor */ - QLabel* colorAtCursorSValueLabel; + TQLabel* colorAtCursorSValueLabel; /** V component value label of the color at cursor */ - QLabel* colorAtCursorVValueLabel; + TQLabel* colorAtCursorVValueLabel; /** R component value label of the color at cursor */ - QLabel* colorAtCursorRValueLabel; + TQLabel* colorAtCursorRValueLabel; /** G component value label of the color at cursor */ - QLabel* colorAtCursorGValueLabel; + TQLabel* colorAtCursorGValueLabel; /** B component value label of the color at cursor */ - QLabel* colorAtCursorBValueLabel; + TQLabel* colorAtCursorBValueLabel; /** RGB Hex string value label of the color at cursor */ - QLabel* colorAtCursorRgbStringValueLabel; + TQLabel* colorAtCursorRgbStringValueLabel; /** If add a color at cursor */ bool addColorAtCursor; /** Add color mode */ @@ -120,7 +120,7 @@ class KColorEditView : public QSplitter { protected: /** Sets component value label of the color at cursor sizes */ - void setColorAtCursorComponentValueLabelSizes(QLabel* const label); + void setColorAtCursorComponentValueLabelSizes(TQLabel* const label); /** Updates color value labels */ void updateColorValueLabels(); }; diff --git a/kcoloredit/kxycolorselector.cpp b/kcoloredit/kxycolorselector.cpp index e12f7987..4a717c5e 100644 --- a/kcoloredit/kxycolorselector.cpp +++ b/kcoloredit/kxycolorselector.cpp @@ -15,15 +15,15 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include #include "kxycolorselector.h" -KXYColorSelector::KXYColorSelector(QWidget *parent, const char *name) : KXYSelector(parent,name) { +KXYColorSelector::KXYColorSelector(TQWidget *parent, const char *name) : KXYSelector(parent,name) { setBackgroundMode(NoBackground); setRange(0, 0, COMPONENT_SELECTION_RESOLUTION - 1, COMPONENT_SELECTION_RESOLUTION - 1); setType(TYPE_NONE); @@ -45,17 +45,17 @@ void KXYColorSelector::updateContents() { repaint(); } -void KXYColorSelector::resizeEvent(QResizeEvent*) { +void KXYColorSelector::resizeEvent(TQResizeEvent*) { setValues(xValue(), yValue()); updateContents(); } -void KXYColorSelector::drawContents(QPainter* painter) { +void KXYColorSelector::drawContents(TQPainter* painter) { painter->drawPixmap(contentsRect().x(), contentsRect().y(), pixmap); } -void KXYColorSelector::drawCursor(QPainter* painter, int x, int y) { - QColor color; +void KXYColorSelector::drawCursor(TQPainter* painter, int x, int y) { + TQColor color; int colorX = x - contentsRect().x(); int colorY = y - contentsRect().y(); if(colorX < 0) @@ -67,13 +67,13 @@ void KXYColorSelector::drawCursor(QPainter* painter, int x, int y) { if(colorY > contentsRect().height() - 1) colorY = contentsRect().height() - 1; setColor(&color, colorX, colorY); - QColor cursorColor; + TQColor cursorColor; if(( 2*color.red() + 4*color.green() + 1*color.blue() )*1.0/ ( 2*255 + 4*255 + 1*255 ) > 0.65) cursorColor = Qt::black; else cursorColor = Qt::white; - painter->setPen(QPen( cursorColor )); + painter->setPen(TQPen( cursorColor )); const int lineBegin = 2; const int lineEnd = 6; painter->drawLine(x + lineBegin, y - lineBegin, x + lineEnd, y - lineEnd); @@ -90,7 +90,7 @@ int KXYColorSelector::globalComponent() const{ return m_globalComponent; } -void KXYColorSelector::setColor(QColor* const color, const int x, const int y) { +void KXYColorSelector::setColor(TQColor* const color, const int x, const int y) { int xSize = contentsRect().width(); int ySize = contentsRect().height(); switch(type) { @@ -131,8 +131,8 @@ void KXYColorSelector::setColor(QColor* const color, const int x, const int y) { } } -QColor* KXYColorSelector::standardColorsPalette() { - QColor* palette = new QColor[STANDARD_PALETTE_SIZE]; +TQColor* KXYColorSelector::standardColorsPalette() { + TQColor* palette = new QColor[STANDARD_PALETTE_SIZE]; int i = 0; palette[i++] = Qt::red; palette[i++] = Qt::green; @@ -154,11 +154,11 @@ QColor* KXYColorSelector::standardColorsPalette() { return palette; } -void KXYColorSelector::drawPalette(QPixmap* pixmap) { +void KXYColorSelector::drawPalette(TQPixmap* pixmap) { int xSize = contentsRect().width(); int ySize = contentsRect().height(); - QImage image(xSize, ySize, 32); - QColor color; + TQImage image(xSize, ySize, 32); + TQColor color; int x; int y; @@ -173,9 +173,9 @@ void KXYColorSelector::drawPalette(QPixmap* pixmap) { ++p; } } - if (QColor::numBitPlanes() <= 8) + if (TQColor::numBitPlanes() <= 8) { - QColor* standardPalette = standardColorsPalette(); + TQColor* standardPalette = standardColorsPalette(); KImageEffect::dither(image, standardPalette, STANDARD_PALETTE_SIZE); delete[] standardPalette; } diff --git a/kcoloredit/kxycolorselector.h b/kcoloredit/kxycolorselector.h index 3213c59c..6225d74f 100644 --- a/kcoloredit/kxycolorselector.h +++ b/kcoloredit/kxycolorselector.h @@ -18,7 +18,7 @@ #ifndef KXYCOLORSELECTOR_H #define KXYCOLORSELECTOR_H -#include +#include #include #include "main.h" @@ -46,7 +46,7 @@ public: /** Constructs a two-dimensional color component selector widget, * with a type TYPE_NONE and ranges 0 .. MAX_COLOR_COMPONENT_VALUE */ - KXYColorSelector(QWidget *parent=0, const char *name=0); + KXYColorSelector(TQWidget *parent=0, const char *name=0); ~KXYColorSelector(); /** Set the type of the selector */ void setType(const int type); @@ -72,26 +72,26 @@ protected: /** Draws the contents of the widget on a pixmap, * which is used for buffering. */ - virtual void drawPalette( QPixmap *pixmap ); + virtual void drawPalette( TQPixmap *pixmap ); /** @reimplemented */ - virtual void resizeEvent( QResizeEvent * ); + virtual void resizeEvent( TQResizeEvent * ); /** Reimplemented from KXYSelector. This drawing is * buffered in a pixmap here. As real drawing * routine, drawPalette() is used. */ - virtual void drawContents( QPainter *painter ); + virtual void drawContents( TQPainter *painter ); /** Draws the cursor */ - virtual void drawCursor(QPainter* painter, int x, int y); + virtual void drawCursor(TQPainter* painter, int x, int y); /** set a color at a given coordinate */ - virtual void setColor(QColor* const color, const int x, const int y); + virtual void setColor(TQColor* const color, const int x, const int y); /** @return STANDARD_PALETTE_SIZE colors used to dither the * pixmap if number of color planes <= 8 */ - QColor* standardColorsPalette(); + TQColor* standardColorsPalette(); private: /* The buffering pixmap */ - QPixmap pixmap; + TQPixmap pixmap; }; #endif diff --git a/kcoloredit/kzcolorselector.cpp b/kcoloredit/kzcolorselector.cpp index 36953180..b00991a2 100644 --- a/kcoloredit/kzcolorselector.cpp +++ b/kcoloredit/kzcolorselector.cpp @@ -15,20 +15,20 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include #include "main.h" #include "kzcolorselector.h" -KZColorSelector::KZColorSelector(Orientation o, QWidget *parent, const char *name) : +KZColorSelector::KZColorSelector(Orientation o, TQWidget *parent, const char *name) : KSelector(o, parent, name) { baseColorH = -1; baseColorS = 0; baseColorV = 0; - pixmap.setOptimization( QPixmap::BestOptim ); + pixmap.setOptimization( TQPixmap::BestOptim ); } KZColorSelector::~KZColorSelector() { } @@ -56,15 +56,15 @@ void KZColorSelector::updateContents() { repaint(false); } -void KZColorSelector::resizeEvent(QResizeEvent*) { +void KZColorSelector::resizeEvent(TQResizeEvent*) { updateContents(); } -void KZColorSelector::drawContents(QPainter* painter) { +void KZColorSelector::drawContents(TQPainter* painter) { painter->drawPixmap(contentsRect().x(), contentsRect().y(), pixmap); } -void KZColorSelector::setBaseColor(const QColor& color) { +void KZColorSelector::setBaseColor(const TQColor& color) { color.hsv(&baseColorH, &baseColorS, &baseColorV); } @@ -100,7 +100,7 @@ void KZColorSelector::updatePointerPos() { setValue(pos); } -void KZColorSelector::setColor(QColor* const color, const int y) { +void KZColorSelector::setColor(TQColor* const color, const int y) { int ySize = contentsRect().height(); switch(type) { case TYPE_H: @@ -118,8 +118,8 @@ void KZColorSelector::setColor(QColor* const color, const int y) { } } -QColor* KZColorSelector::getStandardColorsPalette() { - QColor* palette = new QColor[( int )STANDARD_PALETTE_SIZE]; +TQColor* KZColorSelector::getStandardColorsPalette() { + TQColor* palette = new QColor[( int )STANDARD_PALETTE_SIZE]; int i = 0; palette[i++] = Qt::red; palette[i++] = Qt::green; @@ -141,11 +141,11 @@ QColor* KZColorSelector::getStandardColorsPalette() { return palette; } -void KZColorSelector::drawPalette(QPixmap* pixmap) { +void KZColorSelector::drawPalette(TQPixmap* pixmap) { int xSize = contentsRect().width(); int ySize = contentsRect().height(); - QImage image(xSize, ySize, 32); - QColor color; + TQImage image(xSize, ySize, 32); + TQColor color; int x; int y; @@ -159,9 +159,9 @@ void KZColorSelector::drawPalette(QPixmap* pixmap) { ++p; } } - if (QColor::numBitPlanes() <= 8) + if (TQColor::numBitPlanes() <= 8) { - QColor* standardPalette = getStandardColorsPalette(); + TQColor* standardPalette = getStandardColorsPalette(); KImageEffect::dither(image, standardPalette, STANDARD_PALETTE_SIZE); delete[] standardPalette; } diff --git a/kcoloredit/kzcolorselector.h b/kcoloredit/kzcolorselector.h index cafdb254..60e32f0a 100644 --- a/kcoloredit/kzcolorselector.h +++ b/kcoloredit/kzcolorselector.h @@ -18,8 +18,8 @@ #ifndef KZCOLORSELECTOR_H #define KZCOLORSELECTOR_H -#include "qcolor.h" -#include "qpixmap.h" +#include "tqcolor.h" +#include "tqpixmap.h" #include "kselect.h" #include "color.h" @@ -37,14 +37,14 @@ public: TYPE_V = 2 }; /** Constructs the widget */ - KZColorSelector(Orientation o, QWidget *parent=0, const char *name=0); + KZColorSelector(Orientation o, TQWidget *parent=0, const char *name=0); ~KZColorSelector(); /** Sets the selector type */ void setType(const int type); /** Update the pixmap */ void updateContents(); /** Set the global components */ - void setBaseColor(const QColor& color); + void setBaseColor(const TQColor& color); /** Set the global components using HSV components */ void setBaseColorHsv(const int colorH, const int colorS, const int colorV); /** Updates a pointer position due to the base color */ @@ -69,21 +69,21 @@ protected: /** Draws the contents of the widget on a pixmap, * which is used for buffering. */ - virtual void drawPalette( QPixmap *pixmap ); + virtual void drawPalette( TQPixmap *pixmap ); /** @reimplemented */ - virtual void resizeEvent( QResizeEvent * ); + virtual void resizeEvent( TQResizeEvent * ); /** Draws a color gradient in the selector */ - virtual void drawContents( QPainter *painter ); + virtual void drawContents( TQPainter *painter ); /** Sets a color at a given coordinate */ - virtual void setColor(QColor* const color, const int y); + virtual void setColor(TQColor* const color, const int y); /** @return STANDARD_PALETTE_SIZE colors used to dither the * pixmap if number of color planes <= 8 */ - QColor* getStandardColorsPalette(); + TQColor* getStandardColorsPalette(); private: /* The buffering pixmap */ - QPixmap pixmap; + TQPixmap pixmap; }; #endif diff --git a/kcoloredit/loadpalettedlg.cpp b/kcoloredit/loadpalettedlg.cpp index b426a874..23def4d5 100644 --- a/kcoloredit/loadpalettedlg.cpp +++ b/kcoloredit/loadpalettedlg.cpp @@ -17,11 +17,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -31,22 +31,22 @@ #include "palette.h" #include "loadpalettedlg.h" -LoadPaletteDlg::LoadPaletteDlg(QWidget *parent, const char *name) +LoadPaletteDlg::LoadPaletteDlg(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n( "Load Palette" ), Ok|Cancel, Ok, true) { fileName = ""; - QWidget *mainWidget = new QWidget( this ); + TQWidget *mainWidget = new TQWidget( this ); setMainWidget( mainWidget ); - QVBoxLayout* topLayout = new QVBoxLayout(mainWidget, 0, spacingHint()); - QLabel* label = new QLabel(i18n( "Select a palette:" ), mainWidget); + TQVBoxLayout* topLayout = new TQVBoxLayout(mainWidget, 0, spacingHint()); + TQLabel* label = new TQLabel(i18n( "Select a palette:" ), mainWidget); topLayout->addWidget(label); - paletteBox = new QComboBox(false, mainWidget); + paletteBox = new TQComboBox(false, mainWidget); browseFileNameInserted = false; - QStringList palettesList = Palette::kdePalettes(); - for(QStringList::Iterator palette = palettesList.begin(); + TQStringList palettesList = Palette::kdePalettes(); + for(TQStringList::Iterator palette = palettesList.begin(); palette != palettesList.end(); ++palette) { bool prepend = (*palette).contains( "colors/Custom_Colors" ); - QString fileName = locate("config", (*palette)); + TQString fileName = locate("config", (*palette)); if(prepend) { palettesFileNames.prepend(fileName); setFileName(&fileName); @@ -55,7 +55,7 @@ LoadPaletteDlg::LoadPaletteDlg(QWidget *parent, const char *name) if(palette == palettesList.begin()) setFileName(&fileName); } - QString paletteName = (*palette).mid(palettesDir.length() + 1); + TQString paletteName = (*palette).mid(palettesDir.length() + 1); if(paletteName == "Custom_Colors") paletteName = i18n("Custom Colors"); else if(paletteName == "Recent_Colors") @@ -65,12 +65,12 @@ LoadPaletteDlg::LoadPaletteDlg(QWidget *parent, const char *name) else paletteBox->insertItem(paletteName); } - connect(paletteBox, SIGNAL( activated(int) ), SLOT( setFileName(int) )); + connect(paletteBox, TQT_SIGNAL( activated(int) ), TQT_SLOT( setFileName(int) )); topLayout->addWidget(paletteBox); - QHBoxLayout* browseLayout = new QHBoxLayout( mainWidget ); - QPushButton* browseButton = new QPushButton(i18n( "Browse..." ), + TQHBoxLayout* browseLayout = new TQHBoxLayout( mainWidget ); + TQPushButton* browseButton = new TQPushButton(i18n( "Browse..." ), mainWidget); - connect(browseButton, SIGNAL( clicked() ), SLOT( browseFileNames() )); + connect(browseButton, TQT_SIGNAL( clicked() ), TQT_SLOT( browseFileNames() )); browseLayout->addWidget(browseButton); browseLayout->addStretch(10); topLayout->addLayout(browseLayout); @@ -80,7 +80,7 @@ LoadPaletteDlg::LoadPaletteDlg(QWidget *parent, const char *name) LoadPaletteDlg::~LoadPaletteDlg() { } -void LoadPaletteDlg::setFileName(QString* fileName) { +void LoadPaletteDlg::setFileName(TQString* fileName) { this->fileName = *fileName; } @@ -89,7 +89,7 @@ void LoadPaletteDlg::setFileName(int index) { } void LoadPaletteDlg::browseFileNames() { - QString fileToOpen = KFileDialog::getOpenFileName(lastOpenPaletteFileDir, + TQString fileToOpen = KFileDialog::getOpenFileName(lastOpenPaletteFileDir, i18n("*|All Files"), this, i18n("Open File")); if(!fileToOpen.isEmpty()) { fileName = fileToOpen; @@ -105,7 +105,7 @@ void LoadPaletteDlg::browseFileNames() { } } -QString LoadPaletteDlg::getFileName() { +TQString LoadPaletteDlg::getFileName() { return fileName; } #include "loadpalettedlg.moc" diff --git a/kcoloredit/loadpalettedlg.h b/kcoloredit/loadpalettedlg.h index 3168ed68..f7dd50cb 100644 --- a/kcoloredit/loadpalettedlg.h +++ b/kcoloredit/loadpalettedlg.h @@ -18,7 +18,7 @@ #ifndef LOADPALETTEDLG_H #define LOADPALETTEDLG_H -#include +#include #include /**A dialog showing a list of installed palettes, with a possibility @@ -31,16 +31,16 @@ class LoadPaletteDlg : public KDialogBase { public: /** constructs the dialog */ - LoadPaletteDlg(QWidget *parent = 0, const char *name = 0); + LoadPaletteDlg(TQWidget *parent = 0, const char *name = 0); ~LoadPaletteDlg(); /** @return the fetched file name */ - QString getFileName(); + TQString getFileName(); protected slots: /** sets fileName */ - void setFileName(QString* fileName); + void setFileName(TQString* fileName); /** sets fileName to that at position index in palettesFileNames */ void setFileName(int index); @@ -51,13 +51,13 @@ protected slots: private: /** A widget holding palettes names */ - QComboBox* paletteBox; + TQComboBox* paletteBox; /** A list of KDE palettes file names */ - QStringList palettesFileNames; + TQStringList palettesFileNames; /** A fetched palette file name */ - QString fileName; + TQString fileName; /** whether a browse file name hab already been inserted into * palettesFilenames */ diff --git a/kcoloredit/main.h b/kcoloredit/main.h index 5e0b086a..3794f5ec 100644 --- a/kcoloredit/main.h +++ b/kcoloredit/main.h @@ -18,8 +18,8 @@ #ifndef __MAIN_H__ #define __MAIN_H__ -#include -#include +#include +#include /** The maximum red, green or blue component value in RGB scheme */ @@ -39,14 +39,14 @@ const int HSV_MAX_V_VALUE = 255; /** name of KDE config directories containing palette files */ -static const QString palettesDir("colors"); +static const TQString palettesDir("colors"); /** last open file dialog path */ -static QString lastOpenPaletteFileDir = QDir::homeDirPath(); +static TQString lastOpenPaletteFileDir = TQDir::homeDirPath(); /** last save file as dialog path */ -static QString lastSavePaletteAsFileDir = QDir::homeDirPath(); +static TQString lastSavePaletteAsFileDir = TQDir::homeDirPath(); #endif /* !defined( __MAIN_H__ ) */ diff --git a/kcoloredit/palette.cpp b/kcoloredit/palette.cpp index 1e11aa27..42758b41 100644 --- a/kcoloredit/palette.cpp +++ b/kcoloredit/palette.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -45,17 +45,17 @@ void Palette::init() { colors.setAutoDelete(true); } -QStringList Palette::kdePalettes() { - QStringList paletteList; +TQStringList Palette::kdePalettes() { + TQStringList paletteList; KGlobal::dirs()->findAllResources("config", palettesDir + "/*", false, true, paletteList); return paletteList; } -void Palette::setName(const QString& name) { +void Palette::setName(const TQString& name) { m_name = name; } -const QString& Palette::name() const { +const TQString& Palette::name() const { return m_name; } @@ -102,20 +102,20 @@ void Palette::paste(const int index, Palette& palette) { insert(index + colorIndex, new Color( *palette.color(colorIndex) )); } -bool Palette::load(QTextStream& stream, bool loadName /* = true */) { +bool Palette::load(TQTextStream& stream, bool loadName /* = true */) { bool result = true; setName("KDE palette"); int lineNum = 0; while (!stream.atEnd()) { - QString string = stream.readLine().append(' '); - if(string.find( QRegExp("[^\\s]") ) == -1 || + TQString string = stream.readLine().append(' '); + if(string.find( TQRegExp("[^\\s]") ) == -1 || string.stripWhiteSpace().at( 0 ) == '#' || ( loadName && lineNum == 0 )) { if(loadName && lineNum == 0) setName(string.stripWhiteSpace()); } else { Color* newColor = new Color(); - int position = string.find(QRegExp( "[^\\s]" )); + int position = string.find(TQRegExp( "[^\\s]" )); for(int componentIndex = 0; componentIndex < Color::COMPONENTS_NUM; ++componentIndex) { if(position == -1) { @@ -123,13 +123,13 @@ bool Palette::load(QTextStream& stream, bool loadName /* = true */) { result = false; break; } - int endPosition = string.find(QRegExp( "\\s" ), position); + int endPosition = string.find(TQRegExp( "\\s" ), position); if(endPosition == -1) { m_errorString = i18n("Invalid format"); result = false; break; } - QString componentString = string.mid(position, endPosition - position); + TQString componentString = string.mid(position, endPosition - position); int componentValue = componentString.toInt(&result); if(!result || componentValue < 0 || @@ -139,7 +139,7 @@ bool Palette::load(QTextStream& stream, bool loadName /* = true */) { break; } newColor->setComponent(componentIndex, componentValue); - position = string.find(QRegExp( "[^\\s]" ), endPosition); + position = string.find(TQRegExp( "[^\\s]" ), endPosition); } if(!result) { delete newColor; @@ -156,44 +156,44 @@ bool Palette::load(QTextStream& stream, bool loadName /* = true */) { return result; } -bool Palette::load(const QString& fileName) { +bool Palette::load(const TQString& fileName) { bool result = true; - QFile file(fileName); + TQFile file(fileName); if(!file.open( IO_ReadOnly )) { m_errorString = i18n("Could not open file"); result = false; } else { - QTextStream stream(&file); + TQTextStream stream(&file); result = load(stream); file.close(); } return result; } -bool Palette::save(QTextStream& stream, const QFile* file /* = 0 */, +bool Palette::save(TQTextStream& stream, const TQFile* file /* = 0 */, bool saveName /* = true */) { bool result = true; if(saveName) - stream << name() + QString("\n"); + stream << name() + TQString("\n"); if(file && file->status() != IO_Ok) { m_errorString = i18n("Write error"); result = false; } else for(int colorIndex = 0; colorIndex < length(); ++colorIndex) { Color* col = color(colorIndex); - QString redComponentString; - QString greenComponentString; - QString blueComponentString; + TQString redComponentString; + TQString greenComponentString; + TQString blueComponentString; redComponentString.setNum(col->component( Color::RED_INDEX )); greenComponentString.setNum(col->component( Color::GREEN_INDEX )); blueComponentString.setNum(col->component( Color::BLUE_INDEX )); - QString nameString = col->name(); + TQString nameString = col->name(); if(!nameString.isEmpty()) nameString.prepend(" "); - stream << redComponentString + QString(" ") + - greenComponentString + QString(" ") + + stream << redComponentString + TQString(" ") + + greenComponentString + TQString(" ") + blueComponentString + - nameString + QString("\n"); + nameString + TQString("\n"); if(file && file->status() != IO_Ok) { m_errorString = i18n("Write error"); result = false; @@ -203,14 +203,14 @@ bool Palette::save(QTextStream& stream, const QFile* file /* = 0 */, return result; } -bool Palette::save(const QString& fileName) { +bool Palette::save(const TQString& fileName) { bool result = true; - QFile file(fileName); + TQFile file(fileName); if(!file.open( IO_WriteOnly|IO_Truncate )) { m_errorString = i18n("Could not open file for writing"); result = false; } else { - QTextStream stream(&file); + TQTextStream stream(&file); result = save(stream); file.close(); } @@ -221,6 +221,6 @@ void Palette::deleteContents() { colors.clear(); } -const QString& Palette::errorString() const { +const TQString& Palette::errorString() const { return m_errorString; } diff --git a/kcoloredit/palette.h b/kcoloredit/palette.h index 7b763296..a363ada4 100644 --- a/kcoloredit/palette.h +++ b/kcoloredit/palette.h @@ -18,9 +18,9 @@ #ifndef PALETTE_H #define PALETTE_H -#include -#include -#include +#include +#include +#include #include "color.h" @@ -35,11 +35,11 @@ public: Palette(const Palette& palette); ~Palette(); /** @return A list of KDE palettes */ - static QStringList kdePalettes(); + static TQStringList kdePalettes(); /** sets palette name */ - void setName(const QString& name); + void setName(const TQString& name); /** @return palette name */ - const QString& name() const; + const TQString& name() const; /** inserts a color at a given position */ void insert(const int index, Color* const color); /** appends a color */ @@ -61,32 +61,32 @@ public: /** Loads a palette from a text stream * @return whether the load was succesfull */ - bool load(QTextStream& stream, bool loadName = true); + bool load(TQTextStream& stream, bool loadName = true); /** Loads a palette from a file. * If loadName is true, palette name is expected. * @return whether the load was succesfull */ - bool load(const QString& fileName); + bool load(const TQString& fileName); /** Saves a palette into a text stream. * If file is given, it is checked for IO errors. * If saveName is true, palette name is saved. * @return whether save was succesfull */ - bool save(QTextStream& stream, const QFile* file = 0, bool saveName = true); + bool save(TQTextStream& stream, const TQFile* file = 0, bool saveName = true); /** Saves a palette to a file * @return whether save was succesfull */ - bool save(const QString& fileName); + bool save(const TQString& fileName); /** Deletes contents of the palette */ void deleteContents(); /** @return A possible error description from the last unsuccessfull * IO operation */ - const QString& errorString() const; + const TQString& errorString() const; private: /** The palette name */ - QString m_name; + TQString m_name; private: /** Initialization method called by constructors */ @@ -94,9 +94,9 @@ private: protected: /** A list of palette colors */ - QPtrList colors; + TQPtrList colors; /** An IO error description */ - QString m_errorString; + TQString m_errorString; }; #endif diff --git a/kcoloredit/paletteview.cpp b/kcoloredit/paletteview.cpp index 8e05a2d7..6648d88b 100644 --- a/kcoloredit/paletteview.cpp +++ b/kcoloredit/paletteview.cpp @@ -15,34 +15,34 @@ * * ***************************************************************************/ -#include +#include #include "kcoloreditview.h" #include "paletteview.h" PaletteView::PaletteView(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing, - KColorEditView* view, QWidget *parent, const char *name) : - QFrame(parent, name, QWidget::WResizeNoErase*0) { + KColorEditView* view, TQWidget *parent, const char *name) : + TQFrame(parent, name, TQWidget::WResizeNoErase*0) { setFrameStyle(StyledPanel|Sunken); setLineWidth(2); - QGridLayout* topLayout = new QGridLayout(this, 2, 2); + TQGridLayout* topLayout = new TQGridLayout(this, 2, 2); topLayout->setMargin(2); topLayout->setRowStretch(0, 10); topLayout->setRowStretch(1, 0); topLayout->setColStretch(0, 10); topLayout->setColStretch(1, 0); - scrollBar = new QScrollBar(this); - hScrollBar = new QScrollBar(0, 1, 1, 1, 0, QScrollBar::Horizontal, this); + scrollBar = new TQScrollBar(this); + hScrollBar = new TQScrollBar(0, 1, 1, 1, 0, TQScrollBar::Horizontal, this); scrolledArea = new PaletteViewScrolledArea(defaultCellWidth, defaultCellHeight, cellSpacing, scrollBar, hScrollBar, view, this); - connect(scrollBar, SIGNAL( valueChanged(int) ), - SLOT( slotRepaintScrolledArea() )); + connect(scrollBar, TQT_SIGNAL( valueChanged(int) ), + TQT_SLOT( slotRepaintScrolledArea() )); topLayout->addWidget(scrolledArea, 0, 0); - connect(hScrollBar, SIGNAL( valueChanged(int) ), - SLOT( slotRepaintScrolledArea() )); - QHBoxLayout* hScrollBarLayout = new QHBoxLayout(); + connect(hScrollBar, TQT_SIGNAL( valueChanged(int) ), + TQT_SLOT( slotRepaintScrolledArea() )); + TQHBoxLayout* hScrollBarLayout = new TQHBoxLayout(); hScrollBarLayout->addWidget(hScrollBar, 10); - hScrollBarLayout->addWidget(new QWidget(this), 0); + hScrollBarLayout->addWidget(new TQWidget(this), 0); topLayout->addLayout(hScrollBarLayout, 1, 0); topLayout->addWidget(scrollBar, 0, 1); } diff --git a/kcoloredit/paletteview.h b/kcoloredit/paletteview.h index 0032997f..9501de40 100644 --- a/kcoloredit/paletteview.h +++ b/kcoloredit/paletteview.h @@ -18,8 +18,8 @@ #ifndef PALETTEVIEW_H #define PALETTEVIEW_H -#include -#include +#include +#include #include "paletteviewscrolledarea.h" @@ -29,7 +29,7 @@ class KColorEditView; * Its parent is KColorEditView * @author Artur Rataj */ -class PaletteView : public QFrame { +class PaletteView : public TQFrame { Q_OBJECT public: @@ -37,7 +37,7 @@ public: * The effective cell sizes may be adjusted to fit the widget sizes. */ PaletteView(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing, - KColorEditView* view, QWidget *parent = 0, const char *name=0); + KColorEditView* view, TQWidget *parent = 0, const char *name=0); ~PaletteView(); /** Calls redraw() in scrolledArea */ void redraw(); @@ -56,9 +56,9 @@ protected: /** The scrolled area */ PaletteViewScrolledArea* scrolledArea; /** The scroll bar widget */ - QScrollBar* scrollBar; + TQScrollBar* scrollBar; /** The horizontal scroll bar widget */ - QScrollBar* hScrollBar; + TQScrollBar* hScrollBar; }; #endif diff --git a/kcoloredit/paletteviewscrolledarea.cpp b/kcoloredit/paletteviewscrolledarea.cpp index dafb4d10..0b4f0ec4 100644 --- a/kcoloredit/paletteviewscrolledarea.cpp +++ b/kcoloredit/paletteviewscrolledarea.cpp @@ -16,18 +16,18 @@ ***************************************************************************/ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include "palette.h" #include "palettehistory.h" @@ -37,9 +37,9 @@ #include "paletteviewscrolledarea.moc" PaletteViewScrolledArea::PaletteViewScrolledArea(const int defaultCellWidth, - const int defaultCellHeight, const int cellSpacing, QScrollBar* scrollBar, - QScrollBar* hScrollBar, KColorEditView* view, QWidget* parent, const char* name) - : QFrame(parent, name) { + const int defaultCellHeight, const int cellSpacing, TQScrollBar* scrollBar, + TQScrollBar* hScrollBar, KColorEditView* view, TQWidget* parent, const char* name) + : TQFrame(parent, name) { this->defaultCellWidth = defaultCellWidth; this->defaultCellHeight = defaultCellHeight; this->cellSpacing = cellSpacing; @@ -47,8 +47,8 @@ PaletteViewScrolledArea::PaletteViewScrolledArea(const int defaultCellWidth, this->hScrollBar = hScrollBar; this->view = view; setBackgroundMode(NoBackground); - scrollTimeoutTimer = new QTimer(this); - connect(scrollTimeoutTimer, SIGNAL( timeout() ), SLOT( slotScrollTimeout() )); + scrollTimeoutTimer = new TQTimer(this); + connect(scrollTimeoutTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotScrollTimeout() )); scrollTimeout = true; mousePressed = false; cursorPositioning = false; @@ -98,7 +98,7 @@ void PaletteViewScrolledArea::scrollPalette(const int amount, const int timeout) void PaletteViewScrolledArea::slotScrollTimeout() { scrollTimeout = true; if(mousePressed) { - QPoint cursorPoint = mapFromGlobal(QCursor::pos()); + TQPoint cursorPoint = mapFromGlobal(TQCursor::pos()); setCursorPos(cursorPoint.x(), cursorPoint.y()); selectionEnd = cursorPos(); if(selectionEnd >= selectionBegin) @@ -166,7 +166,7 @@ void PaletteViewScrolledArea::setCellsSizes() { cellWidth = defaultCellWidth; cellHeight = defaultCellHeight; if(viewColorNames) { - QPainter painter; + TQPainter painter; painter.begin(this); if(cellHeight < painter.fontMetrics().height()) { int prevCellHeight = cellHeight; @@ -216,12 +216,12 @@ int PaletteViewScrolledArea::selectionMax() const { return document()->paletteSelectionEnd(); } -void PaletteViewScrolledArea::paintEvent(QPaintEvent* /*event*/) { +void PaletteViewScrolledArea::paintEvent(TQPaintEvent* /*event*/) { setCellsSizes(); - QPixmap pixmap(size()); - QPainter painter; + TQPixmap pixmap(size()); + TQPainter painter; painter.begin(&pixmap, this); - QFontMetrics fontMetrics = painter.fontMetrics(); + TQFontMetrics fontMetrics = painter.fontMetrics(); int maxLineWidth; if(viewColorNames) { int maxTextLength = 0; @@ -249,12 +249,12 @@ void PaletteViewScrolledArea::paintEvent(QPaintEvent* /*event*/) { int lastRow = (posY + height() - 1 + rowHeight - 1)/rowHeight; if(viewColorNames) painter.fillRect(0, 0, rowWidth, height(), - QBrush( QFrame::palette().active().base() )); - QBrush normalBackgroundBrush(QFrame::palette().active().background()); - QBrush selectedBackgroundBrush(QFrame::palette().active().highlight()); - QBrush foregroundBrush; - QBrush cursorBrush(QFrame::palette().active().foreground()); - QPen backgroundPen(QFrame::palette().active().foreground()); + TQBrush( TQFrame::palette().active().base() )); + TQBrush normalBackgroundBrush(TQFrame::palette().active().background()); + TQBrush selectedBackgroundBrush(TQFrame::palette().active().highlight()); + TQBrush foregroundBrush; + TQBrush cursorBrush(TQFrame::palette().active().foreground()); + TQPen backgroundPen(TQFrame::palette().active().foreground()); int min = selectionMin(); int max = selectionMax(); int fontAscent = fontMetrics.ascent(); @@ -270,14 +270,14 @@ void PaletteViewScrolledArea::paintEvent(QPaintEvent* /*event*/) { for(int y = firstRow; y <= lastRow; ++y) { int yBegin = y*rowHeight - posY; int currCellNum = y*cellsInRow + x; - QBrush* backgroundBrush; + TQBrush* backgroundBrush; if(currCellNum >= min && currCellNum < max) backgroundBrush = &selectedBackgroundBrush; else backgroundBrush = &normalBackgroundBrush; if(currCellNum < palette()->length()) { Color* color = palette()->color(currCellNum); - QBrush foregroundBrush(QColor( + TQBrush foregroundBrush(TQColor( color->component(Color::RED_INDEX), color->component(Color::GREEN_INDEX), color->component(Color::BLUE_INDEX) )); @@ -285,7 +285,7 @@ void PaletteViewScrolledArea::paintEvent(QPaintEvent* /*event*/) { *backgroundBrush); painter.fillRect(xBegin, yBegin + rowHeight - cellSpacing, cellWithSpacingWidth, cellSpacing, *backgroundBrush); - QBrush* backgroundOrCursorBrush; + TQBrush* backgroundOrCursorBrush; if(cursorPos() == currCellNum) backgroundOrCursorBrush = &cursorBrush; else @@ -325,7 +325,7 @@ void PaletteViewScrolledArea::paintEvent(QPaintEvent* /*event*/) { painter.end(); } -int PaletteViewScrolledArea::colorIndex(const QPoint& point) const { +int PaletteViewScrolledArea::colorIndex(const TQPoint& point) const { int colorColumn = point.x()*cellsInRow/rowWidth; int colorRow = (point.y() + scrollBar->value())/rowHeight; int colorIndex = colorRow*cellsInRow + colorColumn; @@ -335,14 +335,14 @@ int PaletteViewScrolledArea::colorIndex(const QPoint& point) const { return colorIndex; } -QColor PaletteViewScrolledArea::color(const QPoint& point) const { +TQColor PaletteViewScrolledArea::color(const TQPoint& point) const { Color* color = palette()->color(colorIndex( point )); - return QColor(color->component( Color::RED_INDEX ), + return TQColor(color->component( Color::RED_INDEX ), color->component( Color::GREEN_INDEX ), color->component( Color::BLUE_INDEX )); } -void PaletteViewScrolledArea::mousePressEvent(QMouseEvent* event) { +void PaletteViewScrolledArea::mousePressEvent(TQMouseEvent* event) { cursorPositioning = false; if(( cursorPositioning = setCursorPos(event->x(), event->y()) )) { selectionBegin = cursorPos(); @@ -356,7 +356,7 @@ void PaletteViewScrolledArea::mousePressEvent(QMouseEvent* event) { mousePressed = true; } -void PaletteViewScrolledArea::mouseMoveEvent(QMouseEvent* event) { +void PaletteViewScrolledArea::mouseMoveEvent(TQMouseEvent* event) { if(cursorPositioning) { setCursorPos(event->x(), event->y()); selectionEnd = cursorPos(); @@ -371,7 +371,7 @@ void PaletteViewScrolledArea::mouseMoveEvent(QMouseEvent* event) { if(colorIndex( colorDragPoint ) != -1) { if(abs( event->x() - colorDragPoint.x() ) > 2 || abs( event->y() - colorDragPoint.y() ) > 2) { - QColor draggedColor = color(colorDragPoint); + TQColor draggedColor = color(colorDragPoint); KColorDrag* colorDrag = KColorDrag::makeDrag(draggedColor, this); colorDrag->dragCopy(); } else @@ -380,7 +380,7 @@ void PaletteViewScrolledArea::mouseMoveEvent(QMouseEvent* event) { } } -void PaletteViewScrolledArea::mouseReleaseEvent(QMouseEvent* /*event*/) { +void PaletteViewScrolledArea::mouseReleaseEvent(TQMouseEvent* /*event*/) { if(colorChosen) { if(colorIndex( colorDragPoint ) != -1) { int index = colorIndex(colorDragPoint); diff --git a/kcoloredit/paletteviewscrolledarea.h b/kcoloredit/paletteviewscrolledarea.h index 18bbae2b..db39e454 100644 --- a/kcoloredit/paletteviewscrolledarea.h +++ b/kcoloredit/paletteviewscrolledarea.h @@ -18,28 +18,28 @@ #ifndef PALETTEVIEWSCROLLEDAREA_H #define PALETTEVIEWSCROLLEDAREA_H -#include -#include +#include +#include #include "palette.h" class KColorEditDoc; class KColorEditView; -class QScrollBar; +class TQScrollBar; /** This widget draws the palette view scrolled area. * It has paste and cut features. * @author Artur Rataj */ -class PaletteViewScrolledArea : public QFrame { +class PaletteViewScrolledArea : public TQFrame { Q_OBJECT public: /** Constructs the widget */ PaletteViewScrolledArea(const int defaultCellWidth, const int defaultCellHeight, - const int cellSpacing, QScrollBar* scrollBar, - QScrollBar* hScrollBar, KColorEditView* view, - QWidget* parent = 0, const char* name = 0); + const int cellSpacing, TQScrollBar* scrollBar, + TQScrollBar* hScrollBar, KColorEditView* view, + TQWidget* parent = 0, const char* name = 0); ~PaletteViewScrolledArea(); /** Sets cells sizes and then calls repaintPalette() */ void redraw(); @@ -52,9 +52,9 @@ public slots: protected: /** The scrollbar widget */ - QScrollBar* scrollBar; + TQScrollBar* scrollBar; /** The horizontal scrollbar widget */ - QScrollBar* hScrollBar; + TQScrollBar* hScrollBar; /** Pointer to the document view */ KColorEditView* view; /** Default cell width */ @@ -82,7 +82,7 @@ protected: /** A position at which selection ended */ int selectionEnd; /** Auto scroll timeout timer */ - QTimer* scrollTimeoutTimer; + TQTimer* scrollTimeoutTimer; /** Whether there is auto scroll timeout */ bool scrollTimeout; /** Whether a mouse has been pressed over the palette and not yet released */ @@ -90,7 +90,7 @@ protected: /** Whether the cursor is being positioned */ bool cursorPositioning; /** A color drag point */ - QPoint colorDragPoint; + TQPoint colorDragPoint; /** Whether a color has been chosen and it is not dragged */ bool colorChosen; /** Whether the cursor follows a chosen color */ @@ -108,9 +108,9 @@ protected: /** repaints the palette */ void repaintPalette(); /** @return A color index at a given position, -1 if none */ - int colorIndex(const QPoint& point) const; + int colorIndex(const TQPoint& point) const; /** @return A color at a given position */ - QColor color(const QPoint& point) const; + TQColor color(const TQPoint& point) const; /** sets a palette cursor position */ void setCursorPos(const int pos); /** Sets a cursor position due to a mouse position. @@ -136,13 +136,13 @@ protected: */ void checkSelectionAutoScroll(const int mousePosY); /** The widget painting */ - void paintEvent(QPaintEvent* event); + void paintEvent(TQPaintEvent* event); /** Used to get mouse press events coordinates */ - void mousePressEvent(QMouseEvent* event); + void mousePressEvent(TQMouseEvent* event); /** Used to get mouse move events coordinates */ - void mouseMoveEvent(QMouseEvent* event); + void mouseMoveEvent(TQMouseEvent* event); /** Used to get mouse release events coordinates */ - void mouseReleaseEvent(QMouseEvent* event); + void mouseReleaseEvent(TQMouseEvent* event); /** If there is a scroll timeout, scrolls palette, * sets scrollTimeout to false and resets scroll timeout timer */ diff --git a/kcoloredit/texteditselection.cpp b/kcoloredit/texteditselection.cpp index 65d4ecad..4b1d6a56 100644 --- a/kcoloredit/texteditselection.cpp +++ b/kcoloredit/texteditselection.cpp @@ -15,62 +15,62 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include "main.h" #include "texteditselection.h" -TextEditSelection::TextEditSelection(QWidget *parent, const char *name ) : QWidget(parent,name) { +TextEditSelection::TextEditSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { inChangingComponents = false; - QVBoxLayout* topLayout = new QVBoxLayout(this, 4); - QGridLayout* componentsLayout = new QGridLayout(3, 5, 2); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, 4); + TQGridLayout* componentsLayout = new TQGridLayout(3, 5, 2); topLayout->addLayout(componentsLayout); componentsLayout->setColStretch(1, 10); componentsLayout->addColSpacing(2, 8); componentsLayout->setColStretch(4, 10); - QLineEdit* lineEdit; - addComponent(H_INDEX, ( lineEdit = new QLineEdit(this) ), HSV_MAX_H_VALUE, "H:", 0, 0, componentsLayout); - connect(lineEdit, SIGNAL( textChanged(const QString&) ), SLOT( slotHsvComponentChanged() )); - addComponent(S_INDEX, ( lineEdit = new QLineEdit(this) ), HSV_MAX_S_VALUE, "S:", 1, 0, componentsLayout); - connect(lineEdit, SIGNAL( textChanged(const QString&) ), SLOT( slotHsvComponentChanged() )); - addComponent(V_INDEX, ( lineEdit = new QLineEdit(this) ), HSV_MAX_V_VALUE, "V:", 2, 0, componentsLayout); - connect(lineEdit, SIGNAL( textChanged(const QString&) ), SLOT( slotHsvComponentChanged() )); - addComponent(R_INDEX, ( lineEdit = new QLineEdit(this) ), RGB_MAX_COMPONENT_VALUE, "R:", 0, 1, componentsLayout); - connect(lineEdit, SIGNAL( textChanged(const QString&) ), SLOT( slotRgbComponentChanged() )); - addComponent(G_INDEX, ( lineEdit = new QLineEdit(this) ), RGB_MAX_COMPONENT_VALUE, "G:", 1, 1, componentsLayout); - connect(lineEdit, SIGNAL( textChanged(const QString&) ), SLOT( slotRgbComponentChanged() )); - addComponent(B_INDEX, ( lineEdit = new QLineEdit(this) ), RGB_MAX_COMPONENT_VALUE, "B:", 2, 1, componentsLayout); - connect(lineEdit, SIGNAL( textChanged(const QString&) ), SLOT( slotRgbComponentChanged() )); - QHBoxLayout* rgbStringLayout = new QHBoxLayout(2); - QLabel* rgbStringLabel = new QLabel("RGB " + i18n( "hex." ) + ": ", this); + TQLineEdit* lineEdit; + addComponent(H_INDEX, ( lineEdit = new TQLineEdit(this) ), HSV_MAX_H_VALUE, "H:", 0, 0, componentsLayout); + connect(lineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotHsvComponentChanged() )); + addComponent(S_INDEX, ( lineEdit = new TQLineEdit(this) ), HSV_MAX_S_VALUE, "S:", 1, 0, componentsLayout); + connect(lineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotHsvComponentChanged() )); + addComponent(V_INDEX, ( lineEdit = new TQLineEdit(this) ), HSV_MAX_V_VALUE, "V:", 2, 0, componentsLayout); + connect(lineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotHsvComponentChanged() )); + addComponent(R_INDEX, ( lineEdit = new TQLineEdit(this) ), RGB_MAX_COMPONENT_VALUE, "R:", 0, 1, componentsLayout); + connect(lineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotRgbComponentChanged() )); + addComponent(G_INDEX, ( lineEdit = new TQLineEdit(this) ), RGB_MAX_COMPONENT_VALUE, "G:", 1, 1, componentsLayout); + connect(lineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotRgbComponentChanged() )); + addComponent(B_INDEX, ( lineEdit = new TQLineEdit(this) ), RGB_MAX_COMPONENT_VALUE, "B:", 2, 1, componentsLayout); + connect(lineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotRgbComponentChanged() )); + TQHBoxLayout* rgbStringLayout = new TQHBoxLayout(2); + TQLabel* rgbStringLabel = new TQLabel("RGB " + i18n( "hex." ) + ": ", this); rgbStringLayout->addWidget(rgbStringLabel); - rgbStringLineEdit = new QLineEdit(this); - rgbStringLineEdit->setMinimumWidth(lineEdit->fontMetrics().width( QString("8888888") )); - rgbStringLineEdit->setMaximumWidth(lineEdit->fontMetrics().width( QString("888888888") )); - connect(rgbStringLineEdit, SIGNAL( textChanged(const QString&) ), SLOT( slotRgbStringChanged() )); + rgbStringLineEdit = new TQLineEdit(this); + rgbStringLineEdit->setMinimumWidth(lineEdit->fontMetrics().width( TQString("8888888") )); + rgbStringLineEdit->setMaximumWidth(lineEdit->fontMetrics().width( TQString("888888888") )); + connect(rgbStringLineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( slotRgbStringChanged() )); rgbStringLayout->addWidget(rgbStringLineEdit); topLayout->addLayout(rgbStringLayout); } TextEditSelection::~TextEditSelection(){ } -void TextEditSelection::addComponent(const int index, QLineEdit* lineEdit, const int maxValue, - const QString& labelString, const int row, const int column, QGridLayout* layout) { - QLabel* label = new QLabel(labelString, this); - lineEdit->setValidator(new QIntValidator( 0, maxValue, lineEdit )); +void TextEditSelection::addComponent(const int index, TQLineEdit* lineEdit, const int maxValue, + const TQString& labelString, const int row, const int column, TQGridLayout* layout) { + TQLabel* label = new TQLabel(labelString, this); + lineEdit->setValidator(new TQIntValidator( 0, maxValue, lineEdit )); lineEditTable[index] = lineEdit; - lineEdit->setMinimumWidth(lineEdit->fontMetrics().width( QString("8888") )); - lineEdit->setMaximumWidth(lineEdit->fontMetrics().width( QString("8888888") )); + lineEdit->setMinimumWidth(lineEdit->fontMetrics().width( TQString("8888") )); + lineEdit->setMaximumWidth(lineEdit->fontMetrics().width( TQString("8888888") )); layout->addWidget(label, row, column*3); layout->addWidget(lineEdit, row, column*3 + 1); } void TextEditSelection::setRgbString(const int red, const int green, const int blue) { - QString string; + TQString string; string.sprintf("%02x%02x%02x", red, green, blue); rgbStringLineEdit->setText(string); } @@ -81,12 +81,12 @@ void TextEditSelection::slotHsvComponentChanged() { int hComponent = lineEditTable[H_INDEX]->text().toInt(); int sComponent = lineEditTable[S_INDEX]->text().toInt(); int vComponent = lineEditTable[V_INDEX]->text().toInt(); - QColor color; + TQColor color; color.setHsv(hComponent, sComponent, vComponent); int rComponent = color.red(); int gComponent = color.green(); int bComponent = color.blue(); - QString string; + TQString string; lineEditTable[R_INDEX]->setText(string.setNum( rComponent )); lineEditTable[G_INDEX]->setText(string.setNum( gComponent )); lineEditTable[B_INDEX]->setText(string.setNum( bComponent )); @@ -107,13 +107,13 @@ void TextEditSelection::slotRgbComponentChanged() { int rComponent = lineEditTable[R_INDEX]->text().toInt(); int gComponent = lineEditTable[G_INDEX]->text().toInt(); int bComponent = lineEditTable[B_INDEX]->text().toInt(); - QColor color; + TQColor color; color.setRgb(rComponent, gComponent, bComponent); int hComponent; int sComponent; int vComponent; color.hsv(&hComponent, &sComponent, &vComponent); - QString string; + TQString string; lineEditTable[H_INDEX]->setText(string.setNum( hComponent )); lineEditTable[S_INDEX]->setText(string.setNum( sComponent )); lineEditTable[V_INDEX]->setText(string.setNum( vComponent )); @@ -131,7 +131,7 @@ void TextEditSelection::slotRgbComponentChanged() { void TextEditSelection::slotRgbStringChanged() { if(!inChangingComponents) { inChangingComponents = true; - QString string = rgbStringLineEdit->text().stripWhiteSpace(); + TQString string = rgbStringLineEdit->text().stripWhiteSpace(); bool result; int value = string.toInt(&result, 16); if(result) { @@ -144,7 +144,7 @@ void TextEditSelection::slotRgbStringChanged() { int hComponent; int sComponent; int vComponent; - QColor hsvColor; + TQColor hsvColor; hsvColor.hsv(&hComponent, &sComponent, &vComponent); lineEditTable[H_INDEX]->setText(string.setNum( hComponent )); lineEditTable[S_INDEX]->setText(string.setNum( sComponent )); @@ -164,14 +164,14 @@ void TextEditSelection::slotSetValue(Color* color) { if(!color->equals( this->color )) { inChangingComponents = true; this->color = *color; - QString string; + TQString string; int rComponent = this->color.component(Color::RED_INDEX); int gComponent = this->color.component(Color::GREEN_INDEX); int bComponent = this->color.component(Color::BLUE_INDEX); lineEditTable[R_INDEX]->setText(string.setNum( rComponent )); lineEditTable[G_INDEX]->setText(string.setNum( gComponent )); lineEditTable[B_INDEX]->setText(string.setNum( bComponent )); - QColor hsvColor(rComponent, gComponent, bComponent); + TQColor hsvColor(rComponent, gComponent, bComponent); int hComponent; int sComponent; int vComponent; diff --git a/kcoloredit/texteditselection.h b/kcoloredit/texteditselection.h index c2166098..e140a5dc 100644 --- a/kcoloredit/texteditselection.h +++ b/kcoloredit/texteditselection.h @@ -18,9 +18,9 @@ #ifndef TEXTEDITSELECTION_H #define TEXTEDITSELECTION_H -#include -#include -#include +#include +#include +#include #include "color.h" @@ -28,12 +28,12 @@ * can be set. * @author Artur Rataj */ -class TextEditSelection : public QWidget { +class TextEditSelection : public TQWidget { Q_OBJECT public: /** Constructs the widget */ - TextEditSelection(QWidget *parent=0, const char *name=0); + TextEditSelection(TQWidget *parent=0, const char *name=0); ~TextEditSelection(); signals: @@ -46,8 +46,8 @@ public slots: protected: /** Adds a component line edit */ - void addComponent(const int index, QLineEdit* lineEdit, const int maxValue, const QString& labelString, - const int row, const int column, QGridLayout* layout); + void addComponent(const int index, TQLineEdit* lineEdit, const int maxValue, const TQString& labelString, + const int row, const int column, TQGridLayout* layout); /** sets RGB string in rgbStringLineEdit */ void setRgbString(const int red, const int green, const int blue); @@ -77,9 +77,9 @@ protected: COMPONENTS_NUM = 6 }; /** Line edit widgets table */ - QLineEdit* lineEditTable[COMPONENTS_NUM]; + TQLineEdit* lineEditTable[COMPONENTS_NUM]; /** RGB hex string line edit widgets table */ - QLineEdit* rgbStringLineEdit; + TQLineEdit* rgbStringLineEdit; /** The selected color */ Color color; /** A flag that components are matched */ diff --git a/kcoloredit/textselection.cpp b/kcoloredit/textselection.cpp index 8a4225bc..f916d48f 100644 --- a/kcoloredit/textselection.cpp +++ b/kcoloredit/textselection.cpp @@ -17,7 +17,7 @@ #include "textselection.h" -TextSelection::TextSelection(QWidget *parent, const char *name ) : QWidget(parent,name) { +TextSelection::TextSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { } TextSelection::~TextSelection(){ -- cgit v1.2.3