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

推荐订阅源

WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
C
Check Point Blog
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
M
MIT News - Artificial intelligence
B
Blog RSS Feed
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
美团技术团队
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale

博客园 - 华腾智算

逐个注释 前端学习全景图 · 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;
}