Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
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 (
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 (
createIcon(iconUrl: string): void {
const icon = new QIcon(iconUrl);
this.setIcon(icon);
}
}