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


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

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


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

示例1: setupUi

    void setupUi(QDialog *Dialog)
    {
    Dialog->setObjectName(QString::fromUtf8("Dialog"));
    verticalLayout = new QWidget(Dialog);
    verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
    verticalLayout->setGeometry(QRect(9, 9, 215, 89));
    vboxLayout = new QVBoxLayout(verticalLayout);
    vboxLayout->setSpacing(6);
    vboxLayout->setMargin(0);
    vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
    labelTimeLeft = new QLabel(verticalLayout);
    labelTimeLeft->setObjectName(QString::fromUtf8("labelTimeLeft"));
    vboxLayout->addWidget(labelTimeLeft);
    
    labelImages = new QLabel(verticalLayout);
    labelImages->setObjectName(QString::fromUtf8("labelImages"));
    vboxLayout->addWidget(labelImages);

    progressBar = new QProgressBar(verticalLayout);
    progressBar->setObjectName(QString::fromUtf8("progressBar"));
    progressBar->setValue(0);
    progressBar->setOrientation(Qt::Horizontal);

    vboxLayout->addWidget(progressBar);


    retranslateUi(Dialog);

    QSize size(236, 111);
    size = size.expandedTo(Dialog->minimumSizeHint());
    Dialog->resize(size);


    QMetaObject::connectSlotsByName(Dialog);
    } // setupUi
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:35,代码来源:T_index_pg.cpp

示例2: addRow

void MainWindow::addRow( int fileId, const QString &fileName, int progress )
{
    int rowId = ui->files->rowCount();

    ui->files->insertRow( rowId );
    QTableWidgetItem *id = new QTableWidgetItem( QString::number(fileId) );
    QTableWidgetItem *fn = new QTableWidgetItem( fileName );

    QWidget          *wt = new QWidget();
    QSpacerItem      *s1 = new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding );
    QSpacerItem      *s2 = new QSpacerItem(1, 7, QSizePolicy::Fixed, QSizePolicy::Expanding );
    QVBoxLayout      *lt = new QVBoxLayout( wt );
    QProgressBar     *pb = new QProgressBar( wt );
    pb->setObjectName( "PROGRESS_BAR" );
    pb->setParent( this );
    pb->setValue( progress );
    pb->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );

    lt->addSpacerItem( s1 );
    lt->addWidget( pb );
    lt->addSpacerItem( s2 );

    lt->setMargin( 0 );
    wt->setLayout( lt );

    ui->files->setItem( rowId,       0, id );
    ui->files->setItem( rowId,       1, fn );
    ui->files->setCellWidget( rowId, 2, wt );
}
开发者ID:Jille,项目名称:FBP,代码行数:29,代码来源:mainwindow.cpp

示例3: addCopy

void Progression::addCopy(QString src, QString){
	QLabel * label = new QLabel(src, this);
	label->setObjectName(src);
	label->setMaximumSize(780, 30);
	label->setGeometry(label->x(), label->y(), 780, label->height());
	QProgressBar * prog = new QProgressBar(this);
	prog->setObjectName(src);
	prog->setMaximum(QFile(src).size());
	vbl->addWidget(label);
	vbl->addWidget(prog);
	ProgressBars[label->text()] = prog;
	qDebug() << label->text();
	this->adjustSize();
}
开发者ID:ThomasAy,项目名称:Duplicateur,代码行数:14,代码来源:Progression.cpp

示例4: createWidget

QWidget* WidgetStyle::createWidget(const QString& name)
{
    if(name == "CheckBox")
    {
        QCheckBox* box = new QCheckBox("CheckBox");
        box->setObjectName("CheckBox");
        return setLayoutWidget({ box }, { 100, 30 });
    }
    else if(name == "ComboBox")
    {
        QComboBox* box = new QComboBox;
        box->addItem("Item1");
        box->addItem("Item3");
        box->addItem("Item3");
        box->setObjectName("ComboBox");
        return setLayoutWidget({ box }, { 70, 30 });
    }
    else if(name == "DateEdit")
    {
        QDateEdit* date = new QDateEdit;
        date->setObjectName("DateEdit");
        return setLayoutWidget({ date }, { 110, 40 });
    }
    else if(name == "DateTimeEdit")
    {
        QDateTimeEdit* date = new QDateTimeEdit;
        date->setObjectName("DateTimeEdit");
        return setLayoutWidget({ date }, { 160, 30 });
    }
    else if(name == "Dialog")
    {
        QDialog* dialog = new QDialog;
        dialog->setObjectName("Dialog");
        return setLayoutWidget({ dialog }, { 160, 110 });
    }
    else if(name == "DockWidget") //?
    {
        QDockWidget* widget = new QDockWidget;
        widget->setObjectName("DockWidget");
        widget->resize(61, 22);
        return widget;
    }
    else if(name == "DoubleSpinBox")
    {
        QDoubleSpinBox* box = new QDoubleSpinBox;
        box->setObjectName("DoubleSpinBox");
        return setLayoutWidget({ box }, { 90, 40 });
    }
    else if(name == "Frame") //??
    {
        QFrame* frame = new QFrame;
        frame->setObjectName("Frame");
        frame->resize(150, 100);
        return frame;
    }
    else if(name == "GroupBox")
    {
        QGroupBox* box = new QGroupBox("GroupBox");
        box->setObjectName("GroupBox");
        return setLayoutWidget({ box }, { 160, 110 });
    }
    else if(name == "Label")
    {
        QLabel* label = new QLabel("Label");
        label->setObjectName("Label");
        return setLayoutWidget({ label }, { 40, 20});
    }
    else if(name == "LineEdit")
    {
        QLineEdit* line = new QLineEdit;
        line->setObjectName("LineEdit");
        return setLayoutWidget({ line }, { 30, 30 });
    }
    else if(name == "ListView") //??
    {
        QListView* view = new QListView;
        view->setObjectName("ListView");
        view->resize(71, 71);
        return view;
    }
    else if(name == "ListWidget")
    {
        QListWidget* list = new QListWidget;
        list->setObjectName("ListWidget");
        for(int i = 0; i < 20; i++)
            list->addItem(QString("Item %1").arg(i));
        return setLayoutWidget({ list }, { 80, 80 });
    }
    else if(name == "MainWindow")
    {
        QMainWindow* window = new QMainWindow;
        window->setObjectName("MainWindow");
        return setLayoutWidget({ window }, { 160, 110 });
    }
    else if(name == "Menu")
    {
        QMenu* parentMenu = new QMenu;
        parentMenu->setObjectName("Menu");
        parentMenu->addMenu("Menu1");
        QMenu* menu1 = parentMenu->addMenu("Menu2");
//.........这里部分代码省略.........
开发者ID:kissofblood,项目名称:September,代码行数:101,代码来源:widgetstyle.cpp


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