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] Specifying a font using CSS
Forum Updated to NodeBB v4.3 + New Features

[Solved] Specifying a font using CSS

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

    In the constructor of my form I use the following code:
    @
    setStyleSheet("QPushButton:pressed { background-color: #FFFFFF; }"
    "QPushButton { background-color: #0099FF; border: 1px solid #909090; border-radius: 7px; }"
    "QLabel { background-color: #FFFF99; border-radius: 7px; font: "DejaVu Serif" 10pt; }"
    );
    @
    I'm trying to specify DejaVu Serif as my font. The quotation marks don't work because it fools the compiler into thinking it's the end of the line. No quotation marks don't work either. What character sequence do I need to use in order to have my font recognized?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      You need to backslash escape " your quotes around the font name, perhaps?

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      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