Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkPythonSnippets Class Reference

a widget that holds snippets and serializes the snippets to a certain places More...

#include <QmitkPythonSnippets.h>

Inheritance diagram for QmitkPythonSnippets:
Collaboration diagram for QmitkPythonSnippets:

Public Types

typedef QMap< QString, QString > QStringMap
 typedef for string map More...
 

Signals

void PasteCommandRequested (const QString &command)
 this class whishes to paste sth command More...
 

Public Member Functions

 QmitkPythonSnippets (const QString &_AutoSaveFileName="", QWidget *parent=nullptr)
 
 ~QmitkPythonSnippets () override
 delete d pointer More...
 

Static Public Member Functions

static bool LoadStringMap (const QString &filename, QStringMap &oldMap)
 read string map from xml file More...
 

Static Public Attributes

static const QString DEFAULT_SNIPPET_FILE
 
static const QString SNIPPETS_ROOT_XML_ELEMENT_NAME
 
static const QString SNIPPETS_XML_ELEMENT_NAME
 

Protected Slots

void on_PasteSnippet_triggered (bool checked=false)
 emits PasteCommandRequested signal More...
 
void on_RenameSnippet_triggered (bool checked=false)
 ask for name as long as it exists, call update() More...
 
void on_AddSnippet_triggered (bool checked=false)
 ask for name, create snippet, call update() More...
 
void on_RemoveSnippet_triggered (bool checked=false)
 remove the current snippet, call update() More...
 
void on_RestoreDefaultSnippets_triggered (bool checked=false)
 call LoadStringMap with d->m_DefaultSnippetsAutoSaveFileName More...
 
void on_Name_currentIndexChanged (int i)
 update action state (enable/disable), update text box More...
 
void on_Content_textChanged ()
 save changed snippet More...
 
void on_SaveSnippets_triggered (bool checked=false)
 ask for file, save snippets More...
 
void on_LoadSnippets_triggered (bool checked=false)
 ask for file, load snippets (do not replace) More...
 

Protected Member Functions

void SaveStringMap (const QString &filename, const QStringMap &map) const
 write string map to xml file More...
 
QString CreateUniqueName (const QString &name) const
 creates a name which does not exist in the list More...
 
void Update (const QString &name="")
 

Detailed Description

a widget that holds snippets and serializes the snippets to a certain places

Definition at line 23 of file QmitkPythonSnippets.h.

Member Typedef Documentation

◆ QStringMap

typedef QMap<QString, QString> QmitkPythonSnippets::QStringMap

typedef for string map

Definition at line 33 of file QmitkPythonSnippets.h.

Constructor & Destructor Documentation

◆ QmitkPythonSnippets()

QmitkPythonSnippets::QmitkPythonSnippets ( const QString &  _AutoSaveFileName = "",
QWidget *  parent = nullptr 
)

build ui here the snippets will be loaded from _AutoSaveFileName if not empty and readable otherwise the default snippets will be loaded

◆ ~QmitkPythonSnippets()

QmitkPythonSnippets::~QmitkPythonSnippets ( )
override

delete d pointer

Member Function Documentation

◆ CreateUniqueName()

QString QmitkPythonSnippets::CreateUniqueName ( const QString &  name) const
protected

creates a name which does not exist in the list

◆ LoadStringMap()

static bool QmitkPythonSnippets::LoadStringMap ( const QString &  filename,
QStringMap oldMap 
)
static

read string map from xml file

◆ on_AddSnippet_triggered

void QmitkPythonSnippets::on_AddSnippet_triggered ( bool  checked = false)
protectedslot

ask for name, create snippet, call update()

◆ on_Content_textChanged

void QmitkPythonSnippets::on_Content_textChanged ( )
protectedslot

save changed snippet

◆ on_LoadSnippets_triggered

void QmitkPythonSnippets::on_LoadSnippets_triggered ( bool  checked = false)
protectedslot

ask for file, load snippets (do not replace)

◆ on_Name_currentIndexChanged

void QmitkPythonSnippets::on_Name_currentIndexChanged ( int  i)
protectedslot

update action state (enable/disable), update text box

◆ on_PasteSnippet_triggered

void QmitkPythonSnippets::on_PasteSnippet_triggered ( bool  checked = false)
protectedslot

emits PasteCommandRequested signal

◆ on_RemoveSnippet_triggered

void QmitkPythonSnippets::on_RemoveSnippet_triggered ( bool  checked = false)
protectedslot

remove the current snippet, call update()

◆ on_RenameSnippet_triggered

void QmitkPythonSnippets::on_RenameSnippet_triggered ( bool  checked = false)
protectedslot

ask for name as long as it exists, call update()

◆ on_RestoreDefaultSnippets_triggered

void QmitkPythonSnippets::on_RestoreDefaultSnippets_triggered ( bool  checked = false)
protectedslot

call LoadStringMap with d->m_DefaultSnippetsAutoSaveFileName

◆ on_SaveSnippets_triggered

void QmitkPythonSnippets::on_SaveSnippets_triggered ( bool  checked = false)
protectedslot

ask for file, save snippets

◆ PasteCommandRequested

void QmitkPythonSnippets::PasteCommandRequested ( const QString &  command)
signal

this class whishes to paste sth command

◆ SaveStringMap()

void QmitkPythonSnippets::SaveStringMap ( const QString &  filename,
const QStringMap map 
) const
protected

write string map to xml file

◆ Update()

void QmitkPythonSnippets::Update ( const QString &  name = "")
protected

update combo box if name is passed, the according element will be selected

Member Data Documentation

◆ DEFAULT_SNIPPET_FILE

const QString QmitkPythonSnippets::DEFAULT_SNIPPET_FILE
static

Definition at line 28 of file QmitkPythonSnippets.h.

◆ SNIPPETS_ROOT_XML_ELEMENT_NAME

const QString QmitkPythonSnippets::SNIPPETS_ROOT_XML_ELEMENT_NAME
static

Definition at line 29 of file QmitkPythonSnippets.h.

◆ SNIPPETS_XML_ELEMENT_NAME

const QString QmitkPythonSnippets::SNIPPETS_XML_ELEMENT_NAME
static

Definition at line 30 of file QmitkPythonSnippets.h.


The documentation for this class was generated from the following file: