Solved Set StyleSheen QTableView's Scroll bar.
-
How do I set the style sheet for the Scroll bar for QTableView.
I tried the code below. It works for the setting the style sheet
for QHeaderView but QScrollBar does not seem to work.In function from QHeaderView derived class.
QFile file(":/qss/script_tableview.qss"); file.open(QFile::ReadOnly); QString styleSheet = QString::fromLatin1(file.readAll()); setStyleSheet(styleSheet); QFile file2(":/qss/script_tvheader.qss"); file2.open(QFile::ReadOnly); styleSheet = QString::fromLatin1(file2.readAll()); QHeaderView *headview = horizontalHeader(); headview->setStyleSheet(styleSheet); QFile file3(":/qss/script_tvScrollBar.qss"); file3.open(QFile::ReadOnly); styleSheet = QString::fromLatin1(file3.readAll()); QScrollBar *scrollbar = horizontalScrollBar(); scrollbar->setStyleSheet(styleSheet);
-
Ops So sorry I am getting horizontal vertical blindness. Please ignore.