コード例 #1
0
ファイル: main.cpp プロジェクト: DenisLaky/QtProjects
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    Widget mainWindow;
    QDial *newDial = new QDial;
    QProgressBar *newProgressBar = new QProgressBar;

      newDial->setRange(0,100);
      newDial->setNotchTarget(5);
      newDial->setNotchesVisible(true);
      newDial->setPageStep(20);

   QObject::connect(newDial,SIGNAL(valueChanged(int)),newProgressBar,SLOT(setValue(int)));

   QBoxLayout *boxLayout = new QBoxLayout(QBoxLayout::TopToBottom);
     boxLayout->addWidget(newDial);
     boxLayout->addWidget(newProgressBar);

     mainWindow.setWindowTitle("Dial Change");
     mainWindow.setLayout(boxLayout);
     mainWindow.setGeometry(430,330,200,200);
     mainWindow.show();


    return a.exec();
}
コード例 #2
0
ファイル: QtlDial.cpp プロジェクト: Wushaowei001/NAF
int Dial::setNotchTarget(lua_State * L) //  double target 
{
	QDial* obj = QtObject<QDial>::check( L, 1);
	obj->setNotchTarget(Util::toDbl( L, 2 ));
	return 0;
}