调用软件时说这个文件错误,我完全新手,哪个大佬帮忙看看哪里出错了。非常感谢!!!

qq_41149178 2017-11-30 09:58:51
/***********************************************
******Copyright ANSYS. All Rights Reserved******
************************************************/

/*Global******************************************************************/
QWidget{
font: normal 12px;
}

QListWidget::item:hover {
background: #cce1f0;
}

QListWidget::item:selected {
background: #036cb6;
color: white;
}
QTreeWidget::item:hover {
background: #cce1f0;
}

QTreeWidget::item:selected {
background: #036cb6;
color: white;
}
QListWidget#CxNonSelectableWidget {
background: #efefef;
color: black
}
QTreeWidget#CxNonSelectableWidget {
background: #efefef;
color: black
}
QListWidget#CxSelectableWidget {
background: white;
color: black
}
QTreeWidget#CxSelectableWidget {
background: white;
color: black
}
QListWidget#CxSelectableWidget:disabled {
background: #efefef;
color: black
}
QTreeWidget#CxSelectableWidget:disabled {
background: #efefef;
color: black
}
QDockWidget#RibbonDockWidget QGroupBox {
font-size: 11px;
}

/*Comment this for r17; need to revisit this for r18
QGroupBox[flat="false"] {
border: 1px ridge #6e6e6e;
color: black;
margin-top: 7px; /*revert these margins for Ribbon/
padding-top: 5px;
}

QGroupBox[flat="false"]:disabled {
border: 1px ridge #8a8a8a;
color: #AAAAAA;
margin-top: 7px;
padding-top: 5px;
}

QGroupBox[flat="false"]::title {
subcontrol-origin: margin;
left: 5px; /*revert for Ribbon/
}*/

/*MainWindow******************************************************************/
QMainWindow {
background: white;
}
QMainWindow::separator {
background: #efefef;
width: 5px; /* when vertical */
height: 5px; /* when horizontal */
}
QMainWindow::separator:hover {
background: #e5e5e5;
}
/*PushButton & ToolButton**************************************************/
QPushButton#CxListButton::menu-indicator {
subcontrol-position: bottom right;
}
QDockWidget#RibbonDockWidget QPushButton {
background: #F8F8F8;
border: 0px;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 5px;
padding-right: 5px;
/*min-width: 50px;*/
}
QDockWidget#RibbonDockWidget QToolButton {
background: #F8F8F8;
border: 0px;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
/*min-width: 50px;*/
}

QDockWidget#RibbonDockWidget QToolButton:checked{
border: 1px solid #4c4c4c;
padding-top: 0px;
padding-bottom: 0px;
padding-left: 4px;
padding-right: 4px;
background: white;
}

QDockWidget#RibbonDockWidget QPushButton:hover{
background: #cce1f0;
}
QDockWidget#RibbonDockWidget QToolButton:hover{
background: #cce1f0;
}

QDockWidget#RibbonDockWidget QPushButton:disabled{
color: #AAAAAA;
background: #E4E3E5;
}
QDockWidget#RibbonDockWidget QToolButton:disabled{
color: #AAAAAA;
background: #E4E3E5;
border: 0px;
}
QDockWidget#RibbonDockWidget QPushButton:pressed{
background: #036cb6;
color: white;
}
QDockWidget#RibbonDockWidget QToolButton:pressed{
background: #036cb6;
color: white;
}

QDockWidget#RibbonDockWidget QPushButton::menu-indicator {
image: url(:\spindown)
}

QDockWidget#RibbonDockWidget QToolButton::menu-indicator {
image: url(:\spindown)
}

QDockWidget#RibbonDockWidget QPushButton::menu-indicator:disabled {
image: url(:\spindown_disabled)
}

QDockWidget#RibbonDockWidget QToolButton::menu-indicator:disabled {
image: url(:\spindown_disabled)
}

/*Toggle Buttons********************************************************************/
QDockWidget#RibbonDockWidget QRadioButton, QDockWidget#RibbonDockWidget QCheckBox {
padding: 2px 2px 2px 2px;
}

QDockWidget#RibbonDockWidget QRadioButton:hover, QDockWidget#RibbonDockWidget QCheckBox:hover {
background: #cce1f0;
}

/*Drop Down List*******************************************************************/
QDockWidget#RibbonDockWidget QComboBox{
background: #F8F8F8;
border: 1px solid gray;
padding: 1px 18px 1px 3px;
}

QDockWidget#RibbonDockWidget QComboBox:hover{
background: #cce1f0;
}

QDockWidget#RibbonDockWidget QComboBox:editable {
background: #F8F8F8;
}

QDockWidget#RibbonDockWidget QComboBox:disabled {
color: #AAAAAA;
border: 1px solid #c6c6c6;
background: #E4E3E5;
}

QDockWidget#RibbonDockWidget QComboBox::drop-down:editable {
background: #F8F8F8;
}

/* QComboBox gets the "on" state when the popup is open */
QDockWidget#RibbonDockWidget QComboBox:!editable:on, QDockWidget#RibbonDockWidget QComboBox::drop-down:editable:on {
background: #F8F8F8;
}

QDockWidget#RibbonDockWidget QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;

border-left-width: 1px;
border-left-color: darkgray;
border-left-style: solid; /* just a single line */
border-top-right-radius: 3px; /* same radius as the QComboBox */
border-bottom-right-radius: 3px;
}

QDockWidget#RibbonDockWidget QComboBox::down-arrow {
image: url(":/spindown");
}

QDockWidget#RibbonDockWidget QComboBox::down-arrow:disabled {
image: url(":/spindown_disabled");
}

QDockWidget#RibbonDockWidget QComboBox::down-arrow:on { /* shift the arrow when popup is open */
top: 1px;
left: 1px;
}

/*RibbonGroup*******************************************************************/
QDockWidget#RibbonDockWidget QGroupBox::title {
left: 0px; /*reverted for Ribbon*/
}

QDockWidget#RibbonDockWidget QGroupBox[flat="false"] {
border: 1px ridge #6e6e6e;
color: black;
margin-top: 0px;/*reverted for Ribbon*/
padding-top: 0px;
}

QDockWidget#RibbonDockWidget QGroupBox[flat="false"]:disabled {
border: 1px ridge #8a8a8a;
color: #AAAAAA;
margin-top: 0px;
padding-top: 0px;
}

QDockWidget#RibbonDockWidget QGroupBox[flat="true"]{
border: 0px;
padding-top: 12px;
}
/*Label*************************************************************************/
QDockWidget#RibbonDockWidget QLabel {
color: black;
}

QDockWidget#RibbonDockWidget QLabel:disabled {
color: gray;
}

/*Tabs***************************************************************************/
QDockWidget#RibbonDockWidget QTabBar::tab {
background: #DDDDDD;
border: 1px solid darkgray;
border-bottom-color: gray;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
min-width: 8ex;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 15px;
padding-right: 15px;
margin-left: 1px;
margin-right: 1px;
}

QDockWidget#RibbonDockWidget QTabBar::tab:hover {
background: #c6c6c6;
color: black;
}

QDockWidget#RibbonDockWidget QTabBar::tab:selected {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #036cb6, stop:0.14 #036cb6, stop:0.15 white, stop:1 white);
color: black;
border-color: black;
border-bottom-color: white; /* same as pane color */
margin-left: -5px;
margin-right: -5px;
}
QDockWidget#RibbonDockWidget QTabBar::tab:first:selected {
margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
padding-left: 15px; /*revert the padding again*/
padding-right: 15px;
margin-left: -3px;
}

QDockWidget#RibbonDockWidget QTabBar::tab:last:selected {
margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
padding-left: 4px; /*workaround for last tab*/
padding-right: 4px;
}

QDockWidget#RibbonDockWidget QTabBar::tab:only-one {
margin: 0; /* if there is only one tab, we don't want overlapping margins */
}

QDockWidget#RibbonDockWidget QTabBar::tab:!selected {
margin-top: 1px; /* make non-selected tabs look smaller */
padding-left: 10px;
padding-right: 10px;
}

QDockWidget#RibbonDockWidget QTabBar::scroller { /* the width of the scroll buttons */
width: 20px;
}

QDockWidget#RibbonDockWidget QTabBar QToolButton { /* the scroll buttons are tool buttons */
border-width: 0px;
width:16px;
}

/*Menu Bar********************************************************************/
QMenuBar {
background-color: none;
}
QMenuBar::item {
spacing: 10px;
padding: 1px 8px;
background: transparent;
padding-top: 4px;
padding-bottom: 2px;
}
QMenuBar::item:selected {
background: #4c4c4c;
color: white;
padding-top: 3px;
padding-bottom: 3px;
}
QMenuBar::item:pressed {
background: #4c4c4c;
color: white;
}

/*File Button**********Committed at source code****************
QPushButton#CxFileButton{
background-color: #036cb6;
color: white;
}
QPushButton#CxFileButton:hover{
background-color: black;
color: white;
}
QPushButton#CxFileButton:pressed{
background-color: gray;
color: white;
}*/

/*Console***************************************************************************
QDockWidget#ConsoleDockWidget QTextEdit{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 white, stop:0.5 white, stop:1 #f8f0e6);
}*/

/*ScrollBar*****************************************************************************
QDockWidget#TreeDockWidget QScrollBar:handle:hover {
background: #d3d3d3;
}
QDockWidget#TreeDockWidget QScrollBar:vertical {
border: 0px;
background: #d3d3d3;
width: 10px;
margin: 10px 0 10px 0;
}
...全文
258 3 点赞 打赏 收藏 举报
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
丁劲犇 2017-12-02
这个是qss 文件吧,直接加载就可以了。

#include "mainwindow.h"
#include <QApplication>
#include <QFile>
int main(int argc, char *argv[])
{
	QApplication a(argc, argv);

	QFile File("1.qss");
	File.open(QFile::ReadOnly);
	QString StyleSheet = QLatin1String(File.readAll());
	a.setStyleSheet(StyleSheet);

	MainWindow w;
	w.show();

	return a.exec();
}
似乎没有报错 。
  • 打赏
  • 举报
回复
dext 2017-12-01
你不会用二分查找么?
  • 打赏
  • 举报
回复
qq_41149178 2017-11-30
后面还有一点点,没位置贴出来了 QDockWidget#TreeDockWidget QScrollBar::handle:vertical { background: #a6a6a6; min-height: 10px; } QDockWidget#TreeDockWidget QScrollBar::add-line:vertical { border: 2px solid grey; background: #d3d3d3; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; } QDockWidget#TreeDockWidget QScrollBar::sub-line:vertical { border: 2px solid grey; background: #d3d3d3; height: 0px; subcontrol-position: top; subcontrol-origin: margin; } QDockWidget#TreeDockWidget QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px; width: 10px; height: 10px; background: #a6a6a6; } QDockWidget#TreeDockWidget QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; } QDockWidget#TreeDockWidget QScrollBar:horizontal { border: 0px; background: #d3d3d3; height: 7px; margin: 0px 7px 0 7px; } QDockWidget#TreeDockWidget QScrollBar::handle:horizontal { background: #909090; min-width: 10px; } QDockWidget#TreeDockWidget QScrollBar::add-line:horizontal { border: 2px solid grey; background: #d3d3d3; width: 0px; subcontrol-position: right; subcontrol-origin: margin; } QDockWidget#TreeDockWidget QScrollBar::sub-line:horizontal { border: 2px solid grey; background: #d3d3d3; width: 0px; subcontrol-position: left; subcontrol-origin: margin; } QDockWidget#TreeDockWidget QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal { border: 1px; width: 7px; height: 7px; background: #909090; }*/ /*Tree******************************************************************************/ QDockWidget#TreeDockWidget QTreeWidget::item:hover { background: #cce1f0; } QDockWidget#TreeDockWidget QTreeWidget::item:selected { background: #036cb6; color: white; } QDockWidget#TreeDockWidget QTreeWidget { padding-top: 0px; } QDockWidget#TreeDockWidget QTreeWidget { background: #efefef } /*Graphics-Window Toolbar*************************************************************************/ QDockWidget#GraphicsDockWidget QToolBar { border: 0px; } /*Miscellaneous*************************************************************************/ /*have some spacing amongst pushbuttons in button-box even after having a 0px spacing in source code*/ QDockWidget#RibbonDockWidget QStackedWidget CxButtonBoxQt > QPushButton { margin: 2px; } QLineEdit:read-only { background: #F8F8F8; } QLineEdit:editable { background: white; } QDockWidget#RibbonDockWidget CxLineQt { color: gray; } QDockWidget#RibbonDockWidget CxTextQt { font-size:11px; } /*On some linux machines, disabled buttons/tabs.. text is in black color instead of gray color*/ QWidget:disabled{ color: gray; }
  • 打赏
  • 举报
回复
相关推荐
发帖
Qt
加入

1.3w+

社区成员

Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
申请成为版主
帖子事件
创建了帖子
2017-11-30 09:58
社区公告
暂无公告