当前位置: 首页>>代码示例>>C++>>正文


C++ setEditable函数代码示例

本文整理汇总了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();
}
开发者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


注:本文中的setEditable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。