示例#1
0
void QsciEditor::timerEvent( QTimerEvent *tEvent ) {

	if ( tEvent->timerId() == autoSaveTimer->timerId() ) {
	autoSaveTimer->stop();
		if ( not isModified() ) {
			autoSaveTimer->start( 60000, this );
			tEvent->accept();
		}

		else {
			/* If we have no name for the file, return */
			if ( mFilePath.isEmpty() )
				return;

			saveFile();
			emit autoSaved();
			tEvent->accept();
		}
	}
};
示例#2
0
void ScribusWin::slotSaved(QString newName)
{
	setWindowTitle(QDir::toNativeSeparators(newName));
	qApp->processEvents();
	emit autoSaved(); //TODO: to update the main window title, do this from the doc?
}