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

Icon sourceName does not work if application run via QGuiApplication

    XMLWordPrintable

Details

    • f0d2237177bb97c40c7daace6f2a17bf27f65249

    Description

      Suppose I wrote this piece of qml code:

      ApplicationWindow {
          visible: true
          ToolButton {
              action: Action {
                  id: boldAction
                  checkable: true
                  iconName: "format-text-bold"
                  //iconSource: "textbold.png"
              }
          }
      }
      

      Now, if in main.cpp I will use

      QGuiApplication a(argc, argv);
      

      (which is from qml module of Qt), then there will not be icon in toolbutton.

      But if I replace above QGuiApplication a(argc, argv); with

      QApplication a(argc, argv);
      

      (which is from old widgets module of Qt), all works perfectly.

      So, my question is – is it a bug, or intended behaviour?
      If it is intended then why QApplication is in widgets module of Qt? Must I still use widgets module (and classes from its module) for properly working qml?

      Minimal example here

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            dimanne DimanNe
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes