本文整理汇总了C++中PythonEditor::setReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C++ PythonEditor::setReadOnly方法的具体用法?C++ PythonEditor::setReadOnly怎么用?C++ PythonEditor::setReadOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PythonEditor
的用法示例。
在下文中一共展示了PythonEditor::setReadOnly方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_editButton_clicked
/**
* Opens the macro file in an editor.
*/
void DlgMacroExecuteImp::on_editButton_clicked()
{
QDir dir;
QTreeWidgetItem* item = 0;
int index = tabMacroWidget->currentIndex();
if (index == 0) { //user-specific
item = userMacroListBox->currentItem();
dir.setPath(this->macroPath);
}
else {
//index == 1 system-wide
item = systemMacroListBox->currentItem();
dir.setPath(QString::fromUtf8(App::GetApplication().getHomePath()) + QString::fromUtf8("Macro"));
}
if (!item)
return;
MacroItem * mitem = static_cast<MacroItem *>(item);
QString file = QString::fromLatin1("%1/%2").arg(dir.absolutePath(), item->text(0));
PythonEditor* editor = new PythonEditor();
editor->setWindowIcon(Gui::BitmapFactory().iconFromTheme("applications-python"));
PythonEditorView* edit = new PythonEditorView(editor, getMainWindow());
edit->open(file);
edit->resize(400, 300);
getMainWindow()->addWindow(edit);
if (mitem->systemWide) {
editor->setReadOnly(true);
QString shownName;
shownName = QString::fromLatin1("%1[*] - [%2]").arg(item->text(0), tr("Read-only"));
edit->setWindowTitle(shownName);
}
close();
}