一、界面

在某宝上面的看见别人车上面的车载中控屏,想到自己也会一些QT,刚好跟我的ARM板的驱动联系起来制作一个系统,就想着练习一下实现的界面如下:


采用纯代码编写 QSS修改样式,构思了几天花了几个小时编写代码,具体应用功能还没有实现,跟ARM驱动相关的已经实现,对这方面感兴趣的小伙伴可以私信我一起学习
持续更新内容。。。

一、界面代码

QWidget * MainWindow::MainCarPlay(){this->setGeometry(0, 0, 1024,600);auto ret = new QWidget(this);
//    ret->resize(1024,600);QLabel * Map = new QLabel();QLabel * Music = new QLabel();QLabel * MainAPP = new QLabel();Map->setFixedSize(500,500);Music->setMaximumWidth(400);Music->setMaximumHeight(300);MainAPP->setMaximumWidth(400);MainAPP->setMaximumHeight(200);Map->setObjectName("MainViewMap");Music->setObjectName("MainViewMusic");MainAPP->setObjectName("MainViewMainAPP");Map->setStyleSheet( "background-color: rgb(241,242,246,80%);");//十六进制值:#F1F2F6; rgb 代码值:rgb(241,242,246)Music->setStyleSheet( "background-color: rgb(241,242,246,85%);");//十六进制值:#FFFFFF; rgb 代码值:rgb(255,255,255)MainAPP->setStyleSheet( "background-color: rgb(241,242,246,85%);");QWidget *VWidget = new QWidget(this);auto VLayout = new QVBoxLayout();VLayout->addWidget(Music);
//    VLayout->addWidget(MidBtn);VLayout->addWidget(MainAPP);VWidget->setLayout(VLayout);//Musicauto Musicdata =new QLabel();auto Musicdatatime = new QDateTime(QDateTime::currentDateTime());QString str1 = Musicdatatime->toString("hh:mm"); //设置显示格式QFont FONT("FangSong ",47,60);Musicdata->setFont(FONT);Musicdata->setText(str1);Musicdata->setFixedSize(300,60);Musicdata->setStyleSheet("background-color: transparent;"
//                             "color: white;""border-style: none;"
//                             "font: normal normal 18px;");auto Musicyear =new QLabel();auto Musicyearweek = new QDateTime(QDateTime::currentDateTime());QString str = Musicyearweek->toString("yyyy-MM-dd"); //设置显示格式QFont FONT1("Microsoft YaHei",16,40);//设置为微软雅黑,字体12号,加粗Musicyear->setFont(FONT1);Musicyear->setText(str);Musicyear->setObjectName("yeartime");Musicyear->setFixedSize(300,20);Musicyear->setStyleSheet("background-color: transparent;""border-style: none;");auto MusicWek =new QLabel();auto Musicweek = new QDateTime(QDateTime::currentDateTime());QString str12 = Musicweek->toString("ddd"); //设置显示格式QFont FONT12("Microsoft YaHei",16,40);//设置为微软雅黑,字体12号,加粗MusicWek->setFont(FONT12);MusicWek->setText(str12);MusicWek->setObjectName("yeartime");MusicWek->setAlignment(Qt::AlignHCenter);MusicWek->setFixedSize(100,30);MusicWek->setStyleSheet("background-color: transparent;""border-style: none;");auto YWLayout = new QVBoxLayout();YWLayout->addWidget(Musicyear);YWLayout->addWidget(MusicWek);auto pV1Layout = new QHBoxLayout();pV1Layout->addWidget(Musicdata);pV1Layout->addLayout(YWLayout);//labyaauto Musiclanya = new QLabel();Musiclanya->setAlignment(Qt::AlignRight);Musiclanya->setStyleSheet("image: url(:/misc/topwidget/image/bluetoothx.png);""background-color: transparent;");Musiclanya->setFixedSize(100,70);auto Musictext = new QLabel();Musictext->setText("时光匆匆却没遗失过去");
//    Musictext->setAlignment(Qt::AlignHCenter);Musictext->setStyleSheet("font: normal normal 21px;""background-color: transparent;");Musictext->setFixedSize(290,50);auto Musicbluthayout = new QHBoxLayout();Musicbluthayout->addWidget(Musiclanya);Musicbluthayout->addSpacing(20);Musicbluthayout->addWidget(Musictext);QPushButton *MidBtn = new QPushButton(this);MidBtn->setStyleSheet("image: url(:/misc/CarPlay/image/as.png);""border-radius:5px;""background-color: transparent;");MidBtn->setFixedSize(50,50);QPushButton *RightBtn = new QPushButton(this);RightBtn->setStyleSheet("image: url(:/misc/CarPlay/image/sahng.png);""border-radius:5px;""background-color: transparent;");RightBtn->setFixedSize(50,50);QPushButton *LeftBtn = new QPushButton(this);LeftBtn->setStyleSheet("image: url(:/misc/CarPlay/image/xaio.png);""border-radius:5px;""background-color: transparent;");LeftBtn->setFixedSize(50,50);auto VH1ayout = new QHBoxLayout();VH1ayout->addWidget(RightBtn);VH1ayout->addWidget(MidBtn);VH1ayout->addWidget(LeftBtn);auto MusicvLayout = new QVBoxLayout();MusicvLayout->addLayout(pV1Layout);MusicvLayout->addLayout(Musicbluthayout);MusicvLayout->addLayout(VH1ayout);Music->setLayout(MusicvLayout);  //Musicc父控件//MainAPPauto ACarPlay = new QLabel();ACarPlay->setText("CarPlayer");ACarPlay->setAlignment(Qt::AlignHCenter);ACarPlay->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 30px;");ACarPlay->setFixedSize(175,50);auto ACarPlayview = new QPushButton();ACarPlayview->setStyleSheet("image: url(:/misc/CarPlay/image/qwe.png);""border-radius:35px;""background-color:green");ACarPlayview->raise();ACarPlayview->setFixedSize(175,90);auto ACarPlayPLayout = new QVBoxLayout();ACarPlayPLayout->addWidget(ACarPlayview);ACarPlayPLayout->setSpacing(10);ACarPlayPLayout->addWidget(ACarPlay);auto ACarLift = new QLabel();ACarLift->setText("Carlifter");ACarLift->setAlignment(Qt::AlignHCenter);ACarLift->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 30px;");ACarLift->setFixedSize(175,50);auto ACarliftview = new QPushButton();ACarliftview->setStyleSheet("image: url(:/misc/CarPlay/image/qw.png);""border-radius:35px;""background-color:white");ACarliftview->raise();ACarliftview->setFixedSize(175,90);auto ACarLiftPLayout = new QVBoxLayout();ACarLiftPLayout->addWidget(ACarliftview);ACarLiftPLayout->setSpacing(10);ACarLiftPLayout->addWidget(ACarLift);auto VH3ayout = new QHBoxLayout();VH3ayout->addLayout(ACarPlayPLayout);VH3ayout->addLayout(ACarLiftPLayout);VH3ayout->setContentsMargins(1,30,1,30);MainAPP->setLayout(VH3ayout);  //MainAPP//APP的布局auto App1text = new QLabel();App1text->setText("天气");App1text->setAlignment(Qt::AlignHCenter);App1text->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 30px;");App1text->setFixedSize(115,50);auto APP1 = new QPushButton();APP1->setStyleSheet("border-image: url(:/misc/CarPlay/image/Weather.png);""background-color: transparent;""color: white;""border-style: none;""font: normal normal 18px;");APP1->setFixedSize(115,106);auto veapp1 = new QVBoxLayout();veapp1->addWidget(APP1);veapp1->setSpacing(60);veapp1->addWidget(App1text);auto App2text = new QLabel();App2text->setText("设置");App2text->setAlignment(Qt::AlignHCenter);App2text->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 30px;");App2text->setFixedSize(115,50);auto APP2 = new QPushButton();APP2->setStyleSheet("border-image: url(:/misc/CarPlay/image/set.png);""background-color: transparent;""color: white;""border-style: none;""font: normal normal 18px;");APP2->setFixedSize(115,106);auto veapp2 = new QVBoxLayout();veapp2->addWidget(APP2);veapp2->setSpacing(60);veapp2->addWidget(App2text);auto App3text = new QLabel();App3text->setText("音乐");App3text->setAlignment(Qt::AlignHCenter);App3text->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 30px;");App3text->setFixedSize(115,50);auto APP3 = new QPushButton();APP3->setStyleSheet("border-image: url(:/misc/CarPlay/image/music.png);""background-color: transparent;""color: white;""border-style: none;""font: normal normal 18px;");APP3->setFixedSize(115,106);auto veapp3 = new QVBoxLayout();veapp3->addWidget(APP3);veapp3->setSpacing(60);veapp3->addWidget(App3text);auto App4text = new QLabel();App4text->setText("视频");App4text->setAlignment(Qt::AlignHCenter);App4text->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 30px;");App4text->setFixedSize(115,50);auto APP4 = new QPushButton();APP4->setStyleSheet("border-image: url(:/misc/CarPlay/image/Mplayer.png);""background-color: transparent;""color: white;""border-style: none;""font: normal normal 18px;");APP4->setFixedSize(115,106);auto veapp4 = new QVBoxLayout();veapp4->addWidget(APP4);veapp4->setSpacing(60);veapp4->addWidget(App4text);auto App5text = new QLabel();App5text->setText("地图");App5text->setAlignment(Qt::AlignHCenter);App5text->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 30px;");App5text->setFixedSize(115,50);auto APP5 = new QPushButton();APP5->setStyleSheet("border-image: url(:/misc/CarPlay/image/MAP.png);""background-color: transparent;""color: white;""border-style: none;""font: normal normal 18px;");APP5->setFixedSize(115,106);auto veapp5 = new QVBoxLayout();veapp5->addWidget(APP5);veapp5->setSpacing(60);veapp5->addWidget(App5text);auto App6text = new QLabel();App6text->setText("收音机");App6text->setAlignment(Qt::AlignHCenter);App6text->setStyleSheet( "text-align:center;""background-color: transparent;""font: normal 28px;");App6text->setFixedSize(115,50);auto APP6 = new QPushButton();APP6->setStyleSheet("border-image: url(:/misc/CarPlay/image/carr.png);""background-color: transparent;""color: white;""border-style: none;""font: normal normal 18px;");APP6->setFixedSize(115,106);auto veapp6 = new QVBoxLayout();veapp6->addWidget(APP6);veapp6->setSpacing(60);veapp6->addWidget(App6text);auto APP7 = new QLabel();APP7->setStyleSheet( "background-color: rgb(241,242,246,80%);""border-radius:20;");APP7->setFixedSize(479,47);QPushButton *MAPappRightBtn = new QPushButton(this);MAPappRightBtn->setStyleSheet("image: url(:/misc/CarPlay/image/picture.png);""border-radius:5px;""background-color: transparent;");MAPappRightBtn->setFixedSize(30,30);QPushButton *MAPappMidBtn = new QPushButton(this);MAPappMidBtn->setStyleSheet("image: url(:/misc/CarPlay/image/als.png);""border-radius:5px;""background-color: transparent;");MAPappMidBtn->setFixedSize(30,30);QPushButton *MAPappLeftBtn = new QPushButton(this);MAPappLeftBtn->setStyleSheet("image: url(:/misc/CarPlay/image/eye.png);""border-radius:5px;""background-color: transparent;");MAPappLeftBtn->setFixedSize(30,30);auto MAPappLayout = new QHBoxLayout();MAPappLayout->addWidget(MAPappRightBtn);MAPappLayout->setSpacing(50);MAPappLayout->addWidget(MAPappMidBtn);MAPappLayout->addWidget(MAPappLeftBtn);APP7->setLayout(MAPappLayout);auto APP23Layout = new QVBoxLayout();APP23Layout->addLayout(veapp1);APP23Layout->addLayout(veapp3);APP23Layout->addLayout(veapp5);auto APP233Layout = new QVBoxLayout();APP233Layout->addLayout(veapp2);APP233Layout->addLayout(veapp4);APP233Layout->addLayout(veapp6);auto APP2A33Layout = new QHBoxLayout();APP2A33Layout->addLayout(APP23Layout);APP2A33Layout->setSpacing(20);APP2A33Layout->addLayout(APP233Layout);APP2A33Layout->setContentsMargins(50,0,40,0);auto APP1Layout = new QVBoxLayout();APP1Layout->addLayout(APP2A33Layout);
//    APP1Layout->setContentsMargins(50,0,0,0);APP1Layout->addWidget(APP7);Map->setLayout(APP1Layout);auto pVLayout = new QHBoxLayout(this);pVLayout->setContentsMargins(50,20,50,20);pVLayout->addWidget(VWidget);pVLayout->addWidget(Map);ret->setFixedWidth(m_screenWidth);ret->setLayout(pVLayout);return ret;}

Linux车机中控系统—界面相关推荐

  1. 嘴哥有料系列-can教程3:车机娱乐系统在整车CAN网络的位置与作用

    原文章:https://mp.weixin.qq.com/s/Lwerwb1BGRe2I7gIwMdR3g 在过去的8年内,智能手机领域,尤其是Android/IOS等操作系统的发展, 智能手机已经发 ...

  2. 远程调试在Linux车机中的应用

    导读 在软件开发过程中,调试是必不可少的环节,嵌入式操作系统的调试与桌面操作系统的调试相比有很大差别,嵌入式系统的可视化调试能力比桌面操作系统要弱一点.对于导航这种业务场景比较复杂的程序开发,可视化调 ...

  3. 安卓导航车机root方法_远程调试在Linux车机中的应用

    导读 在软件开发过程中,调试是必不可少的环节,嵌入式操作系统的调试与桌面操作系统的调试相比有很大差别,嵌入式系统的可视化调试能力比桌面操作系统要弱一点.对于导航这种业务场景比较复杂的程序开发,可视化调 ...

  4. linux车机软件市场,车机UI(用户界面)的发展现状

    电视.PC.手机.平板,消费电子市场每一块屏幕都曾创造出一个巨大的市场.屏幕本身当然没有那么大的威力,是内容,是基于同一系统稳定生态下的内容,才粘住了最广大的用户.长期被"忽略"的 ...

  5. 雷凌linux车机升级_绿老师学堂:15万合资车谁更“聪明”?体验思域/福克斯/雷凌车机...

    当汽车新四化成为共识,没有哪一家中国车企不想抓住这个产业变革的时机变道超车.同样是被认定的新趋势,可能还存在新能源的技术路径争论,自动驾驶时间表的争论,但是,对智能网联化的认可是毋庸置疑的. 借助博越 ...

  6. [安卓系统导航升级系统,车机升级系统]汽车系统升级更新,诺威达k2201升级包

    汽车导航升级固件刷机包大屏导航升级救砖,车机使用卡,开机慢,加载音乐慢等问题,更新升级之后,系统也比之前流畅了,诺威达:K2001,K2001N,K2101,K2201,K2201S,K3001 备注 ...

  7. Android 7.1 车机 Android 系统 在线升级,将安装到下载到/data/目录下面

    最近按项目要求,需要做一个车机Android在线升级操作,但是cache内存太小了,最后只能寄存希望在 data/文件夹下,但是data/目录在6.0之后禁止recovery读取data文件.最后的解 ...

  8. Linux车机平台pulseaudio多alsasink配置

    https://www.freedesktop.org/wiki/Software/PulseAudio 官网上的介绍是这样的: pulseaudio 是一个POSIX操作系统上的声音系统.是音频应用 ...

  9. linux车机系统怎么进工厂模式,工厂方法模式 - 跟JBPM学习设计模式_Linux编程_Linux公社-Linux系统门户网站...

    模式简介 工厂方法模式,定义一个用于创建对象的接口,让子类决定实例化那个类,其使一个类的实例化延迟到其子类中. 前边我们学习了简单工厂模式,简单工厂模式的最大优势在于工厂类中包含了必要逻辑判断,根据客 ...

最新文章

  1. 接口使用jwt返回token_JWT实现token验证
  2. python 递归函数_Python尚学堂高淇|P82P86面向对象和面向过程的区别LEGB规则nonlocal_global递归函数阶乘计算案例...
  3. 带你见识不一样的世界,这5部豆瓣纪录片不可错过!
  4. Eclipse 导入项目乱码问题
  5. python常用连接字符串
  6. 开环增益的频率依赖性
  7. 较常用的Math方法及ES6中的扩展
  8. 流水线效率计算公式_线束加工的生产效率、爬坡计划与产能提升浅读
  9. Java8 实战系列-05-lambda 类型推断
  10. OMS智能订单管理系统
  11. word转PDF,导航窗格输出目录
  12. 投资起步晚5年,赶上需要1.5倍的汗水+时间
  13. 基于Java GUI的资产管理系统的设计与实现
  14. Python处理二进制流(一)
  15. Java Cryptography
  16. 自制STC12C5A60S2最小系统板
  17. 你的缺点是什么?资深HR教你套路面试官
  18. 亚马逊云AWS MQTTS 证书使用说明
  19. 机械臂抓取学习笔记四
  20. OP-TEE内核学习笔记(一)(安全存储)—— 密钥和文件结构

热门文章

  1. 刺激战场亚服为何外挂横行?和平精英转战国际服后苦不堪言
  2. Linux如何实现文件系统开机自动挂载
  3. tableau数据可视化实战:大众点评成都美食(一)
  4. 天猫魔盒1S:电视购物新体验
  5. 深入理解Java虚拟机02—类加载机制
  6. MIPS 模拟器 下载安装
  7. MIPS汇编语言学习笔记11:整数减法 (mult方法)
  8. 【病因】 深入剖析强迫症的病因
  9. 科普:关于屏幕的各种性能参数
  10. 大富翁2.0(进阶版)