首页| 论坛| 消息

回复: Qt编写通用顶部导航源码
#21 [lengji22 10-30 16:42]
大神,膜拜
#22 [icemen 11-06 21:22]
有个BUG,建议 UIDemo01::buttonClick() 中的 b->text(); 改成
b->objectName();
否则换肤及换语言时无法执行换页。
void UIDemo01::buttonClick(){QToolButton *b = (QToolButton *)sender();QString name = b->objectName();//b->text();
QList tbtns = ui->widgetTop->findChildren();[color= ..
#23 [wjjontheway 11-06 22:17]
刘大师,我是新手,最近在学习界面设计,看了您的代码,想请教下两个问题:
1.UIDemo01.cpp里面对“form”,和“canMove”属性进行设置
this->setProperty("form", true);
this->setProperty("canMove", true);
UIDemo01集成QDialog,我在QDialog的属性列表里面没有找到这两个属性,在QWidget和QObject里面也没有找到。请问这两个是自定义的还是什么,困惑。
2.另外一个就是psblack.css中的样式表语句中也提到了类似的选择器,还有选择器中的“nav”属性,这是在哪个类的属性呢?
#24 [wjjontheway 11-06 22:51]
刚看了下setProperty(),
"If the property is not defined using Q_PROPERTY, and therefore not listed in the meta-object, it is added as a dynamic property and false is returned."
所以这里的"form",“nav”都是自己添加的一种动态属性对吗
#25 回 wjjontheway 的帖子 [liudianwu 11-07 08:30]
wjjontheway:刚看了下setProperty(),
"If the property is not defined using Q_PROPERTY, and therefore not listed in the meta-object, it is added as a dynamic property and false is returned."
所以这里的"form",“nav”都是自己添加的一种动态属性对吗 (2017-11-06 22:51) 
是的,你也可以写成this->setProperty("niubi", true);
能移动无边框是因为在appinit类中定义了!安装了全局事件过滤器。

<< 3 4 5 6 7 >> (5/10)

回复 发表
主题 版块