When using QPainter and QPrinter, the message "Invalid parameter passed to C runtime function." is displayed.
-
When using QPainter and QPrinter in Qt 5.15.12 to print some content, the printed content is displayed normally, but the output window shows "Invalid parameter passed to C runtime function." I am seeking advice on where the problem lies. The source code is as follows:
**void MainWindow::on_pushButton_clicked()
{QPrinter ptr(QPrinter::PrinterResolution); QPainter painter; bool d=painter.begin(&ptr); if(!d) { return; } #painter.drawsomething() painter.end();
}**
the output window shows :
-
When using QPainter and QPrinter in Qt 5.15.12 to print some content, the printed content is displayed normally, but the output window shows "Invalid parameter passed to C runtime function." I am seeking advice on where the problem lies. The source code is as follows:
**void MainWindow::on_pushButton_clicked()
{QPrinter ptr(QPrinter::PrinterResolution); QPainter painter; bool d=painter.begin(&ptr); if(!d) { return; } #painter.drawsomething() painter.end();
}**
the output window shows :
@QtNewer said in When using QPainter and QPrinter, the message "Invalid parameter passed to C runtime function." is displayed.:
Qt 5.15.12
From the screenshot I can tell that you are using Qt5.15.2 ;-)
5.15.12 is a commercial version. Without the screen, you would get replies like
"Since you have a commercial version and pay for it, ask the official support and dont post in user forum";-)
@QtNewer said in When using QPainter and QPrinter, the message "Invalid parameter passed to C runtime function." is displayed.:
The source code is as follows
Is this all? What else do you do? Where does
1127, FromFileMap
come from? -
@QtNewer said in When using QPainter and QPrinter, the message "Invalid parameter passed to C runtime function." is displayed.:
Qt 5.15.12
From the screenshot I can tell that you are using Qt5.15.2 ;-)
5.15.12 is a commercial version. Without the screen, you would get replies like
"Since you have a commercial version and pay for it, ask the official support and dont post in user forum";-)
@QtNewer said in When using QPainter and QPrinter, the message "Invalid parameter passed to C runtime function." is displayed.:
The source code is as follows
Is this all? What else do you do? Where does
1127, FromFileMap
come from?Sorry, I made a mistake in my writing, it's actually Qt5.15.2 ;-)
The message '1127, FromFileMap' is displayed when running any default "Qt Widgets Application" program and it has been like this since Qt4, though I don't know why.
There is no other code in this program; I just added a QPushButton to a default “Qt Widgets Application” and connected it to the on_pushButton_clicked() slot. When I click the button, "Invalid parameter passed to C runtime function." is displayed.:I tried to locate the problem and found that it is at the line "bool d=painter.begin(&ptr);", but I can't debug into the Qt source code."