• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ csmdoc::Document类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中csmdoc::Document的典型用法代码示例。如果您正苦于以下问题:C++ Document类的具体用法?C++ Document怎么用?C++ Document使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Document类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SceneWidget

CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
: SceneWidget (parent), mDocument(document)
{
    setAcceptDrops(true);

    QAbstractItemModel *referenceables =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables);

    connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceableDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceableAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (referenceables, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceableAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *references =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_References);

    connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (references, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceAdded (const QModelIndex&, int, int)));
}
开发者ID:EitchKeii,项目名称:openmw,代码行数:25,代码来源:worldspacewidget.cpp


示例2: SubView

CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document,
    bool createAndDelete)
: SubView (id)
{
    setWidget (mTable = new Table (id, document.getData(), document.getUndoStack(), createAndDelete));

    connect (mTable, SIGNAL (doubleClicked (const QModelIndex&)), this, SLOT (rowActivated (const QModelIndex&)));
}
开发者ID:DavidBairamian,项目名称:openmw,代码行数:8,代码来源:tablesubview.cpp


示例3: SceneWidget

CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
: SceneWidget (document.getData().getResourceSystem(), parent, 0, false), mSceneElements(0), mRun(0), mDocument(document),
  mInteractionMask (0), mEditMode (0), mLocked (false), mDragging (false), mDragX(0), mDragY(0), mDragFactor(0),
  mDragWheelFactor(0), mDragShiftFactor(0),
  mToolTipPos (-1, -1), mShowToolTips(false), mToolTipDelay(0)
{
    setAcceptDrops(true);

    QAbstractItemModel *referenceables =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables);

    connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceableDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceableAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (referenceables, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceableAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *references =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_References);

    connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (references, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *pathgrids = document.getData().getTableModel (CSMWorld::UniversalId::Type_Pathgrids);

    connect (pathgrids, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (pathgridDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (pathgrids, SIGNAL (rowsRemoved (const QModelIndex&, int, int)),
        this, SLOT (pathgridRemoved (const QModelIndex&, int, int)));
    connect (pathgrids, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (pathgridAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (pathgrids, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (pathgridAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *debugProfiles =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_DebugProfiles);

    connect (debugProfiles, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (debugProfileDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (debugProfiles, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (debugProfileAboutToBeRemoved (const QModelIndex&, int, int)));

    mToolTipDelayTimer.setSingleShot (true);
    connect (&mToolTipDelayTimer, SIGNAL (timeout()), this, SLOT (showToolTip()));

    CSMPrefs::get()["3D Scene Input"].update();
    CSMPrefs::get()["Tooltips"].update();
}
开发者ID:ChunHungLiu,项目名称:openmw,代码行数:53,代码来源:worldspacewidget.cpp


示例4: TableBottomBox

CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: SubView (id), mLayout(new QHBoxLayout), mDocument(document), mScene(NULL), mToolbar(NULL)
{
    QVBoxLayout *layout = new QVBoxLayout;

    layout->setContentsMargins (QMargins (0, 0, 0, 0));

    layout->addWidget (mBottom =
        new TableBottomBox (NullCreatorFactory(), document.getData(), document.getUndoStack(), id,
        this), 0);

    mLayout->setContentsMargins (QMargins (0, 0, 0, 0));

    CSVRender::WorldspaceWidget* wordspaceWidget = NULL;
    widgetType whatWidget;

    if (id.getId()=="sys::default")
    {
        whatWidget = widget_Paged;

        CSVRender::PagedWorldspaceWidget *newWidget = new CSVRender::PagedWorldspaceWidget (this, document);

        wordspaceWidget = newWidget;

        makeConnections(newWidget);
    }
    else
    {
        whatWidget = widget_Unpaged;

        CSVRender::UnpagedWorldspaceWidget *newWidget = new CSVRender::UnpagedWorldspaceWidget (id.getId(), document, this);

        wordspaceWidget = newWidget;

        makeConnections(newWidget);
    }

    replaceToolbarAndWorldspace(wordspaceWidget, makeToolbar(wordspaceWidget, whatWidget));

    layout->insertLayout (0, mLayout, 1);

    CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (document.getData(), this);

    layout->insertWidget (0, filterBox);

    QWidget *widget = new QWidget;

    widget->setLayout (layout);

    setWidget (widget);
}
开发者ID:Allxere,项目名称:openmw,代码行数:51,代码来源:scenesubview.cpp


示例5: QPlainTextEdit

CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode,
    QWidget* parent)
    : QPlainTextEdit (parent),
    mDocument (document),
    mWhiteListQoutes("^[a-z|_]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive),
    mChangeLocked (0)
{
//    setAcceptRichText (false);
    setLineWrapMode (QPlainTextEdit::NoWrap);
    setTabStopWidth (4);
    setUndoRedoEnabled (false); // we use OpenCS-wide undo/redo instead

    mAllowedTypes <<CSMWorld::UniversalId::Type_Journal
                  <<CSMWorld::UniversalId::Type_Global
                  <<CSMWorld::UniversalId::Type_Topic
                  <<CSMWorld::UniversalId::Type_Sound
                  <<CSMWorld::UniversalId::Type_Spell
                  <<CSMWorld::UniversalId::Type_Cell
                  <<CSMWorld::UniversalId::Type_Referenceable
                  <<CSMWorld::UniversalId::Type_Activator
                  <<CSMWorld::UniversalId::Type_Potion
                  <<CSMWorld::UniversalId::Type_Apparatus
                  <<CSMWorld::UniversalId::Type_Armor
                  <<CSMWorld::UniversalId::Type_Book
                  <<CSMWorld::UniversalId::Type_Clothing
                  <<CSMWorld::UniversalId::Type_Container
                  <<CSMWorld::UniversalId::Type_Creature
                  <<CSMWorld::UniversalId::Type_Door
                  <<CSMWorld::UniversalId::Type_Ingredient
                  <<CSMWorld::UniversalId::Type_CreatureLevelledList
                  <<CSMWorld::UniversalId::Type_ItemLevelledList
                  <<CSMWorld::UniversalId::Type_Light
                  <<CSMWorld::UniversalId::Type_Lockpick
                  <<CSMWorld::UniversalId::Type_Miscellaneous
                  <<CSMWorld::UniversalId::Type_Npc
                  <<CSMWorld::UniversalId::Type_Probe
                  <<CSMWorld::UniversalId::Type_Repair
                  <<CSMWorld::UniversalId::Type_Static
                  <<CSMWorld::UniversalId::Type_Weapon
                  <<CSMWorld::UniversalId::Type_Script
                  <<CSMWorld::UniversalId::Type_Region;

    mHighlighter = new ScriptHighlighter (document.getData(), mode, ScriptEdit::document());

    connect (&document.getData(), SIGNAL (idListChanged()), this, SLOT (idListChanged()));

    connect (&mUpdateTimer, SIGNAL (timeout()), this, SLOT (updateHighlighting()));

    mUpdateTimer.setSingleShot (true);
}
开发者ID:Kleptoid,项目名称:openmw,代码行数:50,代码来源:scriptedit.cpp


示例6: TableBottomBox

CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
    : SubView (id)
{
    QVBoxLayout *layout = new QVBoxLayout;

    layout->setContentsMargins (QMargins (0, 0, 0, 0));

    layout->addWidget (mBottom =
                           new TableBottomBox (NullCreatorFactory(), document.getData(), document.getUndoStack(), id,
                                   this), 0);

    QHBoxLayout *layout2 = new QHBoxLayout;

    layout2->setContentsMargins (QMargins (0, 0, 0, 0));

    SceneToolbar *toolbar = new SceneToolbar (48, this);

    if (id.getId()=="sys::default")
        mScene = new CSVRender::PagedWorldspaceWidget (this);
    else
        mScene = new CSVRender::UnpagedWorldspaceWidget (id.getId(), document, this);

    SceneToolMode *navigationTool = mScene->makeNavigationSelector (toolbar);
    toolbar->addTool (navigationTool);

    SceneToolMode *lightingTool = mScene->makeLightingSelector (toolbar);
    toolbar->addTool (lightingTool);

    layout2->addWidget (toolbar, 0);

    layout2->addWidget (mScene, 1);

    layout->insertLayout (0, layout2, 1);

    CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (document.getData(), this);

    layout->insertWidget (0, filterBox);

    QWidget *widget = new QWidget;

    widget->setLayout (layout);

    setWidget (widget);

    mScene->selectDefaultNavigationMode();

    connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
}
开发者ID:ViteFalcon,项目名称:openmw,代码行数:48,代码来源:scenesubview.cpp


示例7: mDocument

CSMTools::ScriptCheckStage::ScriptCheckStage (const CSMDoc::Document& document)
: mDocument (document), mContext (document.getData()), mMessages (0)
{
    /// \todo add an option to configure warning mode
    setWarningsMode (0);

    Compiler::registerExtensions (mExtensions);
    mContext.setExtensions (&mExtensions);
}
开发者ID:Digmaster,项目名称:openmw,代码行数:9,代码来源:scriptcheck.cpp


示例8: mModel

CSVTools::ReportSubView::ReportSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: CSVDoc::SubView (id), mModel (document.getReport (id))
{
    setWidget (mTable = new QTableView (this));
    mTable->setModel (mModel);

    mTable->horizontalHeader()->setResizeMode (QHeaderView::Interactive);
    mTable->verticalHeader()->hide();
    mTable->setSortingEnabled (true);
    mTable->setSelectionBehavior (QAbstractItemView::SelectRows);
    mTable->setSelectionMode (QAbstractItemView::ExtendedSelection);

    mIdTypeDelegate = CSVWorld::IdTypeDelegateFactory().makeDelegate (
        document.getUndoStack(), this);

    mTable->setItemDelegateForColumn (0, mIdTypeDelegate);

    connect (mTable, SIGNAL (doubleClicked (const QModelIndex&)), this, SLOT (show (const QModelIndex&)));
}
开发者ID:0xmono,项目名称:openmw,代码行数:19,代码来源:reportsubview.cpp


示例9: logic_error

CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
    : SubView (id), mDocument (document), mColumn (-1), mChangeLocked (0)
{
    setWidget (mEditor = new ScriptEdit (this, mDocument));

    mEditor->setAcceptRichText (false);
    mEditor->setLineWrapMode (QTextEdit::NoWrap);
    mEditor->setTabStopWidth (4);
    mEditor->setUndoRedoEnabled (false); // we use OpenCS-wide undo/redo instead

    mModel = &dynamic_cast<CSMWorld::IdTable&> (
                 *document.getData().getTableModel (CSMWorld::UniversalId::Type_Scripts));

    for (int i=0; i<mModel->columnCount(); ++i)
        if (mModel->headerData (i, Qt::Horizontal, CSMWorld::ColumnBase::Role_Display)==
                CSMWorld::ColumnBase::Display_Script)
        {
            mColumn = i;
            break;
        }

    if (mColumn==-1)
        throw std::logic_error ("Can't find script column");

    mEditor->setPlainText (mModel->data (mModel->getModelIndex (id.getId(), mColumn)).toString());

    connect (mEditor, SIGNAL (textChanged()), this, SLOT (textChanged()));

    connect (mModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
             this, SLOT (dataChanged (const QModelIndex&, const QModelIndex&)));

    connect (mModel, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
             this, SLOT (rowsAboutToBeRemoved (const QModelIndex&, int, int)));

    connect (&document.getData(), SIGNAL (idListChanged()), this, SLOT (idListChanged()));

    mHighlighter = new ScriptHighlighter (document.getData(), mEditor->document());

    connect (&mUpdateTimer, SIGNAL (timeout()), this, SLOT (updateHighlighting()));

    mUpdateTimer.setSingleShot (true);
}
开发者ID:0xmono,项目名称:openmw,代码行数:42,代码来源:scriptsubview.cpp


示例10: WorldspaceWidget

CSVRender::UnpagedWorldspaceWidget::UnpagedWorldspaceWidget (const std::string& cellId, CSMDoc::Document& document, QWidget* parent)
: WorldspaceWidget (document, parent), mCellId (cellId)
{
    mCellsModel = &dynamic_cast<CSMWorld::IdTable&> (
        *document.getData().getTableModel (CSMWorld::UniversalId::Type_Cells));

    mReferenceablesModel = &dynamic_cast<CSMWorld::IdTable&> (
        *document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables));

    connect (mCellsModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (cellDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (mCellsModel, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (cellRowsAboutToBeRemoved (const QModelIndex&, int, int)));

    update();

    mCell.reset (new Cell (document.getData(), mRootNode, mCellId));

    mView->setCameraManipulator(new osgGA::TrackballManipulator);
}
开发者ID:hristoast,项目名称:openmw,代码行数:20,代码来源:unpagedworldspacewidget.cpp


示例11: PreviewWidget

CSVWorld::PreviewSubView::PreviewSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: SubView (id)
{
    QHBoxLayout *layout = new QHBoxLayout;

    layout->setContentsMargins (QMargins (0, 0, 0, 0));

    if (document.getData().getReferenceables().searchId (id.getId())==-1)
    {
        std::string referenceableId =
            document.getData().getReferences().getRecord (id.getId()).get().mRefID;

        referenceableIdChanged (referenceableId);

        mScene =
            new CSVRender::PreviewWidget (document.getData(), referenceableId, id.getId(), this);
    }
    else
        mScene = new CSVRender::PreviewWidget (document.getData(), id.getId(), this);

    SceneToolbar *toolbar = new SceneToolbar (48+6, this);

    SceneToolMode *lightingTool = mScene->makeLightingSelector (toolbar);
    toolbar->addTool (lightingTool);

    layout->addWidget (toolbar, 0);

    layout->addWidget (mScene, 1);

    QWidget *widget = new QWidget;

    widget->setLayout (layout);

    setWidget (widget);

    connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
    connect (mScene, SIGNAL (referenceableIdChanged (const std::string&)),
        this, SLOT (referenceableIdChanged (const std::string&)));
}
开发者ID:0xmono,项目名称:openmw,代码行数:39,代码来源:previewsubview.cpp


示例12: WorldspaceWidget

CSVRender::UnpagedWorldspaceWidget::UnpagedWorldspaceWidget (const std::string& cellId,
    CSMDoc::Document& document, QWidget *parent)
: WorldspaceWidget (parent), mCellId (cellId)
{
    mCellsModel = &dynamic_cast<CSMWorld::IdTable&> (
        *document.getData().getTableModel (CSMWorld::UniversalId::Type_Cells));

    connect (mCellsModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (cellDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (mCellsModel, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (cellRowsAboutToBeRemoved (const QModelIndex&, int, int)));

    update();
}
开发者ID:Chiur,项目名称:openmw,代码行数:14,代码来源:unpagedworldspacewidget.cpp


示例13: appendStage

CSMTools::SearchOperation::SearchOperation (CSMDoc::Document& document)
: CSMDoc::Operation (CSMDoc::State_Searching, false)
{
    std::vector<CSMWorld::UniversalId::Type> types = CSMWorld::UniversalId::listTypes (
        CSMWorld::UniversalId::Class_RecordList |
        CSMWorld::UniversalId::Class_ResourceList
        );

    for (std::vector<CSMWorld::UniversalId::Type>::const_iterator iter (types.begin());
        iter!=types.end(); ++iter)
        appendStage (new SearchStage (&dynamic_cast<CSMWorld::IdTableBase&> (
            *document.getData().getTableModel (*iter))));

    setDefaultSeverity (CSMDoc::Message::Severity_Info);
}
开发者ID:Driphter,项目名称:openmw,代码行数:15,代码来源:searchoperation.cpp


示例14: DragRecordTable

CSVWorld::RegionMap::RegionMap (const CSMWorld::UniversalId& universalId,
                                CSMDoc::Document& document, QWidget *parent)
    :  DragRecordTable(document, parent)
{
    verticalHeader()->hide();
    horizontalHeader()->hide();

    setSelectionMode (QAbstractItemView::ExtendedSelection);

    setModel (document.getData().getTableModel (universalId));

    resizeColumnsToContents();
    resizeRowsToContents();

    mSelectAllAction = new QAction (tr ("Select All"), this);
    connect (mSelectAllAction, SIGNAL (triggered()), this, SLOT (selectAll()));
    addAction (mSelectAllAction);

    mClearSelectionAction = new QAction (tr ("Clear Selection"), this);
    connect (mClearSelectionAction, SIGNAL (triggered()), this, SLOT (clearSelection()));
    addAction (mClearSelectionAction);

    mSelectRegionsAction = new QAction (tr ("Select Regions"), this);
    connect (mSelectRegionsAction, SIGNAL (triggered()), this, SLOT (selectRegions()));
    addAction (mSelectRegionsAction);

    mCreateCellsAction = new QAction (tr ("Create Cells Action"), this);
    connect (mCreateCellsAction, SIGNAL (triggered()), this, SLOT (createCells()));
    addAction (mCreateCellsAction);

    mSetRegionAction = new QAction (tr ("Set Region"), this);
    connect (mSetRegionAction, SIGNAL (triggered()), this, SLOT (setRegion()));
    addAction (mSetRegionAction);

    mUnsetRegionAction = new QAction (tr ("Unset Region"), this);
    connect (mUnsetRegionAction, SIGNAL (triggered()), this, SLOT (unsetRegion()));
    addAction (mUnsetRegionAction);

    mViewAction = new QAction (tr ("View Cells"), this);
    connect (mViewAction, SIGNAL (triggered()), this, SLOT (view()));
    addAction (mViewAction);

    mViewInTableAction = new QAction (tr ("View Cells in Table"), this);
    connect (mViewInTableAction, SIGNAL (triggered()), this, SLOT (viewInTable()));
    addAction (mViewInTableAction);

    setAcceptDrops(true);
}
开发者ID:ace13,项目名称:openmw,代码行数:48,代码来源:regionmap.cpp


示例15: QTableView

CSVWorld::RegionMapSubView::RegionMapSubView (CSMWorld::UniversalId universalId,
    CSMDoc::Document& document)
: CSVDoc::SubView (universalId)
{
    mTable = new QTableView (this);

    mTable->verticalHeader()->hide();
    mTable->horizontalHeader()->hide();

    mTable->setSelectionMode (QAbstractItemView::ExtendedSelection);

    mTable->setModel (document.getData().getTableModel (universalId));

    mTable->resizeColumnsToContents();
    mTable->resizeRowsToContents();

    setWidget (mTable);
}
开发者ID:Adrian-Revk,项目名称:openmw,代码行数:18,代码来源:regionmapsubview.cpp


示例16: QPlainTextEdit

CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode,
    QWidget* parent)
    : QPlainTextEdit (parent),
    mDocument (document),
    mWhiteListQoutes("^[a-z|_]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive),
    mChangeLocked (0),
    mLineNumberArea(0),
    mShowLineNum(false),
    mDefaultFont(font()),
    mMonoFont(QFont("Monospace"))
{
//    setAcceptRichText (false);
    setLineWrapMode (QPlainTextEdit::NoWrap);
    setTabStopWidth (4);
    setUndoRedoEnabled (false); // we use OpenCS-wide undo/redo instead

    mAllowedTypes <<CSMWorld::UniversalId::Type_Journal
                  <<CSMWorld::UniversalId::Type_Global
                  <<CSMWorld::UniversalId::Type_Topic
                  <<CSMWorld::UniversalId::Type_Sound
                  <<CSMWorld::UniversalId::Type_Spell
                  <<CSMWorld::UniversalId::Type_Cell
                  <<CSMWorld::UniversalId::Type_Referenceable
                  <<CSMWorld::UniversalId::Type_Activator
                  <<CSMWorld::UniversalId::Type_Potion
                  <<CSMWorld::UniversalId::Type_Apparatus
                  <<CSMWorld::UniversalId::Type_Armor
                  <<CSMWorld::UniversalId::Type_Book
                  <<CSMWorld::UniversalId::Type_Clothing
                  <<CSMWorld::UniversalId::Type_Container
                  <<CSMWorld::UniversalId::Type_Creature
                  <<CSMWorld::UniversalId::Type_Door
                  <<CSMWorld::UniversalId::Type_Ingredient
                  <<CSMWorld::UniversalId::Type_CreatureLevelledList
                  <<CSMWorld::UniversalId::Type_ItemLevelledList
                  <<CSMWorld::UniversalId::Type_Light
                  <<CSMWorld::UniversalId::Type_Lockpick
                  <<CSMWorld::UniversalId::Type_Miscellaneous
                  <<CSMWorld::UniversalId::Type_Npc
                  <<CSMWorld::UniversalId::Type_Probe
                  <<CSMWorld::UniversalId::Type_Repair
                  <<CSMWorld::UniversalId::Type_Static
                  <<CSMWorld::UniversalId::Type_Weapon
                  <<CSMWorld::UniversalId::Type_Script
                  <<CSMWorld::UniversalId::Type_Region;

    mHighlighter = new ScriptHighlighter (document.getData(), mode, ScriptEdit::document());

    connect (&document.getData(), SIGNAL (idListChanged()), this, SLOT (idListChanged()));

    connect (&mUpdateTimer, SIGNAL (timeout()), this, SLOT (updateHighlighting()));

    mUpdateTimer.setSingleShot (true);

    // TODO: provide a font selector dialogue
    mMonoFont.setStyleHint(QFont::TypeWriter);
    std::string useMonoFont =
        CSMSettings::UserSettings::instance().setting("script-editor/mono-font", "true").toStdString();
    if (useMonoFont == "true")
        setFont(mMonoFont);

    mLineNumberArea = new LineNumberArea(this);
    updateLineNumberAreaWidth(0);

    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));

    std::string showStatusBar =
        CSMSettings::UserSettings::instance().settingValue("script-editor/show-linenum").toStdString();

    showLineNum(showStatusBar == "true");
}
开发者ID:logorrhea,项目名称:openmw,代码行数:72,代码来源:scriptedit.cpp


示例17: SceneWidget

CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
    : SceneWidget (document.getData().getResourceSystem(), parent, 0, false)
    , mSceneElements(0)
    , mRun(0)
    , mDocument(document)
    , mInteractionMask (0)
    , mEditMode (0)
    , mLocked (false)
    , mDragMode(InteractionType_None)
    , mDragging (false)
    , mDragX(0)
    , mDragY(0)
    , mSpeedMode(false)
    , mDragFactor(0)
    , mDragWheelFactor(0)
    , mDragShiftFactor(0)
    , mToolTipPos (-1, -1)
    , mShowToolTips(false)
    , mToolTipDelay(0)
{
    setAcceptDrops(true);

    QAbstractItemModel *referenceables =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables);

    connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceableDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceableAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (referenceables, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceableAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *references =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_References);

    connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (references, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *pathgrids = document.getData().getTableModel (CSMWorld::UniversalId::Type_Pathgrids);

    connect (pathgrids, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (pathgridDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (pathgrids, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (pathgridAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (pathgrids, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (pathgridAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *debugProfiles =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_DebugProfiles);

    connect (debugProfiles, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (debugProfileDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (debugProfiles, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (debugProfileAboutToBeRemoved (const QModelIndex&, int, int)));

    mToolTipDelayTimer.setSingleShot (true);
    connect (&mToolTipDelayTimer, SIGNAL (timeout()), this, SLOT (showToolTip()));

    CSMPrefs::get()["3D Scene Input"].update();
    CSMPrefs::get()["Tooltips"].update();

    // Shortcuts
    CSMPrefs::Shortcut* primaryEditShortcut = new CSMPrefs::Shortcut("scene-edit-primary", "scene-speed-modifier",
            CSMPrefs::Shortcut::SM_Detach, this);
    connect(primaryEditShortcut, SIGNAL(activated(bool)), this, SLOT(primaryEdit(bool)));
    connect(primaryEditShortcut, SIGNAL(secondary(bool)), this, SLOT(speedMode(bool)));

    CSMPrefs::Shortcut* secondaryEditShortcut = new CSMPrefs::Shortcut("scene-edit-secondary", this);
    connect(secondaryEditShortcut, SIGNAL(activated(bool)), this, SLOT(secondaryEdit(bool)));

    CSMPrefs::Shortcut* primarySelectShortcut = new CSMPrefs::Shortcut("scene-select-primary", this);
    connect(primarySelectShortcut, SIGNAL(activated(bool)), this, SLOT(primarySelect(bool)));

    CSMPrefs::Shortcut* secondarySelectShortcut = new CSMPrefs::Shortcut("scene-select-secondary", this);
    connect(secondarySelectShortcut, SIGNAL(activated(bool)), this, SLOT(secondarySelect(bool)));

    CSMPrefs::Shortcut* abortShortcut = new CSMPrefs::Shortcut("scene-edit-abort", this);
    connect(abortShortcut, SIGNAL(activated()), this, SLOT(abortDrag()));
}
开发者ID:DavidDanielsson,项目名称:openmw,代码行数:83,代码来源:worldspacewidget.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ csmdoc::Messages类代码示例发布时间:2022-05-31
下一篇:
C++ csjson::Reader类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap