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


C++ QProgressBar::setGeometry方法代码示例

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


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

示例1: QProgressBar

MainWindow::MainWindow(QWidget *parent):QMainWindow(parent) {



    int btnWidth = 150;
    int btnHeight = 40;
    QFont font;
    font.setPointSize(50);
    font.setBold(true);

    QProgressBar *progressbar = new QProgressBar(this);
    progressbar->setGeometry(10, (3*btnHeight)+180, 200, 20);
    progressbar->setRange(0,100);

    dpy = XOpenDisplay(NULL);
    XQueryPointer(dpy,DefaultRootWindow(dpy),&root,&child,
                  &rootX,&rootY,&winX,&winY,&mask);
    fd = open(MOUSEFILE, O_RDONLY);
    if(fd == -1) {
        perror("opening device");
        exit(EXIT_FAILURE);
    }






    SearchDevicesAction = new QAction(tr("&Search"), this);

    fileMenu =  menuBar()->addMenu(tr("&File"));

    Exit = new QAction(tr("&Exit"), this);

    ViewDevices = new QAction(tr("&View Devices"), this);

    widgetMenuSearchDevices = new QPushButton("Search Devices...", this);
    widgetMenuSearchDevices->setGeometry(10, 19, btnWidth, btnHeight);

    widgetMenuViewDevices = new QPushButton("View Devices", this);
    widgetMenuViewDevices->setGeometry(10, btnHeight+20, btnWidth, btnHeight);

    widgetMenuConnect = new QPushButton("Connect...", this);
    widgetMenuConnect->setGeometry(10, (2*btnHeight)+20, btnWidth, btnHeight);

    widgetMenuExit = new QPushButton("Exit", this);
    widgetMenuExit->setGeometry(10, (3*btnHeight)+20, btnWidth, btnHeight);

    showDevices = new QTextEdit(this);
    showDevices -> setReadOnly(true);
    showDevices->setGeometry(180, 30, 410, 60);

    logLabel = new QLabel("log output:",this);
    logLabel -> setGeometry(180,10,100,15);

    temperatureLabel = new QLabel("temperature: ",this);
    temperatureLabel -> setGeometry(10,260,80,15);

    moveAreaLabel = new QLabel("Cursor movement area: ",this);
    moveAreaLabel -> setGeometry(180,95,150,15);

    mousePosX = new QLabel("x=NaN ", this);
    mousePosX -> setGeometry(180,200,50,15);

    mousePosY = new QLabel("y=NaN ", this);
    mousePosY -> setGeometry(230,200,50,15);

    //to musi byc aktualizowana na bierzaco
    tempDeegreLabel = new QLabel("-0 C",this);
    tempDeegreLabel -> setFont(font);
    tempDeegreLabel -> setGeometry(90,220,200,100);

    qApp -> installEventFilter(this);

    connect(SearchDevicesAction, SIGNAL(triggered()), this, SLOT(find()));
    connect(Exit, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(ViewDevices, SIGNAL(triggered()), this, SLOT(discovered()));
    connect(widgetMenuSearchDevices, SIGNAL(clicked()), this, SLOT(find()));
    connect(widgetMenuViewDevices, SIGNAL(clicked()), this, SLOT(discovered()));
    connect(widgetMenuConnect, SIGNAL(clicked()), this, SLOT(connectToDevice()));
    connect(widgetMenuExit, SIGNAL(clicked()), qApp, SLOT(quit()));

    fileMenu->addAction(SearchDevicesAction);
    fileMenu->addAction(Exit);
    fileMenu->addAction(ViewDevices);



    temp = new string [search.sizeOfArrayNames()];
    temp2 = new string [search.sizeOfArrayNames()];




    this->resize(630,330);
}
开发者ID:luk4as66,项目名称:SW_Project,代码行数:96,代码来源:MainWindow.cpp


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