MainWindow: Remove copy and paste actions

Remove the copy and paste actions and slots from the main window code.
They have not been working for a very long time and seem to be rather
useless anyway.
This commit is contained in:
Martin Kleusberg
2013-01-18 22:12:20 +01:00
parent d05e90e495
commit e52f268578
3 changed files with 0 additions and 97 deletions

View File

@@ -27,7 +27,6 @@ MainWindow::MainWindow(QWidget* parent)
: QMainWindow(parent),
ui(new Ui::MainWindow),
editWin(new EditDialog(this)),
clipboard(QApplication::clipboard()),
findWin(0)
{
ui->setupUi(this);
@@ -633,37 +632,6 @@ void MainWindow::editTable()
}
}
void MainWindow::copy()
{
QWidget * t = ui->dataTable->cellWidget(ui->dataTable->currentRow(), ui->dataTable->currentColumn());
if (t!=0){
if (QString(t->metaObject()->className()) == "QLineEdit"){
/*we are in edit mode*/
if (t->hasFocus()){
QLineEdit * le = (QLineEdit *) t;
le->copy();
}
}
}
if (ui->editGoto->hasFocus())
ui->editGoto->copy();
}
void MainWindow::paste()
{
QWidget * t = ui->dataTable->cellWidget(ui->dataTable->currentRow(), ui->dataTable->currentColumn());
if (t!=0){
if ( QString(t->metaObject()->className()) == "QLineEdit" ){
/*we are in edit mode*/
if (t->hasFocus()){
QLineEdit * le = (QLineEdit *) t;
le->paste();}
}
}
if (ui->editGoto->hasFocus())
ui->editGoto->paste();
}
void MainWindow::helpWhatsThis()
{
QWhatsThis::enterWhatsThisMode ();

View File

@@ -46,7 +46,6 @@ public:
~MainWindow();
EditDialog* editWin;
QClipboard* clipboard;
FindDialog* findWin;
QIntValidator * gotoValidator;
QString defaultlocation;
@@ -92,8 +91,6 @@ public slots:
virtual void compact();
virtual void deleteObject();
virtual void editTable();
virtual void copy();
virtual void paste();
virtual void helpWhatsThis();
virtual void helpAbout();
virtual void updateRecordText( int row, int col, QString newtext );

View File

@@ -1364,34 +1364,6 @@
<string>Modify Field</string>
</property>
</action>
<action name="editCopyAction">
<property name="text">
<string>&amp;Copy</string>
</property>
<property name="toolTip">
<string>Copies the selected text to the clipboard</string>
</property>
<property name="whatsThis">
<string>Copies the selected text to the clipboard</string>
</property>
<property name="shortcut">
<string>Ctrl+C</string>
</property>
</action>
<action name="editPasteAction">
<property name="text">
<string>&amp;Paste</string>
</property>
<property name="toolTip">
<string>Pastes text from the clipboard into the current text insertion point</string>
</property>
<property name="whatsThis">
<string>Pastes text from the clipboard into the current text insertion point</string>
</property>
<property name="shortcut">
<string>Ctrl+V</string>
</property>
</action>
<action name="actionRecent_y_opened">
<property name="text">
<string>&amp;Recently opened</string>
@@ -1957,38 +1929,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>editCopyAction</sender>
<signal>activated()</signal>
<receiver>MainWindow</receiver>
<slot>copy()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
<connection>
<sender>editPasteAction</sender>
<signal>activated()</signal>
<receiver>MainWindow</receiver>
<slot>paste()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
<connection>
<sender>editModifyFieldActionPopup</sender>
<signal>activated()</signal>
@@ -2098,8 +2038,6 @@
<slot>browseFind(bool)</slot>
<slot>browseRefresh()</slot>
<slot>compact()</slot>
<slot>copy()</slot>
<slot>paste()</slot>
<slot>helpWhatsThis()</slot>
<slot>doubleClickTable(int,int)</slot>
<slot>browseTableHeaderClicked(int)</slot>