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. Big problem with QStyle
Qt 6.11 is out! See what's new in the release blog

Big problem with QStyle

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 830 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.
  • T Offline
    T Offline
    TomNow99
    wrote on last edited by TomNow99
    #1

    Hi,

    Like in a topic - I read QStyle Doc and I don't know, which Param / function I have to use.

    I would like to get many information about QComboBox, but ( look at the picture ) not about the red rectangle element, but about green rectangle elements ( so I would like to get information about items in QComboBox's popup ).

    elements.png

    My questions:

    1. Where I can find a picture with a QWidget and his elements ( like popup, down-arrow, label )?
    2. How to know if that enums in QStyle are about red rectangle element or aboute green rectangle elements?
    3. How can I get size of indicator in item, which is in QComboBox's popup?

    Now I have:

        QStyleOptionComboBox opt;
        initStyleOption( &opt );
        QRect rect( style()->subElementRect( QStyle::SE_CheckBoxIndicator, &opt, this ) );
    

    But I don't know this is a good way. I use CheckBox enum, so is it ok?

    1. How to get size of "label" ( I don't know if is it a label ) in item in QCombobox's popup, where there is a item text?

    Now I have:

        QStyleOptionComboBox opt;
        initStyleOption(&opt);
        QRect rect(style()->subElementRect(QStyle::SE_CheckBoxContents,&opt,this));
    

    The problem is the same as in second 2 question.

    1. Something like question 3. I would like to get size the same but without text margins. Look at the picture:

    combo.png

    I would like to get size without red rectangles ( text margins ).

    I try find something here too: https://code.woboq.org/qt5/qtbase/src/widgets/styles/qcommonstyle.cpp.html

    If you know for example only one answer - please write :) This is very important for me.

    jsulmJ 1 Reply Last reply
    0
    • T TomNow99

      Hi,

      Like in a topic - I read QStyle Doc and I don't know, which Param / function I have to use.

      I would like to get many information about QComboBox, but ( look at the picture ) not about the red rectangle element, but about green rectangle elements ( so I would like to get information about items in QComboBox's popup ).

      elements.png

      My questions:

      1. Where I can find a picture with a QWidget and his elements ( like popup, down-arrow, label )?
      2. How to know if that enums in QStyle are about red rectangle element or aboute green rectangle elements?
      3. How can I get size of indicator in item, which is in QComboBox's popup?

      Now I have:

          QStyleOptionComboBox opt;
          initStyleOption( &opt );
          QRect rect( style()->subElementRect( QStyle::SE_CheckBoxIndicator, &opt, this ) );
      

      But I don't know this is a good way. I use CheckBox enum, so is it ok?

      1. How to get size of "label" ( I don't know if is it a label ) in item in QCombobox's popup, where there is a item text?

      Now I have:

          QStyleOptionComboBox opt;
          initStyleOption(&opt);
          QRect rect(style()->subElementRect(QStyle::SE_CheckBoxContents,&opt,this));
      

      The problem is the same as in second 2 question.

      1. Something like question 3. I would like to get size the same but without text margins. Look at the picture:

      combo.png

      I would like to get size without red rectangles ( text margins ).

      I try find something here too: https://code.woboq.org/qt5/qtbase/src/widgets/styles/qcommonstyle.cpp.html

      If you know for example only one answer - please write :) This is very important for me.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @TomNow99
      https://doc.qt.io/qt-5/stylesheet-reference.html
      https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcombobox

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TomNow99
        wrote on last edited by
        #3

        @jsulm Thank you, but this is good only for QStyleSheet. I would like the same for QStyle documentation.

        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