1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
diff -ruN structure-synth-1.5.0/StructureSynth//GUI/MainWindow.cpp trunk/StructureSynth//GUI/MainWindow.cpp
--- structure-synth-1.5.0/StructureSynth//GUI/MainWindow.cpp 2010-11-25 23:57:52.000000000 +0100
+++ trunk/StructureSynth//GUI/MainWindow.cpp 2010-11-25 23:54:04.000000000 +0100
@@ -50,7 +50,6 @@
namespace {
void createCommandHelpMenu(QMenu* menu, QWidget* textEdit) {
-
QMenu *raytraceMenu = new QMenu("Raytracer Commands", 0);
raytraceMenu->addAction("set raytracer::ambient-occlusion-samples 0 // turn off AO", textEdit , SLOT(insertText()));
raytraceMenu->addAction("set raytracer::samples 4 // for anti-alias and DOF", textEdit , SLOT(insertText()));
@@ -138,16 +137,18 @@
p2Menu->addAction("Builder.reset();", textEdit , SLOT(insertText()));
p2Menu->addAction("Builder.setSize(640,0);", textEdit , SLOT(insertText()));
- menu->insertMenu(menu->actions()[0], modifierMenu);
- menu->insertMenu(menu->actions()[1], transformationMenu);
- menu->insertMenu(menu->actions()[2], setMenu);
- menu->insertMenu(menu->actions()[3], set2Menu);
- menu->insertMenu(menu->actions()[4], colorMenu);
- menu->insertMenu(menu->actions()[5], raytraceMenu);
- menu->insertMenu(menu->actions()[6], setCMenu);
- menu->insertMenu(menu->actions()[7], pMenu);
- menu->insertMenu(menu->actions()[8], p2Menu);
- menu->insertSeparator(menu->actions()[9]);
+ QAction* before = 0;
+ if (menu->actions().count() > 0) before = menu->actions()[0];
+ menu->insertMenu(before, modifierMenu);
+ menu->insertMenu(before, transformationMenu);
+ menu->insertMenu(before, setMenu);
+ menu->insertMenu(before, set2Menu);
+ menu->insertMenu(before, colorMenu);
+ menu->insertMenu(before, raytraceMenu);
+ menu->insertMenu(before, setCMenu);
+ menu->insertMenu(before, pMenu);
+ menu->insertMenu(before, p2Menu);
+ menu->insertSeparator(before);
}
}
|