QtQuick 1.1 Image Rounded Corners - qml

I am limited to using QtQuick 1.1 (Qt 4.8) , and so have no access to the GraphicalEffects library. Also I am not able to use any C++ and so the solution has to be pure QML (frustrating limitations - i know!).
I need to be able to display an image with rounded corners, but have so far been unable to. I have tried wrapping the image inside a clipped Rectangle with a radius but the clip doesn't work! Also thought about applying a border colour on a rectangle over the top but the background can be a gradient or image and so cannot have a solid color border.
Is this possible in QtQuick 1.1 (Qt 4.8)? I would appreciate some suggestions.

Related

Adjust width of Focus Rectangle around QLineEdit on Mac

When a QLineEdit has focus on a Mac, the Mac automatically puts what seems like a 3px-4px wide Focus Rectangle around it. I read
Qt4 Stylesheets and Focus Rect but I only want to adjust the width of the Focus Rectangle (to maybe 1px-2 px), not remove it.
using a for loop for all of my widgets, I also tried
if isinstance(widget, QLineEdit):
widget.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 1)
thinking that the "1" would set the width of the rectangle to 1px, but the code did nothing (my syntax may also be wrong).
Is it possible to set the width in pixels of the focus rectangle on a Mac.

change wireframe background in blender 2.8

I am totally new to blender. Check out the following picture:
My coach changed cylinder to wireframe, so then I change my cylinder to wireframe, however the view is different:
My question: How do I change to wireframe view? My wireframe background is transparent but first in image is not transparent.
Can any one help? I'm using Blender 2.8
You can change between wireframe/solid/material/and render previews by pressing the z key and confirming your selection in the radial menu.
You may also find the options in the
overlay dropdown menu useful - located in the top right hand corner of the 3D viewport. Particularly the floor, grid and wireframe options.

Change the height of NSScroller in NSScrollView

I have a NSScrollView, which has NSClipView and vertical/horizontal NSScrollers in it.
Now I want to change the height of the vertical scroller so that it occupies only the top half portion of the scroll view. I can not change the height from the size inspector. I tried changing the frame. It didn't work either.
Can someone help me get through this problem? Thankyou in advance!
Since OS X 10.10, NSScrollView has a scrollerInsets property which should be able to position the scroller differently than the scroll view itself, if wanted.
Small world.
I ended up cooking a special component for the 8th pure SwiftUI/FRP incarnation of WhatSize.app
There are things Swift UI can't really do, so you have to wrap NSView objects as NSViewRepresentable and now they are available to a pure SwiftUI app.
scrollView.scrollerInsets = .init(top: 0.0, left: 0.0, bottom: 14.0, right: 0.0)
So the vertical scroll bars do not stomp over the drag and column resize icon on the bottom in yellow.
This allows WhatSize to display data just as Finder's "as Columns" does.

wxPython - How to implement a colour slider

for my project I want to implement a colour slider such as the one in the ColourCubeDialog or in Windows' native colour picker dialog. Here are some pictures to illustrate what I mean:
https://www.codeproject.com/KB/WPF/WPFColourSlider/WpfColourSlider1.jpg
https://www.codeproject.com/KB/miscctrl/XColorSpectrumCtrl/XColorSpectrumCtrl4.png
I found the wx.lib.colourchooser.pycolourslider.PyColourSlider while digging around in the wx package and I thought I could use that to implement the colour slider. I tried it the following way, but it only shows a white square (approx. 15 pixels) surrounded by a thin black border in the upper left hand corner.
import wx
from wx.lib.colourchooser.pycolourslider import PyColourSlider
app = wx.App()
frame = wx.Frame(None, -1, title="PyColourSlider",style=wx.MINIMIZE_BOX|
wx.SYSTEM_MENU|wx.CAPTION|wx.CLOSE_BOX|wx.RESIZE_BORDER)
panel = wx.Panel(frame)
slider = PyColourSlider(panel, -1)
slider.SetBaseColour(wx.Colour(80, 100, 120)) # some random color
slider.DrawBuffer()
frame.Show()
app.MainLoop()
What am I doing wrong? Is the PyColouSlider the right way to go or is there a better approach?
I found something that is not the ultimate answer to my own question, but it helped me.
The from wx.lib.colourchooser. folder contains lots of parts that, when put together, allow the user to create an entire colour picker. There is even an implementation of a complete colour picker that can be embedded in a window/frame/whatever. It's called pycolourchooser.

Font size for exporting iOS UIView to svg

Developing a drawing app on ipad. I am trying to export whatever I draw on canvas (overriding UIView drawRect). Everything works fine except for the text. The problem is with the font size.
I am creating the font using systemFontOfSize:size for drawing on the canvas
and while exporting, I am using using the same size with pt. For example if the size is 15 then in the exported svg, adding a style attribute of text tag as
style="font-size:15pt;"
The Apple documentation says that the systemFontOfSize takes fontSize in points. So whatever I draw on the canvas should be of same size to the size of text in svg (rendered by firefox, Inkscape)
But the size of the text rendered by svg seems to be bigger. I have other drawing on the canvas e.g a rectangle, the size of the text relative to rectangle is bigger in svg than that is displayed on ipad screen. I am also drawing rectangle using point unit on both UIView and svg.
Is there anything I am missing? I am using both places point unit, so DPI should not matter..