Hello, and sorry for being such a newb by asking, which I believe really is a simple thing.

Okay, here's the thing.
I want to do a simple editor, which then will check the input characters and change them to something else, and the
set them in the QTextEdit.

What I mean is that, when I write for eg. a 2, it will be checked against a list of characters, and if there's a match, change the 2 into
a specific text/chars.

I want it to change my 2 to a G#. But the QTextEdit shouldn't input characters that I don't want, eg. z, x etc.

And as you may already know, I am newb, just started with Qt yesterday :P
Im not a complete newb when it comes to C++, even tho it may seem so. I just have a hard time figuring out what needs to be done
and how to do it "right".

I've been looking through this forum, the Qt docs and google, but without success.
So, even if it's against my principles, I decided to ask you guys here at the forum.

When I execute my program, it gives me the SIGSEV signal when I try to edit the text in my QTextEdit.

The code looks like this atm:

dialog.h
Qt Code:
  1. #ifndef DIALOG_H
  2. #define DIALOG_H
  3.  
  4. #include <QDialog>
  5. #include <QLineEdit>
  6. #include <QLabel>
  7. #include <QTextEdit>
  8.  
  9. class myDialog : public QDialog
  10. {
  11. Q_OBJECT
  12.  
  13. private:
  14.  
  15. QLineEdit* m_lneTitle;
  16. QLabel* m_lTitle;
  17. QTextEdit* m_document;
  18.  
  19. private slots:
  20.  
  21. void textEditSlot();
  22.  
  23. public:
  24.  
  25. myDialog();
  26. virtual ~myDialog(){};
  27. };
  28.  
  29. #endif // DIALOG_H
To copy to clipboard, switch view to plain text mode 

dialog.cpp
Qt Code:
  1. #include "dialog.h"
  2.  
  3. myDialog::myDialog()
  4. {
  5. //fönsterstorlek samt pos. vart den ska vara när app. startas
  6. this->setGeometry(200, 100, 600, 400);
  7.  
  8. //skapa en label
  9. m_lTitle = new QLabel(this);
  10. m_lTitle->setText("Song Title:");
  11. m_lTitle->setGeometry(20, 20, 80, 20);
  12.  
  13. // skapa lineedit, till songtiteln
  14. m_lneTitle = new QLineEdit(this);
  15. m_lneTitle->setGeometry(80, 20, 140, 20);
  16.  
  17. //skapa själva editrutan
  18. m_document = new QTextEdit(this);
  19. m_document->setGeometry(20, 60, 560, 300);
  20.  
  21. //koppla lite signaler
  22. connect(m_document, SIGNAL(textChanged()), this, SLOT(textEditSlot()));
  23. }
  24.  
  25. void myDialog::textEditSlot()
  26. {
  27. // haven't put anything here atm, cuz anything in here makes it crasch. with anything I mean like m_document->setText();
  28. }
To copy to clipboard, switch view to plain text mode 

main.cpp
Qt Code:
  1. #include <QApplication>
  2. #include "dialog.h"
  3.  
  4. int main(int argc, char **argv)
  5. {
  6. QApplication app( argc, argv );
  7.  
  8. myDialog* d = new myDialog();
  9. d->show();
  10.  
  11. return app.exec();
  12. }
To copy to clipboard, switch view to plain text mode 

I haven't put any code in the signal slot right now, cuz everything that I tried just crashed the program.

Is this because of the "SIGNAL(textChanged()"?
If so, what should I use instead?

Oh, and I could be satisfied with any solution, I just want to get this to work right now.
If it's possible to catch the keyboard event, which I assume is, how would I do that and then set the text in the QTextEdit via
that function?

The reason I want this to work is because I feel that me and my buddy, who happens to be a way better coder than me, created
an application in SDL which reads "notes" from a text file, and then output the sound via either the PC-speaker or via the speakers.

Now you may think: "Well, if your buddy is such a better coder than you, why doesn't he create this?".
Well, the answer to that is: "Because I want to learn more, I want to "grow"."

So, please. If you feel like helping me out here, it would be greatly appreciated.

/Flayer