Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. LINUX: Can't render opacity or an image (setWindowIcon(QIcon(":/images/qt.png"));)
Forum Updated to NodeBB v4.3 + New Features

LINUX: Can't render opacity or an image (setWindowIcon(QIcon(":/images/qt.png"));)

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 331 Views 1 Watching
  • 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
    Ada-OS
    wrote on last edited by
    #1

    Hello, I'm learning how to use Qtcreator to create apps, and I'm following the steps of a course that I downloaded, but is just not rendering nothing, i use ArchLinux, at the beginning (first time in using the program) it warns about, using clangd as a kit been potentially bad for it, because of CPU concerns,, QTcreator runs well, but for some reason is not rendering nothing when I run it with ctrl + r...

    this is the cpp i'm working on right now:
    #include "widget.h"

    Widget::Widget(QWidget *parent)
    : QWidget(parent)
    {
    setWindowTitle("Hello World");
    //resize(500,300);
    setFixedWidth(500);
    setFixedHeight(300);
    // setStyleSheet("background-color:red");
    // setWindowOpacity(0.4);
    setWindowIcon(QIcon(":/images/qt.png"));

    }

    Widget::~Widget()
    {
    }

    i can send the project:
    https://www.mediafire.com/file/xfxrzzxjxzfpmyb/4.2+4-WindowScratchIcon.zip/file

    Pl45m4P 1 Reply Last reply
    0
    • A Ada-OS

      Hello, I'm learning how to use Qtcreator to create apps, and I'm following the steps of a course that I downloaded, but is just not rendering nothing, i use ArchLinux, at the beginning (first time in using the program) it warns about, using clangd as a kit been potentially bad for it, because of CPU concerns,, QTcreator runs well, but for some reason is not rendering nothing when I run it with ctrl + r...

      this is the cpp i'm working on right now:
      #include "widget.h"

      Widget::Widget(QWidget *parent)
      : QWidget(parent)
      {
      setWindowTitle("Hello World");
      //resize(500,300);
      setFixedWidth(500);
      setFixedHeight(300);
      // setStyleSheet("background-color:red");
      // setWindowOpacity(0.4);
      setWindowIcon(QIcon(":/images/qt.png"));

      }

      Widget::~Widget()
      {
      }

      i can send the project:
      https://www.mediafire.com/file/xfxrzzxjxzfpmyb/4.2+4-WindowScratchIcon.zip/file

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      Hi and welcome,

      @Ada-OS said in LINUX: Can't render opacity or an image (setWindowIcon(QIcon(":/images/qt.png"));):

      i use ArchLinux

      What windowing system/server do you use?

      Note:

      This feature is available on Embedded Linux, macOS, Windows, and X11 platforms that support the Composite extension.

      Note: On X11 you need to have a composite manager running, and the X11 specific _NET_WM_WINDOW_OPACITY atom needs to be supported by the window manager you are using.

      (https://doc.qt.io/qt-6/qwidget.html#windowOpacity-prop)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Ada-OS
        wrote on last edited by Ada-OS
        #3

        i use Wayland, i switched to x11 like an hour a go into an x11 session (yeah, i have x11 also), and nothing, now i don't know if i'm missing a pkg

        EDIT: also my DE is KDE Plasma, and I tried the Flatpak version, same.. Google's AI, thinks that this could be:

        ~~To use Qt Creator with Wayland on Arch Linux, ensure you have the necessary packages installed, including qt6-wayland or qt5-wayland, and set the QT_QPA_PLATFORM=wayland environment variable.
        Here's a more detailed breakdown:

        Install Qt Creator:
            Use the package manager pacman to install Qt Creator: sudo pacman -S qtcreator. 
        

        Install Wayland support for Qt:

        Install the appropriate Wayland plugin for your Qt version:
            For Qt 6: sudo pacman -S qt6-wayland. 
        

        For Qt 5: sudo pacman -S qt5-wayland.

        Set the environment variable:

        To force Qt applications to use Wayland, set the QT_QPA_PLATFORM environment variable:
            Open a terminal and run: export QT_QPA_PLATFORM=wayland. 
        

        To make this change permanent, add the line export QT_QPA_PLATFORM=wayland to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc).

        Troubleshooting:

        If you encounter issues with Qt applications finding the Wayland plugin, ensure that the necessary directories are correctly copied or symlinked, as described in this Qt Forum thread. 
        

        If you are using a custom Qt build, make sure that the Wayland plugin is included in the build.
        If you are using XWayland, you might need to set QT_QPA_PLATFORM=xcb to run Qt applications on XWayland.

        Wayland and Qt:

        Wayland is a display server protocol that aims to replace the X Window System. 
        

        Qt provides the Qt Wayland Compositor module for developing custom display servers based on the Wayland protocol.
        The Qt Wayland Compositor module provides QML and C++ APIs for developing custom display servers.
        ~~

        i have all of that i just need to run qtcreator under that env var, and see if that can solve it

        followed the ai steps, nothing also.. just that now the qt icon is not missing everytime i run a project in the window but that's all, didn't really worked at all

        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