本文整理汇总了C++中setEditable函数的典型用法代码示例。如果您正苦于以下问题:C++ setEditable函数的具体用法?C++ setEditable怎么用?C++ setEditable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setEditable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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();
}
}
示例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 ();
}
示例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);
}
示例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);
}
示例9: QStandardItem
AlbumItem::AlbumItem()
: QStandardItem()
, m_iconSize( 40 )
, m_showArtist( false )
{
setEditable( false );
}
示例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 ();
}
示例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);
}
示例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();
}
示例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);
}
示例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()));
}
示例15: QComboBox
//-----------------------------------------------------------------------------
// Function: ReferenceSelector::ReferenceSelector()
//-----------------------------------------------------------------------------
ReferenceSelector::ReferenceSelector(QWidget *parent):
QComboBox(parent)
{
setEditable(false);
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(onIndexChange(int)), Qt::UniqueConnection);
}