当前位置: 首页>>代码示例>>C++>>正文


C++ QSpinBox::setStyle方法代码示例

本文整理汇总了C++中QSpinBox::setStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::setStyle方法的具体用法?C++ QSpinBox::setStyle怎么用?C++ QSpinBox::setStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QSpinBox的用法示例。


在下文中一共展示了QSpinBox::setStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

FormJqgzcs::FormJqgzcs(QParam *data,QComm *comm, QWidget *parent):
    QWidget(parent),param(data),pcomm(comm), mdstyle(new QMdStyle){
    setupUi(this);
    QWidget *widget[]={
        _1_spinBox    ,_2_spinBox    ,_3_spinBox    ,_4_spinBox ,_5_doubleSpinBox,
        _6_spinBox    ,_7_spinBox    ,_8_pushButton ,_9_spinBox ,_10_spinBox,
        _11_spinBox   ,_12_spinBox   ,_13_spinBox   ,_14_spinBox,_15_spinBox,
        _16_spinBox   ,_17_pushButton,_18_spinBox   ,_19_spinBox,_20_spinBox,
        _21_pushButton,_22_spinBox   ,_23_pushButton,_24_spinBox,_25_spinBox,
        _26_pushButton,_27_spinBox   ,_28_spinBox   ,_29_spinBox,_30_spinBox
    };

    for(unsigned int i=0;i<sizeof widget/sizeof widget[0];i++){
        int val;
        signalmapper.setMapping(widget[i],widget[i]);
        if(i<23)
            val = param->fechData(QParam::SpaItemHd_Jqgzcs,i+1);
        else
            val = param->fechData(QParam::SpaItemHd_Jqgzcs,i+2);
        switch(i){
        case 4:{
                QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox *>(widget[i]);
                doublespinbox->setValue(val/10.0);
                doublespinbox->setStyle(mdstyle);
                connect(doublespinbox,SIGNAL(valueChanged(double)),&signalmapper,SLOT(map()));
                break;
            }
        case 7:
        case 16:
        case 20:
        case 22:
        case 25:{
                QPushButton *pushbutton = qobject_cast<QPushButton *>(widget[i]);
                pushbutton->setChecked(val);
                connect(pushbutton,SIGNAL(toggled(bool)),&signalmapper,SLOT(map()));
                break;
            }
        default:{
                QSpinBox *spinbox = qobject_cast<QSpinBox *>(widget[i]);
                spinbox->setValue(val);
                spinbox->setStyle(mdstyle);
                connect(spinbox,SIGNAL(valueChanged(int)),&signalmapper,SLOT(map()));
                break;
            }
        }
    }
    connect(&signalmapper,SIGNAL(mapped(QWidget*)),SLOT(valeChanged(QWidget*)));

}
开发者ID:httpftpli,项目名称:mdimh,代码行数:49,代码来源:formjqgzcs.cpp

示例2: QWidget

FormXtcs::FormXtcs(QParam *paramdata,QComm *comm, QWidget *parent) :
    QWidget(parent),param(paramdata),pcomm(comm),mdstyle(new QMdStyle){
    setupUi(this);
    QWidget *widget[]={
        _01_spinBox  ,_02_spinBox  ,_03_spinBox   ,_04_spinBox   ,_05_spinBox,
        _06_doubleSpinBox  ,_07_doubleSpinBox     ,_08_doubleSpinBox   ,_09_spinBox   ,_10_spinBox,
        _11_spinBox  ,_12_spinBox  ,_13_spinBox   ,_14_pushButton,_15_spinBox,
        _16_spinBox  ,_17_spinBox, _18_pushButton ,_19_pushButton,_20_pushButton,
        _21_spinBox
    };
    for(int i=0;i<sizeof widget/sizeof widget[0];i++){
        int val = param->fechData(QParam::SpaItemHd_Xtcs,i);
        signalmapper.setMapping(widget[i],widget[i]);
        switch(i){
        case 13:
        case 17 ... 19:{
                QPushButton *pushbutton = qobject_cast<QPushButton *>(widget[i]);
                pushbutton->setChecked(val);
                connect(pushbutton,SIGNAL(toggled(bool)),&signalmapper,SLOT(map()));
                break;
            }
        case 5 ... 7:{
                QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox *>(widget[i]);
                doublespinbox->setValue(val/10);
                doublespinbox->setStyle(mdstyle);
                connect(doublespinbox,SIGNAL(valueChanged(double)),&signalmapper,SLOT(map()));
                break;
            }
        default:{
                QSpinBox *spinbox = qobject_cast<QSpinBox *>(widget[i]);
                (11==i)?spinbox->setValue((unsigned short)val):spinbox->setValue(val);
                spinbox->setStyle(mdstyle);
                connect(spinbox,SIGNAL(valueChanged(int)),&signalmapper,SLOT(map()));
                break;
            }
        }
    }
    connect(&signalmapper,SIGNAL(mapped(QWidget*)),SLOT(valeChanged(QWidget*)));
}
开发者ID:httpftpli,项目名称:mdimh,代码行数:39,代码来源:formxtcs.cpp


注:本文中的QSpinBox::setStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。