Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTextBrowser with texttables, to large for self and/or MainWindow
Forum Updated to NodeBB v4.3 + New Features

QTextBrowser with texttables, to large for self and/or MainWindow

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 999 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pwnstar23
    wrote on last edited by
    #1

    I am making a calendar much like the one in the calendar example. It's a text browser with tables in it and represents the next 5 weeks. I have a minimum of 5 lines in each cell to keep things tidy, it will add '\n' if necessary.

    The problem is the calendar is bigger than the browser is allowing. It's adding the slider to the right side. I don't want a slider I want the whole thing to show up. I've tried messing with size policies but haven't gotten it right. So how do I tell QT to display the whole browser and NEVER chop it up or use a slider?

    BTW I have no layouts set up. And the size the browser is choosing is to small on the height, the width seems ok for now.

    !http://imageshack.us/a/img43/1637/calendarslider.png!

    As you can see it appears the browser and the window are not being created large enough. Fiddling with the size of the mainwindow does nothing it resizes to the size in the picture on creation.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You probably need to take a look at "Qt::ScrollBarPolicy":https://qt-project.org/doc/qt-4.8/qt.html#ScrollBarPolicy-enum. Although if you had used layouts, it might have worked out of the box. In order to adjust the height, you need to use the SizeHint property of the widget. In some cases automatic calculation may fail. First, try updating the height, if it does not work, calculate your own.

      (Z(:^

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved