qss使用

news/2024/7/8 7:28:42
qss相关语法,请百度
//新建qss文件.例如myStyl.qss 
QPushButton#IM_btn_hall {
	background-image: url(Resources/IM/im_btn_hall_normal.png);
	border:none;
}
QPushButton#IM_btn_hall:hover {
	background-image: url(Resources/IM/im_btn_hall_hover.png);
	border:none;
}
QWidget#im_wid_titile {
	border-image: url(Resources/IM/im_title_top.png);
}

	//加载qss样式
	QFile styleSheet("qss/myStyle.qss");
	if (!styleSheet.open(QIODevice::ReadOnly))
	{
		qWarning("Can't open the style sheet file.");
		return;
	}
	qApp->setStyleSheet(styleSheet.readAll());


http://www.niftyadmin.cn/n/1445132.html

相关文章

安全配置向导打造Win2003“铜墙铁壁”(转)

Windows Server 2003是大家最常用的服务器操作系统之一。虽然它提供了强大的网络服务功能,并且简单易用,但它的安全性一直困扰着众多网管,如何在充分利用Windows Server 2003提供的各种服务的同时,保证服务器的安全稳定运行&#…

QT 控件基础

//屏幕分辨率: QDesktopWidget* desktopWidget QApplication::desktop(); QRect screenRect desktopWidget->screenGeometry(); int g_nActScreenW screenRect.width(); int g_nActScreenH screenRect.height(); //固定控件的大小: setFixedSize(90,60)…

alexa 网站的 Site Stats 详解(转)

最近发现越来越多的人开始重视 alexa 的排名了,也有很多的网友关注自己在 alexa 的排名,也常常在论坛中问到关于 alexa 的问题,我想对于国内的网站建设者来说,在这个全英文的网站上查找对自己有利的信息,或者修正自己的…

c2w

c2w wchar_t* c2w(const char *str) {int length strlen(str)1;wchar_t *t (wchar_t*)malloc(sizeof(wchar_t)*length);memset(t,0,length*sizeof(wchar_t));MultiByteToWideChar(CP_ACP,0,str,strlen(str),t,length);return t; }

uva 11796 - Dog Distance(几何)

题目链接&#xff1a;uva 11796 - Dog Distance 将一只狗位移向量加到另一只上&#xff0c;即变成点到线段的最短距离。 #include <cstdio> #include <cstring> #include <cmath> #include <algorithm>using namespace std; const double pi 4 * atan…

QT子线程与主线程的信号槽通信

最近用QT做一个服务器&#xff0c;众所周知&#xff0c;QT的主线程必须保持畅通&#xff0c;才能刷新UI。所以&#xff0c;网络通信端采用新开线程的方式。在涉及到使用子线程更新Ui上的控件时遇到了点儿麻烦。网上提供了很多同一线程不同类间采用信号槽通信的方式&#xff0c;…

Oracle中如何去定位未知的对象(转)

Oracle中如何去定位未知的对象,未知的对象,开发技术前几天看见有人问怎么查找某个view引用了什么表,或者某个表被那些对象引用,偶当时没有注意,今天朋友问到了.我想是有view表达这种依赖关系的,于是&#xff0c;偶打开 dba studio ,进入 方案---视图---sys,然后快速浏览 dba_* …

qt 通过样式表修改背景

在Qt中设置widget背景颜色或者图片方法很多种&#xff1a;重写paintEvent() , 调色板QPalette , 样式表setStyleSheet等等。 setStyleSheet() pWidget->setStyleSheet("background-color:blue;"); //设置背景颜色 pWidget->setStyleSheet("background-c…