Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. print
    Log in to post

    • UNSOLVED QPrintSupport - print dialog not showing in windows
      General and Desktop • print printsupport qtprintsupport • • Kosmic  

      6
      0
      Votes
      6
      Posts
      220
      Views

      Finally discovered the error here. Inspired here: https://forum.qt.io/topic/39319/solved-qprinterinfo-availableprinters-don-t-list-available-printers/2 the .dll file was from the previous version before upgrade and somehow didnt get upgraded along. So copying the file manually to the location instead of the previous dll version made it. Thanks for help, Kosmic
    • SOLVED QPainter ignore the text when the clipping is applied while printing to a PDF document
      General and Desktop • qpainter text pdf print clipping • • jeanmilost  

      3
      0
      Votes
      3
      Posts
      382
      Views

      @mrjj Thank you for your answer. So I tested to remove the text rectangle passed to the drawContents() function, and indeed the global clipping was applied instead.
    • UNSOLVED Is there a way to draw geometric shapes below the text in a QTextDocument?
      General and Desktop • qtextdocument paint print shapes printtopdf • • jeanmilost  

      1
      0
      Votes
      1
      Posts
      144
      Views

      No one has replied

    • UNSOLVED how to select file and then print to printer ?
      General and Desktop • file pdf print printsupport • • Qjay  

      11
      0
      Votes
      11
      Posts
      6601
      Views

      @Qjay This may not help because I do not know quite how you would do this directly from Qt, but when we want to print a PDF under Windows we use the underlying Win32 function ShellExecute() (https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx) to go (effectively) ShellExecute("print", native-path-to-file), and let Windows shell sort it out. This is effectively the same as right-clicking on the file and picking the Print action. So you don't need to know anything about the actual process which does the printing, its arguments etc.
    • UNSOLVED Resize A Picture When Print it
      General and Desktop • resize print picture screen capture • • M4RZB4Ni  

      8
      0
      Votes
      8
      Posts
      5631
      Views

      @M4RZB4Ni yes, that is normal. Printer have many more pixels. so image seem smaller. Read docs. they have example of scaling stuff. This sample takes snapshot and scales it. void MainWindow::printshot() { QPixmap pix = QPixmap::grabWindow(QApplication::desktop()->winId()); QPrinter printer(QPrinter::HighResolution); printer.setOrientation(QPrinter::Landscape); QPainter painter; painter.begin(&printer); double xscale = printer.pageRect().width() / double(pix.width()); double yscale = printer.pageRect().height() / double(pix.height()); double scale = qMin(xscale, yscale); painter.translate(printer.paperRect().x() + printer.pageRect().width() / 2, printer.paperRect().y() + printer.pageRect().height() / 2); painter.scale(scale, scale); painter.translate(-width() / 2, -height() / 2); // note uses the form width/height! use pix.h/w if random image painter.drawPixmap(0, 0, pix); painter.end(); }
    • UNSOLVED Qt Console Application - Print colored text
      General and Desktop • color console print • • AliReza Beytari  

      12
      0
      Votes
      12
      Posts
      10494
      Views

      Yes, the code you have there uses VT100 Escape Codes (note that \033 is the octal representation of character 27=escape. You could also use the hexadecimal \x1b instead), see http://en.wikipedia.org/wiki/ANSI_escape_code These require a terminal emulator that supports VT100, which almost all linux terminal emulators do. Windows Command Prompt doesn't support them by default, but at the bottom of https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences there is some code that shows how to turn that on (it's only a few lines of additional code that you only need to run once at the beginning - I would put it into an #ifdef __WIN32 #endif for platform independence.) I haven't actually tried that though and I'm not sure on which versions of windows it works. Regarding python: python doesn't natively support VT100 either, but the colorama package https://pypi.org/project/colorama/ enables them (to my knowledge, it replaces the print or write methods with something that extracts the escape codes and does the manipulations via calls to kernel32.dll methods).
    • How to add multiple lines of text from a single class to a scene [SOLVEÐ]
      General and Desktop • text scene print • • nanoandrew4  

      7
      0
      Votes
      7
      Posts
      1921
      Views

      Ok, so what happened before is that the item you added was destroyed before it could be shown
    • How to print logs (qDebug, qWarning, qCritical , qFatal) of Qt framework / libraries itself?
      General and Desktop • qdebug output print logging log qwarning logs • • AnantAgrawal  

      2
      0
      Votes
      2
      Posts
      3971
      Views

      Hi @AnantAgrawal, Just just launch your app from the console. qDebug, qWarning etc. will be printed to the console too (stdout/stderr). Make sure you don't define QT_NO_DEBUG_OUTPUT -- see http://doc.qt.io/qt-5/debug.html for more info.
    • [SOLVED] (BEGINNER) How to print barcodes
      General and Desktop • c++ font beginner string newbie print conversion barcode starter code39 • • A7Victor  

      3
      0
      Votes
      3
      Posts
      2550
      Views

      @mcosta Hi, I'll certainly take a look at it. So I guess it's not only changing the font xD Thank you.
    • Activate print messages on debug mode / Disable print statements on release mode in C++ linux
      C++ Gurus • c++ linux debug print • • kumararajas  

      7
      0
      Votes
      7
      Posts
      6154
      Views

      Thanks Sam for Chris for great ideas. I had put together made an test implementation. I wrote a Makefile as release: main.cpp g++ main.cpp -o booh debug: main.cpp g++ main.cpp -o booh -DDEBUG_ENABLE Since release configuration at the top, that becomes default one. So, here in this case, release is by default. And, when someone wants to enable debug messages, they would call "make debug", which defines a MACRO called DEBUG_ENABLE. In the .cpp file, #ifdef DEBUG_ENABLE #define PRINTDEBUG(debugString) std::cout << (debugString) << std::endl; #else #define PRINTDEBUG(debugString) #endif So, based on configuration, Macro is either enabled or disabled. Thanks!
    • Printing QTextTable And QPainter
      General and Desktop • qpainter qt5.4 print printing qprint • • root0x  

      1
      0
      Votes
      1
      Posts
      1290
      Views

      No one has replied

    • How to print an image and scale it to fit page?
      General and Desktop • image print scale to fit • • pmh4514  

      5
      0
      Votes
      5
      Posts
      4197
      Views

      it doesn't seem to matter what rectangle values I pass to drawImage, or if it's based on the paper size or even if I try a dummy rect that is like (0,0,50,50) - the resulting print still occupies the entire 8.5x11 sheet of paper and is cutoff on the right..