SystemTrayIconProps

The SystemTrayIcon component provides the ability to add and manipulate a native system tray icon. NodeGui's QSystemTrayIcon.

Example

import React from "react";
import { QIcon, QAction } from "@nodegui/nodegui";
import { Menu, Renderer, SystemTrayIcon, Window } from "@nodegui/react-nodegui";
import path from "path";
const icon = new QIcon(path.join(__dirname, "../extras/assets/nodegui.png"));
const action = new QAction();
action.setText("Hello");
action.addEventListener("triggered", () => {
console.log("hello");
});
const App = () => {
return (
<Window>
<SystemTrayIcon icon={icon} tooltip="Hello World" visible>
<Menu actions={[action]} />
</SystemTrayIcon>
</Window>
);
};
Renderer.render(<App />);

Hierarchy

  • RNProps

    SystemTrayIconProps

Index

Properties

Properties

Optional icon

icon? : QIcon

Sets an icon for the system tray. QSystemTrayIcon: setIcon


Optional id

id? : undefined | string

Sets the object name (id) of the widget in Qt. Object name can be analogous to id of an element in the web world. Using the objectName of the widget one can reference it in the Qt's stylesheet much like what we do with id in the web world. QWidget: setObjectName


Optional on

on? : Partial‹WidgetEventListeners | QSystemTrayIconSignals›

Prop to set the event listener map. See Handlong Events


Optional tooltip

tooltip? : undefined | string

Sets a tooltip for the system tray. QSystemTrayIcon: setTooltip


Optional visible

visible? : undefined | false | true

Shows or hides the widget and its children. QWidget: show