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. Is there a way to get a string of stylesheet errors
Forum Updated to NodeBB v4.3 + New Features

Is there a way to get a string of stylesheet errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.4k Views 2 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
    tjudg
    wrote on last edited by
    #1

    For example, when my stylesheet is formatted wrong I get errors like

    1. Could not parse stylesheet of object 0x2db36817
    2. Unknown property widt

    I get these errors in the application output in Qt Creator but is there a way to get a string of it? Is there a signal that emits if I get a stylesheet error?

    A signal like void styleSheetError(QStringList errors)

    jsulmJ 1 Reply Last reply
    0
    • T tjudg

      For example, when my stylesheet is formatted wrong I get errors like

      1. Could not parse stylesheet of object 0x2db36817
      2. Unknown property widt

      I get these errors in the application output in Qt Creator but is there a way to get a string of it? Is there a signal that emits if I get a stylesheet error?

      A signal like void styleSheetError(QStringList errors)

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

      @tjudg Why do you need it? Do you generate your stylesheets at runtime? If not just make sure there are no such errors when you execute your app while testing it. How would such a signal help you or users of your app?

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

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

        Yes, I generate my stylesheets at runtime. I read the stylesheets from a file so I can change it whenever I want to without having to rebuild the program.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Looking at qstylesheetstyle.cpp, I'd say there's no clean way to get these messages. You could install a custom message handler using QtMessageHandler qInstallMessageHandler(QtMessageHandler handler), but that looks like a very ugly hack to me. If you really need the messages, you'll probably have to patch the Qt sources.

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved