首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Qt编写自定义控件51-可输入仪表盘

这个控件是近期定制的控件,还是比较实用的控件之一,用户主要是提了三点需求,一点是切换焦点的时候控件放大突出显示,一点是可直接输入或者编辑值,还有一点是支持上下键及翻页键和鼠标滚轮来动态修改值,类似于qspinbox控件。要能够支持直接输入首先想到的就是qlineedit控件,在原有的仪表盘控件上中间部分,放置一个qlineedit控件用来输入值,采用正则表达式来限制只能输入数字,为了使得qlinedit和自定义绘制的仪表盘完全融为一体,必须设置qlineedit的样式为背景透明,至于输入框的位置,有个小技巧就是直接将输入框设置为控件的大小,这样输入的焦点永远在控件的中间,完全混合,丝毫看不出是一个输入框控件插在那里,至于上下键及翻页键和鼠标滚轮,直接安装事件过滤器即可识别到,进行对应的处理即可。

02

hostapd 配置「建议收藏」

hostapd is an IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator. This page is dedicated to the Linux documentation of it’s implementation and use. Please refer to the hostapd home page for information for other Operating Systems. As far a Linux is concerned, out of the old drivers you can only use these 3 drivers with hostapd: HostAP madwifi prism54 All new mac80211 based drivers that implement AP functionality are supported with hostapd’s nl80211 driver. The mac80211 subsystem moves all aspects of master mode into user space. It depends on hostapd to handle authenticating clients, setting encryption keys, establishing key rotation policy, and other aspects of the wireless infrastructure. Due to this, the old method of issuing ‘ iwconfig <wireless interface> mode master’ no longer works. Userspace programs like hostapd now use netlink (the nl80211 driver) to create a master mode interface for your traffic and a monitor mode interface for receiving and transmitting management frames. Getting hostapd Using your distributions hostapd It is advisable to try your distributions version of hostapd before taking the time to compile and install your own copy. This will make future maintenance easier as you’ll be able to use the init scripts shipped by the distro and hostapd will be updated by it as well. If your distribution ships 0.6.8 or later, you can test with this bare minimum config by creating the file hostapd-minimal.conf: #change wlan0 to your wireless device interface=wlan0 driver=nl80211 ssid=test channel=1 If that config errors out with something like: hostapd $ sudo hostapd ./hostapd-minimal.conf Configuration file: ./hostapd-minimal.conf Line 2: invalid/unknown driver ‘nl80211’ 1 errors found in configuration file ‘./hostapd-minimal.conf’ that means that your distro is not shipping hostapd with nl80211 driver support and you’ll need to follow the building instructions that follow. If it works, you can skip down to the configuring hostapd secti

02

Qt编写自定义控件54-时钟仪表盘

这个控件没有太多的应用场景,主要就是练手,论美观的话比不上之前发过的一个图片时钟控件,所以此控件也是作为一个基础的绘制demo出现在Qt源码中,我们可以在Qt的安装目录下找到一个时钟控件的绘制,甚至还有qml版本,本控件无非就是一个仪表边框加上时钟分钟刻度再加上时分秒指针,打完收工,我是在此基础上增加了可以设置各种颜色,然后鼠标右键可设置四种效果 普通效果/弹簧效果/连续效果/隐藏效果,弹簧效果的意思是秒钟走动的时候,先移动到超过指定位置,然后又重新弹回来,连续效果的意思是将步长减少,一点点的移动,将秒钟的定时器精度调高。还有一个新增的功能是内置了设置系统时间公共槽函数,支持任意操作系统。

02
领券