Task icon is blurred
Solved
General and Desktop
-
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:
by way:
is possible render SVG by Qt without antialiasing ?MInimal example
CMakeLists.txtcmake_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(); }
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.
-