One , Adjust cursor position
// Get document object QTextDocument* document = this->paramBar->document(); QTextCursor
cursor; // Must be set, otherwise no cursor appears this->paramBar->setFocus(); // query FIELD Location of , Do not ignore case cursor
= document->find("FIELD",QTextDocument::FindCaseSensitively); // Get offset int pos
= cursor.position(); // Gets the current cursor object QTextCursor cs =this->paramBar->textCursor();
// start cs.movePosition(QTextCursor::Start); // Offset position
cs.movePosition(QTextCursor::NextCharacter,QTextCursor::MoveAnchor,pos); //
Set new cursor object this->paramBar->setTextCursor(cs);
Two , Set font
QFont qf; // Bold or not qf.setBold(true); // size qf.setPointSize(13); // Font name
qf.setFamily(" Chinese imitating Song Dynasty "); // Character spacing qf.setLetterSpacing(QFont::AbsoluteSpacing,12);
Three , Set color
// colour QPalette p = this->paramBar->palette(); //
adopt QPalette::Text Enumerates objects whose settings are changed ,TEXT For text ,BASE Is the background color p.setColor(QPalette::Active,
QPalette::Text, Qt::red); this->paramBar->setPalette(p);

©2019-2020 Toolsou All rights reserved,
Final review of database : Summary of comprehensive application questions Laplance operator ( Second derivative ) Simple learning of computer composition principle pyqt Button call python program _PyQt: Link button to function in program How much can you go up once you change jobs ? Today, I saw the ceiling of job hopping python in str Function usage _python in str Usage Summary of built-in functions MySQL trigger web The server nginx---linux Installation and deployment C++ Chapter V polymorphism exercises :( It's coming to an end )python Check built-in functions , How to check python Built in function