LayerButton* MultiLayer::addLayerButton() { for (int i=0;i<(int)buttonsList->count();i++) { LayerButton *btn=(LayerButton*) buttonsList->at(i); btn->setOn(FALSE); } LayerButton *button=new LayerButton(QString::number(++graphs),hbox1,0); connect (button,SIGNAL(clicked(LayerButton*)),this, SLOT(activateGraph(LayerButton*))); connect (button,SIGNAL(showLayerMenu()),this, SIGNAL(showWindowContextMenu())); connect (button,SIGNAL(showCurvesDialog()),this, SIGNAL(showCurvesDialog())); button->setOn(TRUE); buttonsList->append(button); hbox1->setMaximumWidth(graphs*button->width()); button->show(); return button; }
void MultiLayer::keyPressEvent(QKeyEvent * e) { if (e->key() == Qt::Key_F12) { int index=graphsList->findRef ((QWidget *)active_graph); Graph *g=(Graph *)graphsList->at(index+1); if (g) setActiveGraph(g); } if (e->key() == Qt::Key_F10) { int index=graphsList->findRef ((QWidget *)active_graph); Graph *g=(Graph *)graphsList->at(index-1); if (g) setActiveGraph(g); } if (e->key() == Qt::Key_F11) emit showWindowContextMenu(); }
void MultiLayer::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_F12) { if (d_layers_selector) delete d_layers_selector; int index = graphsList.indexOf((QWidget *)active_graph) + 1; if (index >= graphsList.size()) index = 0; Graph *g = (Graph *)graphsList.at(index); if (g) setActiveGraph(g); return; } if (e->key() == Qt::Key_F10) { if (d_layers_selector) delete d_layers_selector; int index = graphsList.indexOf((QWidget *)active_graph) - 1; if (index < 0) index = graphsList.size() - 1; Graph *g = (Graph *)graphsList.at(index); if (g) setActiveGraph(g); return; } if (e->key() == Qt::Key_F11) { emit showWindowContextMenu(); return; } }
void MultiLayer::contextMenuEvent(QContextMenuEvent *e) { emit showWindowContextMenu(); e->accept(); }