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. 2 questions about QTreeView
Forum Updated to NodeBB v4.3 + New Features

2 questions about QTreeView

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.4k 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    Hello!
    I have 2 questions about QTreeView:
    1)How can I change the height of a line (oddly, nothing about it says in the help)
    2)How do I remove this artifact by using QSS and the delegate (in 1 column, all items have a delegate)
    !http://hostingkartinok.com/uploads/images/2012/03/cb4745a8c0f94e741e857aaf2c09c90e.jpg(1)!
    I use this qss code:
    @QTreeView::item {
    border: 1px solid rgba(108,108,108,75);
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-right-color: transparent;
    }

    QTreeView::item:hover {
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(231,239,253,200), stop: 1 rgba(203,218,241,200));
    }

    QTreeView::item:selected:active, QTreeView::item:selected:!active{
    border-right-color: transparent;
    border: 1px solid rgba(108,108,108,128);
    color: black;
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
    }@
    I tried to set the style sheet to delegate and use them widget - it is dont help
    Thank you in advance!

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Ruzik
      wrote on last edited by
      #2

      2)How does it happened?
      I use delegate, but when delegate is no active and no exist there is this error

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leon.anavi
        wrote on last edited by
        #3

        [quote author="Ruzik" date="1331557006"]
        1)How can I change the height of a line (oddly, nothing about it says in the help)
        [/quote]

        I think you should override the delegate's virtual method "sizeHint":http://qt-project.org/doc/qt-4.8/qitemdelegate.html#sizeHint.

        http://anavi.org/

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Ruzik
          wrote on last edited by
          #4

          Thank you for your help!
          It is work

          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