void UserWnd::showListView(bool bShow) { if (bShow){ if (m_list == NULL){ m_list = new UserList(m_hSplitter); m_hSplitter->setResizeMode(m_list, QSplitter::Stretch); connect(m_list, SIGNAL(selectChanged()), this, SLOT(selectChanged())); if (topLevelWidget()->inherits("Container")){ Container *c = static_cast<Container*>(topLevelWidget()); list<UserWnd*> wnd = c->windows(); for (list<UserWnd*>::iterator it = wnd.begin(); it != wnd.end(); ++it) m_list->selected.push_back((*it)->id()); } } m_list->show(); emit multiplyChanged(); return; } if (m_list == NULL) return; delete m_list; m_list = NULL; emit multiplyChanged(); }
void Draw::toolChange(DrawTool id) { if (_tool==D_OVERDRAW && id!=D_OVERDRAW && _spliceFlag==-2 && _selected) finishSplicedCurve(); _spliceFlag=-1; if (_tool==D_SELECT && id!=D_SELECT && _justPasted) finishJustPasted(); _tool = id; if (_corrShow) { _corrShow = 0; _currDPath = NULL; } if (id==D_DRAW) { if (_selected) { _selected = NULL; emit selectChanged(); } //_selectedPatch = NULL; } _parent->updateGL(); }
ICQSearchResult::ICQSearchResult(QWidget *parent, ICQClient *client) : ICQSearchResultBase(parent) { m_id1 = SEARCH_DONE; m_id2 = SEARCH_DONE; m_nFound = 0; m_client = client; int wChar = QFontMetrics(font()).width('0'); tblUser->addColumn("", -10*wChar); tblUser->setColumnAlignment(0, AlignRight); tblUser->addColumn(i18n("Alias"), 20*wChar); tblUser->addColumn(i18n("Name")); tblUser->setExpandingColumn(COL_NAME); tblUser->setSorting(COL_SCREEN); tblUser->setMenu(MenuSearchResult); tblUser->header()->hide(); connect(tblUser, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(tblUser, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(doubleClicked(QListViewItem*))); connect(tblUser, SIGNAL(selectionChanged()), this, SLOT(selectChanged())); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); connect(wizard->finishButton(), SIGNAL(clicked()), this, SLOT(finishClicked())); }
Services::Services(QWidget *parent, JabberClient *client) : ServicesBase(parent) { m_client = client; m_bOnline = false; wndInfo->hide(); wndInfo->addWidget(new QChildWidget(NULL), 0); wndInfo->raiseWidget(0); cmbAgents->hide(); btnRegister->hide(); lstAgents->addColumn(i18n("JID")); lstAgents->addColumn(i18n("Status")); lstAgents->setExpandingColumn(0); statusChanged(); connect(cmbAgents, SIGNAL(activated(int)), this, SLOT(selectAgent(int))); connect(btnRegister, SIGNAL(clicked()), this, SLOT(regAgent())); connect(btnUnregister, SIGNAL(clicked()), this, SLOT(unregAgent())); connect(btnLogon, SIGNAL(clicked()), this, SLOT(logon())); connect(btnLogoff, SIGNAL(clicked()), this, SLOT(logoff())); connect(lstAgents, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(slectChanged(QListViewItem*))); connect(wndInfo, SIGNAL(aboutToShow(QWidget*)), this, SLOT(showAgent(QWidget*))); selectChanged(NULL); }
void AnimationView::selectionChanged( const QItemSelection& selected, const QItemSelection& deselected ) { QListView::selectionChanged(selected, deselected); emit selectChanged(); }
void StrategicItemModel::notifySelectChanged(const QItemSelection &selection) { emit selectChanged(selection); }
void Draw::mousePressEvent( QMouseEvent *e ) { // printf("mouse press event %d\n", e->button()); // draw _mousePressed = 1; if (e->button() == Qt::LeftButton && (_tool == D_DRAW || _tool == D_PAINT)) { if (_corrShow) { _corrShow = 0; _currDPath = NULL; } if (_currDPath != NULL) return; _pressure = 20.f; //printf("mouse press pressure %f %f\n",_pressure, _sens); _currDPath = new DrawPath(); _currDPath->setColor(_currColor); _currDPath->initHertzStroke(); // comment out to avoid Hertzman strokes Vec2f loc = unproject(e->x(), e->y(), _h); //_currDPath->addVertex(loc.x(), loc.y(), mapPressure()); //_minimalRenderMode = 1; } else if (_tool==D_SELECT) { // select int which; // 0 for patch, 1 for path, -1 for neither void* selected = _dc->pickPrimitive(e->x(), e->y(), &which); _dragLoc = unproject(e->x(), e->y(), _h); if (selected) { if (which==0) { //_selectedPatch = (DrawPatch*) selected; _selected = NULL; } else { _selected = (DrawPath*) selected; //_selectedPatch = NULL; } } else { if (_justPasted) finishJustPasted(); //_selectedPatch = NULL; _selected = NULL; } emit selectChanged(); } else if (e->button() == Qt::LeftButton && _tool==D_OVERDRAW) { // overdraw Vec2f loc = unproject(e->x(), e->y(), _h); if (_spliceFlag > -1) { // already drawing } else { if (!_selected) { printf("Please select a curve to edit, first.\n"); return; } double d1 = _selected->distanceTo2(loc, _spliceIndex); if (d1<16) { // starting on curve _spliceFlag=1; } else { // new beginning to curve _spliceFlag=0; _spliceIndex=0; } assert(!_currDPath); _currDPath = new DrawPath(); _currDPath->setColor(_selected->getColor()); _currDPath->initHertzStroke(); //_currDPath->addVertex(loc.x(), loc.y(), mapPressure()); } } else if (e->button() == Qt::LeftButton && _tool==D_NUDGE) { // nudge if (!_selected) { printf("Please select a curve to edit, first.\n"); _spliceIndex=-1; return; } Vec2f loc = unproject(e->x(), e->y(), _h); double d1 = _selected->distanceTo2(loc, _spliceIndex); if (d1>9) { _spliceIndex=-1; return; } } _parent->updateGL(); }
void Draw::keyPressEvent ( QKeyEvent * e ) { if (_selected) { if (e->key() == Qt::Key_Backspace) { _dc->deletePath(_selected); if (_selected) { _selected = NULL; emit selectChanged(); } } else if (e->key() == Qt::Key_N) { _selected = _dc->cycle(_selected); emit selectChanged(); _parent->updateGL(); } else if (e->key() == Qt::Key_Comma && _selected->getStroke()) { _selected->decrementThickness(1); _selected->freshenAppearance(); } else if (e->key() == Qt::Key_Period && _selected->getStroke()) { _selected->incrementThickness(1); _selected->freshenAppearance(); } else e->ignore(); _parent->updateGL(); /* if (e->key() == Qt::Key_Comma && _selected->getStroke()) _selected->decrementThickness(1); else if (e->key() == Qt::Key_Period && _selected->getStroke()) _selected->incrementThickness(1); else if (e->key() == Qt::Key_A && _selected->prevC()) { _selected->prevC()->fair(); printf("A_prime\n"); interpolateForwards(_selected->prevC(),_frame); } else if (e->key() == Qt::Key_P && _selected->prevC()) { RotoPath* A_prime = _selected->prevC()->getCorrespondRoto(); assert(A_prime); A_prime->fair(); printf("A_prime\n"); interpolateForwards(_selected->prevC(),_frame); } else if (e->key() == Qt::Key_B && _selected->prevC()) { assert(_selected->getCorrespondRoto()); _selected->getCorrespondRoto()->fair(); printf("B_prime\n"); interpolateForwards(_selected->prevC(),_frame); } else if (e->key() == Qt::Key_Backspace) { _dc->deletePath(_selected); _selected = NULL; } else if (e->key() == Qt::Key_S) _selected->fair(); else e->ignore(); _parent->updateGL(); */ } else e->ignore(); }
void Draw::callPopup(const int which) { printf("%d\n",which); Vec3f col; switch(which) { case LONG_TRACK_SPAN: //longTrackSpan(_popupPatchPicked); break; case PROPAGATE_MORE: propagatePathEverywhere(_popupPicked); break; case PROPAGATE_LOOK: propagateLook(_popupPicked); break; case CHANGE_COLOR: if (QtpickColor(col)) { _popupPicked->setColor(col); _popupPicked->calculateStrokeDisplayList(); } break; case CHANGE_FILL_COLOR: if (QtpickColor(col)) _popupPicked->setFillColor(col); break; case CORRESPOND_ROTO: _popupPicked->correspondRoto2(_is->getRotoCurves(_frame), _w, _h); break; case UNCORRESPOND: _popupPicked->vacateRotoCorr(); _parent->updateGL(); break; case MOVE_TO_TOP: _dc->MoveToTop(_popupPicked); break; case MOVE_ONE_UP: _dc->MoveOneDown(_popupPicked); break; case MOVE_ONE_DOWN: _dc->MoveOneUp(_popupPicked); break; case MOVE_SPAN_TO_TOP: moveSpanToTop(_popupPicked); break; case MOVE_TO_BOTTOM: _dc->MoveToBottom(_popupPicked); break; case MOVE_SPAN_TO_BOTTOM: moveSpanToBottom(_popupPicked); break; case DELETE: _dc->deletePath(_popupPicked); if (_selected) { _selected = NULL; emit selectChanged(); } if (_currDPath == _popupPicked) _currDPath = NULL; _popupPicked = NULL; _parent->updateGL(); //_corrShow = 0; break; case DELETE_SPAN: deleteSpan(_popupPicked); break; case DELETE_PATCH: //_dc->deletePatch(_popupPatchPicked); //_popupPatchPicked = NULL; break; case DELETE_ALL: _dc->deleteAll(); if (_currDPath) { delete _currDPath; _currDPath=NULL; } if (_selected) { _selected = NULL; emit selectChanged(); } _parent->updateGL(); break; case ACTIVATE_ALL: _dc->setJustDrawn(1); break; case SELECTD: _selected = _popupPicked; emit selectChanged(); _parent->updateGL(); break; case FIXD: _popupPicked->setFixed(true); break; case REBUILD_STROKE_SPAN: rebuildStrokeSpan(_popupPicked); break; case REDO_FORWARD_SPAN: redoForwardSpan(_popupPicked); break; case UNFILL: _popupPicked->setFilled(false); _popupPicked->freshenAppearance(); break; case SET_THICKNESS: bool ok; int res = QInputDialog::getInteger("yo","Width:",5,0,100,1,&ok, _parent); if (ok) _popupPicked->setUniformThickness(res); break; } }