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. [solved]Can I use QPainter to draw a code editor?
Qt 6.11 is out! See what's new in the release blog

[solved]Can I use QPainter to draw a code editor?

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 2.6k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I want to program an IDE and wonder if I could use QPainter to draw a code editor myself. I know it will be troublesome to draw a code editor, but I don't know other solution. Any other solution?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you thinking of an editor like the one from QtCreator ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        [quote author="SGaist" date="1377517002"]Hi and welcome to devnet,

        Are you thinking of an editor like the one from QtCreator ?[/quote]

        Exactly...How can I code that? Do I have to use QPainter to draw it myself?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          No you don't. Have a look at QSyntaxHighlighter and the associated examples.

          You can also check the implementation of QtCreator.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            [quote author="SGaist" date="1377517628"]No you don't. Have a look at QSyntaxHighlighter and the associated examples.

            You can also check the implementation of QtCreator.[/quote]

            Thank you, you helped a lot.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You're welcome

              If this answers your question, you can update the thread's title to solved so other forum user will know that a solution has been found :)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                [quote author="SGaist" date="1377519054"]You're welcome

                If this answers your question, you can update the thread's title to solved so other forum user will know that a solution has been found :)[/quote]

                One more question..Do I have to draw the line number myself?
                !http://mx.bbs.duoyi.com/upfile/20130827/2EA3D21C88DE45D380B7C8A3156B7EAF.png(Draw the line number)!

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dbzhang800
                  wrote on last edited by
                  #8

                  http://qt-project.org/doc/qt-5.0/qtwidgets/widgets-codeeditor.html

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    [quote author="1+1=2" date="1377574305"]http://qt-project.org/doc/qt-5.0/qtwidgets/widgets-codeeditor.html[/quote]

                    Thank you ^_^

                    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