event more commenting.
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! hilfsfunktion: gibt diesen teilbaum rekursiv aus
|
||||||
|
|
||||||
void inspect( const XQNodePtr& node, int indent )
|
void inspect( const XQNodePtr& node, int indent )
|
||||||
{
|
{
|
||||||
@@ -34,9 +34,7 @@ void inspect( const XQNodePtr& node, int indent )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//! operator<< für QString und std::ostream
|
||||||
|
|
||||||
//! firz
|
|
||||||
|
|
||||||
// Overload the operator<< for MyClass and std::ostream
|
// Overload the operator<< for MyClass and std::ostream
|
||||||
std::ostream& operator<<(std::ostream& os, const QString& obj)
|
std::ostream& operator<<(std::ostream& os, const QString& obj)
|
||||||
@@ -47,7 +45,8 @@ std::ostream& operator<<(std::ostream& os, const QString& obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! 'QString' implementation von split
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
bool znode::zpayload<QString>::xstr_split_by(const QString& entry, const QString& sep, QString& key, QString& value )
|
bool znode::zpayload<QString>::xstr_split_by(const QString& entry, const QString& sep, QString& key, QString& value )
|
||||||
{
|
{
|
||||||
@@ -60,7 +59,7 @@ bool znode::zpayload<QString>::xstr_split_by(const QString& entry, const QString
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! 'QString' implementation von substr
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
QString znode::zpayload<QString>::xstr_sub_str( const QString& entry, int pos ) const
|
QString znode::zpayload<QString>::xstr_sub_str( const QString& entry, int pos ) const
|
||||||
@@ -69,7 +68,7 @@ QString znode::zpayload<QString>::xstr_sub_str( const QString& entry, int pos )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! 'QString' implementation vom test auf 'empty'
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
bool znode::zpayload<QString>::xstr_is_empty(const QString& entry ) const
|
bool znode::zpayload<QString>::xstr_is_empty(const QString& entry ) const
|
||||||
@@ -78,7 +77,7 @@ bool znode::zpayload<QString>::xstr_is_empty(const QString& entry ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! 'QString' varianten der keystrings.
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
const QString znode::zpayload<QString>::cType = "Type";
|
const QString znode::zpayload<QString>::cType = "Type";
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! schreibt einen (teil)baum in ein file
|
||||||
|
|
||||||
void XQNodeWriter::dumpTree( XQNodePtr rootNode, const QString& fileName ) const
|
void XQNodeWriter::dumpTree( XQNodePtr rootNode, const QString& fileName ) const
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,8 @@ void XQNodeWriter::dumpTree( XQNodePtr rootNode, const QString& fileName ) const
|
|||||||
treeFile.close();
|
treeFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! firz
|
|
||||||
|
//! schreibt einen knoten in einen stream
|
||||||
|
|
||||||
void XQNodeWriter::dumpNode( QXmlStreamWriter& writer, XQNodePtr node ) const
|
void XQNodeWriter::dumpNode( QXmlStreamWriter& writer, XQNodePtr node ) const
|
||||||
{
|
{
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! konstruiert ein selectionmodel.
|
||||||
|
|
||||||
XQSelectionModel::XQSelectionModel(QAbstractItemModel* model)
|
XQSelectionModel::XQSelectionModel(QAbstractItemModel* model)
|
||||||
: QItemSelectionModel(model)
|
: QItemSelectionModel(model)
|
||||||
@@ -26,7 +26,7 @@ XQSelectionModel::XQSelectionModel(QAbstractItemModel* model)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! konstruiert ein selectionmodel.
|
||||||
|
|
||||||
XQSelectionModel::XQSelectionModel(QAbstractItemModel* model, QObject* parent)
|
XQSelectionModel::XQSelectionModel(QAbstractItemModel* model, QObject* parent)
|
||||||
: QItemSelectionModel(model, parent)
|
: QItemSelectionModel(model, parent)
|
||||||
@@ -40,7 +40,7 @@ XQSelectionModel::XQSelectionModel(QAbstractItemModel* model, QObject* parent)
|
|||||||
void XQSelectionModel::select(const QItemSelection& selection, QItemSelectionModel::SelectionFlags command)
|
void XQSelectionModel::select(const QItemSelection& selection, QItemSelectionModel::SelectionFlags command)
|
||||||
{
|
{
|
||||||
// step #0: fetch selected indices.
|
// step #0: fetch selected indices.
|
||||||
QModelIndexList list = selection.indexes();
|
const QModelIndexList list = selection.indexes();
|
||||||
if (list.isEmpty() || selectedRows().isEmpty() )
|
if (list.isEmpty() || selectedRows().isEmpty() )
|
||||||
return QItemSelectionModel::select(selection, command);
|
return QItemSelectionModel::select(selection, command);
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include <xqviewmodel.h>
|
#include <xqviewmodel.h>
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! true, wenn paste an er stelle 'curIdx' möglich ist.
|
||||||
|
|
||||||
bool XQSimpleClipBoard::canPaste( const QModelIndex& curIdx ) const
|
bool XQSimpleClipBoard::canPaste( const QModelIndex& curIdx ) const
|
||||||
{
|
{
|
||||||
@@ -38,7 +38,9 @@ bool XQSimpleClipBoard::canPaste( const QModelIndex& curIdx ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! erzeugt eine positions-list aus der liste selectierter indicies.
|
||||||
|
//! Der mit seiner position zusammen gespeicherter knoten muss hier
|
||||||
|
//! gekloned werden.
|
||||||
|
|
||||||
void XQSimpleClipBoard::saveNodes( const QModelIndexList& list )
|
void XQSimpleClipBoard::saveNodes( const QModelIndexList& list )
|
||||||
{
|
{
|
||||||
|
@@ -15,21 +15,7 @@
|
|||||||
#include <xqcontextmenu.h>
|
#include <xqcontextmenu.h>
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! konstruktor.
|
||||||
|
|
||||||
XQContextMenu::XQContextMenu(const QString& title, QWidget* parent )
|
|
||||||
: QMenu( title, parent )
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
QAction* titleDummy = new QAction(title,this);
|
|
||||||
QWidget::addAction(titleDummy);
|
|
||||||
addSeparator();
|
|
||||||
titleDummy->setEnabled(false);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
|
||||||
|
|
||||||
XQContextMenu::XQContextMenu(QWidget* parent)
|
XQContextMenu::XQContextMenu(QWidget* parent)
|
||||||
: QMenu( parent )
|
: QMenu( parent )
|
||||||
@@ -37,7 +23,8 @@ XQContextMenu::XQContextMenu(QWidget* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! erzeugt eine action mit text
|
||||||
|
//! aus einem command-type und fügt sie hinzu.
|
||||||
|
|
||||||
void XQContextMenu::addAction(const QString& text, XQCommand::CmdType commandType, bool enabled)
|
void XQContextMenu::addAction(const QString& text, XQCommand::CmdType commandType, bool enabled)
|
||||||
{
|
{
|
||||||
@@ -49,7 +36,8 @@ void XQContextMenu::addAction(const QString& text, XQCommand::CmdType commandTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! erzeugt eine action mit text und icon aus
|
||||||
|
//! einem command-type und fügt sie hinzu.
|
||||||
|
|
||||||
void XQContextMenu::addAction(const QString& iconKey, const QString& name, XQCommand::CmdType commandType, bool enabled)
|
void XQContextMenu::addAction(const QString& iconKey, const QString& name, XQCommand::CmdType commandType, bool enabled)
|
||||||
{
|
{
|
||||||
@@ -57,7 +45,8 @@ void XQContextMenu::addAction(const QString& iconKey, const QString& name, XQCom
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! erzeugt eine action mit text und icon aus
|
||||||
|
//! einem command-type und fügt sie hinzu.
|
||||||
|
|
||||||
void XQContextMenu::addAction(const QIcon& icon, const QString& text, XQCommand::CmdType commandType, bool enabled)
|
void XQContextMenu::addAction(const QIcon& icon, const QString& text, XQCommand::CmdType commandType, bool enabled)
|
||||||
{
|
{
|
||||||
@@ -69,7 +58,7 @@ void XQContextMenu::addAction(const QIcon& icon, const QString& text, XQCommand:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! schaltet die action mit 'commandType'
|
||||||
|
|
||||||
void XQContextMenu::setActionEnabled(XQCommand::CmdType commandType, bool enabled)
|
void XQContextMenu::setActionEnabled(XQCommand::CmdType commandType, bool enabled)
|
||||||
{
|
{
|
||||||
|
@@ -29,7 +29,6 @@ class XQContextMenu : public QMenu
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
XQContextMenu(const QString& title, QWidget* parent = nullptr );
|
|
||||||
XQContextMenu(QWidget* parent = nullptr );
|
XQContextMenu(QWidget* parent = nullptr );
|
||||||
virtual ~XQContextMenu() = default;
|
virtual ~XQContextMenu() = default;
|
||||||
|
|
||||||
|
@@ -137,25 +137,7 @@ void XQTreeTable::mouseMoveEvent(QMouseEvent* event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! speichert die start-position fürs header-resizing.
|
||||||
|
|
||||||
void XQTreeTable::mouseDoubleClickEvent(QMouseEvent* event)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
QModelIndex idxFromPos = indexAt(event->pos());
|
|
||||||
if (idxFromPos.isValid())
|
|
||||||
{
|
|
||||||
if ( NTItem::isHeaderType(idxFromPos) && cursor().shape() == Qt::SplitHCursor)
|
|
||||||
{
|
|
||||||
return resizeColumnToContents(idxFromPos.column());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
QTreeView::mouseDoubleClickEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
|
||||||
|
|
||||||
void XQTreeTable::mousePressEvent(QMouseEvent* event)
|
void XQTreeTable::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
@@ -174,18 +156,18 @@ void XQTreeTable::mousePressEvent(QMouseEvent* event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! speichert die index-position fürs header-resizing.
|
||||||
|
|
||||||
void XQTreeTable::mouseReleaseEvent(QMouseEvent* event)
|
void XQTreeTable::mouseReleaseEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
// reset index for resize column
|
// reset index for resize column
|
||||||
_indexToResize = QModelIndex();
|
_indexToResize = QModelIndex();
|
||||||
setCursor(QCursor(Qt::ArrowCursor));
|
setCursor(QCursor(Qt::ArrowCursor));
|
||||||
QTreeView::mouseReleaseEvent(event);
|
QTreeView::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! firz
|
//! zoom-in / zoom-out mit mausrad & ctrl
|
||||||
|
|
||||||
void XQTreeTable::wheelEvent(QWheelEvent* event)
|
void XQTreeTable::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
|
@@ -46,7 +46,6 @@ protected:
|
|||||||
void currentChanged(const QModelIndex& current, const QModelIndex& previous) override;
|
void currentChanged(const QModelIndex& current, const QModelIndex& previous) override;
|
||||||
|
|
||||||
void mouseMoveEvent(QMouseEvent* event) override;
|
void mouseMoveEvent(QMouseEvent* event) override;
|
||||||
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
|
||||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||||
void mousePressEvent(QMouseEvent* event) override;
|
void mousePressEvent(QMouseEvent* event) override;
|
||||||
void mouseResizeHeaderEntry(int xpos);
|
void mouseResizeHeaderEntry(int xpos);
|
||||||
|
@@ -50,9 +50,9 @@
|
|||||||
<X>
|
<X>
|
||||||
<Section>
|
<Section>
|
||||||
<Header>
|
<Header>
|
||||||
</Header1>
|
</Header>
|
||||||
<data>
|
<data>
|
||||||
</data>
|
</data>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
</X>
|
</X>
|
||||||
|
Reference in New Issue
Block a user