首页| 论坛| 消息
主题:从Qt4到Qt5修改标记
回帖:[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);
}
下一楼›:说好的整本书的qt5代码呢,就这么点?
‹上一楼:[2301]修改主题问题简述
相关代码
其他注意事项等

查看全部回帖(6)
«返回主帖