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. [solved]qcombobox popup stylesheet
Forum Updated to NodeBB v4.3 + New Features

[solved]qcombobox popup stylesheet

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

    Good day.
    I'm trying to set the QComboBox popup list but unable to change the font size.
    Anyone know how to do this?

    I tried as follows:
    @
    QLabel, QComboBox QAbstractItemView{
    color:red;
    font: 20pt bold;
    }@
    /or/
    @QLabel, QAbstractItemView{
    color:red;
    font: 20pt bold;
    }@

    With QLabel everything happens correctly, with [QAbstractItemView], only the color has changed.

    [Edit: Added @ tags -- mlong]

    Flavio Portela

    1 Reply Last reply
    0
    • F Offline
      F Offline
      flaviomarcio
      wrote on last edited by
      #2

      Worked properly, thank you:

      implementation:
      @
      int dpi=QPaintDevice::physicalDpiX();
      int fontsize=dpi/12; //change to your liking
      QFont myf=QApplication::font();
      myf.setPixelSize(fontsize);
      QApplication::setFont(myf);
      @

      [Edit: Added @ tags -- mlong]

      Flavio Portela

      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