yfx2003 |
2017-11-27 09:00 |
[0603] 代码修改 Editor::Editor(QWidget *parent) : QTextEdit(parent) { action = new QAction(this); action->setCheckable(true); //Qt4 connect(action, SIGNAL(triggered()), this, SLOT(show())); //Qt5 //connect(action, &QAction::triggered, this, &Editor::show); connect(action, SIGNAL(triggered()), this, SLOT(setFocus())); isUntitled = true; //Qt4 connect(document(), SIGNAL(contentsChanged()), this, SLOT(documentWasModified())); //Qt5 //connect(document(), &QTextDocument::contentsChanged, this, &Editor::documentWasModified); setWindowIcon(QPixmap(":/images/document.png")); setWindowTitle("[*]"); setAttribute(Qt::WA_DeleteOnClose); }
|
|