惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
IT之家
IT之家
V
V2EX
C
Check Point Blog
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
B
Blog
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网

博客园 - 华腾智算

逐个注释 前端学习全景图 · HTML5 + CSS3 全部知识点 前端学习全景图 从零实现跨平台 3D 引擎架构方案 2026年的跨平台 GUI 开发趋势 杀毒 现代图形学的本质 C++快速掌握之一 rust控制流-各种循环 rust控制流 rust函数和注释 rust复核类型--元组tuple和数组 rust的类型 rust常量和变量 rust正确的猜数游戏 rust猜数游戏2 rust猜数游戏 字体选型 20260810代码 理解图形学之一入门 Rust 标准库 `std` 中最常用、最核心的模块和类型 Rust 标准库std RUST教程 rust理解一 rust多文件组织 - 华腾智算 Cargo.toml Rust 语言教程 C#常用 C#第六天异常 通俗易懂解释编程-适用于任何编程语言
mainwindows.cpp
华腾智算 · 2025-08-15 · via 博客园 - 华腾智算
 //显示主窗口和另外一个窗口
 #if 1
    TestWidget*w=new TestWidget;
    w->show();
 #else
    TestWidget*w=new TestWidget(this);
 #endif

#if 0
    //创建对话框窗口
    TestDialog*dlg=new TestDialog (this);
    dlg->show();
#else
    //模态,阻塞
    TestDialog*dlg=new TestDialog (this);
    dlg->exec();
#endif
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "testwidget.h"
#include "testdialog.h"
#include<QPushButton>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->move(10,10);
    QPushButton*btnA=new QPushButton (this);
    btnA->move(10,10);
    btnA->setFixedSize(200,200);

    QPushButton*btnB=new QPushButton (btnA);
    btnB->move(10,10);
    btnB->setFixedSize(100,100);

    QPushButton*btnC=new QPushButton (btnB);
    btnC->move(10,10);
    btnC->setFixedSize(50,50);
}

MainWindow::~MainWindow()
{
    delete ui;
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "testwidget.h"
#include "testdialog.h"
#include<QPushButton>
#include"subwindow.h"
#include<QtGlobal>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    subwindow*sub=new subwindow(this);
    sub->show();

    int a =32;
    qintptr p=a;
    qDebug()<<p;
}

MainWindow::~MainWindow()
{
    delete ui;
}