Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 151765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:30:12+00:00 2026-05-11T09:30:12+00:00

i have a QTextEdit document which size is different by every print. In the

  • 0

i have a QTextEdit document which size is different by every print. In the middle of the document i have few blocks of text which are inseparable in the eyes of the user and i have to protect my blocks from splitting on two pages in case the document gets equivalent size. Have you got any solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:30:13+00:00Added an answer on May 11, 2026 at 9:30 am

    I am a great fan of Qt but I have not had an opportunity yet to use a QTextEdit. I would like to help though so I took a look through the documentation.

    If you are using a sufficiently recent version of Qt you should find that a QTextEdit has an associated QTextDocument and it would seem that the functionality you seek may be there. A QTextDocument is a hierarchy of frames and blocks. A block is equivalent to a paragraph as you mention above.

    The documentation seems to indicate that you could specify that your blocks be wrapped in a frame. Then, you should be able to set a format for the frame using QTextFrame::setFrameFormat. This format will allow you to specify a page break policy using some flags. The flags that are specified are PageBreak_Auto, PageBreak_AlwaysBefore and PageBreak_AlwaysAfter.

    It would seem to me that if you set both the PageBreak_AlwaysBefore and PageBreak_AlwaysAfter flags for the frame, then your blocks should stay together.

    I realize this is a fairly complex series. I hope that it helps and would really like to hear if it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 84k
  • Answers 85k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes you can draw control's background to give illusion problem… May 11, 2026 at 5:06 pm
  • Editorial Team
    Editorial Team added an answer Any panel derived control doesn't have a template property, since… May 11, 2026 at 5:06 pm
  • Editorial Team
    Editorial Team added an answer CSS cascades, meaning you can overwrite the values of previously… May 11, 2026 at 5:06 pm

Related Questions

I'm having difficulty getting widgets in a QDialog resized automatically when the dialog itself
I have a KTextEdit, filled with some text. When I put lots of text,
In win32, how do I setup a callback mechanism for RichEdit I have not
I have my winform application gathering data using databinding. Everything looks fine except that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.