main.cpp
来自「Linux窗口程序设计,Qt4精彩实例分析,以循序渐进的方式介绍Qt4开发及其实」· C++ 代码 · 共 27 行
CPP
27 行
#include <QApplication>
#include <QTextEdit>
#include <QHBoxLayout>
#include <QWidget>
#include "dragwidget.h"
int
main(int argc, char * argv[])
{
QApplication app(argc,argv);
QWidget *mainWidget = new QWidget;
QTextEdit *edit = new QTextEdit;
edit->setText("Since we will continue to improve and fine-tune Qt as a result of feedback and suggestions from customers and the open source community, we have not included a detailed list of changes between Qt 4.1 and this release.");
DragWidget *dragWidget = new DragWidget;
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(edit);
layout->addWidget(dragWidget);
layout->setStretchFactor(edit,1);
layout->setStretchFactor(dragWidget,3);
mainWidget->setLayout(layout);
mainWidget->show();
return app.exec();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?