Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to solve QML ToolButton Icon blurred?

How to solve QML ToolButton Icon blurred?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 298 Views
  • 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.
  • D Offline
    D Offline
    Davidzouking
    wrote on last edited by
    #1

    I am new to QML, and I used a 48x48 pixal ico file as the ToolButton Icon. But the icon display is blurred. How to solve this?
    QML:
    header: ToolBar {
    RowLayout {
    ToolButton {
    display: AbstractButton.IconOnly
    text: qsTr("NewProject")
    icon.source: "qrc:/images/icon/NewProject.ico"
    icon.color: "transparent"
    smooth: False
    icon.width: 16
    icon.height: 16
    onClicked: stack.pop()
    }
    }
    }
    Main:
    int main(int argc, char *argv[]) {
    QGuiApplication app(argc, argv);
    QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling );
    QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
    QQmlComponent component(new QQmlApplicationEngine(), "qrc:/main.qml");
    qDebug() << component.errors();
    QWindow window = (QWindow)component.create();
    window->setIcon(QIcon(":/images/icon/Logo.ico"));
    window->showMaximized();
    return app.exec();
    }

    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