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 --- kiconedit/kiconedit.cpp | 192 ++++++++++++++++++++++++------------------------ 1 file changed, 96 insertions(+), 96 deletions(-) (limited to 'kiconedit/kiconedit.cpp') diff --git a/kiconedit/kiconedit.cpp b/kiconedit/kiconedit.cpp index 13cd4b89..74325458 100644 --- a/kiconedit/kiconedit.cpp +++ b/kiconedit/kiconedit.cpp @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -33,7 +33,7 @@ WindowList KIconEdit::windowList; -KIconEdit::KIconEdit(const QImage image, const char *name) +KIconEdit::KIconEdit(const TQImage image, const char *name) : KMainWindow(0, name) { init(); @@ -74,53 +74,53 @@ void KIconEdit::init() createGUI(); - connect(this, SIGNAL(newname(const QString &)), - SLOT( slotUpdateStatusName(const QString &))); - - connect( icon, SIGNAL( saved()), SLOT(slotSaved())); - connect( icon, SIGNAL( loaded(QImage *)), grid, SLOT(load(QImage *))); - connect( icon, SIGNAL(opennewwin(const QString &)), - SLOT(slotNewWin(const QString &))); - connect(icon, SIGNAL(newname(const QString &)), - SLOT( slotUpdateStatusName(const QString &))); - connect(icon, SIGNAL(newmessage(const QString &)), - SLOT( slotUpdateStatusMessage(const QString &))); - connect(icon, SIGNAL(addrecent(const QString &)), - SLOT( addRecent(const QString &))); - - connect( m_paletteToolBar, SIGNAL( newColor(uint)), - grid, SLOT(setColorSelection(uint))); - - connect( grid, SIGNAL( changed(const QPixmap &) ), - m_paletteToolBar, SLOT( previewChanged(const QPixmap &) ) ); - connect( grid, SIGNAL( addingcolor(uint) ), - m_paletteToolBar, SLOT(addColor(uint))); - connect( grid, SIGNAL( colorschanged(uint, uint*) ), - m_paletteToolBar, SLOT(addColors(uint, uint*))); - - connect(grid, SIGNAL(sizechanged(int, int)), - SLOT( slotUpdateStatusSize(int, int))); - connect(grid, SIGNAL(poschanged(int, int)), - SLOT( slotUpdateStatusPos(int, int))); - connect(grid, SIGNAL(scalingchanged(int)), - SLOT( slotUpdateStatusScaling(int))); - connect(grid, SIGNAL(scalingchanged(int)), - SLOT( slotUpdateZoom(int))); - connect( grid, SIGNAL( addingcolor(uint) ), - SLOT(slotUpdateStatusColors(uint))); - connect(grid, SIGNAL(colorschanged(uint, uint*)), - SLOT( slotUpdateStatusColors(uint, uint*))); - connect(grid, SIGNAL(newmessage(const QString &)), - SLOT( slotUpdateStatusMessage(const QString &))); - connect(grid, SIGNAL(clipboarddata(bool)), - SLOT( slotUpdatePaste(bool))); - connect(grid, SIGNAL(colorSelected(uint)), - m_paletteToolBar, SLOT(currentColorChanged(uint))); - connect(grid, SIGNAL(modifiedchanged(bool)), - SLOT( slotUpdateStatusModified(bool))); + connect(this, TQT_SIGNAL(newname(const TQString &)), + TQT_SLOT( slotUpdateStatusName(const TQString &))); + + connect( icon, TQT_SIGNAL( saved()), TQT_SLOT(slotSaved())); + connect( icon, TQT_SIGNAL( loaded(TQImage *)), grid, TQT_SLOT(load(TQImage *))); + connect( icon, TQT_SIGNAL(opennewwin(const TQString &)), + TQT_SLOT(slotNewWin(const TQString &))); + connect(icon, TQT_SIGNAL(newname(const TQString &)), + TQT_SLOT( slotUpdateStatusName(const TQString &))); + connect(icon, TQT_SIGNAL(newmessage(const TQString &)), + TQT_SLOT( slotUpdateStatusMessage(const TQString &))); + connect(icon, TQT_SIGNAL(addrecent(const TQString &)), + TQT_SLOT( addRecent(const TQString &))); + + connect( m_paletteToolBar, TQT_SIGNAL( newColor(uint)), + grid, TQT_SLOT(setColorSelection(uint))); + + connect( grid, TQT_SIGNAL( changed(const TQPixmap &) ), + m_paletteToolBar, TQT_SLOT( previewChanged(const TQPixmap &) ) ); + connect( grid, TQT_SIGNAL( addingcolor(uint) ), + m_paletteToolBar, TQT_SLOT(addColor(uint))); + connect( grid, TQT_SIGNAL( colorschanged(uint, uint*) ), + m_paletteToolBar, TQT_SLOT(addColors(uint, uint*))); + + connect(grid, TQT_SIGNAL(sizechanged(int, int)), + TQT_SLOT( slotUpdateStatusSize(int, int))); + connect(grid, TQT_SIGNAL(poschanged(int, int)), + TQT_SLOT( slotUpdateStatusPos(int, int))); + connect(grid, TQT_SIGNAL(scalingchanged(int)), + TQT_SLOT( slotUpdateStatusScaling(int))); + connect(grid, TQT_SIGNAL(scalingchanged(int)), + TQT_SLOT( slotUpdateZoom(int))); + connect( grid, TQT_SIGNAL( addingcolor(uint) ), + TQT_SLOT(slotUpdateStatusColors(uint))); + connect(grid, TQT_SIGNAL(colorschanged(uint, uint*)), + TQT_SLOT( slotUpdateStatusColors(uint, uint*))); + connect(grid, TQT_SIGNAL(newmessage(const TQString &)), + TQT_SLOT( slotUpdateStatusMessage(const TQString &))); + connect(grid, TQT_SIGNAL(clipboarddata(bool)), + TQT_SLOT( slotUpdatePaste(bool))); + connect(grid, TQT_SIGNAL(colorSelected(uint)), + m_paletteToolBar, TQT_SLOT(currentColorChanged(uint))); + connect(grid, TQT_SIGNAL(modifiedchanged(bool)), + TQT_SLOT( slotUpdateStatusModified(bool))); gridview->checkClipboard(); //Not very elegant, but fixes a buglet - connect(grid, SIGNAL(selecteddata(bool)), SLOT( slotUpdateCopy(bool))); + connect(grid, TQT_SIGNAL(selecteddata(bool)), TQT_SLOT( slotUpdateCopy(bool))); kdDebug(4640) << "Updating statusbar" << endl; slotUpdateStatusSize(grid->cols(), grid->rows()); @@ -165,7 +165,7 @@ bool KIconEdit::queryClose() if (grid->isModified()) { int r = KMessageBox::warningYesNoCancel(this, - i18n("The current file has been modified.\nDo you want to save it?"), QString::null, KStdGuiItem::save(), KStdGuiItem::discard()); + i18n("The current file has been modified.\nDo you want to save it?"), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()); switch(r) { @@ -204,7 +204,7 @@ void KIconEdit::readProperties(KConfig *config) { kdDebug(4640) << "KIconEdit::readProperties" << endl; - QString entry = config->readPathEntry("Name"); // no default + TQString entry = config->readPathEntry("Name"); // no default if (entry.isEmpty()) return; icon->open(&grid->image(), KURL::fromPathOrURL( entry )); } @@ -222,12 +222,12 @@ void KIconEdit::writeConfig() saveMainWindowSettings( config, "MainWindowSettings" ); } -QSize KIconEdit::sizeHint() const +TQSize KIconEdit::sizeHint() const { if(gridview) return gridview->sizeHint(); else - return QSize(-1, -1); + return TQSize(-1, -1); } void KIconEdit::setupActions() @@ -240,43 +240,43 @@ void KIconEdit::setupActions() // File Menu action = new KAction(i18n("New &Window"), "window_new", cut, - this, SLOT(slotNewWin()), actionCollection(), "file_new_window"); + this, TQT_SLOT(slotNewWin()), actionCollection(), "file_new_window"); action->setWhatsThis(i18n("New window\n\nOpens a new icon editor window.")); - action = KStdAction::openNew(this, SLOT(slotNew()), actionCollection()); + action = KStdAction::openNew(this, TQT_SLOT(slotNew()), actionCollection()); action->setWhatsThis(i18n("New\n\nCreate a new icon, either from a" " template or by specifying the size")); - action = KStdAction::open(this, SLOT(slotOpen()), actionCollection()); + action = KStdAction::open(this, TQT_SLOT(slotOpen()), actionCollection()); action->setWhatsThis(i18n("Open\n\nOpen an existing icon")); m_actRecent = KStdAction::openRecent(this, - SLOT(slotOpenRecent(const KURL&)), actionCollection()); + TQT_SLOT(slotOpenRecent(const KURL&)), actionCollection()); m_actRecent->setMaxItems(15); // FIXME should be configurable! m_actRecent->loadEntries(kapp->config()); - action = KStdAction::save(this, SLOT(slotSave()), actionCollection()); + action = KStdAction::save(this, TQT_SLOT(slotSave()), actionCollection()); action->setWhatsThis(i18n("Save\n\nSave the current icon")); - KStdAction::saveAs(this, SLOT(slotSaveAs()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(slotSaveAs()), actionCollection()); - action = KStdAction::print(this, SLOT(slotPrint()), actionCollection()); + action = KStdAction::print(this, TQT_SLOT(slotPrint()), actionCollection()); action->setWhatsThis(i18n("Print\n\nOpens a print dialog to let you print" " the current icon.")); - KStdAction::close(this, SLOT(slotClose()), actionCollection()); + KStdAction::close(this, TQT_SLOT(slotClose()), actionCollection()); // Edit Menu - m_actCut = KStdAction::cut(this, SLOT(slotCut()), actionCollection()); + m_actCut = KStdAction::cut(this, TQT_SLOT(slotCut()), actionCollection()); m_actCut->setWhatsThis(i18n("Cut\n\nCut the current selection out of the" " icon.\n\n(Tip: You can make both rectangular and circular selections)")); - m_actCopy = KStdAction::copy(this, SLOT(slotCopy()), actionCollection()); + m_actCopy = KStdAction::copy(this, TQT_SLOT(slotCopy()), actionCollection()); m_actCopy->setWhatsThis(i18n("Copy\n\nCopy the current selection out of the" " icon.\n\n(Tip: You can make both rectangular and circular selections)")); - m_actPaste = KStdAction::paste(this, SLOT(slotPaste()), actionCollection()); + m_actPaste = KStdAction::paste(this, TQT_SLOT(slotPaste()), actionCollection()); m_actPaste->setWhatsThis(i18n("Paste\n\n" "Paste the contents of the clipboard into the current icon.\n\n" "If the contents are larger than the current icon you can paste them" @@ -285,28 +285,28 @@ void KIconEdit::setupActions() " if you also want to paste transparency.)")); m_actPasteNew = new KAction( i18n( "Paste as &New" ), cut, grid, - SLOT( editPasteAsNew() ), actionCollection(), "edit_paste_as_new" ); + TQT_SLOT( editPasteAsNew() ), actionCollection(), "edit_paste_as_new" ); - KStdAction::clear(this, SLOT(slotClear()), actionCollection()); - KStdAction::selectAll(this, SLOT(slotSelectAll()), actionCollection()); + KStdAction::clear(this, TQT_SLOT(slotClear()), actionCollection()); + KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), actionCollection()); action = new KAction(i18n("Resi&ze..."), "transform", cut, - grid, SLOT(editResize()), actionCollection(), "edit_resize"); + grid, TQT_SLOT(editResize()), actionCollection(), "edit_resize"); action->setWhatsThis(i18n("Resize\n\nSmoothly resizes the icon while" " trying to preserve the contents")); action = new KAction(i18n("&GrayScale"), "grayscale", cut, - grid, SLOT(grayScale()), actionCollection(), "edit_grayscale"); + grid, TQT_SLOT(grayScale()), actionCollection(), "edit_grayscale"); action->setWhatsThis(i18n("Gray scale\n\nGray scale the current icon.\n" "(Warning: The result is likely to contain colors not in the icon" " palette")); // View Menu - m_actZoomIn = KStdAction::zoomIn(this, SLOT(slotZoomIn()), + m_actZoomIn = KStdAction::zoomIn(this, TQT_SLOT(slotZoomIn()), actionCollection()); m_actZoomIn->setWhatsThis(i18n("Zoom in\n\nZoom in by one.")); - m_actZoomOut = KStdAction::zoomOut(this, SLOT(slotZoomOut()), + m_actZoomOut = KStdAction::zoomOut(this, TQT_SLOT(slotZoomOut()), actionCollection()); m_actZoomOut->setWhatsThis(i18n("Zoom out\n\nZoom out by one.")); @@ -314,26 +314,26 @@ void KIconEdit::setupActions() actionCollection(), "view_zoom" ); // xgettext:no-c-format - action = new KAction( i18n( "100%" ), cut, this, SLOT( slotZoom1() ), + action = new KAction( i18n( "100%" ), cut, this, TQT_SLOT( slotZoom1() ), actionCollection(), "view_zoom_1" ); actMenu->insert( action ); // xgettext:no-c-format - action = new KAction( i18n( "200%" ), cut, this, SLOT( slotZoom2() ), + action = new KAction( i18n( "200%" ), cut, this, TQT_SLOT( slotZoom2() ), actionCollection(), "view_zoom_2" ); actMenu->insert( action ); // xgettext:no-c-format - action = new KAction( i18n( "500%" ), cut, this, SLOT( slotZoom5() ), + action = new KAction( i18n( "500%" ), cut, this, TQT_SLOT( slotZoom5() ), actionCollection(), "view_zoom_5" ); actMenu->insert( action ); // xgettext:no-c-format - action = new KAction( i18n( "1000%" ), cut, this, SLOT( slotZoom10() ), + action = new KAction( i18n( "1000%" ), cut, this, TQT_SLOT( slotZoom10() ), actionCollection(), "view_zoom_10" ); actMenu->insert( action ); // Settings Menu - KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), + KStdAction::keyBindings(this, TQT_SLOT(slotConfigureKeys()), actionCollection()); - KStdAction::preferences(this, SLOT(slotConfigureSettings()), + KStdAction::preferences(this, TQT_SLOT(slotConfigureSettings()), actionCollection()); createStandardStatusBarAction(); @@ -341,7 +341,7 @@ void KIconEdit::setupActions() KToggleAction *toggle; toggle = new KToggleAction( i18n( "Show &Grid" ), "grid", - cut, this, SLOT( slotShowGrid() ), actionCollection(), + cut, this, TQT_SLOT( slotShowGrid() ), actionCollection(), "options_show_grid" ); toggle->setCheckedState(i18n("Hide &Grid")); toggle->setWhatsThis( i18n( "Show grid\n\nToggles the grid in the icon" @@ -350,14 +350,14 @@ void KIconEdit::setupActions() // Tools Menu toolAction = new KRadioAction(i18n("Color Picker"), "colorpicker", - cut, this, SLOT(slotToolPointer()), actionCollection(), + cut, this, TQT_SLOT(slotToolPointer()), actionCollection(), "tool_find_pixel"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Color Picker\n\nThe color of the pixel clicked" " on will be the current draw color")); toolAction = new KRadioAction(i18n("Freehand"), "paintbrush", - cut, this, SLOT(slotToolFreehand()), actionCollection(), + cut, this, TQT_SLOT(slotToolFreehand()), actionCollection(), "tool_freehand"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Free hand\n\nDraw non-linear lines")); @@ -366,64 +366,64 @@ void KIconEdit::setupActions() grid->setTool(KIconEditGrid::Freehand); toolAction = new KRadioAction(i18n("Rectangle"), "rectangle", - cut, this, SLOT(slotToolRectangle()), actionCollection(), + cut, this, TQT_SLOT(slotToolRectangle()), actionCollection(), "tool_rectangle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Rectangle\n\nDraw a rectangle")); toolAction = new KRadioAction(i18n("Filled Rectangle"), "filledrectangle", - cut, this, SLOT(slotToolFilledRectangle()), actionCollection(), + cut, this, TQT_SLOT(slotToolFilledRectangle()), actionCollection(), "tool_filled_rectangle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Filled rectangle\n\nDraw a filled rectangle")); toolAction = new KRadioAction(i18n("Circle"), "circle", - cut, this, SLOT(slotToolCircle()), actionCollection(), + cut, this, TQT_SLOT(slotToolCircle()), actionCollection(), "tool_circle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Circle\n\nDraw a circle")); toolAction = new KRadioAction(i18n("Filled Circle"), "filledcircle", - cut, this, SLOT(slotToolFilledCircle()), actionCollection(), + cut, this, TQT_SLOT(slotToolFilledCircle()), actionCollection(), "tool_filled_circle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Filled circle\n\nDraw a filled circle")); toolAction = new KRadioAction(i18n("Ellipse"), "ellipse", - cut, this, SLOT(slotToolEllipse()), actionCollection(), + cut, this, TQT_SLOT(slotToolEllipse()), actionCollection(), "tool_ellipse"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Ellipse\n\nDraw an ellipse")); toolAction = new KRadioAction(i18n("Filled Ellipse"), "filledellipse", - cut, this, SLOT(slotToolFilledEllipse()), actionCollection(), + cut, this, TQT_SLOT(slotToolFilledEllipse()), actionCollection(), "tool_filled_ellipse"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Filled ellipse\n\nDraw a filled ellipse")); toolAction = new KRadioAction(i18n("Spray"), "airbrush", - cut, this, SLOT(slotToolSpray()), actionCollection(), + cut, this, TQT_SLOT(slotToolSpray()), actionCollection(), "tool_spray"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Spray\n\nDraw scattered pixels in the" " current color")); toolAction = new KRadioAction(i18n("Flood Fill"), "fill", - cut, this, SLOT(slotToolFlood()), actionCollection(), + cut, this, TQT_SLOT(slotToolFlood()), actionCollection(), "tool_flood_fill"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Flood fill\n\nFill adjoining pixels with" " the same color with the current color")); toolAction = new KRadioAction(i18n("Line"), "line", - cut, this, SLOT(slotToolLine()), actionCollection(), + cut, this, TQT_SLOT(slotToolLine()), actionCollection(), "tool_line"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Line\n\nDraw a straight line vertically," " horizontally or at 45 deg. angles")); toolAction = new KRadioAction(i18n("Eraser (Transparent)"), "eraser", - cut, this, SLOT(slotToolEraser()), actionCollection(), + cut, this, TQT_SLOT(slotToolEraser()), actionCollection(), "tool_eraser"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Erase\n\nErase pixels. Set the pixels to" @@ -432,14 +432,14 @@ void KIconEdit::setupActions() " to use)")); toolAction = new KRadioAction(i18n("Rectangular Selection"), - "selectrect", cut, this, SLOT(slotToolSelectRect()), + "selectrect", cut, this, TQT_SLOT(slotToolSelectRect()), actionCollection(), "edit_select_rectangle"); toolAction->setExclusiveGroup( "toolActions" ); toolAction->setWhatsThis(i18n("Select\n\nSelect a rectangular section" " of the icon using the mouse.")); toolAction = new KRadioAction(i18n("Circular Selection"), - "selectcircle", cut, this, SLOT(slotToolSelectCircle()), + "selectcircle", cut, this, TQT_SLOT(slotToolSelectCircle()), actionCollection(), "edit_select_circle"); toolAction->setExclusiveGroup( "toolActions" ); toolAction->setWhatsThis(i18n("Select\n\nSelect a circular section of the" @@ -451,8 +451,8 @@ void KIconEdit::updateAccels() actionCollection()->readShortcutSettings(); } -QWidget *KIconEdit::createContainer( QWidget *parent, int index, - const QDomElement &element, int &id ) +TQWidget *KIconEdit::createContainer( TQWidget *parent, int index, + const TQDomElement &element, int &id ) { if ( element.attribute( "name" ) == "paletteToolBar" ) { @@ -468,11 +468,11 @@ bool KIconEdit::setupStatusBar() { statusbar = statusBar(); - QString str = i18n("Statusbar\n\nThe statusbar gives information on" + TQString str = i18n("Statusbar\n\nThe statusbar gives information on" " the status of the current icon. The fields are:\n\n" "\t- Application messages\n\t- Cursor position\n\t- Size\n\t- Zoom factor\n" "\t- Number of colors"); - QWhatsThis::add(statusBar(), str); + TQWhatsThis::add(statusBar(), str); statusbar->insertFixedItem("99999,99999", 0, true); statusbar->insertFixedItem("99999 x 99999", 1, true); @@ -489,7 +489,7 @@ bool KIconEdit::setupStatusBar() return true; } -void KIconEdit::addRecent(const QString & path) +void KIconEdit::addRecent(const TQString & path) { m_actRecent->addURL(KURL( path )); } -- cgit v1.2.3