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. Can I implement this example in my program?

Can I implement this example in my program?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.6k Views
  • 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.
  • I Offline
    I Offline
    I-sty
    wrote on last edited by
    #1

    "Your text to link here...":http://qt-project.org/doc/qt-4.8/widgets-codeeditor-codeeditor-h.html

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

    How to?

    Sorry, for my bad English. My first language is Hungarian.

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      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.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • I Offline
        I Offline
        I-sty
        wrote on last edited by
        #3

        The all.

        @
        .....
        ui->setupUi(this);

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

        }

        MainWindow::~MainWindow()
        {
        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()));
        
         updateLineNumberAreaWidth(0);
         highlightCurrentLine();
        

        }@

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

        Sorry, for my bad English. My first language is Hungarian.

        1 Reply Last reply
        0
        • I Offline
          I Offline
          I-sty
          wrote on last edited by
          #4

          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);@

          Sorry, for my bad English. My first language is Hungarian.

          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