From 458efa7b0c935cbaafa2791021a5f8f7241aa876 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 2 May 2011 22:38:52 +0000 Subject: Initial TQt4 port of Rosegarden This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1230242 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/gui/general/EditView.cpp | 106 +++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'src/gui/general/EditView.cpp') diff --git a/src/gui/general/EditView.cpp b/src/gui/general/EditView.cpp index e37cbfc..f216dad 100644 --- a/src/gui/general/EditView.cpp +++ b/src/gui/general/EditView.cpp @@ -112,15 +112,15 @@ const unsigned int EditView::TOPBARBUTTONS_ROW = RULERS_ROW + 1; const unsigned int EditView::CANVASVIEW_ROW = TOPBARBUTTONS_ROW + 1; const unsigned int EditView::CONTROLRULER_ROW = CANVASVIEW_ROW + 1; -// Just some simple features we might want to show - make them bit maskable +// Just some simple features we might want to show - make them bit tqmaskable // static int FeatureShowVelocity = 0x00001; // show the velocity ruler EditView::EditView(RosegardenGUIDoc *doc, std::vector segments, unsigned int cols, - TQWidget *parent, const char *name) : - EditViewBase(doc, segments, cols, parent, name), + TQWidget *tqparent, const char *name) : + EditViewBase(doc, segments, cols, tqparent, name), m_currentEventSelection(0), m_activeItem(0), m_canvasView(0), @@ -138,7 +138,7 @@ EditView::EditView(RosegardenGUIDoc *doc, connect(m_controlRulers, TQT_SIGNAL(closeRequest(TQWidget*)), this, TQT_SLOT(slotRemoveControlRuler(TQWidget*))); - (dynamic_cast(m_bottomBox->layout()))->setDirection(TQBoxLayout::BottomToTop); + (dynamic_cast(m_bottomBox->tqlayout()))->setDirection(TQBoxLayout::BottomToTop); // m_rulerBoxFiller is a white label used to keep m_rulerBox exactly // above the scrolling part of the view (and never above the @@ -154,7 +154,7 @@ EditView::EditView(RosegardenGUIDoc *doc, m_grid->addLayout(gl, RULERS_ROW, m_mainCol); m_grid->addMultiCellLayout(m_controlBox, CONTROLS_ROW, CONTROLS_ROW, 0, 1); - m_controlBox->setAlignment(AlignRight); + m_controlBox->tqsetAlignment(AlignRight); // m_grid->addWidget(m_controlRulers, CONTROLRULER_ROW, 2); m_controlRulers->hide(); @@ -169,7 +169,7 @@ EditView::~EditView() void EditView::updateBottomWidgetGeometry() { - getBottomWidget()->layout()->invalidate(); + getBottomWidget()->tqlayout()->tqinvalidate(); getBottomWidget()->updateGeometry(); getCanvasView()->updateBottomWidgetGeometry(); } @@ -728,82 +728,82 @@ EditView::setupActions() TQIconSet icon = TQIconSet(pixmap); new KAction(AddTempoChangeCommand::getGlobalName(), icon, 0, - this, TQT_SLOT(slotAddTempo()), + TQT_TQOBJECT(this), TQT_SLOT(slotAddTempo()), actionCollection(), "add_tempo"); pixmap.load(pixmapDir + "/toolbar/event-insert-timesig.png"); icon = TQIconSet(pixmap); new KAction(AddTimeSignatureCommand::getGlobalName(), icon, 0, - this, TQT_SLOT(slotAddTimeSignature()), + TQT_TQOBJECT(this), TQT_SLOT(slotAddTimeSignature()), actionCollection(), "add_time_signature"); // // Transforms // - new KAction(i18n("&Halve Durations"), Key_H + CTRL, this, + new KAction(i18n("&Halve Durations"), Key_H + CTRL, TQT_TQOBJECT(this), TQT_SLOT(slotHalveDurations()), actionCollection(), "halve_durations"); - new KAction(i18n("&Double Durations"), Key_H + CTRL + SHIFT, this, + new KAction(i18n("&Double Durations"), Key_H + CTRL + SHIFT, TQT_TQOBJECT(this), TQT_SLOT(slotDoubleDurations()), actionCollection(), "double_durations"); - new KAction(RescaleCommand::getGlobalName(), 0, this, + new KAction(RescaleCommand::getGlobalName(), 0, TQT_TQOBJECT(this), TQT_SLOT(slotRescale()), actionCollection(), "rescale"); new KAction(TransposeCommand::getGlobalName(1), 0, - Key_Up, this, + Key_Up, TQT_TQOBJECT(this), TQT_SLOT(slotTransposeUp()), actionCollection(), "transpose_up"); new KAction(TransposeCommand::getGlobalName(12), 0, - Key_Up + CTRL, this, + Key_Up + CTRL, TQT_TQOBJECT(this), TQT_SLOT(slotTransposeUpOctave()), actionCollection(), "transpose_up_octave"); new KAction(TransposeCommand::getGlobalName( -1), 0, - Key_Down, this, + Key_Down, TQT_TQOBJECT(this), TQT_SLOT(slotTransposeDown()), actionCollection(), "transpose_down"); new KAction(TransposeCommand::getGlobalName( -12), 0, - Key_Down + CTRL, this, + Key_Down + CTRL, TQT_TQOBJECT(this), TQT_SLOT(slotTransposeDownOctave()), actionCollection(), "transpose_down_octave"); - new KAction(TransposeCommand::getGlobalName(0), 0, this, + new KAction(TransposeCommand::getGlobalName(0), 0, TQT_TQOBJECT(this), TQT_SLOT(slotTranspose()), actionCollection(), "general_transpose"); - new KAction(TransposeCommand::getDiatonicGlobalName(0,0), 0, this, + new KAction(TransposeCommand::getDiatonicGlobalName(0,0), 0, TQT_TQOBJECT(this), TQT_SLOT(slotDiatonicTranspose()), actionCollection(), "general_diatonic_transpose"); - new KAction(InvertCommand::getGlobalName(0), 0, this, + new KAction(InvertCommand::getGlobalName(0), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvert()), actionCollection(), "invert"); - new KAction(RetrogradeCommand::getGlobalName(0), 0, this, + new KAction(RetrogradeCommand::getGlobalName(0), 0, TQT_TQOBJECT(this), TQT_SLOT(slotRetrograde()), actionCollection(), "retrograde"); - new KAction(RetrogradeInvertCommand::getGlobalName(0), 0, this, + new KAction(RetrogradeInvertCommand::getGlobalName(0), 0, TQT_TQOBJECT(this), TQT_SLOT(slotRetrogradeInvert()), actionCollection(), "retrograde_invert"); - new KAction(i18n("Jog &Left"), Key_Left + ALT, this, + new KAction(i18n("Jog &Left"), Key_Left + ALT, TQT_TQOBJECT(this), TQT_SLOT(slotJogLeft()), actionCollection(), "jog_left"); - new KAction(i18n("Jog &Right"), Key_Right + ALT, this, + new KAction(i18n("Jog &Right"), Key_Right + ALT, TQT_TQOBJECT(this), TQT_SLOT(slotJogRight()), actionCollection(), "jog_right"); // Control rulers // - new KAction(i18n("Show Velocity Property Ruler"), 0, this, + new KAction(i18n("Show Velocity Property Ruler"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowVelocityControlRuler()), actionCollection(), "show_velocity_control_ruler"); @@ -822,37 +822,37 @@ EditView::setupActions() // // Control Ruler context menu // - new KAction(i18n("Insert item"), 0, this, + new KAction(i18n("Insert item"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInsertControlRulerItem()), actionCollection(), "insert_control_ruler_item"); // This was on Key_Delete, but that conflicts with existing Delete commands // on individual edit views - new KAction(i18n("Erase selected items"), 0, this, + new KAction(i18n("Erase selected items"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotEraseControlRulerItem()), actionCollection(), "erase_control_ruler_item"); - new KAction(i18n("Clear ruler"), 0, this, + new KAction(i18n("Clear ruler"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotClearControlRulerItem()), actionCollection(), "clear_control_ruler_item"); - new KAction(i18n("Insert line of controllers"), 0, this, + new KAction(i18n("Insert line of controllers"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotStartControlLineItem()), actionCollection(), "start_control_line_item"); - new KAction(i18n("Flip forward"), Key_BracketRight, this, + new KAction(i18n("Flip forward"), Key_BracketRight, TQT_TQOBJECT(this), TQT_SLOT(slotFlipForwards()), actionCollection(), "flip_control_events_forward"); - new KAction(i18n("Flip backwards"), Key_BracketLeft, this, + new KAction(i18n("Flip backwards"), Key_BracketLeft, TQT_TQOBJECT(this), TQT_SLOT(slotFlipBackwards()), actionCollection(), "flip_control_events_back"); - new KAction(i18n("Draw property line"), 0, this, + new KAction(i18n("Draw property line"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotDrawPropertyLine()), actionCollection(), "draw_property_line"); - new KAction(i18n("Select all property values"), 0, this, + new KAction(i18n("Select all property values"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSelectAllProperties()), actionCollection(), "select_all_properties"); } @@ -891,9 +891,9 @@ EditView::setupAddControlRulerMenu() TQString hexValue; hexValue.sprintf("(0x%x)", it->getControllerValue()); - itemStr = i18n("%1 Controller %2 %3").arg(strtoqstr(it->getName())) - .arg(it->getControllerValue()) - .arg(hexValue); + itemStr = i18n("%1 Controller %2 %3").tqarg(strtoqstr(it->getName())) + .tqarg(it->getControllerValue()) + .tqarg(hexValue); } else if (it->getType() == PitchBend::EventType) itemStr = i18n("Pitch Bend"); @@ -1082,18 +1082,18 @@ EditView::createInsertPitchActionMenu() }; KActionMenu *insertPitchActionMenu = - new KActionMenu(i18n("&Insert Note"), this, "insert_note_actionmenu"); + new KActionMenu(i18n("&Insert Note"), TQT_TQOBJECT(this), "insert_note_actionmenu"); for (int octave = 0; octave <= 2; ++octave) { KActionMenu *menu = insertPitchActionMenu; if (octave == 1) { - menu = new KActionMenu(i18n("&Upper Octave"), this, + menu = new KActionMenu(i18n("&Upper Octave"), TQT_TQOBJECT(this), "insert_note_actionmenu_upper_octave"); - insertPitchActionMenu->insert(new KActionSeparator(this)); + insertPitchActionMenu->insert(new KActionSeparator(TQT_TQOBJECT(this))); insertPitchActionMenu->insert(menu); } else if (octave == 2) { - menu = new KActionMenu(i18n("&Lower Octave"), this, + menu = new KActionMenu(i18n("&Lower Octave"), TQT_TQOBJECT(this), "insert_note_actionmenu_lower_octave"); insertPitchActionMenu->insert(menu); } @@ -1114,10 +1114,10 @@ EditView::createInsertPitchActionMenu() insertPitchAction = new KAction - (flat.arg(notePitchNames[i]), + (flat.tqarg(notePitchNames[i]), CTRL + SHIFT + notePitchKeys[octave][i], - this, TQT_SLOT(slotInsertNoteFromAction()), actionCollection(), - TQString("insert_%1_flat%2").arg(i).arg(octaveSuffix)); + TQT_TQOBJECT(this), TQT_SLOT(slotInsertNoteFromAction()), actionCollection(), + TQString("insert_%1_flat%2").tqarg(i).tqarg(octaveSuffix)); menu->insert(insertPitchAction); } @@ -1126,8 +1126,8 @@ EditView::createInsertPitchActionMenu() new KAction (notePitchNames[i], notePitchKeys[octave][i], - this, TQT_SLOT(slotInsertNoteFromAction()), actionCollection(), - TQString("insert_%1%2").arg(i).arg(octaveSuffix)); + TQT_TQOBJECT(this), TQT_SLOT(slotInsertNoteFromAction()), actionCollection(), + TQString("insert_%1%2").tqarg(i).tqarg(octaveSuffix)); menu->insert(insertPitchAction); @@ -1137,16 +1137,16 @@ EditView::createInsertPitchActionMenu() insertPitchAction = new KAction - (sharp.arg(notePitchNames[i]), + (sharp.tqarg(notePitchNames[i]), SHIFT + notePitchKeys[octave][i], - this, TQT_SLOT(slotInsertNoteFromAction()), actionCollection(), - TQString("insert_%1_sharp%2").arg(i).arg(octaveSuffix)); + TQT_TQOBJECT(this), TQT_SLOT(slotInsertNoteFromAction()), actionCollection(), + TQString("insert_%1_sharp%2").tqarg(i).tqarg(octaveSuffix)); menu->insert(insertPitchAction); } if (i < 6) - menu->insert(new KActionSeparator(this)); + menu->insert(new KActionSeparator(TQT_TQOBJECT(this))); } } @@ -1351,13 +1351,13 @@ void EditView::slotShowPropertyControlRuler() KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok); KListBox* propList = new KListBox(propChooserDialog.makeVBoxMainWidget()); - new QListBoxRGProperty(propList, BaseProperties::VELOCITY.c_str()); + new TQListBoxRGProperty(propList, BaseProperties::VELOCITY.c_str()); int rc = propChooserDialog.exec(); if (rc == TQDialog::Accepted) { // fix for KDE 3.0 - //QListBoxRGProperty* item = dynamic_cast(propList->selectedItem()); - QListBoxRGProperty* item = dynamic_cast + //TQListBoxRGProperty* item = dynamic_cast(propList->selectedItem()); + TQListBoxRGProperty* item = dynamic_cast (propList->item(propList->currentItem())); if (item) { @@ -1484,7 +1484,7 @@ void EditView::slotTranspose() int dialogDefault = m_config->readNumEntry("lasttransposition", 0); bool ok = false; - int semitones = QInputDialog::getInteger + int semitones = TQInputDialog::getInteger (i18n("Transpose"), i18n("By number of semitones: "), dialogDefault, -127, 127, 1, &ok, this); @@ -1674,7 +1674,7 @@ ControlRuler* EditView::findRuler(const ControlParameter& controller, int &index PropertyControlRuler* EditView::makePropertyControlRuler(PropertyName propertyName) { - TQCanvas* controlRulerCanvas = new TQCanvas(this); + TQCanvas* controlRulerCanvas = new TQCanvas(TQT_TQOBJECT(this)); TQSize viewSize = getViewSize(); controlRulerCanvas->resize(viewSize.width(), ControlRuler::DefaultRulerHeight); // TODO - keep it in sync with main canvas size @@ -1692,7 +1692,7 @@ PropertyControlRuler* EditView::makePropertyControlRuler(PropertyName propertyNa ControllerEventsRuler* EditView::makeControllerEventRuler(const ControlParameter *controller) { - TQCanvas* controlRulerCanvas = new TQCanvas(this); + TQCanvas* controlRulerCanvas = new TQCanvas(TQT_TQOBJECT(this)); TQSize viewSize = getViewSize(); controlRulerCanvas->resize(viewSize.width(), ControlRuler::DefaultRulerHeight); // TODO - keep it in sync with main canvas size // TQCanvas* controlRulerCanvas = ControlRulerCanvasRepository::getCanvas(getCurrentSegment(), controller, -- cgit v1.2.1