Implement draggable rectangle selection
This commit is contained in:
18
document.cpp
18
document.cpp
@@ -38,6 +38,7 @@ TeletextDocument::TeletextDocument()
|
||||
m_undoStack = new QUndoStack(this);
|
||||
m_cursorRow = 1;
|
||||
m_cursorColumn = 0;
|
||||
m_selectionSubPage = nullptr;
|
||||
}
|
||||
|
||||
TeletextDocument::~TeletextDocument()
|
||||
@@ -285,6 +286,23 @@ void TeletextDocument::moveCursor(int newCursorRow, int newCursorColumn)
|
||||
emit cursorMoved();
|
||||
}
|
||||
|
||||
void TeletextDocument::setSelection(int topRow, int leftColumn, int bottomRow, int rightColumn)
|
||||
{
|
||||
if (m_selectionTopRow != topRow || m_selectionBottomRow != bottomRow || m_selectionLeftColumn != leftColumn || m_selectionRightColumn != rightColumn) {
|
||||
m_selectionSubPage = currentSubPage();
|
||||
m_selectionTopRow = topRow;
|
||||
m_selectionBottomRow = bottomRow;
|
||||
m_selectionLeftColumn = leftColumn;
|
||||
m_selectionRightColumn = rightColumn;
|
||||
emit selectionMoved();
|
||||
}
|
||||
}
|
||||
|
||||
void TeletextDocument::cancelSelection()
|
||||
{
|
||||
m_selectionSubPage = nullptr;
|
||||
}
|
||||
|
||||
|
||||
OverwriteCharacterCommand::OverwriteCharacterCommand(TeletextDocument *teletextDocument, unsigned char newCharacter, QUndoCommand *parent) : QUndoCommand(parent)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user