working on QT change/get win property (stylesheet for cvTrackBar fixed !!!)
This commit is contained in:
parent
802d5f9940
commit
f6f634bace
@ -627,12 +627,12 @@ CvTrackbar::CvTrackbar(CvWindow* arg, QString name, int* value, int count, CvTra
|
||||
//QFile qss(PATH_QSLIDERCSS);
|
||||
//if (qss.open(QFile::ReadOnly))
|
||||
//{
|
||||
//slider->setStyleSheet(QLatin1String(qss.readAll()));
|
||||
//qss.close();
|
||||
// slider->setStyleSheet(QLatin1String(qss.readAll()));
|
||||
// qss.close();
|
||||
//}
|
||||
|
||||
|
||||
//does not work if we change the style with a stylesheet, why ?
|
||||
//this next line does not work if we change the style with a stylesheet, why ? (bug in QT ?)
|
||||
//slider->setTickPosition(QSlider::TicksBelow);
|
||||
label = new QPushButton;
|
||||
label->setFlat(true);
|
||||
|
@ -206,62 +206,60 @@ private slots:
|
||||
|
||||
//here css for trackbar
|
||||
/* from http://thesmithfam.org/blog/2010/03/10/fancy-qslider-stylesheet */
|
||||
//#define PATH_QSLIDERCSS ":/qss/window_QT.qss"
|
||||
static const QString str_Trackbar_css = "QSlider::groove:horizontal {";/*
|
||||
static const QString str_Trackbar_css = QString("")
|
||||
+ "QSlider::groove:horizontal {"
|
||||
+ "border: 1px solid #bbb;"
|
||||
+ "background: white;"
|
||||
+ "height: 10px;"
|
||||
+ "border-radius: 4px;"
|
||||
+ "}"
|
||||
|
||||
+ "QSlider::sub-page:horizontal {"
|
||||
+ "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
||||
+ "stop: 0 #66e, stop: 1 #bbf);"
|
||||
+ "background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1,"
|
||||
+ "stop: 0 #bbf, stop: 1 #55f);"
|
||||
+ "border: 1px solid #777;"
|
||||
+ "height: 10px;"
|
||||
+ "border-radius: 4px;"
|
||||
+ "}"
|
||||
|
||||
+ "QSlider::add-page:horizontal {"
|
||||
+ "background: #fff;"
|
||||
+ "border: 1px solid #777;"
|
||||
+ "height: 10px;"
|
||||
+ "border-radius: 4px;"
|
||||
+ "}"
|
||||
|
||||
+ "QSlider::handle:horizontal {"
|
||||
+ "background: qlineargradient(x1:0, y1:0, x2:1, y2:1,"
|
||||
+ "stop:0 #eee, stop:1 #ccc);"
|
||||
+ "border: 1px solid #777;"
|
||||
+ "width: 13px;"
|
||||
+ "margin-top: -2px;"
|
||||
+ "margin-bottom: -2px;"
|
||||
+ "border-radius: 4px;"
|
||||
+ "}"
|
||||
|
||||
+ "QSlider::handle:horizontal:hover {"
|
||||
+ "background: qlineargradient(x1:0, y1:0, x2:1, y2:1,"
|
||||
+ "stop:0 #fff, stop:1 #ddd);"
|
||||
+ "border: 1px solid #444;"
|
||||
+ "border-radius: 4px;"
|
||||
+ "}"
|
||||
|
||||
+ "QSlider::sub-page:horizontal:disabled {"
|
||||
+ "background: #bbb;"
|
||||
+ "border-color: #999;"
|
||||
+ "}"
|
||||
|
||||
+ "QSlider::add-page:horizontal:disabled {"
|
||||
+ "background: #eee;"
|
||||
+ "border-color: #999;"
|
||||
+ "}"
|
||||
|
||||
+ "QSlider::handle:horizontal:disabled {"
|
||||
+ "background: #eee;"
|
||||
+ "border: 1px solid #aaa;"
|
||||
+ "border-radius: 4px;"
|
||||
+ "}";
|
||||
|
||||
|
||||
QSlider::sub-page:horizontal {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #66e, stop: 1 #bbf);
|
||||
background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1,
|
||||
stop: 0 #bbf, stop: 1 #55f);
|
||||
border: 1px solid #777;
|
||||
height: 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
QSlider::add-page:horizontal {
|
||||
background: #fff;
|
||||
border: 1px solid #777;
|
||||
height: 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal {
|
||||
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #eee, stop:1 #ccc);
|
||||
border: 1px solid #777;
|
||||
width: 13px;
|
||||
margin-top: -2px;
|
||||
margin-bottom: -2px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal:hover {
|
||||
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #fff, stop:1 #ddd);
|
||||
border: 1px solid #444;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
QSlider::sub-page:horizontal:disabled {
|
||||
background: #bbb;
|
||||
border-color: #999;
|
||||
}
|
||||
|
||||
QSlider::add-page:horizontal:disabled {
|
||||
background: #eee;
|
||||
border-color: #999;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal:disabled {
|
||||
background: #eee;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
}*/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user