New functions with QT GUI
Shortcut for zoom (CTRL + and CTRL - for zoomin/out, CTRL Left/Right/Up/Down for panning, CTRL P for zoom = 1) Fix bug with key event
This commit is contained in:
parent
65f3b09d31
commit
5cbe64dac7
@ -630,7 +630,6 @@ int GuiReceiver::start()
|
|||||||
|
|
||||||
CvTrackbar::CvTrackbar(CvWindow* arg, QString name, int* value, int count, CvTrackbarCallback on_change )
|
CvTrackbar::CvTrackbar(CvWindow* arg, QString name, int* value, int count, CvTrackbarCallback on_change )
|
||||||
{
|
{
|
||||||
//moveToThread(qApp->instance()->thread());
|
|
||||||
setObjectName(trackbar_name);
|
setObjectName(trackbar_name);
|
||||||
parent = arg;
|
parent = arg;
|
||||||
trackbar_name = name;
|
trackbar_name = name;
|
||||||
@ -638,7 +637,6 @@ CvTrackbar::CvTrackbar(CvWindow* arg, QString name, int* value, int count, CvTra
|
|||||||
|
|
||||||
callback = on_change;
|
callback = on_change;
|
||||||
slider = new QSlider(Qt::Horizontal);
|
slider = new QSlider(Qt::Horizontal);
|
||||||
//slider->setObjectName(trackbar_name);
|
|
||||||
slider->setFocusPolicy(Qt::StrongFocus);
|
slider->setFocusPolicy(Qt::StrongFocus);
|
||||||
slider->setMinimum(0);
|
slider->setMinimum(0);
|
||||||
slider->setMaximum(count);
|
slider->setMaximum(count);
|
||||||
@ -742,10 +740,27 @@ CvWindow::CvWindow(QString arg, int arg2)
|
|||||||
myview = new ViewPort(this, CV_MODE_NORMAL);
|
myview = new ViewPort(this, CV_MODE_NORMAL);
|
||||||
myview->setAlignment(Qt::AlignHCenter);
|
myview->setAlignment(Qt::AlignHCenter);
|
||||||
|
|
||||||
|
|
||||||
|
shortcutZ = new QShortcut(Qt::CTRL + Qt::Key_P, this);
|
||||||
|
QObject::connect( shortcutZ, SIGNAL( activated ()),myview, SLOT( resetZoom( ) ));
|
||||||
|
shortcutPlus = new QShortcut(QKeySequence(QKeySequence::ZoomIn), this);
|
||||||
|
QObject::connect( shortcutPlus, SIGNAL( activated ()),myview, SLOT( ZoomIn() ));
|
||||||
|
shortcutMinus = new QShortcut(QKeySequence(QKeySequence::ZoomOut), this);
|
||||||
|
QObject::connect(shortcutMinus, SIGNAL( activated ()),myview, SLOT( ZoomOut() ));
|
||||||
|
shortcutLeft = new QShortcut(Qt::CTRL + Qt::Key_Left, this);
|
||||||
|
QObject::connect( shortcutLeft, SIGNAL( activated ()),myview, SLOT( siftWindowOnLeft() ));
|
||||||
|
shortcutRight = new QShortcut(Qt::CTRL + Qt::Key_Right, this);
|
||||||
|
QObject::connect( shortcutRight, SIGNAL( activated ()),myview, SLOT( siftWindowOnRight() ));
|
||||||
|
shortcutUp = new QShortcut(Qt::CTRL + Qt::Key_Up, this);
|
||||||
|
QObject::connect(shortcutUp, SIGNAL( activated ()),myview, SLOT( siftWindowOnUp() ));
|
||||||
|
shortcutDown = new QShortcut(Qt::CTRL + Qt::Key_Down, this);
|
||||||
|
QObject::connect(shortcutDown, SIGNAL( activated ()),myview, SLOT( siftWindowOnDown() ));
|
||||||
|
|
||||||
layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
||||||
layout->setSpacing(5);
|
layout->setSpacing(5);
|
||||||
layout->setObjectName(QString::fromUtf8("boxLayout"));
|
layout->setObjectName(QString::fromUtf8("boxLayout"));
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
layout->setMargin(0);
|
||||||
layout->addWidget(myview);
|
layout->addWidget(myview);
|
||||||
|
|
||||||
if (flags == CV_WINDOW_AUTOSIZE)
|
if (flags == CV_WINDOW_AUTOSIZE)
|
||||||
@ -792,12 +807,37 @@ void CvWindow::addSlider(QString name, int* value, int count,CvTrackbarCallback
|
|||||||
layout->insertLayout(layout->count()-1,t);
|
layout->insertLayout(layout->count()-1,t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Need more test here !
|
||||||
void CvWindow::keyPressEvent(QKeyEvent *event)
|
void CvWindow::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
mutexKey.lock();
|
//see http://doc.trolltech.com/4.6/qt.html#Key-enum
|
||||||
last_key = (int)event->text().toLocal8Bit().at(0);
|
int key = event->key();
|
||||||
mutexKey.unlock();
|
bool goodKey = false;
|
||||||
key_pressed.wakeAll();
|
|
||||||
|
if (key>=20 && key<=255 )
|
||||||
|
{
|
||||||
|
key = (int)event->text().toLocal8Bit().at(0);
|
||||||
|
goodKey = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == Qt::Key_Escape)
|
||||||
|
{
|
||||||
|
key = 27;
|
||||||
|
goodKey = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//control plus Z, plus +, and plus - are used for zoom functions
|
||||||
|
if (event->modifiers() != Qt::ControlModifier && goodKey)
|
||||||
|
{
|
||||||
|
mutexKey.lock();
|
||||||
|
last_key = key;
|
||||||
|
|
||||||
|
//last_key = event->nativeVirtualKey ();
|
||||||
|
mutexKey.unlock();
|
||||||
|
key_pressed.wakeAll();
|
||||||
|
//event->accept();
|
||||||
|
}
|
||||||
|
|
||||||
QWidget::keyPressEvent(event);
|
QWidget::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -823,8 +863,10 @@ ViewPort::ViewPort(QWidget* arg, int arg2)
|
|||||||
{
|
{
|
||||||
mode = arg2;
|
mode = arg2;
|
||||||
centralWidget = arg,
|
centralWidget = arg,
|
||||||
|
|
||||||
setupViewport(centralWidget);
|
setupViewport(centralWidget);
|
||||||
setUpdatesEnabled(true);
|
setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
setObjectName(QString::fromUtf8("graphicsView"));
|
setObjectName(QString::fromUtf8("graphicsView"));
|
||||||
timerDisplay = new QTimer(this);
|
timerDisplay = new QTimer(this);
|
||||||
timerDisplay->setSingleShot(true);
|
timerDisplay->setSingleShot(true);
|
||||||
@ -833,21 +875,20 @@ ViewPort::ViewPort(QWidget* arg, int arg2)
|
|||||||
positionGrabbing = QPointF(0,0);
|
positionGrabbing = QPointF(0,0);
|
||||||
positionCorners = QRect(0,0,size().width(),size().height());
|
positionCorners = QRect(0,0,size().width(),size().height());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(OPENCV_GL)
|
||||||
if (mode == CV_MODE_OPENGL)
|
if (mode == CV_MODE_OPENGL)
|
||||||
{
|
{
|
||||||
#if defined(OPENCV_GL)
|
|
||||||
setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
||||||
initGL();
|
initGL();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
image2Draw=cvCreateImage(cvSize(centralWidget->width(),centralWidget->height()),IPL_DEPTH_8U,3);
|
image2Draw=cvCreateImage(cvSize(centralWidget->width(),centralWidget->height()),IPL_DEPTH_8U,3);
|
||||||
cvZero(image2Draw);
|
cvZero(image2Draw);
|
||||||
|
setInteractive(false);
|
||||||
setSceneRect(0,0,size().width(),size().height());
|
|
||||||
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
||||||
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
||||||
this->setInteractive(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewPort::~ViewPort()
|
ViewPort::~ViewPort()
|
||||||
@ -858,6 +899,51 @@ ViewPort::~ViewPort()
|
|||||||
delete timerDisplay;
|
delete timerDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ViewPort::resetZoom()
|
||||||
|
{
|
||||||
|
matrixWorld.reset();
|
||||||
|
controlImagePosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ViewPort::ZoomIn()
|
||||||
|
{
|
||||||
|
scaleView( 0.5,QPointF(size().width()/2,size().height()/2));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ViewPort::ZoomOut()
|
||||||
|
{
|
||||||
|
scaleView( -0.5,QPointF(size().width()/2,size().height()/2));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Note: move 2 percent of the window
|
||||||
|
void ViewPort::siftWindowOnLeft()
|
||||||
|
{
|
||||||
|
float delta = 2*width()/(100.0*matrixWorld.m11());
|
||||||
|
moveView(QPointF(delta,0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Note: move 2 percent of the window
|
||||||
|
void ViewPort::siftWindowOnRight()
|
||||||
|
{
|
||||||
|
float delta = -2*width()/(100.0*matrixWorld.m11());
|
||||||
|
moveView(QPointF(delta,0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Note: move 2 percent of the window
|
||||||
|
void ViewPort::siftWindowOnUp()
|
||||||
|
{
|
||||||
|
float delta = 2*height()/(100.0*matrixWorld.m11());
|
||||||
|
moveView(QPointF(0,delta));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Note: move 2 percent of the window
|
||||||
|
void ViewPort::siftWindowOnDown()
|
||||||
|
{
|
||||||
|
float delta = -2*height()/(100.0*matrixWorld.m11());
|
||||||
|
moveView(QPointF(0,delta));
|
||||||
|
}
|
||||||
|
|
||||||
void ViewPort::startDisplayInfo(QString text, int delayms)
|
void ViewPort::startDisplayInfo(QString text, int delayms)
|
||||||
{
|
{
|
||||||
if (timerDisplay->isActive())
|
if (timerDisplay->isActive())
|
||||||
@ -939,8 +1025,18 @@ void ViewPort::controlImagePosition()
|
|||||||
|
|
||||||
//save also the inv matrix
|
//save also the inv matrix
|
||||||
matrixWorld_inv = matrixWorld.inverted();
|
matrixWorld_inv = matrixWorld.inverted();
|
||||||
|
|
||||||
|
|
||||||
|
viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ViewPort::moveView(QPointF delta)
|
||||||
|
{
|
||||||
|
matrixWorld.translate(delta.x(),delta.y());
|
||||||
|
controlImagePosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
//factor is -0.5 (zoom out) or 0.5 (zoom in)
|
||||||
void ViewPort::scaleView(qreal factor,QPointF center)
|
void ViewPort::scaleView(qreal factor,QPointF center)
|
||||||
{
|
{
|
||||||
factor/=5;//-0.1 <-> 0.1
|
factor/=5;//-0.1 <-> 0.1
|
||||||
@ -965,8 +1061,6 @@ void ViewPort::scaleView(qreal factor,QPointF center)
|
|||||||
setCursor(Qt::OpenHandCursor);
|
setCursor(Qt::OpenHandCursor);
|
||||||
else
|
else
|
||||||
unsetCursor();
|
unsetCursor();
|
||||||
|
|
||||||
viewport()->update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewPort::wheelEvent(QWheelEvent *event)
|
void ViewPort::wheelEvent(QWheelEvent *event)
|
||||||
@ -1184,8 +1278,7 @@ void ViewPort::mouseMoveEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
positionGrabbing = event->pos();
|
positionGrabbing = event->pos();
|
||||||
|
|
||||||
matrixWorld.translate(dxy.x(),dxy.y());
|
moveView(dxy);
|
||||||
controlImagePosition();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget::mouseMoveEvent(event);
|
QWidget::mouseMoveEvent(event);
|
||||||
@ -1204,8 +1297,8 @@ QSize ViewPort::sizeHint() const
|
|||||||
|
|
||||||
void ViewPort::resizeEvent ( QResizeEvent *event)
|
void ViewPort::resizeEvent ( QResizeEvent *event)
|
||||||
{
|
{
|
||||||
controlImagePosition();
|
controlImagePosition();
|
||||||
return QGraphicsView::resizeEvent(event);
|
return QGraphicsView::resizeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1258,7 +1351,7 @@ void ViewPort::drawOverview(QPainter *painter)
|
|||||||
|
|
||||||
const int margin = 5;
|
const int margin = 5;
|
||||||
|
|
||||||
painter->setBrush(QBrush ( QColor(0, 0, 0, 127)));
|
painter->setBrush(QColor(0, 0, 0, 127));
|
||||||
painter->setPen(Qt::darkGreen);
|
painter->setPen(Qt::darkGreen);
|
||||||
|
|
||||||
painter->drawRect(QRect(width()-viewSize.width()-margin, 0,viewSize.width(),viewSize.height()));
|
painter->drawRect(QRect(width()-viewSize.width()-margin, 0,viewSize.width(),viewSize.height()));
|
||||||
@ -1266,7 +1359,6 @@ void ViewPort::drawOverview(QPainter *painter)
|
|||||||
qreal ratioSize = 1/matrixWorld.m11();
|
qreal ratioSize = 1/matrixWorld.m11();
|
||||||
qreal ratioWindow = (qreal)(viewSize.height())/(qreal)(size().height());
|
qreal ratioWindow = (qreal)(viewSize.height())/(qreal)(size().height());
|
||||||
|
|
||||||
painter->setBrush(QColor(0, 0, 0, 127));
|
|
||||||
painter->setPen(Qt::darkBlue);
|
painter->setPen(Qt::darkBlue);
|
||||||
painter->drawRect(QRectF(width()-viewSize.width()-positionCorners.left()*ratioSize*ratioWindow-margin,
|
painter->drawRect(QRectF(width()-viewSize.width()-positionCorners.left()*ratioSize*ratioWindow-margin,
|
||||||
-positionCorners.top()*ratioSize*ratioWindow,
|
-positionCorners.top()*ratioSize*ratioWindow,
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
|
#include <QShortcut>
|
||||||
|
|
||||||
//Macro here
|
//Macro here
|
||||||
#define CV_MODE_NORMAL 0
|
#define CV_MODE_NORMAL 0
|
||||||
@ -83,7 +84,7 @@ public:
|
|||||||
GuiReceiver();
|
GuiReceiver();
|
||||||
int start();
|
int start();
|
||||||
bool _bTimeOut;
|
bool _bTimeOut;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
@ -124,7 +125,7 @@ private:
|
|||||||
QString createLabel();
|
QString createLabel();
|
||||||
QPointer<QPushButton > label;
|
QPointer<QPushButton > label;
|
||||||
CvTrackbarCallback callback;
|
CvTrackbarCallback callback;
|
||||||
CvWindow* parent;
|
QPointer<CvWindow> parent;
|
||||||
int* dataSlider;
|
int* dataSlider;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -151,9 +152,15 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<ViewPort> myview;
|
QPointer<ViewPort> myview;
|
||||||
|
|
||||||
int status;//0 normal, 1 fullscreen (YV)
|
|
||||||
|
|
||||||
|
int status;//0 normal, 1 fullscreen (YV)
|
||||||
|
QPointer<QShortcut> shortcutZ;
|
||||||
|
QPointer<QShortcut> shortcutPlus;
|
||||||
|
QPointer<QShortcut> shortcutMinus;
|
||||||
|
QPointer<QShortcut> shortcutLeft;
|
||||||
|
QPointer<QShortcut> shortcutRight;
|
||||||
|
QPointer<QShortcut> shortcutUp;
|
||||||
|
QPointer<QShortcut> shortcutDown;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -166,30 +173,41 @@ public:
|
|||||||
~ViewPort();
|
~ViewPort();
|
||||||
void updateImage(void* arr);
|
void updateImage(void* arr);
|
||||||
void startDisplayInfo(QString text, int delayms);
|
void startDisplayInfo(QString text, int delayms);
|
||||||
void setMouseCallBack(CvMouseCallback m, void* param);
|
void setMouseCallBack(CvMouseCallback m, void* param);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//reference:
|
//reference:
|
||||||
//http://www.qtcentre.org/wiki/index.php?title=QGraphicsView:_Smooth_Panning_and_Zooming
|
//http://www.qtcentre.org/wiki/index.php?title=QGraphicsView:_Smooth_Panning_and_Zooming
|
||||||
//http://doc.qt.nokia.com/4.6/gestures-imagegestures-imagewidget-cpp.html
|
//http://doc.qt.nokia.com/4.6/gestures-imagegestures-imagewidget-cpp.html
|
||||||
void scaleView(qreal scaleFactor, QPointF center);
|
void scaleView(qreal scaleFactor, QPointF center);
|
||||||
|
void moveView(QPointF delta);
|
||||||
|
void resetZoom();
|
||||||
|
void ZoomIn();
|
||||||
|
void ZoomOut();
|
||||||
|
void siftWindowOnLeft();
|
||||||
|
void siftWindowOnRight();
|
||||||
|
void siftWindowOnUp() ;
|
||||||
|
void siftWindowOnDown();
|
||||||
void resizeEvent ( QResizeEvent * );
|
void resizeEvent ( QResizeEvent * );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QGraphicsScene *myScene;
|
||||||
|
|
||||||
QPointF positionGrabbing;
|
QPointF positionGrabbing;
|
||||||
QRect positionCorners;
|
QRect positionCorners;
|
||||||
QTransform matrixWorld;
|
QTransform matrixWorld;
|
||||||
QTransform matrixWorld_inv;
|
QTransform matrixWorld_inv;
|
||||||
|
|
||||||
CvMouseCallback on_mouse;
|
CvMouseCallback on_mouse;
|
||||||
void* on_mouse_param;
|
void* on_mouse_param;
|
||||||
|
|
||||||
int mode;
|
int mode;
|
||||||
IplImage* image2Draw;
|
IplImage* image2Draw;
|
||||||
|
|
||||||
bool isSameSize(IplImage* img1,IplImage* img2);
|
bool isSameSize(IplImage* img1,IplImage* img2);
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QWidget* centralWidget;
|
QPointer<QWidget> centralWidget;
|
||||||
QTimer* timerDisplay;
|
QPointer<QTimer> timerDisplay;
|
||||||
bool drawInfo;
|
bool drawInfo;
|
||||||
QString infoText;
|
QString infoText;
|
||||||
//QImage* image;
|
//QImage* image;
|
||||||
@ -201,10 +219,9 @@ private:
|
|||||||
void mouseReleaseEvent(QMouseEvent *event);
|
void mouseReleaseEvent(QMouseEvent *event);
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||||
void drawInstructions(QPainter *painter);
|
void drawInstructions(QPainter *painter);
|
||||||
|
void drawOverview(QPainter *painter);
|
||||||
void draw2D(QPainter *painter);
|
void draw2D(QPainter *painter);
|
||||||
void controlImagePosition();
|
void controlImagePosition();
|
||||||
void drawOverview(QPainter *painter);
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(OPENCV_GL)
|
#if defined(OPENCV_GL)
|
||||||
void draw3D();
|
void draw3D();
|
||||||
@ -221,61 +238,61 @@ private slots:
|
|||||||
//here css for trackbar
|
//here css for trackbar
|
||||||
/* from http://thesmithfam.org/blog/2010/03/10/fancy-qslider-stylesheet */
|
/* from http://thesmithfam.org/blog/2010/03/10/fancy-qslider-stylesheet */
|
||||||
static const QString str_Trackbar_css = QString("")
|
static const QString str_Trackbar_css = QString("")
|
||||||
+ "QSlider::groove:horizontal {"
|
+ "QSlider::groove:horizontal {"
|
||||||
+ "border: 1px solid #bbb;"
|
+ "border: 1px solid #bbb;"
|
||||||
+ "background: white;"
|
+ "background: white;"
|
||||||
+ "height: 10px;"
|
+ "height: 10px;"
|
||||||
+ "border-radius: 4px;"
|
+ "border-radius: 4px;"
|
||||||
+ "}"
|
+ "}"
|
||||||
|
|
||||||
+ "QSlider::sub-page:horizontal {"
|
+ "QSlider::sub-page:horizontal {"
|
||||||
+ "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
+ "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
||||||
+ "stop: 0 #66e, stop: 1 #bbf);"
|
+ "stop: 0 #66e, stop: 1 #bbf);"
|
||||||
+ "background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1,"
|
+ "background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1,"
|
||||||
+ "stop: 0 #bbf, stop: 1 #55f);"
|
+ "stop: 0 #bbf, stop: 1 #55f);"
|
||||||
+ "border: 1px solid #777;"
|
+ "border: 1px solid #777;"
|
||||||
+ "height: 10px;"
|
+ "height: 10px;"
|
||||||
+ "border-radius: 4px;"
|
+ "border-radius: 4px;"
|
||||||
+ "}"
|
+ "}"
|
||||||
|
|
||||||
+ "QSlider::add-page:horizontal {"
|
+ "QSlider::add-page:horizontal {"
|
||||||
+ "background: #fff;"
|
+ "background: #fff;"
|
||||||
+ "border: 1px solid #777;"
|
+ "border: 1px solid #777;"
|
||||||
+ "height: 10px;"
|
+ "height: 10px;"
|
||||||
+ "border-radius: 4px;"
|
+ "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 {"
|
+ "QSlider::handle:horizontal {"
|
||||||
+ "background: qlineargradient(x1:0, y1:0, x2:1, y2:1,"
|
+ "background: qlineargradient(x1:0, y1:0, x2:1, y2:1,"
|
||||||
+ "stop:0 #fff, stop:1 #ddd);"
|
+ "stop:0 #eee, stop:1 #ccc);"
|
||||||
+ "border: 1px solid #444;"
|
+ "border: 1px solid #777;"
|
||||||
+ "border-radius: 4px;"
|
+ "width: 13px;"
|
||||||
+ "}"
|
+ "margin-top: -2px;"
|
||||||
|
+ "margin-bottom: -2px;"
|
||||||
+ "QSlider::sub-page:horizontal:disabled {"
|
+ "border-radius: 4px;"
|
||||||
+ "background: #bbb;"
|
+ "}"
|
||||||
+ "border-color: #999;"
|
|
||||||
+ "}"
|
+ "QSlider::handle:horizontal:hover {"
|
||||||
|
+ "background: qlineargradient(x1:0, y1:0, x2:1, y2:1,"
|
||||||
+ "QSlider::add-page:horizontal:disabled {"
|
+ "stop:0 #fff, stop:1 #ddd);"
|
||||||
+ "background: #eee;"
|
+ "border: 1px solid #444;"
|
||||||
+ "border-color: #999;"
|
+ "border-radius: 4px;"
|
||||||
+ "}"
|
+ "}"
|
||||||
|
|
||||||
+ "QSlider::handle:horizontal:disabled {"
|
+ "QSlider::sub-page:horizontal:disabled {"
|
||||||
+ "background: #eee;"
|
+ "background: #bbb;"
|
||||||
+ "border: 1px solid #aaa;"
|
+ "border-color: #999;"
|
||||||
+ "border-radius: 4px;"
|
+ "}"
|
||||||
+ "}";
|
|
||||||
|
+ "QSlider::add-page:horizontal:disabled {"
|
||||||
|
+ "background: #eee;"
|
||||||
|
+ "border-color: #999;"
|
||||||
|
+ "}"
|
||||||
|
|
||||||
|
+ "QSlider::handle:horizontal:disabled {"
|
||||||
|
+ "background: #eee;"
|
||||||
|
+ "border: 1px solid #aaa;"
|
||||||
|
+ "border-radius: 4px;"
|
||||||
|
+ "}";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user