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 print rightToLeft arabic text

QTextEdit print rightToLeft arabic text

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 2.0k 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.
  • D Offline
    D Offline
    david100100
    wrote on last edited by
    #1

    i have problem with QtextEdit::drawContents() whene i print right to left arabic char with other char like "-" or ":" the output is reversed in other word whene i try printing :ببببب - the result is -ببببب :

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

      Hi,

      Did you set the layout direction of your application ?

      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
      1
      • D Offline
        D Offline
        david100100
        wrote on last edited by
        #3

        yes i try it but no thing change
        i think that the problem is in the QPaintDevice because when i use QTextEdit::drawContents() with

        • QPainter (QPixmap) the output result is the same of QTextEdit view
          but when i use QPainter(QPrinter) the output result is reversed
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you share the exact code where the problem manifests itself ?

          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
          • D Offline
            D Offline
            david100100
            wrote on last edited by
            #5

            http://s32.postimg.org/ng20k9zt1/Untitled_1.jpg look at this image

            the function that draw in pixmap and show this pixmap in qlabel is
            void drawPixMapFromTextEdit()

            {
            QPixmap* pm=new QPixmap(400,400);
            QPainter p(pm);
            textEdit->drawContents(&p,textEdit->rect());
            p.end();

            }

            the function that draw in printer is
            void print()
            {
            QPrinter* pr=new QPrinter();
            QPainter p(pr);
            textEdit->drawContents(&p,textEdit->rect());
            p.end();

            }

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

              Ok, can you write a minimal compilable example that shows that behavior ?

              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
              • D Offline
                D Offline
                david100100
                wrote on last edited by
                #7

                when i compile my project with Desktop_Qt_5_5_1_MinGW_32bit there is no difference between QTextEdit view and printPerview but when i compile the project with Desktop_Qt_5_3_MSVC2012_OpenGL_32bit the printPerview is not the same thate QTextEdit !!!!!!!!!!!!!!!!!!!!!!!!!!!! ??? ??????

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

                  No need for so much exclamation or question marks. That just means that it's something that has been fixed between these two Qt versions.

                  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
                  1

                  • Login

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