Files
clients/NaverCafeListManager/stable.cpp
admin 2eb2d91f76 NaverCafeListManager 추가
네이버카페리스트 관리

git-svn-id: svn://192.168.0.12/source@224 8346c931-da38-4b9b-9d4c-e48b93cbd075
2015-11-11 06:52:37 +00:00

42 lines
767 B
C++

#include "stable.h"
#include <QDebug>
STable::STable()
{
}
STable::~STable()
{
}
void STable::keyPressEvent(QKeyEvent* event)
{
// If Ctrl-C typed
if (event->key() == Qt::Key_C && (event->modifiers() & Qt::ControlModifier))
Copy();
}
void STable::Copy()
{
QModelIndexList cells = selectedIndexes();
//qSort(cells);
QString text;
int currentRow = 0;
foreach (const QModelIndex& cell, cells)
{
if (text.length() == 0)
{
}
else if (cell.row() != currentRow)
text += '\n';
else
text += '\t';
currentRow = cell.row();
text += cell.data().toString();
}
QApplication::clipboard()->setText(text);
}