int Widget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: mySignal(); break; case 1: on_toolButton_List_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break; case 2: tableWidget_cellDoubleClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 3: on_toolButton_lrcD_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break; case 4: on_toolButton_next_clicked(); break; case 5: on_toolButton_stop_clicked(); break; case 6: on_toolButton_playpause_clicked(); break; case 7: on_toolButton_previous_clicked(); break; case 8: on_toolButton_open_clicked(); break; case 9: showTime((*reinterpret_cast< qint64(*)>(_a[1]))); break; case 10: Timeout(); break; case 11: musicInformationStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break; case 12: mediaObjectStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break; case 13: musicAboutToFinish(); break; case 14: currentMusicSourceChanged((*reinterpret_cast< Phonon::MediaSource(*)>(_a[1]))); break; case 15: removeSlot(); break; case 16: exitSlot(); break; case 17: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break; default: ; } _id -= 18; } return _id; }
/** Destructor. */ Component::~Component() { DEBUGINFO(this, "Component::~Component() (\""+name+"\")"); // Remove all slots... while(slots.begin()!=slots.end()) { removeSlot(slots.begin()->first); } }
void usr2Handling(int signo) { #ifdef DEBUG printf("Terminazione thread %u\n", (unsigned int)pthread_self() ); #endif removeSlot(); pthread_exit(NULL); }
void Armature::removeSlotByName(std::string slotName){ if((slotName == "") || (slotName == " ")) { return; } Slot* slot = getSlot(slotName); if(slot) { removeSlot(slot); } }
//Добавление пакета в буфер int JitterBuffer::append(quint16 sequenceNumber, //Порядковый номер пакета QByteArray media) //Данные { betweenRcp->stop(); BufferListElement newEl; newEl.sequenceNumber = sequenceNumber; newEl.media = media; //Есть место в буфере - добавляем if (buffList_.count() < bufferSize_) buffList_.append(newEl); //Буфер заполнен - ищем кандидатов на отправку else { int minNumSlot = getSlotByNumber(getMinimumNumber()); //Еще отправлений не было if (lastSequenceNumber_ == 0) removeSlot(minNumSlot); else { //Номера последовательны if ((lastSequenceNumber_+1 ) == buffList_.at(minNumSlot).sequenceNumber) removeSlot(minNumSlot); //Отправляем пустые до покрытия пропуска else { for (int i = lastSequenceNumber_ + 1; i < buffList_.at(minNumSlot).sequenceNumber; i++) sendGarbage(i); removeSlot(minNumSlot); } } buffList_.append(newEl); } return buffList_.count(); }
void DeleteSlotTest() { ///// { ConstraintModel model {id_type<ConstraintModel>{0}, id_type<AbstractConstraintViewModel>{0}, this}; auto content_id = getStrongId(model.rackes()); model.createRack(content_id); auto rack = model.rack(content_id); auto slot_id = getStrongId(rack->getSlots()); rack->addSlot(new SlotModel { slot_id, rack }); rack->removeSlot(slot_id); model.removeRack(content_id); } ////// { ConstraintModel model {id_type<ConstraintModel>{0}, id_type<AbstractConstraintViewModel>{0}, this }; auto content_id = getStrongId(model.rackes()); model.createRack(content_id); auto rack = model.rack(content_id); rack->addSlot(new SlotModel { getStrongId(rack->getSlots()), rack }); rack->addSlot(new SlotModel { getStrongId(rack->getSlots()), rack }); rack->addSlot(new SlotModel { getStrongId(rack->getSlots()), rack }); model.removeRack(content_id); } }
PlayerListWidget::PlayerListWidget( QWidget* parent) : QWidget( parent ) { ui.setupUi(this); connect(gMainWindow, SIGNAL(tournamentOpened()), this, SLOT(tournamentOpened())); connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addSlot())); connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeSlot())); connect(ui.rankButton, SIGNAL(clicked()), this, SLOT(rankSlot())); ui.tableView->setSortingEnabled(true); if (gTournament) { connect (gTournament, SIGNAL(playerAddedSignal()), this, SLOT(refresh())); refresh(); } }//
// patch the hole so chaining still works bool HashTableX::removeKey ( void *key ) { // returns -1 if key not in hash table long n = getOccupiedSlotNum(key); if ( n >= 0 ) return removeSlot ( n ); return true; }
//----------------------------------------------------------------------------- ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent), _saved(false), _WWHEnabled(0) { // kDebug(11001) << ": ConfigDialog"; setWindowTitle( i18n("Configure Highscores") ); setModal( true ); QWidget *page = 0; QTabWidget *tab = 0; QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); if ( internal->isWWHSAvailable() ) { tab = new QTabWidget(this); layout->addWidget(tab); page = new QWidget; tab->addTab(page, i18n("Main")); } else { page = new QWidget(this); layout->addWidget(page); } QGridLayout *pageTop = new QGridLayout(page); //pageTop->setMargin(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)); //pageTop->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)); layout->addLayout(pageTop); QLabel *label = new QLabel(i18n("Nickname:"), page); pageTop->addWidget(label, 0, 0); _nickname = new QLineEdit(page); connect(_nickname, SIGNAL(textChanged(QString)), SLOT(modifiedSlot())); connect(_nickname, SIGNAL(textChanged(QString)), SLOT(nickNameChanged(QString))); _nickname->setMaxLength(16); pageTop->addWidget(_nickname, 0, 1); label = new QLabel(i18n("Comment:"), page); pageTop->addWidget(label, 1, 0); _comment = new QLineEdit(page); connect(_comment, SIGNAL(textChanged(QString)), SLOT(modifiedSlot())); _comment->setMaxLength(50); pageTop->addWidget(_comment, 1, 1); if (tab) { _WWHEnabled = new QCheckBox(i18n("World-wide highscores enabled"), page); connect(_WWHEnabled, SIGNAL(toggled(bool)), SLOT(modifiedSlot())); pageTop->addWidget(_WWHEnabled, 2, 0, 1, 2 ); // advanced tab QWidget *page = new QWidget; tab->addTab(page, i18n("Advanced")); QVBoxLayout *pageTop = new QVBoxLayout(page); //pageTop->setMargin(QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin)); //pageTop->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)); QGroupBox *group = new QGroupBox(page); group->setTitle( i18n("Registration Data") ); pageTop->addWidget(group); QGridLayout *groupLayout = new QGridLayout(group); //groupLayout->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)); label = new QLabel(i18n("Nickname:"), group); groupLayout->addWidget(label, 0, 0); _registeredName = new KLineEdit(group); _registeredName->setReadOnly(true); groupLayout->addWidget(_registeredName, 0, 1); label = new QLabel(i18n("Key:"), group); groupLayout->addWidget(label, 1, 0); _key = new KLineEdit(group); _key->setReadOnly(true); groupLayout->addWidget(_key, 1, 1); KGuiItem gi = KStandardGuiItem::clear(); gi.setText(i18n("Remove")); _removeButton = new QPushButton(group); KGuiItem::assign(_removeButton, gi); groupLayout->addWidget(_removeButton, 2, 0); connect(_removeButton, SIGNAL(clicked()), SLOT(removeSlot())); } buttonBox = new QDialogButtonBox(this); buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); // TODO mapping for Apply button pageTop->addWidget(buttonBox); load(); buttonBox->button(QDialogButtonBox::Ok)->setEnabled( !_nickname->text().isEmpty() ); buttonBox->button(QDialogButtonBox::Apply)->setEnabled( false ); }
// Constructor. qtractorInstrumentForm::qtractorInstrumentForm ( QWidget *pParent, Qt::WindowFlags wflags ) : QDialog(pParent, wflags) { // Setup UI struct... m_ui.setupUi(this); // Window modality (let plugin/tool windows rave around). QDialog::setWindowModality(Qt::WindowModal); m_pInstruments = NULL; m_iDirtyCount = 0; QHeaderView *pHeader = m_ui.InstrumentsListView->header(); pHeader->setDefaultAlignment(Qt::AlignLeft); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setResizeMode(QHeaderView::ResizeToContents); pHeader->setMovable(false); #endif pHeader = m_ui.FilesListView->header(); pHeader->setDefaultAlignment(Qt::AlignLeft); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setResizeMode(QHeaderView::ResizeToContents); pHeader->setMovable(false); #endif pHeader = m_ui.NamesListView->header(); pHeader->setDefaultAlignment(Qt::AlignLeft); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setResizeMode(QHeaderView::ResizeToContents); pHeader->setMovable(false); #endif qtractorSession *pSession = qtractorSession::getInstance(); if (pSession) setInstruments(pSession->instruments()); adjustSize(); // UI signal/slot connections... QObject::connect(m_ui.FilesListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(stabilizeForm())); QObject::connect(m_ui.NamesListView, SIGNAL(itemCollapsed(QTreeWidgetItem*)), SLOT(itemCollapsed(QTreeWidgetItem*))); QObject::connect(m_ui.NamesListView, SIGNAL(itemExpanded(QTreeWidgetItem*)), SLOT(itemExpanded(QTreeWidgetItem*))); QObject::connect(m_ui.InstrumentsListView, SIGNAL(itemCollapsed(QTreeWidgetItem*)), SLOT(itemCollapsed(QTreeWidgetItem*))); QObject::connect(m_ui.InstrumentsListView, SIGNAL(itemExpanded(QTreeWidgetItem*)), SLOT(itemExpanded(QTreeWidgetItem*))); QObject::connect(m_ui.ImportPushButton, SIGNAL(clicked()), SLOT(importSlot())); QObject::connect(m_ui.RemovePushButton, SIGNAL(clicked()), SLOT(removeSlot())); QObject::connect(m_ui.MoveUpPushButton, SIGNAL(clicked()), SLOT(moveUpSlot())); QObject::connect(m_ui.MoveDownPushButton, SIGNAL(clicked()), SLOT(moveDownSlot())); QObject::connect(m_ui.ReloadPushButton, SIGNAL(clicked()), SLOT(reloadSlot())); QObject::connect(m_ui.ExportPushButton, SIGNAL(clicked()), SLOT(exportSlot())); QObject::connect(m_ui.ClosePushButton, SIGNAL(clicked()), SLOT(reject())); }
int MboxCondReceive(int mbox_id, void *msg_ptr, int msg_size) { check_kernel_mode("MboxCondReceive"); disableInterrupts(); // get the mailbox mailbox *mbox = &(MailBoxTable[mbox_id]); // check message size isn't too big if (msg_size > MAX_MESSAGE) { enableInterrupts(); return -1; } // check if mailbox exists at first if (mbox->mboxID == -1) { enableInterrupts(); return -1; } // check for 0-slot mbox if (mbox->numSlots == 0) { int size = -1; int *sPtr = &size; // if there was no one waiting on this mailbox, leave if (!unblock(mbox->mboxID, SENDBLOCK, msg_size, msg_ptr, sPtr)) { enableInterrupts(); return -2; } // checked to make sure process wasn't zapped if (isZapped()) { enableInterrupts(); return -3; } // check to make mailbox still exists if (mbox->mboxID == -1) { enableInterrupts(); return -3; } enableInterrupts(); return size; } // check for mailbox empty if (mbox->numSlotsUsed == 0) { enableInterrupts(); return -2; } // check message size too small if (mbox->headPtr->size > msg_size) { enableInterrupts(); return -1; } // get the size of the message to save for later int size = mbox->headPtr->size; // copy information from slot to msg_ptr and remove that slot memcpy(msg_ptr, mbox->headPtr->message, msg_size); removeSlot(mbox_id); // unblock send blocked people unblock(mbox_id, SENDBLOCK, msg_size, NULL, NULL); // checked to make sure process wasn't zapped if (isZapped()) { enableInterrupts(); return -3; } enableInterrupts(); return size; }
// Constructor. qtractorMidiControlForm::qtractorMidiControlForm ( QWidget *pParent, Qt::WindowFlags wflags ) : QDialog(pParent, wflags) { // Setup UI struct... m_ui.setupUi(this); // Window modality (let plugin/tool windows rave around). QDialog::setWindowModality(Qt::WindowModal); m_iDirtyCount = 0; m_iDirtyMap = 0; m_iUpdating = 0; QHeaderView *pHeader = m_ui.FilesListView->header(); pHeader->setDefaultAlignment(Qt::AlignLeft); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setResizeMode(QHeaderView::ResizeToContents); pHeader->setMovable(false); #endif pHeader = m_ui.ControlMapListView->header(); pHeader->setDefaultAlignment(Qt::AlignLeft); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setResizeMode(QHeaderView::ResizeToContents); pHeader->setMovable(false); #endif m_pControlTypeGroup = new qtractorMidiControlTypeGroup(NULL, m_ui.ControlTypeComboBox, m_ui.ParamComboBox, m_ui.ParamTextLabel); m_ui.ControlTypeComboBox->setCurrentIndex(3); // Controller (default). // m_ui.ChannelComboBox->clear(); m_ui.ChannelComboBox->addItem("*"); for (unsigned short iChannel = 0; iChannel < 16; ++iChannel) m_ui.ChannelComboBox->addItem(textFromChannel(iChannel)); const QIcon iconCommand(":/images/itemChannel.png"); // m_ui.CommandComboBox->clear(); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_GAIN)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_PANNING)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_MONITOR)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_RECORD)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_MUTE)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_SOLO)); m_ui.SyncCheckBox->setChecked(qtractorMidiControl::isSync()); stabilizeTypeChange(); refreshFiles(); adjustSize(); // UI signal/slot connections... QObject::connect(m_ui.FilesListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(stabilizeForm())); QObject::connect(m_ui.ControlMapListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(stabilizeForm())); QObject::connect(m_ui.ImportPushButton, SIGNAL(clicked()), SLOT(importSlot())); QObject::connect(m_ui.RemovePushButton, SIGNAL(clicked()), SLOT(removeSlot())); QObject::connect(m_ui.MoveUpPushButton, SIGNAL(clicked()), SLOT(moveUpSlot())); QObject::connect(m_ui.MoveDownPushButton, SIGNAL(clicked()), SLOT(moveDownSlot())); QObject::connect(m_pControlTypeGroup, SIGNAL(controlTypeChanged(int)), SLOT(typeChangedSlot())); QObject::connect(m_pControlTypeGroup, SIGNAL(controlParamChanged(int)), SLOT(keyChangedSlot())); QObject::connect(m_ui.ChannelComboBox, SIGNAL(activated(int)), SLOT(keyChangedSlot())); QObject::connect(m_ui.TrackCheckBox, SIGNAL(toggled(bool)), SLOT(keyChangedSlot())); QObject::connect(m_ui.TrackSpinBox, SIGNAL(valueChanged(int)), SLOT(valueChangedSlot())); QObject::connect(m_ui.CommandComboBox, SIGNAL(activated(int)), SLOT(valueChangedSlot())); QObject::connect(m_ui.FeedbackCheckBox, SIGNAL(toggled(bool)), SLOT(valueChangedSlot())); QObject::connect(m_ui.MapPushButton, SIGNAL(clicked()), SLOT(mapSlot())); QObject::connect(m_ui.UnmapPushButton, SIGNAL(clicked()), SLOT(unmapSlot())); QObject::connect(m_ui.SyncCheckBox, SIGNAL(toggled(bool)), SLOT(syncSlot(bool))); QObject::connect(m_ui.ReloadPushButton, SIGNAL(clicked()), SLOT(reloadSlot())); QObject::connect(m_ui.ExportPushButton, SIGNAL(clicked()), SLOT(exportSlot())); QObject::connect(m_ui.ClosePushButton, SIGNAL(clicked()), SLOT(reject())); }
EraserWidget::EraserWidget(PatientModelServicePtr patientModelService, VisualizationServicePtr visualizationService, QWidget* parent) : BaseWidget(parent, "EraserWidget", "Eraser"), mPreviousCenter(0,0,0), mPreviousRadius(0), mActiveImageProxy(ActiveImageProxyPtr()), mPatientModelService(patientModelService), mVisualizationService(visualizationService) { QVBoxLayout* layout = new QVBoxLayout(this); this->setToolTip("Erase parts of volumes/models"); mContinousEraseTimer = new QTimer(this); connect(mContinousEraseTimer, SIGNAL(timeout()), this, SLOT(continousRemoveSlot())); // this signal will be executed in the thread of THIS, i.e. the main thread. QHBoxLayout* buttonLayout = new QHBoxLayout; layout->addLayout(buttonLayout); QHBoxLayout* buttonLayout2 = new QHBoxLayout; layout->addLayout(buttonLayout2); mShowEraserCheckBox = new QCheckBox("Show"); mShowEraserCheckBox->setToolTip("Show eraser sphere in the views."); connect(mShowEraserCheckBox, SIGNAL(toggled(bool)), this, SLOT(toggleShowEraser(bool))); buttonLayout->addWidget(mShowEraserCheckBox); mContinousEraseCheckBox = new QCheckBox("Continous"); mContinousEraseCheckBox->setToolTip("Erase continously using the sphere. (might be slow)"); connect(mContinousEraseCheckBox, SIGNAL(toggled(bool)), this, SLOT(toggleContinous(bool))); buttonLayout2->addWidget(mContinousEraseCheckBox); mDuplicateAction = this->createAction(this, QIcon(), "Duplicate", "Duplicate active volume - do this before erasing!", SLOT(duplicateSlot()), buttonLayout); mSaveAction = this->createAction(this, QIcon(), "Save", "Save modified image to disk", SLOT(saveSlot()), buttonLayout); mRemoveAction = this->createAction(this, QIcon(), "Erase", "Erase everything inside sphere", SLOT(removeSlot()), buttonLayout2); double sphereRadius = 10; mSphereSizeAdapter = DoubleProperty::initialize("SphereSize", "Sphere Size", "Radius of Eraser Sphere", sphereRadius, DoubleRange(0,200,1), 0, QDomNode()); connect(mSphereSizeAdapter.get(), &DoubleProperty::changed, this, &EraserWidget::sphereSizeChangedSlot); mSphereSize = new SpinBoxAndSliderGroupWidget(this, mSphereSizeAdapter); layout->addWidget(mSphereSize); ImagePtr image = mPatientModelService->getActiveImage(); int eraseValue = 0; if(image) eraseValue = image->getMin(); mEraseValueAdapter = DoubleProperty::initialize("EraseValue", "Erase value", "Erase/draw with value", eraseValue, DoubleRange(1,200,1), 0, QDomNode()); mActiveImageProxy = ActiveImageProxy::New(mPatientModelService); connect(mActiveImageProxy.get(), &ActiveImageProxy::activeImageChanged, this, &EraserWidget::activeImageChangedSlot); mEraseValueWidget = new SpinBoxAndSliderGroupWidget(this, mEraseValueAdapter); layout->addWidget(mEraseValueWidget); layout->addStretch(); this->enableButtons(); }
//Дописать оставшиеся пакеты из буфера void JitterBuffer::clearAndWrite() { lastSequenceNumber_ = 0; while (buffList_.count() != 0) removeSlot(0); }