Пример #1
0
Power::Power(QWidget *parent)
    : QWidget(parent)
{
    /*setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint
               | Qt::WindowCloseButtonHint);
    setAttribute(Qt::WA_TranslucentBackground);*/

    checked = false;
    mPress = false;
    hover = false;
    timer = new QTimer(this);
    connect(timer,SIGNAL(timeout()),this,SLOT(timerout()),Qt::DirectConnection);
    //按钮尺寸自己调
    setFixedSize(60,30);
    framed = 6;//阴影框与按钮框的间距
    resizePainter();

   //字体设置和文字设置 自己DIY
    QFont font1 = this->font();
    font1.setBold(true);
    font1.setPointSize(13);
    setFont(font1);
    setText();
    setspeed(50);//设置滑动速度
}
Пример #2
0
mockcommonPrivate::mockcommonPrivate()
    : QObject(),prevts(50), firstRun(0)
{
    readTimer = new QTimer(this);
    readTimer->setSingleShot(true);
    connect(readTimer,SIGNAL(timeout()),this,SLOT(timerout()));
}
Пример #3
0
void ControlBar::setupConnection(){
    connect(timer,SIGNAL(timeout()),this,SLOT(timerout()));
    connect(playSlider,SIGNAL(sliderPressed()),this,SLOT(playSliderPressed()));
    connect(playSlider,SIGNAL(sliderReleased()),this,SLOT(playSliderReleased()));
    connect(volumeSlider,SIGNAL(valueChanged(int)),player,SLOT(changeVolume(int)));
    connect(player,SIGNAL(volumeChanged(int)),volumeSlider,SLOT(setValue(int)));
    connect(playBtn,SIGNAL(clicked()),player,SLOT(playOrPause()));
    connect(player,SIGNAL(stateChanged(MPlayerState)),this,SLOT(stateChanged(MPlayerState)));
    connect(player,SIGNAL(streamPositionChanged(double)),this,SLOT(changePlaySliderPosisition(double)));
    connect(fullScreenBtn,SIGNAL(clicked()),parent,SLOT(toggleFullScreen()));
    connect(subtitleBtn,SIGNAL(clicked()),this,SLOT(loadSubtitle()));
}