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


C++ QScrollArea类代码示例

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


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

示例1: createColorTab

void OptionsForm::createColorTab(QTabWidget *tab)
{
    QWidget *w = new QWidget;

    QVBoxLayout *mainLayout = new QVBoxLayout;
    w->setLayout(mainLayout);

    QFormLayout *formLayout = new QFormLayout;
    mainLayout->addLayout(formLayout);

    checkEnableColors = new QCheckBox;
    checkEnableColors->setChecked(options_.enableColors);
    formLayout->addRow(tr("Enable color:"),checkEnableColors);

    cref = new ColorRegExpForm;
    for(int i=0;i<options_.colors.size();i++)
        cref->addColorRegExp(options_.colors.at(i).regExp,
                             options_.colors.at(i).color,
                             options_.colors.at(i).weight,
                             options_.colors.at(i).italic,
                             options_.colors.at(i).isText,
                             options_.colors.at(i).caseSensitivity?Qt::CaseSensitive:Qt::CaseInsensitive,
                             options_.colors.at(i).active);

    cref->setEditFont(options_.mainFont);

    QScrollArea *area = new QScrollArea;
    area->setWidgetResizable(true);
    area->setWidget(cref);

    mainLayout->addWidget(area);

    tab->addTab(w,tr("Colors"));
}
开发者ID:lbaudouin,项目名称:TabZ,代码行数:34,代码来源:optionsform.cpp

示例2: QVBoxLayout

QWidget* Exif::SearchDialog::makeCamera()
{
    QScrollArea* view = new QScrollArea;
    view->setWidgetResizable(true);

    QWidget* w = new QWidget;
    view->setWidget( w );
    QVBoxLayout* layout = new QVBoxLayout( w );


    QList< QPair<QString, QString> > cameras = Exif::Database::instance()->cameras();
    qSort( cameras );

    for( QList< QPair<QString,QString> >::ConstIterator cameraIt = cameras.constBegin(); cameraIt != cameras.constEnd(); ++cameraIt ) {
        QCheckBox* cb = new QCheckBox( QString::fromUtf8( "%1 - %2" ).arg( (*cameraIt).first.trimmed() ).arg( (*cameraIt).second.trimmed() ) );
        layout->addWidget( cb );
        m_cameras.append( Setting< QPair<QString,QString> >( cb, *cameraIt ) );
    }

    if ( cameras.isEmpty() ) {
        QLabel* label = new QLabel( i18n("No cameras found in the database") );
        layout->addWidget( label );
    }

    return view;
}
开发者ID:KDE,项目名称:kphotoalbum,代码行数:26,代码来源:SearchDialog.cpp

示例3: QGridLayout

void SettingsBottomView::rowsInserted(
  const QModelIndex& parent, int start, int end) {
  QModelIndex index;
  QGridLayout* layout;
  QWidget* page;

  if (!parent.isValid()) {
    layout = new QGridLayout();

    layout->setHorizontalSpacing(5);
    layout->setVerticalSpacing(5);
    layout->setContentsMargins(5, 5, 5, 5);

    QScrollArea* scrollArea = new QScrollArea();

    page = new QWidget();
    page->setLayout(layout);
    page->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
    page->setMinimumSize(0, 0);

    scrollArea->setFrameStyle(QFrame::NoFrame);
    scrollArea->setWidget(page);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    stack->addWidget(scrollArea);
  }

  // Invalid insertion index will mark insertion of a group
  insertionIndex = parent;
}
开发者ID:Sylla,项目名称:updraft,代码行数:30,代码来源:settingsbottomview.cpp

示例4: connect

void DlgPreferences::addPageWidget(DlgPreferencePage* pWidget) {
    connect(this, SIGNAL(showDlg()),
            pWidget, SLOT(slotShow()));
    connect(this, SIGNAL(closeDlg()),
            pWidget, SLOT(slotHide()));
    connect(this, SIGNAL(showDlg()),
            pWidget, SLOT(slotUpdate()));

    connect(this, SIGNAL(applyPreferences()),
            pWidget, SLOT(slotApply()));
    connect(this, SIGNAL(cancelPreferences()),
            pWidget, SLOT(slotCancel()));
    connect(this, SIGNAL(resetToDefaults()),
            pWidget, SLOT(slotResetToDefaults()));

    QScrollArea* sa = new QScrollArea(pagesWidget);
    sa->setWidgetResizable(true);

    sa->setWidget(pWidget);
    pagesWidget->addWidget(sa);

    int iframe = 2 * sa->frameWidth();
    m_pageSizeHint = m_pageSizeHint.expandedTo(
            pWidget->sizeHint()+QSize(iframe, iframe));

}
开发者ID:Drakeo,项目名称:mixxx,代码行数:26,代码来源:dlgpreferences.cpp

示例5: SideBarWidget

PluginBrowser::PluginBrowser( QWidget * _parent ) :
	SideBarWidget( tr( "Instrument plugins" ),
				embed::getIconPixmap( "plugins" ).transformed( QTransform().rotate( 90 ) ), _parent )
{
	setWindowTitle( tr( "Instrument browser" ) );
	m_view = new QWidget( contentParent() );
	//m_view->setFrameShape( QFrame::NoFrame );

	addContentWidget( m_view );

	QVBoxLayout * view_layout = new QVBoxLayout( m_view );
	view_layout->setMargin( 5 );
	view_layout->setSpacing( 5 );


	QLabel * hint = new QLabel( tr( "Drag an instrument "
					"into either the Song-Editor, the "
					"Beat+Bassline Editor or into an "
					"existing instrument track." ),
								m_view );
	hint->setFont( pointSize<8>( hint->font() ) );
	hint->setWordWrap( true );

	QScrollArea* scrollarea = new QScrollArea( m_view );
	PluginDescList* descList = new PluginDescList( m_view );
	scrollarea->setWidget(descList);
	scrollarea->setWidgetResizable(true);

	view_layout->addWidget(hint);
	view_layout->addWidget(scrollarea);
}
开发者ID:diizy,项目名称:lmms,代码行数:31,代码来源:PluginBrowser.cpp

示例6: QWidget

MainWidget::MainWidget(QWidget *parent) : QWidget(parent)
{
  setFixedSize(1920, 1200);
  setWindowTitle(tr("Babel"));

  QVBoxLayout *mainLayout = new QVBoxLayout;
  QTabBar *tb;

  UiContact *contact = new UiContact(this);
  QScrollArea *contactScrollArea = new QScrollArea();
  contactScrollArea->setWidget(contact);

  _tabWidget = new QTabWidget;
  tb = _tabWidget->tabBar();

  _tabWidget->addTab(new Home(), tr("Home"));
  _tabWidget->addTab(contactScrollArea, tr("Contact"));

  std::ostringstream oss;

  _tabWidget->setTabsClosable(true);
  connect(_tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));

  tb->tabButton(0, QTabBar::RightSide)->hide();
  tb->tabButton(1, QTabBar::RightSide)->hide();

  _tabWidget->setFocusPolicy(Qt::NoFocus);

  connect(&g_PTUser, SIGNAL(receivedCall(const std::string&)), this, SLOT(receivedCall(const std::string&)));
  mainLayout->addWidget(_tabWidget);
  setLayout(mainLayout);
}
开发者ID:charvoa,项目名称:cpp_babel,代码行数:32,代码来源:MainWidget.cpp

示例7: QScrollArea

void MainWindow::OpenImage(const QString &fileName)
{
	QScrollArea* area = new QScrollArea();
	ImageWidget* img = new ImageWidget();

	// Nur les- und schreibbare Bildformate werden unterstützt
	if (img->OpenImage(fileName)) {
		QString shortFileName = ParseFileName(fileName);
		shortFileName = shortFileName.mid(0, shortFileName.lastIndexOf('.'));

		// Bild in die ScrollArea laden
		area->setWidget(img);
		area->setStyleSheet("background: qlineargradient(x1: 0, y0: 1, x2:1, y2: 0, stop: 0.96 #383838, stop: 0.99 #2e2e2e);");

		// neuen Tab hinzufügen
		int index = ui->imagetab->addTab(area, shortFileName);
		ui->imagetab->setTabToolTip(index, shortFileName);
		ui->imagetab->setCurrentIndex(index);

		// schließlich Signalhandler setzen
		connect(this, SIGNAL(Arguments(QHash<QString,QString>)), img, SLOT(Arguments(QHash<QString,QString>)));
		connect(this, SIGNAL(Operation(IOperation*,QHash<QString,QString>)), img, SLOT(Operation(IOperation*,QHash<QString,QString>)));
		connect(this, SIGNAL(Operation(IOperation*,QHash<QString,QString>,OperationType)), img, SLOT(Operation(IOperation*,QHash<QString,QString>,OperationType)));
		emit Operation(mOperation, GetArgs());
	}
开发者ID:LariscusObscurus,项目名称:ITP3_ImageProcessing,代码行数:25,代码来源:mainwindow.cpp

示例8: QWizardPage

DocumentTypeSelectionPage::DocumentTypeSelectionPage(QWidget* parent) : QWizardPage(parent)
{
    QVBoxLayout *vb = new QVBoxLayout;
    QScrollArea *scroll = new QScrollArea;
    scroll->setWidgetResizable(true);
    scroll->setFocusPolicy(Qt::NoFocus);
    scroll->setFrameShape(QFrame::NoFrame);
    scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    m_ui = new Ui::DocumentTypeSelector;
    m_ui->setupUi(scroll);

    vb->addWidget(scroll);

    setLayout(vb);

    registerField("documentsTypeSelectionPage_minimumSize", m_ui->minimumSize);
    registerField("documentsTypeSelectionPage_allLocations", m_ui->allLocations, "checked");
    registerField("documentsTypeSelectionPage_location", m_ui->location, "installationPath");
    registerField("documentsTypeSelectionPage_allDocuments", m_ui->allDocuments);
    registerField("documentsTypeSelectionPage_audioDocuments", m_ui->audioDocuments);
    registerField("documentsTypeSelectionPage_imageDocuments", m_ui->imageDocuments);
    registerField("documentsTypeSelectionPage_textDocuments", m_ui->textDocuments);
    registerField("documentsTypeSelectionPage_videoDocuments", m_ui->videoDocuments);

    connect(m_ui->allDocuments, SIGNAL(clicked(bool)), this, SLOT(alltypes(bool)));
    connect(m_ui->allDocuments, SIGNAL(clicked()), this, SIGNAL(completeChanged()));
    connect(m_ui->audioDocuments, SIGNAL(clicked()), this, SIGNAL(completeChanged()));
    connect(m_ui->imageDocuments, SIGNAL(clicked()), this, SIGNAL(completeChanged()));
    connect(m_ui->textDocuments, SIGNAL(clicked()), this, SIGNAL(completeChanged()));
    connect(m_ui->videoDocuments, SIGNAL(clicked()), this, SIGNAL(completeChanged()));
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:32,代码来源:cleanupwizard.cpp

示例9: f

void RenderWindow::slotMenuAboutNews()
{
	QString filename = systemData.docDir + "NEWS";

	QFile f(filename);
	QString text = "";
	if (f.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		text = f.readAll();
	}

	QLabel *label = new QLabel;
	label->setText(text);
	label->setWordWrap(true);
	label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);

	QScrollArea *scroll = new QScrollArea();
	scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	scroll->setWidget(label);
	scroll->setWidgetResizable(true);

	QHBoxLayout *layout = new QHBoxLayout();
	layout->addWidget(scroll);
	QDialog *dialog = new QDialog();
	dialog->setLayout(layout);
	dialog->setWindowTitle(QObject::tr("News"));
	dialog->show();
}
开发者ID:mancoast,项目名称:mandelbulber2,代码行数:28,代码来源:render_window_menu.cpp

示例10: QWidget

SymbolDialog::SymbolDialog(QWidget* parent)
   : QWidget(parent, Qt::WindowFlags(Qt::Dialog | Qt::Window))
      {
      setupUi(this);
      int idx = 0;
      int currentIndex = 0;
      for (const ScoreFont& f : ScoreFont::scoreFonts()) {
            fontList->addItem(f.name());
            if (f.name() == "Bravura")
                  currentIndex = idx;
            ++idx;
            }
      fontList->setCurrentIndex(currentIndex);

      setWindowTitle(tr("MuseScore: Symbols"));
      QLayout* l = new QVBoxLayout();
      frame->setLayout(l);
      createSymbolPalette();

      QScrollArea* sa = new PaletteScrollArea(sp);
      l->addWidget(sa);

      sp->setAcceptDrops(false);
      sp->setDrawGrid(true);
      sp->setSelectable(true);


      connect(systemFlag, SIGNAL(stateChanged(int)), SLOT(systemFlagChanged(int)));
      connect(fontList, SIGNAL(currentIndexChanged(int)), SLOT(systemFontChanged(int)));

      sa->setWidget(sp);
      }
开发者ID:WeiChou,项目名称:MuseScore,代码行数:32,代码来源:symboldialog.cpp

示例11: Dialog

NetworkProxyDialog::NetworkProxyDialog(QWidget *parent) :
    Dialog(parent),
    m_proxyTypeSelector(new ValueSelector(tr("Proxy type"), this)),
    m_hostEdit(new QLineEdit(this)),
    m_portEdit(new QLineEdit(this)),
    m_userEdit(new QLineEdit(this)),
    m_passEdit(new QLineEdit(this))
{
    setWindowTitle(tr("Network proxy"));
    
    m_proxyTypeSelector->setModel(new NetworkProxyTypeModel(this));
    m_proxyTypeSelector->setValue(Settings::instance()->networkProxyType());

    m_hostEdit->setMinimumWidth(380);
    m_hostEdit->setText(Settings::instance()->networkProxyHost());
    m_portEdit->setValidator(new QIntValidator(0, 100000, this));
    m_portEdit->setText(QString::number(Settings::instance()->networkProxyPort()));
    m_passEdit->setEchoMode(QLineEdit::Password);
    m_passEdit->setText(Settings::instance()->networkProxyPassword());
    m_userEdit->setText(Settings::instance()->networkProxyUsername());

    QGroupBox *proxyGroup = new QGroupBox(tr("Use network proxy"), this);
    proxyGroup->setCheckable(true);
    proxyGroup->setChecked(Settings::instance()->networkProxyEnabled());
    
    QGridLayout *proxyGrid = new QGridLayout(proxyGroup);
    proxyGrid->setContentsMargins(0, 0, 0, 0);
    proxyGrid->addWidget(m_proxyTypeSelector, 0, 0, 1, 2);
    proxyGrid->addWidget(new QLabel(tr("Host"), this), 1, 0, 1, 1);
    proxyGrid->addWidget(new QLabel(tr("Port"), this), 1, 1, 1, 1);
    proxyGrid->addWidget(m_hostEdit, 2, 0, 1, 1);
    proxyGrid->addWidget(m_portEdit, 2, 1, 1, 1);
    proxyGrid->addWidget(new QLabel(tr("Username"), this), 3, 0, 1, 2);
    proxyGrid->addWidget(m_userEdit, 4, 0, 1, 2);
    proxyGrid->addWidget(new QLabel(tr("Password"), this), 5, 0, 1, 2);
    proxyGrid->addWidget(m_passEdit, 6, 0, 1, 2);

    QWidget *scrollWidget = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout(scrollWidget);
    vbox->setContentsMargins(0, 0, 0, 0);
    vbox->addWidget(proxyGroup);
    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    scrollArea->setWidget(scrollWidget);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Vertical, this);
    QHBoxLayout *hbox = new QHBoxLayout(this);
    hbox->addWidget(scrollArea);
    hbox->addWidget(buttonBox);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(proxyGroup, SIGNAL(toggled(bool)), Settings::instance(), SLOT(setNetworkProxyEnabled(bool)));
    connect(m_proxyTypeSelector, SIGNAL(valueChanged(QVariant)), this, SLOT(setNetworkProxyType(QVariant)));
    connect(m_hostEdit, SIGNAL(textEdited(QString)), Settings::instance(), SLOT(setNetworkProxyHost(QString)));
    connect(m_portEdit, SIGNAL(textEdited(QString)), this, SLOT(setNetworkProxyPort(QString)));
    connect(m_userEdit, SIGNAL(textEdited(QString)), Settings::instance(), SLOT(setNetworkProxyUsername(QString)));
    connect(m_passEdit, SIGNAL(textEdited(QString)), Settings::instance(), SLOT(setNetworkProxyPassword(QString)));
}
开发者ID:freemangordon,项目名称:cutetube2,代码行数:59,代码来源:networkproxydialog.cpp

示例12: InitializeMainWindowScrollBar

void
MainWindow::
InitializeMainWindowScrollBar() {

    QScrollArea* scrollArea = new QScrollArea();
    scrollArea->setWidget(ui->scrollableRegion);
    setCentralWidget(scrollArea);
}
开发者ID:sangbomkoh,项目名称:R2,代码行数:8,代码来源:mainwindow.cpp

示例13: QStackedWidget

void SettingsBottomView::createEditors() {
  QModelIndex index;
  QGridLayout* layout;

  if (!model()) {
    return;
  }

  delete stack;
  stack = new QStackedWidget(this);

  for (int page = 0; page < model()->rowCount(); ++page) {
    layout = new QGridLayout();

    // Create labels and editors
    index = model()->index(page, 0);
    int row;
    for (row = 0; row < model()->rowCount(index); ++row) {
      QModelIndex child = model()->index(row, 0, index);
      QString description = getSettingDescription(child);

      QLabel* label = new QLabel(description, NULL);
      label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
      layout->addWidget(label, row, 0);

      QWidget* editor = createEditorForIndex(child);
      editor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
      layout->addWidget(editor, row, 1);

      editor->show();
    }

    // Adding a stretcher at the bottom of all settings
    QWidget* dummy = new QWidget();
    layout->addWidget(dummy, row, 0);
    layout->setRowStretch(row, 1);

    // Setting space on the page
    layout->setHorizontalSpacing(5);
    layout->setVerticalSpacing(5);
    layout->setContentsMargins(5, 5, 5, 5);

    QScrollArea* scrollArea = new QScrollArea();

    QWidget* pageWidget = new QWidget();
    pageWidget->setLayout(layout);
    pageWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
    pageWidget->setMinimumSize(0, 0);

    scrollArea->setFrameStyle(QFrame::NoFrame);
    scrollArea->setWidget(pageWidget);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    stack->addWidget(scrollArea);
  }

  this->layout()->addWidget(stack);
}
开发者ID:Sylla,项目名称:updraft,代码行数:58,代码来源:settingsbottomview.cpp

示例14: QDialog

Save::Save(QWidget *parent) : QDialog(parent)
{
	img = 0;
	setModal(false);
	setWindowFlags(Qt::Window);

	QHBoxLayout *layout = new QHBoxLayout(this);

	QVBoxLayout *sLayout = new QVBoxLayout;
	layout->addLayout(sLayout);

	QGroupBox *gbBlock = new QGroupBox(tr("Block size"));
	sLayout->addWidget(gbBlock);
	QHBoxLayout *gbBlockLayout = new QHBoxLayout(gbBlock);
	gbBlockLayout->addWidget(spBlockSize[0] = new QSpinBox);
	gbBlockLayout->addWidget(new QLabel(tr("x")));
	gbBlockLayout->addWidget(spBlockSize[1] = new QSpinBox);
	for (int i = 0; i != 2; i++) {
		spBlockSize[i]->setMinimum(1);
		spBlockSize[i]->setMaximum(2048);
		spBlockSize[i]->setValue(DEFSZ);
	}

	QGroupBox *gbCount = new QGroupBox(tr("Block count"));
	sLayout->addWidget(gbCount);
	QHBoxLayout *gbCountLayout = new QHBoxLayout(gbCount);
	gbCountLayout->addWidget(spBlockCount[0] = new QSpinBox);
	gbCountLayout->addWidget(new QLabel(tr("x")));
	gbCountLayout->addWidget(spBlockCount[1] = new QSpinBox);
	for (int i = 0; i != 2; i++) {
		spBlockCount[i]->setMinimum(1);
		spBlockCount[i]->setMaximum(1000);
		spBlockCount[i]->setValue(DEFCNT);
	}

	sLayout->addWidget(lFinalRes = new QLabel);

	QPushButton *pbRender = new QPushButton(tr("Render"));
	sLayout->addWidget(pbRender);

	QPushButton *pbSave = new QPushButton(tr("Save image"));
	sLayout->addWidget(pbSave);

	layout->addWidget(lwProgess = new QListWidget);

	QScrollArea *saOutput = new QScrollArea;
	saOutput->setBackgroundRole(QPalette::Dark);
	saOutput->setWidget(lOutput = new QLabel);
	layout->addWidget(saOutput, 4);

	for (int i = 0; i != 2; i++) {
		connect(spBlockSize[i], SIGNAL(valueChanged(int)), this, SLOT(updateRes()));
		connect(spBlockCount[i], SIGNAL(valueChanged(int)), this, SLOT(updateRes()));
	}
	connect(pbRender, SIGNAL(clicked(bool)), this, SLOT(render()));
	connect(pbSave, SIGNAL(clicked(bool)), this, SLOT(save()));
	updateRes();
}
开发者ID:zhiyb,项目名称:MathPic,代码行数:58,代码来源:save.cpp

示例15: resizeEvent

void SettingsBottomView::resizeEvent(QResizeEvent* event) {
  int pages = stack->count();

  for (int p = 0; p < pages; ++p) {
    QScrollArea* scrollArea = qobject_cast<QScrollArea*>(stack->widget(p));
    QWidget* page = scrollArea->widget();
    page->setFixedWidth(scrollArea->width());
  }
}
开发者ID:Sylla,项目名称:updraft,代码行数:9,代码来源:settingsbottomview.cpp


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