qt5--创建控件的两种方式

 

#include <QApplication>
#include <QPushButton>
#include <QWidget>
 
int main(int argc,char *argv[])
{
    QApplication app(argc,argv);  
    
    QWidget win;  //创建窗体
    QPushButton button("栈区按钮",&win);  //在栈区创建按钮控件
    button.move(10,10);
    QPushButton* button1=new QPushButton("堆区按钮",&win); //在堆区创建按钮控件
    button1->move(50,50);
    win.show();

    return app.exec();  
}

 

 

 

qt5--创建控件的两种方式

相关文章:

  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
猜你喜欢
  • 2022-12-23
  • 2021-05-03
  • 2021-07-27
  • 2021-07-18
  • 2021-10-19
  • 2022-12-23
  • 2021-07-07
相关资源
相似解决方案