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. printing: Why have you disabeled "reverse order" in "QTextDocument::print" ?
Forum Updated to NodeBB v4.3 + New Features

printing: Why have you disabeled "reverse order" in "QTextDocument::print" ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 325 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.
  • D Offline
    D Offline
    Drure
    wrote on last edited by
    #1

    Not sure, if this is the right place to ask this. Please let me know, where would be the right place for this.

    Are you aware, of this QT issue:
    When we want to print in "reverse mode" in a QT program, then it nevertheless prints in normal order. It does not print pages 4,3,2,1, but 1,2,3,4 .

    This is always the case, when a particular QT program has not implemented any workaround for this.

    For example with Kate we have this wrong behaviour.

    Here is an example of a QT printing dialog:
    https://www.bilder-upload.eu/bild-310380-1606730172.png.html

    It has the function "reverse" activated, but it does not work.

    Why does it not work?
    Here is the answer:
    It does not work, because the reverse order is disabled in "QTextDocument::print" .

    I consider this issue important. Why is it important?
    How should anybody print his documents on both sides, if he has a printer that does not support duplex mode?

    So here is my question:
    Why is "QTextDocument::print" disabeled in QT ?
    Are you aware of this?

    Thank you.

    jsulmJ JonBJ 2 Replies Last reply
    0
    • D Drure

      Not sure, if this is the right place to ask this. Please let me know, where would be the right place for this.

      Are you aware, of this QT issue:
      When we want to print in "reverse mode" in a QT program, then it nevertheless prints in normal order. It does not print pages 4,3,2,1, but 1,2,3,4 .

      This is always the case, when a particular QT program has not implemented any workaround for this.

      For example with Kate we have this wrong behaviour.

      Here is an example of a QT printing dialog:
      https://www.bilder-upload.eu/bild-310380-1606730172.png.html

      It has the function "reverse" activated, but it does not work.

      Why does it not work?
      Here is the answer:
      It does not work, because the reverse order is disabled in "QTextDocument::print" .

      I consider this issue important. Why is it important?
      How should anybody print his documents on both sides, if he has a printer that does not support duplex mode?

      So here is my question:
      Why is "QTextDocument::print" disabeled in QT ?
      Are you aware of this?

      Thank you.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @Drure You should check Qt bug tracker and file a bug if there is nothing yet for this issue.
      https://bugreports.qt.io/secure/Dashboard.jspa

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Drure

        Not sure, if this is the right place to ask this. Please let me know, where would be the right place for this.

        Are you aware, of this QT issue:
        When we want to print in "reverse mode" in a QT program, then it nevertheless prints in normal order. It does not print pages 4,3,2,1, but 1,2,3,4 .

        This is always the case, when a particular QT program has not implemented any workaround for this.

        For example with Kate we have this wrong behaviour.

        Here is an example of a QT printing dialog:
        https://www.bilder-upload.eu/bild-310380-1606730172.png.html

        It has the function "reverse" activated, but it does not work.

        Why does it not work?
        Here is the answer:
        It does not work, because the reverse order is disabled in "QTextDocument::print" .

        I consider this issue important. Why is it important?
        How should anybody print his documents on both sides, if he has a printer that does not support duplex mode?

        So here is my question:
        Why is "QTextDocument::print" disabeled in QT ?
        Are you aware of this?

        Thank you.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @Drure
        I presume you are referring to code at https://code.woboq.org/qt5/qtbase/src/gui/text/qtextdocument.cpp.html#2045

        //    bool ascending = true;
        //    if (printer->pageOrder() == QPrinter::LastPageFirst) {
        //        int tmp = fromPage;
        //        fromPage = toPage;
        //        toPage = tmp;
        //        ascending = false;
        //    }
        

        Note that it is commented out. I don't know why, and I don't whether given this it ought disable the option. The only related Qt Bug I could find is https://bugreports.qt.io/browse/QTBUG-84016, where the user may be falling foul of this issue.

        Also, https://community.kde.org/Printing/Missing_Features notes:

        Reverse Page Order (4)

        Choose to print last page first, currently X11 only.

        Add Windows support, and possibly set-only Mac support.

        I don't know whether this is in any way related to the issue. Doesn't seem so, because we are looking at QTextDocument::print() only.

        I think you'd need to raise a bug report referring to the commented-out code and ask why that is so, given that there are no comments against it!

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Bonnie
          wrote on last edited by Bonnie
          #4

          @JonB said in printing: Why have you disabeled "reverse order" in "QTextDocument::print" ?:

          Note that it is commented out. I don't know why

          I think it is probably related to QPagedPaintDevice not having an "order" option. pageOrder is QPrinter only.
          And in the documentation of QPrinter, setPageOrder is also stated that:

          This function is only supported under X11.

          and

          The application is responsible for reading the page order and printing accordingly.

          (I also find there is a pageOrderAscending in QPagedPaintDevicePrivate, but it is useless)

          D 1 Reply Last reply
          0
          • B Bonnie

            @JonB said in printing: Why have you disabeled "reverse order" in "QTextDocument::print" ?:

            Note that it is commented out. I don't know why

            I think it is probably related to QPagedPaintDevice not having an "order" option. pageOrder is QPrinter only.
            And in the documentation of QPrinter, setPageOrder is also stated that:

            This function is only supported under X11.

            and

            The application is responsible for reading the page order and printing accordingly.

            (I also find there is a pageOrderAscending in QPagedPaintDevicePrivate, but it is useless)

            D Offline
            D Offline
            Drure
            wrote on last edited by
            #5

            Thank you all.

            and

            The application is responsible for reading the page order and printing accordingly.

            Not all developers of QT programs are aware of this.
            Many of them think something like: "My program has no control over the print process. It only calls Qt's print dialog; the rest is done by Qt (and CUPS)."

            See here:
            https://github.com/tsujan/FeatherPad/issues/455#issuecomment-731603828

            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