Comments (4)
@Luyaojun thanks for the contact. You can append the patch you made in the end of the stylesheet provided by qdarkstyle. Something like this:
mypatch = '''
QTableView{
border: 1px solid rgb(45, 45, 45);
gridline-color: rgb(60, 60, 60);
background-color: red;
selection-background-color: green;
}
'''
style = qdarkstyle.load_stylesheet_pyqt5()
app.setStyleSheet(style + mypatch)
You also avoid using style changes over the code and have everything in one place. If you want this change on a specific object, you can use the css properties to do that. I hope this works for you.
from qdarkstylesheet.
Thanks for your reply!
The first method works for me, and I learned more about the stylesheet.
I adjust the property and now it met my need.
from qdarkstylesheet.
Sorry to bother you again.
Is it possible to modify its style dynamically?
I need to change the background color of selected items according to their data.
It seems that no ItemDataRole matches the selected situation?
from qdarkstylesheet.
I tried the code below:
app = QApplication.instance()
dark_style_sheet = qdarkstyle.load_stylesheet_pyqt5()
dynamic_style = '''
QTableView#tableView_task::item:selected{
background: red;
color: white;
}
'''
app.setStyleSheet(dark_style_sheet + dynamic_style)
It works fine, but may be not elegant.
Appreciate for any suggestions in advance!
from qdarkstylesheet.
Related Issues (20)
- QDateEdit Popup too small, wrong colors for weekends
- Incorrect modification to warnings HOT 1
- QMessageBox buttons too narrow
- Widgets inside a QToolBox are not displayed properly when placed in a QToolBox
- Improve C++ use case explanation in documentation HOT 2
- Cannot Get QTTabbar Tab Font to Change Color
- QMenu section text not visible
- Release 3.2 HOT 4
- Regression in 3.2: sass.CompileError: Error: Undefined variable: "$COLOR-DISABLED". HOT 9
- No checked hint of checkable actions inside menu entries HOT 7
- Dark theme in version 3.2.1 is not working HOT 3
- "SetuptoolsDeprecationWarning: Invalid dash-separated options" during python package build
- BUG: Cannot use 3.2.2 on PySide2 (probably anything other than PyQt5) HOT 3
- Qt5 C++:QCheckBox does not display checkbox
- The font size of the table header cannot be adjusted
- The font size of the table header cannot be adjusted
- The QComboBox looks too thick in "other applications"
- QAbstractScrollArea without frame
- Unexpected indentation for items in combobox
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qdarkstylesheet.