I usually find a workaround for this, however it is getting on my nerves lately and I cannot find any information regarding it anywhere on the internet.
Right, I want to change the property of a progress bar I have in Qt and have set the initial values in the form designer.
This is what I have in my initial (and working) style sheet configuration:
QProgressBar {
border: 2px solid grey;
border-radius: 7px;
}
QProgressBar::chunk {
background-color: #05B8CC;
width: 20px;
}
(NOTE: Bare in mind that I have done it in the Form Designer, which is the inbuilt drag and drop graphical designer for Qt)
However, I want to change it programmatically within the code by doing this:
ui->progressBar->styleSheet("QProgressBar::chunk { background-color: #05B8CC; width: 20px;}");
According to the documentation for style sheets, it should be working with not problem whatsoever, but I get the following non-nonsensical error:
D:\Qt Projects\test\mainwindow.cpp:165: error: C2660: 'QWidget::styleSheet' : function does not take 1 arguments
Any ideas on what might be causing this?
The function you are looking for is setStyleSheet