Important: Please read the Qt Code of Conduct -

Can I implement this example in my program?

  • "Your text to link here...":

    I have a other program (other form, buttons, plaintextedites), and I would implement this to my plaintext.

    How to?

  • Moderators

    Which part do you want to implement? What do you want your program to do?

    You can copy the code, as long as you follow the license at the top of the file.

  • The all.


    CodeEditor editor1;
    editor1.setGeometry (15, 15, 300, 150); ();


    delete ui;

    CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent)
    lineNumberArea = new LineNumberArea(this);

     connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
     connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
     connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));


    This is my code. But does not appear nothing. :(

  • Okay, I solved.

    @//it creates the two text boxes
    CodeEditor *editor0 = new CodeEditor; //left side box
    CodeEditor *editor1 = new CodeEditor; //right side box
    //it uploads the text boxes in the main window
    ui->textBoxLayout->addWidget (editor0, 0, 0);
    ui->textBoxLayout->addWidget (editor1, 0, 0);@

Log in to reply