Hello,

I'm building (or rather playing with) a Qt 4.7 app which basically consists of a window that contains a menu bar, a tab widget and a status bar. Each tab in the tab widgets contains a plain text editor. So basically, it's a tabbed plain text editor
Until now, I've managed to get it to create/open/save/close files, however, I haven't been able to change the tab text when the contents of the QPlainTextEdit change. It's simple when I open/save the file, but I don't know how to do it otherwise.
Any ideas?
In a SDI app I would normally do something like:
Qt Code:
  1. connect(textEdit->document(), SIGNAL(contentsChanged()), this, SLOT(documentWasModified()));
To copy to clipboard, switch view to plain text mode 
but in this case, the text editor is no longer the central widget.
I've tried (in the newFile method):
Qt Code:
  1. EditorTab *editorTab = new EditorTab;
  2. int tabIndex = tabWidget->addTab(
  3. editorTab,
  4. editorTab->currentTitle
  5. );
  6. tabWidget->setCurrentIndex(tabIndex);
  7. connect(
  8. editorTab->document(),
  9. SIGNAL(contentsChanged()),
  10. this,
  11. SLOT(documentWasModified(tabIndex))
  12. );
  13. editorTab->setFocus();
To copy to clipboard, switch view to plain text mode 
documentWasModified is:
Qt Code:
  1. qDebug("Tab %d changed", tabIndex);
  2. tabWidget->setTabText(tabIndex, "CHANGED");
To copy to clipboard, switch view to plain text mode 
And the result is
Qt Code:
  1. Object::connect: No such slot MainWindow::documentWasModified(tabIndex) in ..\tabbedtextedit\mainwindow.cpp:85
To copy to clipboard, switch view to plain text mode