Der connect für die action lautet:
Code: Alles auswählen
QObject::connect(actionUndo, SIGNAL(triggered()), this, SLOT(undo()));Die implementierte undo()-Funktion sieht so aus:
Code: Alles auswählen
public slots:
void undo()
{
QTextDocument *codeTextDocument = codeTextEdit->document();
codeTextDocument->undo();
}codeTextEdit ist wie eigentlich sowieso ersichtliche in QTextEdit Objekt.
Das Problem dabei liegt im connect, was mir folgende Compiler-Fehler beschert:
Code: Alles auswählen
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o main.o main.cpp
Mainwindow.h: In member function ‘void Ui_MainWindow::connectSignalsSlots()’:
Mainwindow.h:272: error: no matching function for call to ‘QObject::connect(QAction*&, const char [13], Ui_MainWindow* const, const char [8])’
/usr/include/qt4/QtCore/qobject.h:174: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/usr/include/qt4/QtCore/qobject.h:274: note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
make: *** [main.o] Fehler 1Was ich so aus dieser Meldung schließen kann ist, dass der Typ von "this" nicht passt, aber keine Ahnung was da sonst hingehören könnte.