Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.3.0
-
None
Description
#include "mainwindow.h" #include "qtextedit.h" #include "qtextdocument.h" #include <QTextFrame> #include <QTextFrameFormat> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { textedit = new QTextEdit; setCentralWidget(textedit); QTextDocument *doc = textedit->document(); QTextFrame *rootFrame = doc->rootFrame(); QTextFrameFormat rootFrameFormat = rootFrame->frameFormat(); /* 50.0, 30.0 have no problem*/ rootFrameFormat.setProperty(QTextFrameFormat::FrameLeftMargin, 50); rootFrameFormat.setProperty(QTextFrameFormat::FrameTopMargin, 30); rootFrame->setFrameFormat(rootFrameFormat); /* 50.0, 50 , both of them are okay */ rootFrameFormat.setLeftMargin(50); rootFrame->setFrameFormat(rootFrameFormat); } MainWindow::~MainWindow() { }
If I set margin by setProperty, I must adjust the type to real.
On the other hand, if I set margin by setLeftMargin , int object is converted.
I think this is not a bug, but it has no consistency.