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. Task icon is blurred
Forum Updated to NodeBB v4.3 + New Features

Task icon is blurred

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 189 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.
  • A Offline
    A Offline
    AndrzejB
    wrote on last edited by AndrzejB
    #1

    I have Ubuntu Cinnamon.
    MainWindow icon in task bar (probably 32x32) is quite ok, but larger for Alt+Tab (probably 72x72) is blurred.
    No matter, icon is svg, or 32x32 png, or 72x72 png or even 256x256 png
    Note: Inkskape convert without blur - was exported without anti-aliasing , here png without blur:
    Floppy_icon72.png

    by way:
    is possible render SVG by Qt without antialiasing ?

    MInimal example
    CMakeLists.txt

    cmake_minimum_required(VERSION 3.22)
    project(minblur)
    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    
    set(CMAKE_CXX_STANDARD 14)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(Qt5 COMPONENTS Widgets REQUIRED)
    qt5_add_resources(QRC_SOURCES icons.qrc)
    
    set(PROJECT_SOURCES main.cpp)
    
    add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${QRC_SOURCES})
    
    target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
    

    icons.qrc

    <!DOCTYPE RCC>
    <RCC version="1.0">
    <qresource prefix="/">
        <file>line72.png</file>
    </qresource>
    </RCC>
    

    main.cpp

    #include <QApplication>
    #include <QMainWindow>
    
    class MainWindow: public QMainWindow {
    public:
        explicit MainWindow(QWidget *parent = nullptr) {
            QIcon icon;
            icon.addFile(":line72.png", QSize(72, 72));
            setWindowIcon(icon);
        }
    };
    
    int main(int argc, char *argv[]) {
        QApplication app(argc, argv);
        MainWindow w;
        w.show();
        return app.exec();
    }
    
    

    line72.pg : line72.png

    Here is png, which is grayed and b;lured in Alt+Tab with Cinnamon


    Solution: seems to be a Cinnamon thing, not Qt: If I add my binary to menu and add png as icon, is OK when I launch application from menu instead of direct binary.

    1 Reply Last reply
    0
    • A AndrzejB has marked this topic as solved on

    • Login

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