How to use the @nodegui/nodegui.QIcon function in @nodegui/nodegui

To help you get started, weโ€™ve selected a few @nodegui/nodegui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nodegui / examples / nodegui / systray / src / index.ts View on Github external
import {
  QKeySequence,
  QApplication,
  QMainWindow,
  QMenu,
  QIcon,
  QSystemTrayIcon,
  QAction
} from "@nodegui/nodegui";
import path from "path";
import { Dock } from "@nodegui/nodegui-os-utils";
const icon = require("../assets/nodegui_white.png");

const win = new QMainWindow();
const trayIcon = new QIcon(path.resolve(__dirname, icon));
const tray = new QSystemTrayIcon();
tray.setIcon(trayIcon);
tray.show();
tray.setToolTip("hello");

const menu = new QMenu();
tray.setContextMenu(menu);

// -------------------
// Quit Action
// -------------------
const quitAction = new QAction();
quitAction.setText("Quit");
quitAction.setIcon(trayIcon);
quitAction.addEventListener("triggered", () => {
  const app = QApplication.instance();
github nodegui / react-nodegui-starter / src / app.tsx View on Github external
import { Text, Window, hot, View } from "@nodegui/react-nodegui";
import React from "react";
import { QIcon } from "@nodegui/nodegui";
import path from "path";
import { StepOne } from "./components/stepone";
import { StepTwo } from "./components/steptwo";
import nodeguiIcon from "../assets/nodegui.jpg";

const minSize = { width: 500, height: 520 };
const winIcon = new QIcon(path.resolve(__dirname, nodeguiIcon));
class App extends React.Component {
  render() {
    return (
github nodegui / react-nodegui / src / demo.tsx View on Github external
import React from "react";
import {
  Renderer,
  Button,
  Window,
  View,
  AnimatedImage,
  ComboBox
} from "./index";
import { QIcon, QVariant, QPushButtonSignals } from "@nodegui/nodegui";
import { useEventHandler } from "./hooks";

const items = [
  {
    text: "hello",
    icon: new QIcon(
      "/Users/atulr/Project/nodegui/nodegui/src/lib/QtGui/__tests__/assets/nodegui.png"
    ),
    userData: new QVariant(12346)
  },
  { text: "world" }
];

const handler = useEventHandler(
  {
    clicked: clicked => {}
  },
  []
);
const App = () => {
  return (
github ng-qt / ng-qt / packages / common / widgets / button / button.widget.ts View on Github external
createIcon(iconUrl: string): void {
    const icon = new QIcon(iconUrl);
    this.setIcon(icon);
  }
}