本文整理汇总了C++中setEditable函数的典型用法代码示例。如果您正苦于以下问题:C++ setEditable函数的具体用法?C++ setEditable怎么用?C++ setEditable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setEditable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getEditLayerIndex
void LayersMgrWidget::onDelLayer(wxCommandEvent& event)
{
int index = getEditLayerIndex();
m_layersSizer->Detach(m_layers.size() - 1 - index);
delete m_layers[index]->getLayer();
delete m_layers[index];
m_layers.erase(m_layers.begin() + index);
if (index < m_layers.size())
setEditable(m_layers[index]);
else
setEditable(m_layers.back());
if (m_layers.empty())
m_editedLayer = NULL;
if (m_layers.size() == 1)
m_btnDel->Enable(false);
m_parent->Fit();
wxWindow* root = m_parent;
while (root->GetParent())
root = root->GetParent();
root->Refresh();
}
开发者ID:xzrunner,项目名称:easyeditor,代码行数:27,代码来源:LayersMgrWidget.cpp
示例2: QStandardItemModel
QStandardItemModel *ConversationData::makeContextModel(
QMap<int, QStandardItem *> &items, bool editable) {
auto ret = new QStandardItemModel();
auto rootItem = new QStandardItem();
rootItem->setText("Root context");
rootItem->setEditable(false);
rootItem->setDragEnabled(false);
rootItem->setDropEnabled(editable);
rootItem->setData(rootContext()->id(), IDData);
ret->invisibleRootItem()->appendRow(rootItem);
items[rootContext()->id()] = rootItem;
for(auto con : m_contexts) {
if(items.contains(con->id())) continue;
auto item = new QStandardItem();
item->setData(con->id(), IDData);
item->setText(con->label());
item->setEditable(editable);
item->setDragEnabled(editable);
item->setDropEnabled(editable);
items[con->id()] = item;
}
for(auto con : m_contexts) {
if(!con->parent()) continue;
items[con->parent()->id()]->appendRow(items[con->id()]);
}
// TODO: sort the elements in the tree
return ret;
}
开发者ID:etherealvisage,项目名称:pineseed-editor,代码行数:34,代码来源:ConversationData.cpp
示例3: QStandardItem
void Plugin::Init (ICoreProxy_ptr proxy)
{
Proxy_ = proxy;
#ifdef HAVE_QJSON
auto di = new QStandardItem ("Digitally Imported");
di->setData (Media::RadioType::None, Media::RadioItemRole::ItemType);
di->setEditable (false);
di->setIcon (QIcon (":/hotstreams/resources/images/di.png"));
Roots_ ["di"] = di;
auto sky = new QStandardItem ("SkyFM");
sky->setData (Media::RadioType::None, Media::RadioItemRole::ItemType);
sky->setEditable (false);
sky->setIcon (QIcon (":/hotstreams/resources/images/skyfm.png"));
Roots_ ["sky"] = sky;
#endif
auto somafm = new QStandardItem ("SomaFM");
somafm->setData (Media::RadioType::None, Media::RadioItemRole::ItemType);
somafm->setEditable (false);
somafm->setIcon (QIcon (":/hotstreams/resources/images/somafm.png"));
Roots_ ["somafm"] = somafm;
auto stealkill = new QStandardItem ("42fm");
stealkill->setData (Media::RadioType::None, Media::RadioItemRole::ItemType);
stealkill->setEditable (false);
stealkill->setIcon (QIcon (":/hotstreams/resources/images/radio.png"));
Roots_ ["42fm"] = stealkill;
}
开发者ID:panter-dsd,项目名称:leechcraft,代码行数:30,代码来源:hotstreams.cpp
示例4: setEditable
void DataManagerProperty::setProperty(ossimRefPtr<ossimProperty> property)
{
m_property = property.get();
if(m_property.valid())
{
setEditable(!m_property->isReadOnly());
}
if(column() != 1)
{
setEditable(false);
}
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:13,代码来源:DataManagerPropertyView.cpp
示例5: setEditable
void DepthComboBox::updateEditable(int index)
{
if ( index == 0 ) {
// Allow the combo box to be edited
setEditable(true);
// Select all of the text
lineEdit()->selectAll();
setCursor(Qt::IBeamCursor);
} else {
// Depth is the bedrock depth and is uneditable
setEditable(false);
unsetCursor();
}
}
开发者ID:arkottke,项目名称:strata,代码行数:14,代码来源:DepthComboBox.cpp
示例6: QStandardItem
void StreamListFetcherBase::handleParsed ()
{
auto watcher = dynamic_cast<QFutureWatcher<decltype (Parse ({}))>*> (sender ());
watcher->deleteLater ();
for (const auto& stream : watcher->result ())
{
auto name = stream.Name_;
if (!stream.Genres_.isEmpty ())
name += " (" + stream.Genres_.join ("; ") + ")";
auto tooltip = "<span style=\"white-space: nowrap\">" + stream.Description_;
if (!stream.DJ_.isEmpty ())
tooltip += "<br /><em>DJ:</em> " + stream.DJ_;
tooltip += "</span>";
auto item = new QStandardItem (name);
item->setToolTip (tooltip);
item->setIcon (RadioIcon_);
item->setData (stream.Name_, StreamItemRoles::PristineName);
item->setData (Media::RadioType::Predefined, Media::RadioItemRole::ItemType);
item->setData (stream.URL_, Media::RadioItemRole::RadioID);
item->setData (stream.PlaylistFormat_, StreamItemRoles::PlaylistFormat);
item->setEditable (false);
Root_->appendRow (item);
}
deleteLater ();
}
开发者ID:AlexWMF,项目名称:leechcraft,代码行数:29,代码来源:streamlistfetcherbase.cpp
示例7: ComboBoxWidget
ActionComboBoxWidget::ActionComboBoxWidget(QWidget *parent) : ComboBoxWidget(parent),
m_filterLineEdit(nullptr),
m_wasPopupVisible(false)
{
setEditable(true);
lineEdit()->hide();
getView()->viewport()->parentWidget()->installEventFilter(this);
QStandardItemModel *model(new QStandardItemModel(this));
const QVector<ActionsManager::ActionDefinition> definitions(ActionsManager::getActionDefinitions());
for (int i = 0; i < definitions.count(); ++i)
{
QStandardItem *item(new QStandardItem(QCoreApplication::translate("actions", (definitions.at(i).description.isEmpty() ? definitions.at(i).text : definitions.at(i).description).toUtf8().constData())));
item->setData(QColor(Qt::transparent), Qt::DecorationRole);
item->setData(definitions.at(i).identifier, Qt::UserRole);
item->setToolTip(ActionsManager::getActionName(definitions.at(i).identifier));
item->setFlags(item->flags() | Qt::ItemNeverHasChildren);
if (!definitions.at(i).icon.isNull())
{
item->setIcon(definitions.at(i).icon);
}
model->appendRow(item);
}
setModel(model);
setCurrentIndex(-1);
}
开发者ID:OtterBrowser,项目名称:otter-browser,代码行数:32,代码来源:ActionComboBoxWidget.cpp
示例8: ComboBoxWidget
ActionComboBoxWidget::ActionComboBoxWidget(QWidget *parent) : ComboBoxWidget(parent),
m_filterLineEditWidget(nullptr),
m_model(new QStandardItemModel(this)),
m_wasPopupVisible(false)
{
setEditable(true);
lineEdit()->hide();
getView()->viewport()->parentWidget()->installEventFilter(this);
const QVector<ActionsManager::ActionDefinition> definitions(ActionsManager::getActionDefinitions());
for (int i = 0; i < definitions.count(); ++i)
{
if (!definitions.at(i).flags.testFlag(ActionsManager::ActionDefinition::IsDeprecatedFlag) && !definitions.at(i).flags.testFlag(ActionsManager::ActionDefinition::RequiresParameters))
{
addDefinition(definitions.at(i));
}
}
m_model->setSortRole(IdentifierRole);
setModel(m_model);
setCurrentIndex(-1);
}
开发者ID:OtterBrowser,项目名称:otter-browser,代码行数:26,代码来源:ActionComboBoxWidget.cpp
示例9: QStandardItem
AlbumItem::AlbumItem()
: QStandardItem()
, m_iconSize( 40 )
, m_showArtist( false )
{
setEditable( false );
}
开发者ID:cancamilo,项目名称:amarok,代码行数:7,代码来源:AlbumItem.cpp
示例10: CreateDomDocumentFromReply
void FotoBilderAccount::handleGotAlbums ()
{
QDomDocument document;
const QByteArray& content = CreateDomDocumentFromReply (qobject_cast<QNetworkReply*> (sender ()),
document);
if (content.isEmpty ())
return;
if (IsErrorReply (content))
return;
if (auto rc = CollectionsModel_->rowCount ())
CollectionsModel_->removeRows (0, rc);
CollectionsModel_->setHorizontalHeaderLabels ({ tr ("Name") });
AllPhotosItem_ = new QStandardItem (tr ("All photos"));
AllPhotosItem_->setData (ItemType::AllPhotos, CollectionRole::Type);
AllPhotosItem_->setEditable (false);
CollectionsModel_->appendRow (AllPhotosItem_);
//TODO enable due to upload issues
const auto& albums = ParseGetGalsRequest (document);
for (const auto& album : albums)
{
auto item = new QStandardItem (album.Title_);
item->setData (ItemType::Collection, CollectionRole::Type);
item->setEditable (false);
item->setData (album.ID_, CollectionRole::ID);
CollectionsModel_->appendRow (item);
Id2AlbumItem_ [album.ID_] = item;
}
RequestPictures ();
}
开发者ID:AlexWMF,项目名称:leechcraft,代码行数:34,代码来源:fotobilderaccount.cpp
示例11: QWidget
QtVCardPhotoAndNameFields::QtVCardPhotoAndNameFields(QWidget* parent) :
QWidget(parent),
ui(new Ui::QtVCardPhotoAndNameFields) {
ui->setupUi(this);
ui->lineEditPREFIX->hide();
ui->lineEditMIDDLE->hide();
ui->lineEditSUFFIX->hide();
ui->lineEditFN->hide();
ui->lineEditNICKNAME->hide();
ui->labelFN->hide();
ui->labelNICKNAME->hide();
ui->labelFULLNAME->hide();
#if QT_VERSION >= 0x040700
ui->lineEditFN->setPlaceholderText(tr("Formatted Name"));
ui->lineEditNICKNAME->setPlaceholderText(tr("Nickname"));
ui->lineEditPREFIX->setPlaceholderText(tr("Prefix"));
ui->lineEditGIVEN->setPlaceholderText(tr("Given Name"));
ui->lineEditMIDDLE->setPlaceholderText(tr("Middle Name"));
ui->lineEditFAMILY->setPlaceholderText(tr("Last Name"));
ui->lineEditSUFFIX->setPlaceholderText(tr("Suffix"));
#endif
setEditable(false);
}
开发者ID:scopeInfinity,项目名称:swift,代码行数:25,代码来源:QtVCardPhotoAndNameFields.cpp
示例12: QComboBox
CaptureFilterCombo::CaptureFilterCombo(QWidget *parent, bool plain) :
QComboBox(parent),
cf_edit_(NULL)
{
cf_edit_ = new CaptureFilterEdit(this, plain);
setEditable(true);
// Enabling autocompletion here gives us two simultaneous completions:
// Inline (highlighted text) for entire filters, handled here and popup
// completion for fields handled by CaptureFilterEdit.
setAutoCompletion(false);
setLineEdit(cf_edit_);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
setInsertPolicy(QComboBox::NoInsert);
setAccessibleName(tr("Capture filter selector"));
setStyleSheet(
"QComboBox {"
#ifdef Q_OS_MAC
" border: 1px solid gray;"
#else
" border: 1px solid palette(shadow);"
#endif
" border-radius: 3px;"
" padding: 0px 0px 0px 0px;"
" margin-left: 0px;"
" min-width: 20em;"
" }"
"QComboBox::drop-down {"
" subcontrol-origin: padding;"
" subcontrol-position: top right;"
" width: 16px;"
" border-left-width: 0px;"
" }"
"QComboBox::down-arrow {"
" image: url(:/icons/toolbar/14x14/x-filter-dropdown.png);"
" }"
"QComboBox::down-arrow:on { /* shift the arrow when popup is open */"
" top: 1px;"
" left: 1px;"
"}"
);
connect(this, SIGNAL(interfacesChanged()), cf_edit_, SLOT(checkFilter()));
connect(cf_edit_, SIGNAL(pushFilterSyntaxStatus(const QString&)),
this, SIGNAL(pushFilterSyntaxStatus(const QString&)));
connect(cf_edit_, SIGNAL(popFilterSyntaxStatus()),
this, SIGNAL(popFilterSyntaxStatus()));
connect(cf_edit_, SIGNAL(captureFilterSyntaxChanged(bool)),
this, SIGNAL(captureFilterSyntaxChanged(bool)));
connect(cf_edit_, SIGNAL(startCapture()), this, SIGNAL(startCapture()));
connect(cf_edit_, SIGNAL(startCapture()), this, SLOT(saveAndRebuildFilterList()));
connect(wsApp, SIGNAL(appInitialized()), this, SLOT(rebuildFilterList()));
connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(rebuildFilterList()));
rebuildFilterList();
clearEditText();
}
开发者ID:crondaemon,项目名称:wireshark,代码行数:60,代码来源:capture_filter_combo.cpp
示例13: QWidget
QtVCardWidget::QtVCardWidget(QWidget* parent) :
QWidget(parent),
ui(new ::Ui::QtVCardWidget) {
ui->setupUi(this);
ui->cardFields->setColumnStretch(0,0);
ui->cardFields->setColumnStretch(1,0);
ui->cardFields->setColumnStretch(2,2);
ui->cardFields->setColumnStretch(3,1);
ui->cardFields->setColumnStretch(4,2);
menu = new QMenu(this);
toolButton = new QToolButton(this);
toolButton->setText(tr("Add Field"));
toolButton->setArrowType(Qt::NoArrow);
toolButton->setAutoRaise(false);
toolButton->setPopupMode(QToolButton::InstantPopup);
toolButton->hide();
toolButton->setMenu(menu);
addFieldType(menu, std::make_shared<QtVCardInternetEMailField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardTelephoneField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardAddressField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardAddressLabelField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardBirthdayField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardJIDField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardDescriptionField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardRoleField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardTitleField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardOrganizationField::FieldInfo>());
addFieldType(menu, std::make_shared<QtVCardURLField::FieldInfo>());
setEditable(false);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
}
开发者ID:swift,项目名称:swift,代码行数:35,代码来源:QtVCardWidget.cpp
示例14: QComboBox
AutocompletingComboBox::AutocompletingComboBox(QWidget* parent) : QComboBox(parent) {
setEditable(true);
setInsertPolicy(QComboBox::NoInsert);
completer()->setCompletionMode(QCompleter::PopupCompletion);
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(resetColor()));
}
开发者ID:TuxSH,项目名称:PkmGCTools,代码行数:7,代码来源:AutocompletingComboBox.cpp
示例15: QComboBox
//-----------------------------------------------------------------------------
// Function: ReferenceSelector::ReferenceSelector()
//-----------------------------------------------------------------------------
ReferenceSelector::ReferenceSelector(QWidget *parent):
QComboBox(parent)
{
setEditable(false);
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(onIndexChange(int)), Qt::UniqueConnection);
}
开发者ID:kammoh,项目名称:kactus2,代码行数:10,代码来源:ReferenceSelector.cpp
示例16: switch
int QwtCounter::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: buttonReleased((*reinterpret_cast< double(*)>(_a[1]))); break;
case 1: valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
case 2: btnReleased(); break;
case 3: btnClicked(); break;
case 4: textChanged(); break;
}
_id -= 5;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< int*>(_v) = numButtons(); break;
case 1: *reinterpret_cast< double*>(_v) = step(); break;
case 2: *reinterpret_cast< double*>(_v) = minVal(); break;
case 3: *reinterpret_cast< double*>(_v) = maxVal(); break;
case 4: *reinterpret_cast< int*>(_v) = stepButton1(); break;
case 5: *reinterpret_cast< int*>(_v) = stepButton2(); break;
case 6: *reinterpret_cast< int*>(_v) = stepButton3(); break;
case 7: *reinterpret_cast< double*>(_v) = value(); break;
case 8: *reinterpret_cast< bool*>(_v) = editable(); break;
}
_id -= 9;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setNumButtons(*reinterpret_cast< int*>(_v)); break;
case 1: setStep(*reinterpret_cast< double*>(_v)); break;
case 2: setMinValue(*reinterpret_cast< double*>(_v)); break;
case 3: setMaxValue(*reinterpret_cast< double*>(_v)); break;
case 4: setStepButton1(*reinterpret_cast< int*>(_v)); break;
case 5: setStepButton2(*reinterpret_cast< int*>(_v)); break;
case 6: setStepButton3(*reinterpret_cast< int*>(_v)); break;
case 7: setValue(*reinterpret_cast< double*>(_v)); break;
case 8: setEditable(*reinterpret_cast< bool*>(_v)); break;
}
_id -= 9;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 9;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:chongle,项目名称:prorata,代码行数:60,代码来源:moc_qwt_counter.cpp
示例17: installEventFilter
MOTableView::MOTableView(QWidget* parent):QTableView(parent)
{
//_view->installEventFilter(this);
installEventFilter(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
#else
horizontalHeader()->setResizeMode(QHeaderView::Interactive);
#endif
verticalHeader()->hide();
//editable ?
setEditable(true);
// context menu
_actionCopy = new QAction("Copy", this);
connect(_actionCopy,SIGNAL(triggered()),this, SLOT(onCopyAsked()));
_actionCopy->setShortcut(QKeySequence::Copy);
_actionCopy->setShortcutContext(Qt::WidgetShortcut);
this->addAction(_actionCopy);
_actionPaste = new QAction("Paste", this);
connect(_actionPaste,SIGNAL(triggered()),this, SLOT(onPasteAsked()));
_actionPaste->setShortcut(QKeySequence::Paste);
_actionPaste->setShortcutContext(Qt::WidgetShortcut);
this->addAction(_actionPaste);
this->setContextMenuPolicy(Qt::CustomContextMenu);
connect(this,SIGNAL(customContextMenuRequested(const QPoint &)),
this,SLOT(contextualMenu(const QPoint &)));
}
开发者ID:OpenModelica,项目名称:OMOptim,代码行数:33,代码来源:MOTableView.cpp
示例18: QComboBox
SearchWidget::SearchWidget(Window *window, QWidget *parent) : QComboBox(parent),
m_window(NULL),
m_completer(new QCompleter(this)),
m_suggester(NULL),
m_lastValidIndex(0),
m_isIgnoringActivation(false),
m_isPopupUpdated(false),
m_shouldSelectAllOnRelease(false),
m_wasPopupVisible(false)
{
m_completer->setCaseSensitivity(Qt::CaseInsensitive);
m_completer->setCompletionMode(QCompleter::PopupCompletion);
m_completer->setCompletionRole(Qt::DisplayRole);
setEditable(true);
setMinimumWidth(100);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
setItemDelegate(new SearchDelegate(this));
setModel(SearchesManager::getSearchEnginesModel());
setInsertPolicy(QComboBox::NoInsert);
optionChanged(QLatin1String("Search/SearchEnginesSuggestions"), SettingsManager::getValue(QLatin1String("Search/SearchEnginesSuggestions")));
lineEdit()->setCompleter(m_completer);
lineEdit()->setDragEnabled(true);
lineEdit()->setStyleSheet(QLatin1String("QLineEdit {background:transparent;}"));
lineEdit()->installEventFilter(this);
ToolBarWidget *toolBar = qobject_cast<ToolBarWidget*>(parent);
if (toolBar && toolBar->getIdentifier() != ToolBarsManager::NavigationBar)
{
connect(toolBar, SIGNAL(windowChanged(Window*)), this, SLOT(setWindow(Window*)));
}
开发者ID:DoctorJellyface,项目名称:otter-browser,代码行数:33,代码来源:SearchWidget.cpp
示例19: setCheckable
void QtPropertyItem::ApplyDataFlags()
{
if(NULL != itemData)
{
int dataFlags = itemData->GetFlags();
if(dataFlags & QtPropertyData::FLAG_IS_CHECKABLE)
{
setCheckable(true);
if(itemData->GetValue().toBool())
{
setCheckState(Qt::Checked);
}
}
if(dataFlags & QtPropertyData::FLAG_IS_DISABLED)
{
setEnabled(false);
}
if(dataFlags & QtPropertyData::FLAG_IS_NOT_EDITABLE)
{
setEditable(false);
}
}
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:26,代码来源:QtPropertyItem.cpp
示例20: QSelectAction
KoZoomAction::KoZoomAction( KoZoomMode::Modes zoomModes, const QString& text, QObject *parent)
: QSelectAction(text, parent)
,d(new Private)
{
d->zoomModes = zoomModes;
d->slider = 0;
d->input = 0;
d->specialButtons = 0;
setIcon(koIcon("zoom-original"));
setEditable( true );
setMaxComboViewCount( 15 );
d->sliderLookup[0] = KoZoomMode::minimumZoom();
d->sliderLookup[32] = KoZoomMode::maximumZoom();
int steps = 32;
int halfSteps = steps / 2;
qreal zoomStep = pow(1.0 / KoZoomMode::minimumZoom(), 1.0/halfSteps);
for(int i = 1; i < steps; ++i) {
d->sliderLookup[i] = pow(zoomStep, i - halfSteps);
}
d->effectiveZoom = 1.0;
regenerateItems(d->effectiveZoom, true);
connect( this, SIGNAL( triggered( const QString& ) ), SLOT( triggered( const QString& ) ) );
}
开发者ID:NavyZhao1978,项目名称:QCalligra,代码行数:27,代码来源:KoZoomAction.cpp
注:本文中的setEditable函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论