我知道 qApp 是全局指针,所以它应该可以在任何地方访问,但我收到了这个错误 error: qApp was not declared in this scope
。
1 #include "textEdit.h"
2
3 TextEdit::TextEdit() {
4 }
5
6 void TextEdit::insertFromMimeData (const QMimeData * source) {
7 if (qApp->mouseButtons() == Qt::MidButton) {
8 return;
9 }
10 QTextEdit::insertFromMimeData(source);
11 }
12
13