Results 1 to 12 of 12

Thread: no horizontal scroll bar in QTableWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2012
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default no horizontal scroll bar in QTableWidget

    hi.
    i want to create search results window, so i put QTextBrowsers in QTableWidget's cells using setCellWidget. there is a problem: horizontal scroll bar in QTableWidget is never appears in contrast to the vertical, which is appears when its needed. all scroll bar settings are default.
    how can i get this scroll when its needed? and even when i set horizontalScrollBarPolicy in alwaysOn, there is no slider on it even when it should be.
    and also how to adjust table's cell size to full browser's text size?
    there is some sample code
    Qt Code:
    1. // ui->tw is a QTableWidget
    2. ui->tw->insertRow(0);
    3. b = new QTextBrowser(ui->tw);
    4. b->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    5. b->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    6. b->setWordWrapMode(QTextOption::NoWrap);
    7. b->setHtml(tr("some <b>HTML</b> <i>marked</i> search result <u>that does not fit in table cell without scroll bar</u>"));
    8. ui->tw->setCellWidget(0,0,b);
    To copy to clipboard, switch view to plain text mode 
    Last edited by moskk; 17th October 2012 at 11:05. Reason: updated contents

Similar Threads

  1. Replies: 9
    Last Post: 10th October 2012, 13:17
  2. Horizontal scroll bar on QTreeView
    By LynneV in forum Qt Programming
    Replies: 7
    Last Post: 9th November 2010, 22:05
  3. Resizing QTableView to eliminate horizontal scroll bar?
    By russford in forum Qt Programming
    Replies: 7
    Last Post: 18th March 2010, 08:21
  4. Vertical scroll bar, but resizable horizontal content
    By minimoog in forum Qt Programming
    Replies: 0
    Last Post: 14th January 2009, 21:51
  5. ListWidget horizontal scroll.
    By patrick772goh in forum Qt Tools
    Replies: 3
    Last Post: 17th July 2007, 08:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.