有时需要把一个子窗口内嵌进入父窗口当中。

我们可以这样做

1.新建一个QWidget 或者QDialog的子类 ClassA(父类为ClassB)

2.在新建类的构造函数中添加设置窗口属性

 

[cpp] view plain copy
 
  1. setWindowFlags(Qt::CustomizeWindowHint|Qt::FramelessWindowHint);  

关闭默认的窗口标题提示以及没有边框的窗口。

 

3.在父窗口中调用。

[html] view plain copy
 
  1. ClassA *A;  
  2. A = new ClassA(this);  
  3. A->show();  

在要显示的地方show就行了。

https://blog.csdn.net/kfbyj/article/details/8841525

相关文章:

  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-09-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-08-31
  • 2022-02-08
相关资源
相似解决方案