如何设置QTextEdit的框架形状
How to set the frame shape of a QTextEdit
我只是无法从语法上理解类概念中的枚举。我正在尝试禁用QTextEdit的帧:
//in a header for my custom class where the main element is the textField
QTextEdit* textField;
...
//displaying it myCustomClass.cpp
textField = new QTextEdit(this);
textField->Shape = QFrame::NoFrame;
我得到错误"无效使用枚举::Qframe::Shape"。正确的语法是什么?为什么?
这是无效的C++:QTextEdit没有这样的"Shape"成员。此外,Qt使用适当的封装,因此形状是而不是成员变量暴露的。
你必须调用一个设置框架形状的方法,令人惊讶的是,它被称为setFrameShape
!
textField->setFrameShape(QFrame::NoFrame);
相关文章:
- 在没有Xcode的情况下在Mac捆绑包中嵌入框架
- catch框架有没有办法比较流或文件
- 如何将不同的可执行文件合并到一个窗口框架中进行编码?像浏览器一样
- 使用Qt框架在c ++类中创建API调用
- 如何在ECS框架中更新组件数据和通知系统
- VSCode IntelliSense无法识别SDL框架的SDL_image扩展库
- 用于C++的静态二进制检测或二进制重写工具和框架
- GoogleMock是否仍然打算与任何测试框架一起使用?
- 带有框架的 QGraphicsTextItem 的 QPropertyAnimation 会使文本抖动
- 在C++中使用 Catch 测试框架编译错误"error: expected ';' at end of declaration list"
- 在 QTextEdit 中使用指针或在 Qt-Creator 上使用 connect()
- 修改生成文件以简化框架 #include 路径
- 无敌框架并受到伤害等级
- 如何在QTextEdit中添加URL或IMAGE-URL
- 如何在提升构建中设置环境变量以进行提升单元测试框架?
- 使用 gtest 框架在单元测试代码中检查目标对象的私有变量的最佳实践是什么?
- Xcode 中的加速框架以获得 A 的 QR 分解,但找不到 zgeqrf
- 在 QTextEdit C++ 中为特定行添加下划线
- 是否可以在 Xcode C++项目中包含框架?
- 如何设置QTextEdit的框架形状