Linux下如何利用QtCreator下创建一个界面程序

Linux给QtCreator创建快捷启动的图标 Linux安装好QtCreator后只能通过设置环境变量,在终端启动QtCreator,不太方便,可以通过创建快捷启动图标,快速找到启动并不用占用一个终端。 快捷方式一般以.desktop后缀命名,并保存到/usr/share/applications目录下,有固定的语法,但常用的应用快捷方式可用以下命令: [Desktop Entry] Name=软件的名称 Comment=软件注释 Exec=启动脚本路径 Icon=软件的图标 Terminal=是否打开终端 StartupNotify=true. 阅读详情

1、首先通过工程下新建一个界面程序

file->New下选择一个界面,把界面

2、然后新建一个main.cpp文件

#include <QtGui>
#include "ui_qtTest.h"//这个地方是利用qmake -project自动生成的.h文件
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
QDialog *dd = new QDialog();
Ui_Dialog *ui = new Ui_Dialog();//Ui_Dialog 这个类是在qmake -project自动生成的.h文件中的类
ui->setupUi(dd);
dd->show();
return app.exec();
}

在Linux下用QtCreator编译C++源码 前言昨天折腾了一天,要把在Visual Studio上的一个C++工程到Linux系统上编译,简单的C++程序直接写makefile或者g++命令行编译,但是这个工程有十几个cpp文件和h头文件,互相之间有依赖关系,还要依赖boost库,makefile会很复杂也费时,最终借助Linux下的一款叫QtCreator的IDE编译成功了,QtCreator比Clion编译更快。总结一下一些小经验,方便其 阅读详情

相关推荐

使用QtCreator创建Qt工程

前面一篇文章记录了Qt库文件和开发相关工具的编译,现在就来使用这些东东来写一实用的GUI。 一、使用QtCreator—V2.4.1创建工程: ①配置编译工具:Tools-->Options-->Build & Run -->QtVersion/Tool Chains ############################   添加之前编译生成的qmake,这个用来生成Makefi

2621593260的专栏 8487

【Qt| 入门知识】怎样创建一个最简单 Qt 界面程序

👉本文介绍命令行编写一个Qt程序并执行的过程,然后也介绍了使用Qt Creator 创建一个Qt程序的过程。

wkd_007的博客 2624

Linux环境下Qt图形界面编程入门指南(Qt Creator的安装与Hello实例)

Linux环境(Ubuntu 15.04)下Qt图形界面编程入门指南(Qt Creator的安装与Hello实例),以C++语言使用Qt Creator开发图形界面的对话框或窗口程序的开发环境配置及Hello实例测试详细指南。

qt creator开发一个Linux 下运行的无界面的程序

通过 Qt Creator 创建一个 无界面程序 其实非常简单,你只需要使用 QCoreApplication 替代 QApplication,然后根据需要编写程序的逻辑。如果你要创建一个无界面程序,我们将使用 QCoreApplication,它不依赖图形界面,因此更适合做后台、服务类等无界面的任务。在这个例子中,我们使用了 QCoreApplication,它不需要窗口管理,因此更适合无界面程序。选择合适的 Qt 版本(确保你选择的是 Qt 5 或 Qt 6,取决于你的安装版本),点击 下一步。

jjjxxxhhh123的博客 2442

Qt5.9.1可执行程序做成可执行文件的步骤

本片文档主要介绍, 如何将Qt可执行程序,最简单、最快速的制作可执行文件, 也就是xx.exe的安装文件

Linux下Qt GUI应用程序框架的建立

qnapplication 调试环境:Red Hat 9.0;gcc 3.4

linux下实现qtcreater ui事件处理函数编程,使用QtCreator创造Qt工程

使用QtCreator创建Qt工程前面一篇文章记录了Qt库文件和开发相关工具的编译,现在就来使用这些东东来写一实用的GUI。一、使用QtCreator—V2.4.1创建工程:①配置编译工具:Tools-->Options-->Build & Run -->QtVersion/Tool Chains############################ 添加之前编译生...

weixin_39743722的博客 454

嵌入式L inux系统的Qt/Embedded图形界面开发

首先根据ARM9开发平台与GU I(图形用户界面)软件开发环境Qt/Embedded2. 3. 7,结合 实例介绍在嵌入式Linux系统上Qt/Embedded的编程方法,阐述了基于嵌入式L inux图形界面的开发 过程并具体描述Qt/Embedded图形系统的移植,包括编译环境的建立、编译Qt/Embedded库等。结果 验证了用Qt/Embedded开发的图形用户界面应用于具体的硬件平台上收到了良好效果。

如何再linux利用命令行创建一个QT程序

【代码】如何再linux利用命令行创建一个QT程序。

qq_53491675的博客 493

YT8531 PHY芯片硬件设计与MDIO/RGMII实战指南

以太网PHY芯片是FPGA系统实现网络通信的物理层核心,其关键在于标准接口(如MDIO管理总线和RGMII数据接口)的正确实现与协同。MDIO作为IEEE 802.3定义的低速配置通道,负责寄存器级控制与状态监控;RGMII则通过双沿采样精简引脚,在千兆速率下兼顾性能与PCB布线可行性。技术价值体现在电压兼容性(支持1.8V/2.5V/3.3V)、可编程时序调节(RX_DELAY/TX_DELAY)及多级环回测试能力,显著提升国产FPGA平台(如Xilinx Zynq)的工程鲁棒性。典型应用场景涵盖嵌入式网

weixin_42453228的博客 1340

告别Selenium!纯Python+Requests搞定微信视频号登录Cookie(附完整代码与避坑指南)

本文详细介绍了如何利用纯Python和Requests库实现微信视频号的自动化登录,替代传统的Selenium方案。通过解析HTTP请求交互流程,提供完整的代码实现和避坑指南,显著提升爬虫效率和隐蔽性,适用于轻量化爬虫开发。

weixin_30642561的博客 312

Qt4创建工程的几种方法:linux系统

方法一:以Qt Creator 作为IDE 1、启动Qt Creator,并创建一个空项目 2、输入路径和工程名字 3、添加cpp文件 4、添加代码,并且编译执行 5、执行结果 方法二:利用linux命令行 1、创建HelloWorld.cpp文件,并保存到HelloWorld文件夹下面 2、生成项目文

JPing的专栏 4085

STM32实战:用定时器触发ADC+DMA双缓冲实现电机电流采样(附避坑指南)

本文详细介绍了如何利用STM32的定时器触发ADC注入组采样,结合DMA双缓冲机制实现电机电流的高效采样。通过PWM触发和双缓冲架构,解决了开关噪声干扰、实时性要求和数据一致性等核心挑战,显著降低CPU负载并提升采样精度。附有完整的代码示例和避坑指南,适用于无人机电调、工业伺服驱动器等高精度电机控制场景。

weixin_33737134的博客 520

嵌入式linux物联网毕业设计项目智能语音识别基于stm32mp157开发板

关注公众号“华清远见在线实验室”,回复“mp157项目”,即可领取项目配套文档及源码。 在弹出的对话框中"Name"为"Desktop","Device Type"选择"Desktop"选项, "Sysroot"选择目标设备的系统目录,"Compiler"选择之前配置的名称"Auto-GCC"和"Auto-G++","Qt version"选择之前配 置的名称"Qt 5.14.1GCC",其它默认即可,最后点击"Apply"和"OK"按钮。QMainWindow 窗口经常被继承...

华清远见IT实验室专栏 3349

skywalking各项指标说明

skywalking各项指标说明

没有简介 2488

组态王的日历时间控件脚本

日期时间控件中的脚本中在小于10的月份和天数前必须要加上0,这是由首字符对比机制规定的,首字母相同,就不再不做对比了,比如1和11,是一样的。首字母不同,再比较下一位。 float Ayear1; float Amonth1; float Aday1; string temp1; Ayear1=sd.Year; Amonth1=sd.Month; Aday1=sd.Day; temp1=StrFromInt( Ayear1, 10 ); if(Amonth1<10) temp1=temp1+"-0"+

逍遥子的博客 5718

Linux下在qtcreator中创建qt程序

切换到“编辑”界面,点击菜单栏中的“文件”-“新建文件或项目”

啵啵啵啵博客 3250

linux内核学习(八)---摄像头框架移植(上)

本章来开始进行摄像头的移植,同时回顾一下V4L2的整个框架

文艺小少年的博客 114

我在Linux开发板上跑的第一个Qt程序

摘要:学Linux不难,难的是没有找对教程,没有人快速的带你。开发板买了之后就放在那里吃灰,看视频也看不下去,看文档又看不懂,太难了!本文以通俗易懂的方式讲一下在正点原子Linux开发板上跑一个qt程序的基本步骤,争取让初学者能够在半天的时间跑通第一个程序。...

果果小师弟的博客 1万+

软件设计师---计算机系统

软件设计师---计算机系统

我从不打没有准备的仗! 3万+

YOLO11优化:特征融合 | 金字塔稀疏 Transformer(PST)——一个轻量级、即插即用的模块 | 25年7月最新成果

我们提出金字塔稀疏 Transformer(PST)——一个轻量级、即插即用的模块,通过由粗到细的 token 选择机制和共享注意力参数,在大幅降低计算量的同时保留空间细节。

①答疑群聊服务;②YOLO大模型知识问答系统;③计算机视觉论文生成智能体; 1067

环境搭建 | Linux下 安装QtCreator

开发环境搭建: 参考博客:

Leonadoice的博客 7036

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

ubuntu20.10创建QT应用程序快捷方式 Terminal中输入命令直接打开QtCreator

在Terminal中直接输入命令就能打开QtCreator, i.e. ~$ qtcreator 就可以打开Qt Creator了。 想完成这个功能的原因是,一般在Linux下打命令比较方便,而师兄给下来的这个环境(已经打包成虚拟机,配置好了开发环境),需要自己找到那个目录,一开始费了我好大劲才找到。。 如果可以像进入python的交互环境一样,直接不管在哪个目录只要来个 ~$ python3 步骤: 1.在Terminal下直接输入命令就能打开QtCreator qtcreator所在原始目录是/op

星如雨落 4047

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

QtCreator此IDE的界面基本组成和入门使用讲解(Win,Linux,MacOS搭配不同版本 Qt)

简 述: 讲述 Qt Creator 此IDE的界面基本组成,和入门使用讲解;这里主要是以 Windows 版本讲述为主,但是 Linux 和 MacOS 版本的会贴出来,这里需要注意的是win版本基本和 Linux版本界面完全一样,而 MacOS 版本的界面和细节部分,则是有着少许的不一样,会标记出来; 感谢自由软件,感谢开源项目,感谢前辈大家们的分享,感谢 Qt 社区的人们,感谢互联网精神,...

3759

嵌入式Linux应用程序开发-(1)第一个嵌入式QT应用程序

第一个嵌入式QT应用程序 在成功安装 Qt Creator 开发环境后,我们通过一个简单的嵌入式Qt应用程序,来说明一下如何构建和编译一个Qt界面应用程序。 关于如何安装并构建 Qt Creator 开发环境,请参考以下帖子: 嵌入式Linux开发环境搭建-(5)安装和配置Qt Creator开发工具 目标:了解 Qt Creator 如何构建和编译工程,如何把应用程序...

EmbedIoT Studio 4万+
上一篇: Linux下如何运行一个QT的程序
下一篇: ubuntu下ftp服务器搭建
RubyBoss
博客等级 码龄18年 157粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值