×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    10

    QTreeView WordWrap?

    I know that WordWrap doesn't necessarily overflow the TreeView Item text into a new line, but I don't want the text of a parent/child to overflow past the width of the screen (it's not visible!) How do I go about doing this? A mouseOver with full text display doesn't make sense as this is a mobile qt app.



    Code:
       bookTreeView->setModel(standardModel);
        bookTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
        bookTreeView->setWordWrap(true);
        bookTreeView->sizeHint();
        //bookTreeView->mousePressEvent(QMouseEvent());
        bookTreeView->setTextElideMode(Qt::ElideNone);
        bookTreeView->setExpandsOnDoubleClick(true);
        bookTreeView->setUniformRowHeights(true);
        bookTreeView->setHeaderHidden(true);
        bookTreeView->setStyleSheet("QTreeView { font-size: 27px; show-decoration-selected: 0; } QTreeView::branch:has-siblings:!adjoins-item { border-image: none; } QTreeView::branch:has-siblings:adjoins-item { border-image: none; } QTreeView::branch:!has-children:!has-siblings:adjoins-item { border-image: none;} QTreeView::branch:has-children:!has-siblings:closed, QTreeView::branch:closed:has-children:has-siblings { border-image: none; image: url(':images/images/right_arrow.png'); } QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-children:has-siblings  { border-image: none; image: url(':images/images/down_arrow.png'); } ");
    
        QVBoxLayout *layout = new QVBoxLayout;
        layout->addWidget(someWidget);
        layout->addWidget(bookTreeView);
    
        QWidget *page = new QWidget;
        page->setLayout(layout);
    
        return page;
    Last edited by franklovecchio; 2010-12-07 at 10:59. Reason: Image Inclusion

Similar Threads

  1. QTreeView Selected Row?
    By g33kz0rd in forum Qt
    Replies: 3
    Last Post: 2010-06-10, 20:09
  2. Wordwrap problem with ChoiceElements when deployed on N70
    By sanaulla123 in forum Mobile Java General
    Replies: 4
    Last Post: 2010-05-19, 14:05
  3. Wordwrap in label
    By irwansyahnokia in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-02-23, 11:45
  4. Show a text with WordWrap
    By Aphex3K in forum Mobile Java General
    Replies: 4
    Last Post: 2003-08-06, 22:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×