void QWebNavigationRequest::setAction(int action) { if (d->action == action) return; d->action = action; emit actionChanged(); }
void ActionGroup::removeAction(QAction *action) { if (m_actions.removeAll(action)) { if (action == current) current = 0; QObject::disconnect(action, SIGNAL(changed()), this, SLOT(actionChanged())); } }
GDrag::GDrag(QObject *parent,VM *pVM) : QDrag(parent) { this->pVM = pVM; this->pParaList = ring_list_new(0); strcpy(this->cactionChangedEvent,""); strcpy(this->ctargetChangedEvent,""); QObject::connect(this, SIGNAL(actionChanged(Qt::DropAction)),this, SLOT(actionChangedSlot())); QObject::connect(this, SIGNAL(targetChanged(QObject *)),this, SLOT(targetChangedSlot())); }
void Rule::_init() { connect(this, SIGNAL(ruleNameChanged()), this, SIGNAL(changed())); connect(this, SIGNAL(ruleIdChanged()), this, SIGNAL(changed())); connect(this, SIGNAL(ruleActiveChanged()), this, SIGNAL(changed())); connect(this, SIGNAL(stopIfMatchedChanged()), this, SIGNAL(changed())); connect(&_condition, SIGNAL(changed()), this, SIGNAL(conditionChanged())); connect(&_action, SIGNAL(changed()), this, SIGNAL(actionChanged())); connect(&_condition, SIGNAL(changed()), this, SIGNAL(changed())); connect(&_action, SIGNAL(changed()), this, SIGNAL(changed())); // connect(this, SIGNAL(conditionChanged()), this, SIGNAL(changed())); // connect(this, SIGNAL(actionChanged()), this, SIGNAL(changed())); }
void ActionGroup::addAction(QAction *action) { if(!m_actions.contains(action)) { m_actions.append(action); QObject::connect(action, SIGNAL(changed()), this, SLOT(actionChanged())); } if (current && current->isChecked()) { current->setChecked(false); } if (action->isChecked()) { current = action; } }
HelpWebView::HelpWebView(IEditorSite::Pointer editorSite, QWidget *parent, qreal zoom) : QWebView(parent) //, parentWidget(parent) , m_LoadFinished(false) , m_HelpEngine(HelpPluginActivator::getInstance()->getQHelpEngine()) { setAcceptDrops(false); setPage(new HelpPage(editorSite, parent)); page()->setNetworkAccessManager(new HelpNetworkAccessManager(this)); QAction* action = pageAction(QWebPage::OpenLinkInNewWindow); action->setText(tr("Open Link in New Tab")); if (!parent) action->setVisible(false); pageAction(QWebPage::DownloadLinkToDisk)->setVisible(false); pageAction(QWebPage::DownloadImageToDisk)->setVisible(false); pageAction(QWebPage::OpenImageInNewWindow)->setVisible(false); connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this, SLOT(actionChanged())); connect(pageAction(QWebPage::Back), SIGNAL(changed()), this, SLOT(actionChanged())); connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this, SLOT(actionChanged())); connect(page(), SIGNAL(linkHovered(QString,QString,QString)), this, SIGNAL(highlighted(QString))); connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl))); connect(this, SIGNAL(loadStarted()), this, SLOT(setLoadStarted())); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); connect(page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested())); setFont(viewerFont()); setTextSizeMultiplier(zoom == 0.0 ? 1.0 : zoom); }
void QQuickMenuItem::setBoundAction(QQuickAction *a) { if (a == m_boundAction) return; if (m_boundAction) { if (m_boundAction->parent() == this) delete m_boundAction; else unbindFromAction(m_boundAction); } bindToAction(a); emit actionChanged(); }
QAction *PopupMenu::addAction(QAction *a) { connect(a, SIGNAL(changed()), this, SLOT(actionChanged())); _actions.push_back(a); if (a->menu()) { _menus.push_back(new PopupMenu(a->menu())); _menus.back()->deleteOnHide(false); } else { _menus.push_back(0); } _texts.push_back(QString()); _shortcutTexts.push_back(QString()); int32 w = processAction(a, _actions.size() - 1, width()); resize(w, height() + (a->isSeparator() ? _separatorHeight : _itemHeight)); update(); return a; }
QAction *ContextMenu::addAction(const QString &text, const QObject *receiver, const char* member) { QAction *a = 0; _actions.push_back(a = new QAction(text, this)); connect(a, SIGNAL(triggered(bool)), receiver, member); connect(a, SIGNAL(changed()), this, SLOT(actionChanged())); IconedButton *b = 0; _buttons.push_back(b = new IconedButton(this, _buttonStyle, a->text())); connect(b, SIGNAL(clicked()), this, SLOT(hideStart())); connect(b, SIGNAL(clicked()), a, SIGNAL(triggered())); connect(b, SIGNAL(stateChanged(int,ButtonStateChangeSource)), this, SLOT(buttonStateChanged(int,ButtonStateChangeSource))); _width = qMax(_width, int(st::dropdownPadding.left() + st::dropdownPadding.right() + b->width())); _height += b->height(); resize(_width, _height); return a; }
void StartupDlg::actionChanged( int action, bool browse) { DBGOUT("action" << action); if(action == 2) { // create new selected passPhraseStack->setCurrentIndex(1); newPassPhraseBox->setFocus(); } else { assert(m_myps != NULL); if(action == 1) { // browse selected if(browse) { // display open safe dialog QString filename, filter; if(m_myps->browseForSafe(filename, filter, false) == false) { // canceled return; } // update the file name setFilename(filename); setFilter(filter); } else { setFilename(getFilename()); } } else { // open default selected if(m_myps->getDefaultSafe().isEmpty() != true) { setFilename(m_myps->getDefaultSafe()); setFilter(QString::null); } else { actionChanged(1); // set the action to browse m_myps->setDefaultSafe(getFilename()); } } passPhraseStack->setCurrentIndex(0); passPhraseBox->setFocus(); } }
void ActionButton::setAction(Action *AAction) { if (FAction != AAction) { if (FAction) { disconnect(FAction,0,this,0); } FAction = AAction; onActionChanged(); if (FAction) { connect(this,SIGNAL(clicked()),FAction,SLOT(trigger())); connect(FAction,SIGNAL(changed()),SLOT(onActionChanged())); connect(FAction,SIGNAL(actionDestroyed(Action *)),SLOT(onActionDestroyed(Action *))); setActionString(AAction->data(Action::DR_UserDefined + 1).toString()); } emit actionChanged(); } }
void QFStyledButton::setAction(QAction *action) { if (m_action) disconnect(m_action, SIGNAL(changed()), this, SLOT(actionChanged())); m_action=action; actionChanged(); if (m_action) connect(m_action, SIGNAL(changed()), this, SLOT(actionChanged())); }
int UIDnDHandler::dragStartInternal(const QStringList &lstFormats, Qt::DropAction defAction, Qt::DropActions actions) { int rc = VINF_SUCCESS; #ifdef VBOX_WITH_DRAG_AND_DROP_GH LogFlowFunc(("defAction=0x%x\n", defAction)); LogFlowFunc(("Number of formats: %d\n", lstFormats.size())); # ifdef DEBUG for (int i = 0; i < lstFormats.size(); i++) LogFlowFunc(("\tFormat %d: %s\n", i, lstFormats.at(i).toUtf8().constData())); # endif # ifdef DEBUG_DND_QT QFile *pFileDebugQt = new QFile(DEBUG_DND_QT_LOGFILE); if (pFileDebugQt->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) { g_pStrmLogQt = new QTextStream(pFileDebugQt); #if QT_VERSION >= 0x050000 qInstallMessageHandler(UIDnDHandler::debugOutputQt); #else /* QT_VERSION < 0x050000 */ qInstallMsgHandler(UIDnDHandler::debugOutputQt); #endif /* QT_VERSION < 0x050000 */ qDebug("========================================================================"); } # endif # ifdef RT_OS_WINDOWS UIDnDDataObject *pDataObject = new UIDnDDataObject(this, lstFormats); if (!pDataObject) return VERR_NO_MEMORY; UIDnDDropSource *pDropSource = new UIDnDDropSource(m_pParent, pDataObject); if (!pDropSource) return VERR_NO_MEMORY; DWORD dwOKEffects = DROPEFFECT_NONE; if (actions) { if (actions & Qt::CopyAction) dwOKEffects |= DROPEFFECT_COPY; if (actions & Qt::MoveAction) dwOKEffects |= DROPEFFECT_MOVE; if (actions & Qt::LinkAction) dwOKEffects |= DROPEFFECT_LINK; } DWORD dwEffect; LogRel2(("DnD: Starting drag and drop operation\n", dwOKEffects)); LogRel3(("DnD: DoDragDrop dwOKEffects=0x%x\n", dwOKEffects)); HRESULT hr = ::DoDragDrop(pDataObject, pDropSource, dwOKEffects, &dwEffect); LogRel3(("DnD: DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n", hr, dwEffect)); if (pDropSource) pDropSource->Release(); if (pDataObject) pDataObject->Release(); # else /* !RT_OS_WINDOWS */ QDrag *pDrag = new QDrag(m_pParent); if (!pDrag) return VERR_NO_MEMORY; /* Note: pMData is transferred to the QDrag object, so no need for deletion. */ m_pMIMEData = new UIDnDMIMEData(this, lstFormats, defAction, actions); if (!m_pMIMEData) { delete pDrag; return VERR_NO_MEMORY; } /* Inform the MIME data object of any changes in the current action. */ connect(pDrag, SIGNAL(actionChanged(Qt::DropAction)), m_pMIMEData, SLOT(sltDropActionChanged(Qt::DropAction))); /* Invoke this handler as data needs to be retrieved by our derived QMimeData class. */ connect(m_pMIMEData, SIGNAL(sigGetData(Qt::DropAction, const QString&, QVariant::Type, QVariant&)), this, SLOT(sltGetData(Qt::DropAction, const QString&, QVariant::Type, QVariant&))); /* * Set MIME data object and start the (modal) drag'n drop operation on the host. * This does not block Qt's event loop, however (on Windows it would). */ pDrag->setMimeData(m_pMIMEData); LogFlowFunc(("Executing modal drag'n drop operation ...\n")); Qt::DropAction dropAction; # ifdef RT_OS_DARWIN # ifdef VBOX_WITH_DRAG_AND_DROP_PROMISES dropAction = pDrag->exec(actions, defAction, true /* fUsePromises */); # else /* Without having VBOX_WITH_DRAG_AND_DROP_PROMISES enabled drag and drop * will not work on OS X! It also requires some handcrafted patches within Qt * (which also needs VBOX_WITH_DRAG_AND_DROP_PROMISES set there). */ dropAction = Qt::IgnoreAction; rc = VERR_NOT_SUPPORTED; # endif # else /* !RT_OS_DARWIN */ dropAction = pDrag->exec(actions, defAction); # endif /* RT_OS_DARWIN */ LogRel3(("DnD: Ended with dropAction=%ld\n", UIDnDHandler::toVBoxDnDAction(dropAction))); /* Note: The UIDnDMimeData object will not be not accessible here anymore, * since QDrag had its ownership and deleted it after the (blocking) * QDrag::exec() call. */ /* pDrag will be cleaned up by Qt automatically. */ # endif /* !RT_OS_WINDOWS */ reset(); #ifdef DEBUG_DND_QT if (g_pStrmLogQt) { delete g_pStrmLogQt; g_pStrmLogQt = NULL; } if (pFileDebugQt) { pFileDebugQt->close(); delete pFileDebugQt; } #endif /* DEBUG_DND_QT */ #else /* !VBOX_WITH_DRAG_AND_DROP_GH */ rc = VERR_NOT_SUPPORTED; #endif /* VBOX_WITH_DRAG_AND_DROP_GH */ LogFlowFuncLeaveRC(rc); return rc; }
void StartupDlg::actionChanged( int action ) { actionChanged(action, true); }
//----------------------------------------------------------------------------- // Function: NewSystemPage() //----------------------------------------------------------------------------- NewSystemPage::NewSystemPage(LibraryInterface* libInterface, QWidget* parentDlg) : NewPage(libInterface, VLNV::COMPONENT, tr("New System"), tr("Creates SW architecture that can be mapped to HW"), parentDlg), actionGroupBox_(new QGroupBox(tr("Mapping Options"), this)), actionGroup_(new QButtonGroup(this)), emptyRadioButton_(new QRadioButton(tr("Leave initially unmapped"), this)), emptyDescLabel_(new QLabel(tr("Creates an unmapped SW architecture. A new system component will be created."), this)), mapRadioButton_(new QRadioButton(tr("Map to specific HW now"), this)), mapDescLabel_(new QLabel(tr("Creates a SW architecture and maps it to selected top-level HW. A system view will " "be created for the HW component to reference the new system design."), this)), treeLabel_(new QLabel(tr("Select top-level HW component:"), this)), compTreeWidget_(new QTreeWidget(this)), viewLabel_(new QLabel(tr("Select view of top-level HW component:"), this)), viewComboBox_(new QComboBox(this)) { emptyDescLabel_->setStyleSheet("QLabel { padding-left: 19px; }"); emptyDescLabel_->setWordWrap(true); mapDescLabel_->setStyleSheet("QLabel { padding-left: 19px; }"); mapDescLabel_->setWordWrap(true); QFont font = emptyRadioButton_->font(); font.setBold(true); emptyRadioButton_->setFont(font); emptyRadioButton_->setStyleSheet("QRadioButton::indicator { width: 15px; height: 15px; }"); mapRadioButton_->setFont(font); mapRadioButton_->setStyleSheet("QRadioButton::indicator { width: 15px; height: 15px; }"); actionGroup_->addButton(emptyRadioButton_); actionGroup_->addButton(mapRadioButton_); // Create the tree widget and fill it with VLNV data. compTreeWidget_->setColumnCount(1); compTreeWidget_->setSelectionBehavior(QAbstractItemView::SelectItems); compTreeWidget_->header()->close(); compTreeWidget_->setIconSize(QSize(20, 20)); for (int i = 0; i < libInterface->getTreeRoot()->getNumberOfChildren(); ++i) { QTreeWidgetItem* item = new QTreeWidgetItem(); item->setText(0, libInterface->getTreeRoot()->child(i)->getName()); // Add child items. addChildItems(libInterface->getTreeRoot()->child(i), item); // Add only items that have children. if (item->childCount() == 0) { delete item; continue; } // Add the item to the tree. compTreeWidget_->addTopLevelItem(item); } compTreeWidget_->sortItems(0, Qt::AscendingOrder); compTreeWidget_->setFixedHeight(160); connect(compTreeWidget_, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(onTreeItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); // Create the VLNV editor. vlnvEditor_->setImplementationFilter(true, KactusAttribute::SYSTEM); vlnvEditor_->addNameExtension(".sysdesign"); vlnvEditor_->addNameExtension(".sysdesigncfg"); //vlnvEditor_->setTitle(tr("VLNV of the new system design")); QVBoxLayout* groupLayout = new QVBoxLayout(actionGroupBox_); groupLayout->addWidget(emptyRadioButton_); groupLayout->addWidget(emptyDescLabel_); groupLayout->addWidget(mapRadioButton_); groupLayout->addWidget(mapDescLabel_); // Setup the layout. QVBoxLayout* topLayout = dynamic_cast<QVBoxLayout*>(layout()); Q_ASSERT(topLayout); topLayout->insertWidget(3, actionGroupBox_); topLayout->insertWidget(4, treeLabel_); topLayout->insertWidget(5, compTreeWidget_, 1); topLayout->insertWidget(6, viewLabel_); topLayout->insertWidget(7, viewComboBox_); connect(actionGroup_, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(actionChanged(QAbstractButton*)), Qt::UniqueConnection); emptyRadioButton_->setChecked(true); actionChanged(emptyRadioButton_); }
void StartupDlg::setAction(Action action) { setActionBoxItem(action); actionChanged((int)action, false); }
void QmlPresenceModelStub::onRuleChanged() { connect(_rows[2]->rule, SIGNAL(actionChanged()), SLOT(removeRandom())); connect(_rows[3]->rule, SIGNAL(actionChanged()), SLOT(addRandom())); }
void Action::setAction(ActionType action) { if (action != m_action) { m_action = action; emit actionChanged(m_action); } }