Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116337

QStyle::name() is empty when using stylesheets

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.4.3
    • Widgets: Styles
    • None
    • All

    Description

      I'm trying to determine the current style name but I get an empty string when I use qApp->setStylesheet(). I suggest the "stylesheet style" should return the name of the proxied style.

      qDebug() << QApplication::style().name();

      I also tried casting to QProxyStyle and getting the baseStyle but it returns QApplication::style() as documented, i.e. always the "stylesheet style".

       auto style = qobject_cast<QProxyStyle *>(QApplication::style())->baseStyle();

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            flaviotordini Flavio Tordini
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes