Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTextEdit and EditEvent
Forum Updated to NodeBB v4.3 + New Features

QTextEdit and EditEvent

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pablik2005
    wrote on last edited by
    #1

    Hi i need help with QTextEdit, i want make smart QTextEdit who know if it was edited (insert, delete some chars), so i want reimplement class QTextEdit and add :

    • bool verbal "isEdited" - its done
    • event who will by know if somting was edit in my QTextEdit

    [code]
    #ifndef MYTEXTEDIT_H
    #define MYTEXTEDIT_H

    #include <QtGui>
    #include <QtCore>

    class MyTextEdit : public QTextEdit
    {
    Q_OBJECT
    public:
    explicit MyTextEdit(QWidget *parent);

    private:
    bool isEdited;
    signals:

    public slots:

    protected:

    };

    #endif // MYTEXTEDIT_H
    [/code]
    [code]
    #include "mytextedit.h"

    MyTextEdit::MyTextEdit(QWidget *parent)
    {
    setParent( parent );
    isEdited = false;
     
    }
    

    [/code]
    I try write somting with use KeyEvent but if sombody select and delete or past with the help of mouse then my QTextEdit will by dont konow about this edit.
    Coud you help me with that ??

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      Are you using the textChanged() signal?

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Pablik2005
        wrote on last edited by
        #3

        Srry i didnt see this signal in manual.
        Thx for help

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved