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


C++ QSplitter::setStretchFactor方法代码示例

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


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

示例1: QSplitter

MainWindow::MainWindow(Sampler* sampler)
: m_sampler(sampler), m_view(NULL), m_lut_index(-1)
, m_seed(0), m_spaceSize(0.21), m_min_density(1), m_max_density(4e3), m_min_level(0), m_max_level(1), m_min_rank(0), m_max_rank(1), m_offsetInterpolate(true), m_dither(true)
, m_crop(true)
, m_DFunc(&dFunc_constant), m_image()//"data/img/butterfly.png")
{
	//~ qRegisterMetaType<PickedValue>("PickedValue");

	//main window properties
	this->resize(1024, 700);
	this->setWindowTitle(tr("Sampler"));

	//splitter ( view | options )
	QSplitter* splitter = new QSplitter();
	this->setCentralWidget(splitter);

	m_view = new PointSetView();
	createOptionPanel();
	splitter->addWidget(m_view);
	splitter->setStretchFactor(0,1);
	splitter->addWidget(options);
	splitter->setStretchFactor(1,0);

	setDensityMin();
	setDensityMax();

	createStatusBar();
	connect(m_view, SIGNAL(pointsetCursorMoved(float, float)), this, SLOT(showCoordinates(float, float)));
}
开发者ID:herculesyuan,项目名称:sampler,代码行数:29,代码来源:window.cpp

示例2: str

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    QVBoxLayout *layout = new QVBoxLayout;
    QSplitter *vsplit = new QSplitter(Qt::Vertical);
    layout->addWidget(vsplit);

    QSplitter *hsplit = new QSplitter;

    QVBoxLayout *settingsLayout = new QVBoxLayout;
    addVersions(settingsLayout);
    addProfiles(settingsLayout);
    addOptions(settingsLayout);
    addRenderableTypes(settingsLayout);
    hsplit->addWidget(widgetWithLayout(settingsLayout));

    QVBoxLayout *outputLayout = new QVBoxLayout;
    m_output = new QTextEdit;
    m_output->setReadOnly(true);
    outputLayout->addWidget(m_output);
    m_extensions = new QTextEdit;
    m_extensions->setReadOnly(true);
    outputLayout->addWidget(m_extensions);
    hsplit->addWidget(widgetWithLayout(outputLayout));

    hsplit->setStretchFactor(0, 4);
    hsplit->setStretchFactor(1, 6);
    vsplit->addWidget(hsplit);

    m_renderWindowLayout = new QVBoxLayout;
    vsplit->addWidget(widgetWithLayout(m_renderWindowLayout));
    vsplit->setStretchFactor(1, 5);

    m_renderWindowContainer = new QWidget;
    addRenderWindow();

    QString description;
    QTextStream str(&description);
    str << "Qt " << QT_VERSION_STR << ' ' << QGuiApplication::platformName();
    const char *openGlVariables[] =
        {"QT_ANGLE_PLATFORM", "QT_OPENGL", "QT_OPENGL_BUGLIST", "QT_OPENGL_DLL"};
    const size_t variableCount = sizeof(openGlVariables) / sizeof(openGlVariables[0]);
    for (size_t v = 0; v < variableCount; ++v) {
        if (qEnvironmentVariableIsSet(openGlVariables[v]))
            str << ' ' << openGlVariables[v] << '=' << qgetenv(openGlVariables[v]);
    }
    if (QCoreApplication::testAttribute(Qt::AA_UseOpenGLES))
        str << " Qt::AA_UseOpenGLES";
    if (QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL))
        str << " Qt::AA_UseSoftwareOpenGL";
    if (QCoreApplication::testAttribute(Qt::AA_UseDesktopOpenGL))
        str << " Qt::AA_UseSoftwareOpenGL";
    layout->addWidget(new QLabel(description));

    setLayout(layout);
}
开发者ID:RSATom,项目名称:Qt,代码行数:56,代码来源:widget.cpp

示例3: QWidget

    QueryWidget::QueryWidget(IServerSPtr server, QWidget* parent)
        : QWidget(parent)
    {
        shellWidget_ = new BaseShellWidget(server);
        outputWidget_ = new OutputWidget(server);

        VERIFY(connect(shellWidget_, &BaseShellWidget::rootCreated, outputWidget_, &OutputWidget::rootCreate));
        VERIFY(connect(shellWidget_, &BaseShellWidget::rootCompleated, outputWidget_, &OutputWidget::rootCompleate));

        VERIFY(connect(shellWidget_, &BaseShellWidget::addedChild, outputWidget_, &OutputWidget::addChild));
        VERIFY(connect(shellWidget_, &BaseShellWidget::itemUpdated, outputWidget_, &OutputWidget::itemUpdate));

        QSplitter* splitter = new QSplitter;
#ifdef OS_WIN
        splitter->setStyleSheet("QSplitter::handle { background-color: gray }");
#endif
        splitter->setOrientation(Qt::Vertical);
        splitter->setHandleWidth(1);

        QVBoxLayout *mainLayout = new QVBoxLayout;
        splitter->addWidget(shellWidget_);
        splitter->addWidget(outputWidget_);
        splitter->setStretchFactor(0, 0);
        splitter->setStretchFactor(1, 1);
        mainLayout->addWidget(splitter);
        setMinimumSize(QSize(min_width, min_height));

        setLayout(mainLayout);
    }
开发者ID:tempbottle,项目名称:fastonosql,代码行数:29,代码来源:query_widget.cpp

示例4: QGLViewer

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

	setMinimumSize(20, 20);
	resize(1500, 900); 

	glViewer = new QGLViewer(this);

	m_parameter_control = new ParameterControl(glViewer, this);	

	createActions();
	createMenus();
	createToolBars();

	QList <int> sizes;
	sizes<<1200<<300;
	QSplitter* mainSplitter = new QSplitter(Qt::Horizontal);
	mainSplitter->addWidget(glViewer);
	mainSplitter->addWidget(m_parameter_control);
    mainSplitter->setSizes(sizes);
	mainSplitter->setStretchFactor(0, 1);

	setCentralWidget(mainSplitter);

	setWindowTitle("Parameter");
}
开发者ID:hywei,项目名称:MultiChart-Parameterization,代码行数:26,代码来源:MainWindow.cpp

示例5: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QFont font("ZYSong18030",12);
    a.setFont(font);
    //主分割窗口
    QSplitter *splitterMain =new QSplitter(Qt::Horizontal,0);
    QTextEdit *textLeft =new QTextEdit(QObject::tr("Left Widget"),splitterMain);
    textLeft->setAlignment(Qt::AlignCenter);
    //右部分割窗口
    QSplitter *splitterRight =new QSplitter(Qt::Vertical,splitterMain);
    splitterRight->setOpaqueResize(false);
    QTextEdit *textUp =new QTextEdit(QObject::tr("Top Widget"),splitterRight);
    textUp->setAlignment(Qt::AlignCenter);
    QTextEdit *textBottom =new QTextEdit(QObject::tr("Bottom Widget"),splitterRight);
    textBottom->setAlignment(Qt::AlignCenter);
    splitterMain->setStretchFactor(1,1);
    splitterMain->setWindowTitle(QObject::tr("Splitter"));
    splitterMain->show();

    //MainWindow w;
    //w.show();
    
    return a.exec();
}
开发者ID:Pengfei-Gao,项目名称:develop-reference-data,代码行数:25,代码来源:main.cpp

示例6: QWidget

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
        ui->setupUi(this);

        setFixedSize(750, 500); // 窗口大小
        ui->stackedWidget->setCurrentIndex(0);

        QSqlQueryModel *typeModel = new QSqlQueryModel(this);
        typeModel->setQuery("select name from type");
        ui->sellTypeComboBox->setModel(typeModel);

        QSplitter *splitter = new QSplitter(ui->managePage);
        splitter->resize(700, 360);
        splitter->move(0, 50);

        splitter->addWidget(ui->toolBox);
        splitter->addWidget(ui->dailyList);
        splitter->setStretchFactor(0, 1);
        splitter->setStretchFactor(1, 1);

        on_sellCancelBtn_clicked();

        showDailyList();
}
开发者ID:github-jxm,项目名称:QtCrearor_fast_learn,代码行数:26,代码来源:widget.cpp

示例7: createLayout

void IrcClient::createLayout()
{
    setWindowTitle(tr("Communi %1 example client").arg(IRC_VERSION_STR));

    // a read-only text editor for showing the messages
    textEdit = new QTextEdit(this);
    textEdit->setReadOnly(true);

    // a line editor for entering commands
    lineEdit = new QLineEdit(this);
    lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
    textEdit->setFocusProxy(lineEdit);
    connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(onTextEntered()));
    connect(lineEdit, SIGNAL(textEdited(QString)), this, SLOT(onTextEdited()));

    // the rest is just setting up the UI layout...
    QSplitter* splitter = new QSplitter(this);
    splitter->setHandleWidth(1);
    splitter->addWidget(textEdit);
    splitter->addWidget(userList);
    splitter->setStretchFactor(0, 5);
    splitter->setStretchFactor(1, 1);

    QWidget* container = new QWidget(this);
    QVBoxLayout* layout = new QVBoxLayout(container);
    layout->setSpacing(0);
    layout->setMargin(0);
    layout->addWidget(splitter);
    layout->addWidget(lineEdit);

    addWidget(container);

    setHandleWidth(1);
}
开发者ID:anselmolsm,项目名称:libcommuni,代码行数:34,代码来源:ircclient.cpp

示例8: setupViews

void ReportView::setupViews()
{
    QSplitter *splitter = new QSplitter;
    table_ = new QTableView;
    pie_chart_ = new PieView(row_count_, total_value_);
    splitter->addWidget(table_);
    splitter->addWidget(pie_chart_);
    splitter->setStretchFactor(0, 0);
    splitter->setStretchFactor(1, 1);

    table_->setModel(model_view_);
    pie_chart_->setModel(model_);
    if(report_info_.report_type_ == ReportInfo::USEFUL){
        table_->hideColumn(1);
    }

    QItemSelectionModel *selectionModel = new QItemSelectionModel(model_);
    QItemSelectionModel *selectionModel_view = new QItemSelectionModel(model_view_);
    table_->setSelectionModel(selectionModel_view);
    pie_chart_->setSelectionModel(selectionModel);

    QHeaderView *headerView = table_->horizontalHeader();
    headerView->setStretchLastSection(true);

    setCentralWidget(splitter);

}
开发者ID:vovak,项目名称:bigbro,代码行数:27,代码来源:reportview.cpp

示例9: QSplitter

void
MainWindow::updateWindow(){

	QSplitter		*mainSplitter = new QSplitter( Qt::Vertical );
	QSplitter       *upSplitter =  new QSplitter( Qt::Horizontal );
	upSplitter->addWidget( molTreeViewer );
	upSplitter->addWidget( molViewer );
	upSplitter->setStretchFactor(0, 8);
	upSplitter->setStretchFactor(1, 20);
	mainSplitter->addWidget(upSplitter);
	mainSplitter->addWidget(termEdit);
	mainSplitter->setStretchFactor(0, 20);
	mainSplitter->setStretchFactor(1, 2);

	setCentralWidget( mainSplitter );
}
开发者ID:xushutan,项目名称:aDock,代码行数:16,代码来源:window.cpp

示例10: createPanel

void MainWindow::createPanel()
{
  QSplitter *splitter = new QSplitter;
  //-- Create left panel
  m_tabWidget = new QTabWidget;
  //-- Create right panel
  m_widget = new control_point_GUI::GraphicsMainWindow(m_doc, this);
  splitter->addWidget(m_tabWidget);
  splitter->addWidget(m_widget);
  splitter->setStretchFactor(0, 0);
  splitter->setStretchFactor(1, 1);
  setCentralWidget(splitter);

  //-- Add tab inside the m_tabWidget
  m_tab_1 = new QWidget;
  m_tab_1->setObjectName(QString::fromUtf8("m_tab_1"));
  m_tabWidget->addTab(m_tab_1, QString());
  m_tabWidget->setTabText(m_tabWidget->indexOf(m_tab_1), "ImageList");

  //-- Configure tab widgets
  m_treeView_Images = new QTreeView(m_tab_1);
  m_treeView_Images->setRootIsDecorated(false);
  m_treeView_Images->setEditTriggers(QAbstractItemView::NoEditTriggers);
  m_treeView_Images->setObjectName(QString::fromUtf8("m_treeView_Images"));
  m_treeView_Images->setSortingEnabled(true);

  QGridLayout * gridLayout1 = new QGridLayout(m_tab_1);
  gridLayout1->addWidget(m_treeView_Images, 0, 0, 1, 1);
}
开发者ID:DirSch,项目名称:openMVG,代码行数:29,代码来源:mainLayout.cpp

示例11: setupWindowButtons

    void MainWindow::setupWindowButtons()
    {
        m_videoDetailsList->setStyleSheet("QWidget{height: 20px;}");

        QWidget *widget = new QWidget;
        QVBoxLayout *vLayout = new QVBoxLayout( widget );
        vLayout->addWidget( m_filterList, 1 );
        vLayout->addWidget( m_filterByUploadDateButton );
        vLayout->addWidget( m_filterByTypeButton );
        vLayout->addWidget( m_filterByDurationButton );
        vLayout->addWidget( m_filterByFeaturesButton );
        vLayout->addWidget( m_filterBySortButton );

        QSplitter *splitter = new QSplitter( Qt::Vertical );
        splitter->addWidget( m_videoDisplayTable );
        splitter->addWidget( m_videoDetailsList );
        splitter->setStretchFactor( 0, 1 );

        QSplitter *new_splitter = new QSplitter( Qt::Horizontal );
        new_splitter->addWidget( widget );
        new_splitter->addWidget( splitter );
        new_splitter->setStretchFactor( 1, 1 );

        m_filterByUploadDateButton->click();
        setCentralWidget( new_splitter );
    }
开发者ID:karllen,项目名称:Hend_Old,代码行数:26,代码来源:mainwindow.cpp

示例12: setWindowTitle

MainWindow::MainWindow(Application *app):
    m_app(app)
{
    setWindowTitle(qApp->applicationName());
    connect(app, &Application::error, this, &MainWindow::onError);

    QSplitter* splitter = new QSplitter(this);

    m_pages = new QTabWidget(splitter);
    m_pages->setDocumentMode(true);
    m_pages->setTabsClosable(true);
    m_pages->setMovable(true);
    m_pages->setTabBarAutoHide(true);
    m_pages->setTabPosition(QTabWidget::South);
    connect(m_pages, &QTabWidget::tabCloseRequested, this, &MainWindow::onCloseRequested);
    connect(m_pages, &QTabWidget::currentChanged, this, &MainWindow::onCurrentChanged);

    m_trees = new QStackedWidget(splitter);

    splitter->addWidget(m_trees);
    splitter->addWidget(m_pages);
    splitter->setStretchFactor(0, 0);
    splitter->setStretchFactor(1, 1);

    setCentralWidget(splitter);

    createActions();
    createMenus();
    createToolBars();
    createStatusBar();
    readSettings();

    newDoc();
}
开发者ID:guervillep,项目名称:Kunie,代码行数:34,代码来源:MainWindow.cpp

示例13: QMainWindow

MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
    : QMainWindow(parent, flags)
{
  QSplitter *splitter = new QSplitter(this);
  splitter->setStretchFactor(1, 5);

  m_designWidget = new DesignWidget(splitter);

  m_tabWidget = new QTabWidget(splitter);
  m_tabWidget->sizePolicy().setHorizontalPolicy(QSizePolicy::Expanding);

  createOutputTab("Output", "Click Generate to create output");

  setCentralWidget(splitter);

  connect(m_designWidget, SIGNAL(generateClicked(bool)),
          SLOT(generateOutput()));

  m_engine = new Grantlee::Engine(this);
  m_engine->setPluginPaths(QStringList() << GRANTLEE_PLUGIN_PATH
                                         << ":/plugins");
  m_engine->addDefaultLibrary("grantlee_scriptabletags");
  m_engine->setSmartTrimEnabled(true);

  m_loader = QSharedPointer<Grantlee::FileSystemTemplateLoader>(
      new Grantlee::FileSystemTemplateLoader);
  m_loader->setTemplateDirs(QStringList() << ":/templates");
  m_engine->addTemplateLoader(m_loader);
  m_engine->addDefaultLibrary("custom_tags");
}
开发者ID:aodkrisda,项目名称:grantlee,代码行数:30,代码来源:mainwindow.cpp

示例14: AbstractPage

ResultsPage::ResultsPage(QWidget * parent)
    : AbstractPage(parent), m_outputCatalog(0), m_selectedOutput(0)
{
    m_statsNeedUpdate = false;

    QSplitter* splitter = new QSplitter;

    splitter->addWidget(createOutputGroup());
    splitter->setStretchFactor(0, 1);

    splitter->addWidget(createDataTabWidget());
    splitter->setStretchFactor(1, 4);

    QHBoxLayout* layout = new QHBoxLayout;
    layout->addWidget(splitter);
    setLayout(layout);

    createContextMenu();
}
开发者ID:arkottke,项目名称:strata,代码行数:19,代码来源:ResultsPage.cpp

示例15: createMainWidgets

void UimPrefDialog::createMainWidgets()
{
    QVBoxLayout *mainVLayout = new QVBoxLayout( this );
    mainVLayout->setMargin( 6 );

    QSplitter *mainSplitter = new QSplitter( this );

    /* ListView */
    m_groupListView = new QTreeWidget( mainSplitter );
    m_groupListView->setRootIsDecorated( false );
    m_groupListView->setHeaderLabel( _("Group") );
    m_groupListView->setSelectionMode( QAbstractItemView::SingleSelection );
    connect( m_groupListView, SIGNAL(itemSelectionChanged()),
                      this, SLOT(slotItemSelectionChanged()) );

    /* Contents Frame */
    m_rightSideWidget = new QScrollArea( mainSplitter );
    m_rightSideWidget->setWidgetResizable( true );
    m_groupWidgetStack = new QStackedWidget;

    /* Buttons */
    QWidget *buttonHWidget = new QWidget( this );
    buttonHWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed);
    QHBoxLayout *buttonHLayout = new QHBoxLayout( buttonHWidget );
    buttonHLayout->setMargin( 6 );
    buttonHLayout->setSpacing( 6 );
    QPushButton *defaultButton = new QPushButton( _("Defaults"), buttonHWidget );
    connect( defaultButton, SIGNAL(clicked()),
                      this, SLOT(slotSetDefault()) );
    QPushButton *okButton = new QPushButton( _("OK"), buttonHWidget );
    connect( okButton, SIGNAL(clicked()),
                      this, SLOT(slotOK()) );
    m_applyButton = new QPushButton( _("Apply"), buttonHWidget );
    m_applyButton->setEnabled( false );
    connect( m_applyButton, SIGNAL(clicked()),
                      this, SLOT(slotApply()) );
    QPushButton *cancelButton = new QPushButton( _("Cancel"), buttonHWidget );
    connect( cancelButton, SIGNAL(clicked()),
                      this, SLOT(slotCancel()) );
    buttonHLayout->addWidget( defaultButton );
    buttonHLayout->addStretch();
    buttonHLayout->addWidget( okButton );
    buttonHLayout->addWidget( m_applyButton );
    buttonHLayout->addWidget( cancelButton );

    QFrame *separator = new QFrame( this );
    separator->setFrameShape( QFrame::HLine );
    separator->setFrameShadow( QFrame::Sunken );
    mainVLayout->setMargin( 0 );
    mainVLayout->addWidget( mainSplitter );
    mainVLayout->addWidget( separator );
    mainVLayout->addWidget( buttonHWidget );

    mainSplitter->setStretchFactor( 1, 1 );
}
开发者ID:m8a,项目名称:uim,代码行数:55,代码来源:qt4.cpp


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