0

How do I add a QTextEdit to a QSplitter? I have got a QString which I have added to a QTextEdit which I now want to display in a QSplitter. Is this possible or must it be changed to something else in order to add it to a QSplitter?

Dmon
  • 220
  • 4
  • 15
  • Don't worry I figured it out, the QTextEdit needs to be created as a pointer for it to work. – Dmon Apr 05 '14 at 14:51
  • 1
    There's no such thing as creating a class instance "as a pointer". You *do not need to create `QTextEdit` separately on the heap*. You can have the `QTextEdit` be a member variable in a class, for example, and simply give its *address* to `QSplitter::addWidget`. Use the address operator (`&`). – Kuba hasn't forgotten Monica Apr 06 '14 at 05:59

0 Answers0