Comments (10)
Actually yes.
You could add a ref to the react-nodegui component
like so:
const buttonRef = React.createRef<QPushButton>();
useEffect(()=>{
buttonRef.current.setIconSize(new QSize(23,23));
},[]);
...
...
<Button ref={buttonRef} />
The ref would contain the QPushButton which is the nodegui version of the button component.
Make sure you have the latest version of nodegui to use setIconSize.
from react-nodegui.
iconSize prop is now available in 0.2.7 of react-nodegui for button, checkbox and radiobuttons
from react-nodegui.
Something like this :
import React from "react";
import { Renderer, Button, Window, View } from "@nodegui/react-nodegui";
import { QIcon, QSize } from "@nodegui/nodegui";
const icon = new QIcon(
"/Users/atulr/Project/nodegui/react-nodegui/extras/assets/nodegui_white.png"
);
const App = () => {
return (
<Window>
<View>
<Button
text={"Hello"}
icon={icon}
iconSize={new QSize(200, 200)}
/>
</View>
</Window>
);
};
from react-nodegui.
Could you try const newIcon = Icon.scaled(width, height);
? @talentlessguy
https://docs.nodegui.org/docs/api/QPixmap#pixmapscaledwidth-height-aspectratiomode
from react-nodegui.
@master-atul
const Icon = new QIcon(`${__dirname}/${icon}`)
Icon.scaled() // trying to call the method
Property 'scaled' does not exist on type 'QIcon'.
When I try to use QImage
instead:
from react-nodegui.
Alright, seems like a missing functionality. Will add it in the next release. @talentlessguy
from react-nodegui.
Alright, seems like a missing functionality. Will add it in the next release. @talentlessguy
awesome! looking forward to this feature
from react-nodegui.
@master-atul
while this functionality is being implemented in react-nodegui
, is it possible to achieve it with plain nodegui
with combination of react-nodegui
?
from react-nodegui.
iconSize prop is now available in 0.2.7 of react-nodegui for button, checkbox and radiobuttons
How can I use it? Please give an example
from react-nodegui.
Hello @a7ul
Can u tell me how can we make a messagebox or alertbox in react-nodegui
from react-nodegui.
Related Issues (20)
- Bad URL Protocol C: when running on Windows.
- react nodegui call stack exceeded error when using GridView/ BoxView components HOT 5
- What should I use to manipulate audio in react nodegui? HOT 1
- Running for the second time no Macbook M1 HOT 3
- [Question] How do I use an SVG as an app background?
- It seems that react third-party component libraries are not supported HOT 1
- RNList and FlexLayout
- process dlopen: Cannot find symbol in flat namespace
- Can I create Intel windows binary on Apple Arm M1 machine ?
- libQt5Core.so.5: version `Qt_5.15' not found
- Cannot receive close event of FileDialog HOT 2
- Can I create submenus for System Tray Menu Actions?
- Is List component same as FlatList (efficient renderer)?
- Frameless window
- qmenubar.setCornerWidget
- Getting selected text in PlainTextEdit
- QTableWidget support
- This project is unmaintained
- Add windowGeometryChanged to QMainWindowSignals to track window changes. HOT 1
- was this project die?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-nodegui.