Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KTextEditor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • KTextEditor
  • Merge requests
  • !582

Drop icon properties in UI files with Designer's broken normaloff injection

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Friedrich W. H. Kossebau requested to merge work/kossebau/cleaniconproperties into master Jul 19, 2023
  • Overview 0
  • Commits 2
  • Pipelines 3
  • Changes 2

Qt Designer (accidentally) injected "." file names as fallback when setting theme icon names.

<property name="icon">
 <iconset theme="format-text-superscript">
  <normaloff>.</normaloff>.</iconset>
</property>

With theme icon names set, it results in generated code like:

    QIcon icon;
    QString iconThemeName = QString::fromUtf8("format-text-superscript");
    if (QIcon::hasThemeIcon(iconThemeName)) {
        icon = QIcon::fromTheme(iconThemeName);
    } else {
        icon.addFile(QString::fromUtf8("."), QSize(), QIcon::Normal, QIcon::Off);
    }

Such a "." file name is not documented to serve any purpose, just results in failing icon lookup.

For empty string icon properties like

<property name="icon">
 <iconset>
  <normaloff/>
 </iconset>
</property>

it results in generated code that sets a bogus icon:

    QIcon icon;
    icon.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon::Off);
    next->setIcon(icon);

For the given UI elements the icons will be replaced in manual code later, with more special code, so the properties can just be dropped.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/kossebau/cleaniconproperties