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());
	}
Example #2
0
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;
}
Example #3
0
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"));
}
Example #4
0
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;
}
Example #5
0
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);
}
Example #6
0
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));

}
Example #7
0
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);
}
Example #8
0
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()));
}
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();
}
Example #10
0
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);
      }
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)));
}
Example #12
0
void
MainWindow::
InitializeMainWindowScrollBar() {

    QScrollArea* scrollArea = new QScrollArea();
    scrollArea->setWidget(ui->scrollableRegion);
    setCentralWidget(scrollArea);
}
Example #13
0
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);
}
Example #14
0
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();
}
Example #15
0
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());
  }
}
Example #16
0
DuplicateMerger::DuplicateMerger(QWidget *parent) : QDialog(parent)
{
    setAttribute(Qt::WA_DeleteOnClose);
    resize(800,600);

    QWidget* top = new QWidget(this);
    QVBoxLayout* topLayout = new QVBoxLayout(top);
    setLayout(topLayout);
    topLayout->addWidget(top);

    QString txt = i18n("<p>Below is a list of all images that are duplicate in your database.<br/>"
                       "Select which you want merged, and which of the duplicates should be kept.<br/>"
                       "The tag and description from the deleted images will be transferred to the kept image</p>");
    QLabel* label = new QLabel(txt);
    QFont fnt = font();
    fnt.setPixelSize(18);
    label->setFont(fnt);
    topLayout->addWidget(label);

    m_trash = new QRadioButton(i18n("Move to &trash"));
    m_deleteFromDisk = new QRadioButton(i18n("&Delete from disk"));
    QRadioButton* blockFromDB = new QRadioButton(i18n("&Block from database"));
    m_trash->setChecked(true);

    topLayout->addSpacing(10);
    topLayout->addWidget(m_trash);
    topLayout->addWidget(m_deleteFromDisk);
    topLayout->addWidget(blockFromDB);
    topLayout->addSpacing(10);

    QScrollArea* scrollArea = new QScrollArea;
    topLayout->addWidget(scrollArea);
    scrollArea->setWidgetResizable(true);

    m_container = new QWidget(scrollArea);
    m_scrollLayout = new QVBoxLayout(m_container);
    scrollArea->setWidget(m_container);

    m_selectionCount = new QLabel;
    topLayout->addWidget(m_selectionCount);

    QDialogButtonBox* buttonBox = new QDialogButtonBox();

    m_selectAllButton = buttonBox->addButton(i18n("Select &All"), QDialogButtonBox::YesRole);
    m_selectNoneButton = buttonBox->addButton(i18n("Select &None"), QDialogButtonBox::NoRole);
    m_okButton = buttonBox->addButton(QDialogButtonBox::Ok);
    m_cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);

    connect(m_selectAllButton, SIGNAL(clicked()), this, SLOT(selectAll()));
    connect(m_selectNoneButton, SIGNAL(clicked()), this, SLOT(selectNone()));
    connect(m_okButton, SIGNAL(clicked()), this, SLOT(go()));
    connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject()));

    topLayout->addWidget(buttonBox);

    findDuplicates();
}
void nixstbuild::addPackagesTab()
{
    varout = new CVarOutput;
    varout->init(pkgvars);
    QScrollArea *scrolla = new QScrollArea;
    scrolla->setWidget(varout->getLayout());
    tabs->addTab(scrolla, QIcon(":/ark_addfile.png"), "Packaging");
    connect(varout->getSaveButton(), SIGNAL(clicked()), this, SLOT(savePackage()));
}
	QWidget* createWidgets(BasePropertyWidget* parent)
	{
		m_parent = parent;
		m_property = parent->property();
		m_propertyValue = m_property->value<value_type>();
		if (!m_propertyValue)
			return nullptr;
		m_value = m_propertyValue->value();

		// Get widget creator
		std::string widget;
		auto meta = m_propertyValue->metaContainer().get<meta::Widget>();
		if (meta)
			widget = meta->type();

		auto id = std::type_index(typeid(base_type));
		m_widgetCreator = PropertyWidgetFactory::instance().creator(id, widget);

		auto container = new QWidget(parent);
		auto layout = new QVBoxLayout(container);
		layout->setContentsMargins(0, 0, 0, 0);

		auto topLayout = new QHBoxLayout;
		m_toggleButton = new QPushButton(QPushButton::tr("show"));
		m_toggleButton->setCheckable(true);
		QObject::connect(m_toggleButton, &QPushButton::toggled, [this](bool toggled){ toggleView(toggled); });
		topLayout->addWidget(m_toggleButton);

		if (!list_traits::fixed(m_value))
		{
			m_spinBox = new QSpinBox;
			m_spinBox->setMaximum(INT_MAX);
			m_spinBox->setValue(list_traits::size(m_value));
			topLayout->addWidget(m_spinBox, 1);

			auto resizeButton = new QPushButton(QPushButton::tr("resize"));
			QObject::connect(resizeButton, &QPushButton::clicked, [this]() { 
				for (auto w : m_propertyWidgets) 
					w->updatePropertyValue(); 
				resize(m_spinBox->value()); 
			});
			QObject::connect(resizeButton, &QPushButton::clicked, parent, &BasePropertyWidget::setWidgetDirty);
			topLayout->addWidget(resizeButton);
		}
		else
			topLayout->addStretch();
		
		m_scrollArea = new QScrollArea();

		layout->addLayout(topLayout);
		layout->addWidget(m_scrollArea, 1);

		m_scrollArea->hide();
		m_scrollArea->setWidgetResizable(true);

		return container;
	}
Example #19
0
void AppsPage::initializePage()
{
    MainWizard *mainWizard = (MainWizard *)wizard();
    QStringList sources;
    mainWizard->getSources(sources);

    release();

    nrSources = sources.size();

    sourcesLabels = new QLabel[nrSources];
    for (int i = 0; i < nrSources; i ++) {
        QFileInfo file(sources[i]);
        sourcesLabels[i].setText(file.fileName());
        sourcesLabels[i].setToolTip(file.absoluteFilePath());
    }

    needDisplayCheckBoxes = new QCheckBox[nrSources];
    for (int i = 0; i < nrSources; i ++) {
        needDisplayCheckBoxes[i].setToolTip("Display");
        needDisplayCheckBoxes[i].setChecked(true);
    }

    appsTypesComboBoxes = new QComboBox[nrSources];
    for (int i = 0; i < nrSources; i ++) {
        for (int j = 0; j < NR_APPS; j ++)
            appsTypesComboBoxes[i].addItem(APPS_TYPES[j].c_str());
    }

    appsParamsLineEdits = new QLineEdit[nrSources];
    for (int i = 0; i < nrSources; i ++) {
        appsParamsLineEdits[i].setText(APPS_DEFAULT_PARAMS[0].c_str());
        appsParamsLineEdits[i].setToolTip(tr("d,k,lambda"));
    }

    QGridLayout *subLayout = new QGridLayout;
    for (int i = 0; i < nrSources; i ++) {
        subLayout->addWidget(&sourcesLabels[i], i, 0);
        subLayout->addWidget(&needDisplayCheckBoxes[i], i, 1);
        subLayout->addWidget(&appsTypesComboBoxes[i], i, 2);
        subLayout->addWidget(&appsParamsLineEdits[i], i, 3);
    }

    QWidget *subWidget = new QWidget;
    subWidget->setLayout(subLayout);

    QScrollArea *scrollPanel = new QScrollArea;
    scrollPanel->setWidget(subWidget);
    scrollPanel->setWidgetResizable(true);

    QGridLayout *wholeLayout = new QGridLayout;
    wholeLayout->addWidget(scrollPanel, 0, 0);

    delete layout();
    setLayout(wholeLayout);
}
 void addPage(const QString &name)
 {
     TypeFormatsDialogPage *page = new TypeFormatsDialogPage;
     pages.append(page);
     QScrollArea *scroller = new QScrollArea;
     scroller->setWidgetResizable(true);
     scroller->setWidget(page);
     scroller->setFrameStyle(QFrame::NoFrame);
     tabs->addTab(scroller, name);
 }
void ScrollAreaWidgetContainer::addWidget(QWidget *widget)
{
  QScrollArea *scrollArea = extendedScrollArea();

  if (scrollArea->widget()) {
    qmlInfo(scrollArea) << "Can not add multiple Widgets to ScrollArea";
  } else {
    scrollArea->setWidget(widget);
  }
}
Example #22
0
void
ViewletView::defaultVSet(QWidget *parent, QHBoxLayout *FPOLayout)
{
    /* For default viewlet */
    comboAccountsList = new QComboBox();
    comboAccountsList->addItem(tr("-NA-"));

    connect(comboAccountsList, SIGNAL(currentIndexChanged(int)),
            this, SLOT(defaultVUpdate()));

    /* Add a new QWidget (acts as a container for this viewlet) to the
       layout of QWidget (QDockWidget>QWidget, i.e, dockwFPO>dockcFPO)
       in dashboard QMainWindow.
    */
    QWidget *viewletContainer = new QWidget;
    FPOLayout->addWidget(viewletContainer);

    /* Set a layout for the container QWidget */
    QVBoxLayout *vLay = new QVBoxLayout;
    viewletContainer->setLayout(vLay);

    /***** Start of viewlet specific implementations *****/
    /* Specification:
       This default viewlet contains two widgets, 1) An account
       selection widget, and 2) A scroll area which wraps a QWidget
       to show the entries.*/
    /** @bugid_1 1) Account selection feature of the viewlet  */
    /*
    comboAccountsList = new QComboBox();
    comboAccountsList->addItem(tr("-NA-"));
    */

    vLay->addWidget(comboAccountsList);

    /* 2) The actual viewlet display of account selected in 1) */
    QWidget *defaultViewletWidget = new QWidget();
    defaultVLayout = new QVBoxLayout();
    QScrollArea *viewletScrollArea = new QScrollArea();

    viewletScrollArea->setWidget(defaultViewletWidget);
    viewletScrollArea->setAlignment(Qt::AlignLeft);
    viewletScrollArea->setWidgetResizable(true);
    defaultViewletWidget->setLayout(defaultVLayout);
    vLay->addWidget(viewletScrollArea);

    //create viewlet
    if(comboAccountsList->currentIndex())
    {
        selectedAccountIndex = comboAccountsList->currentIndex();
        selectedAccount = accountsList->at(selectedAccountIndex);

        viewletModel->defaultVGenerate(selectedAccount);
        defaultVDraw();
    }
}
Example #23
0
void ShareUserGroupWidget::slotAdjustScrollWidgetSize()
{
    QScrollArea *scrollArea = _ui->scrollArea;
    if (scrollArea->findChildren<ShareWidget*>().count() <= 3) {
        auto minimumSize = scrollArea->widget()->sizeHint();
        auto spacing = scrollArea->widget()->layout()->spacing();
        minimumSize.rwidth() += spacing;
        minimumSize.rheight() += spacing;
        scrollArea->setMinimumSize(minimumSize);
    }
}
/**
 * Opens a window containing the image found under the given path.
 * @param imagePath The path to the image a window is opened for.
 */
void CameraCalibrationEvaluation::openMaxPicWindow(const QString &imagePath) {
    qDebug() << "CameraCalibrationEvaluation::openMaxPicWindow(const QString "
                "&imagePath) ...";
    QScrollArea *sArea = new QScrollArea;
    QLabel *label = new QLabel;
    QPixmap *pixmap = new QPixmap(imagePath);
    label->setPixmap(*pixmap);
    sArea->setWidget(label);
    sArea->setWindowTitle(imagePath);
    sArea->showMaximized();
}
ImageWidget* MainWindow::GetImageWidget(int index) const
{
	QWidget* widget = ui->imagetab->widget(index);

	if (widget) {
		QScrollArea* area = qobject_cast<QScrollArea*>(widget);
		return qobject_cast<ImageWidget*>(area->widget());
	}

	return nullptr;
}
Example #26
0
QWidget* KgGeneral::createTab(QString name)
{
    QScrollArea *scrollArea = new QScrollArea(tabWidget);
    tabWidget->addTab(scrollArea, name);
    scrollArea->setFrameStyle(QFrame::NoFrame);
    scrollArea->setWidgetResizable(true);

    QWidget *tab = new QWidget(scrollArea);
    scrollArea->setWidget(tab);

    return tab;
}
PreviewDialog::PreviewDialog(QWidget *parent) : DragWidget(parent)
{
    m_borderImage = false;
    setAutoFillBackground(true);

    m_label = new PreviewLabel(this);
    m_slider = new QSlider(this);

    m_zoomLabel = new QLabel(this);

    setZoom(1);

    QVBoxLayout *layout = new QVBoxLayout(this);
    QHBoxLayout *horizontalLayout = new QHBoxLayout();
    QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
    layout->setMargin(0);
    layout->setContentsMargins(2, 2, 2, 16);
    layout->setSpacing(4);
    QToolButton *toolButton = new QToolButton(this);
    QIcon icon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton));
    toolButton->setIcon(icon);
    toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
    toolButton->setFixedSize(icon.availableSizes().value(0) + QSize(4, 4));
    connect(toolButton, SIGNAL(clicked()), this, SLOT(onTogglePane()));

    QScrollArea *scrollArea = new QScrollArea(this);
    WheelFilter *wheelFilter = new WheelFilter(scrollArea);
    scrollArea->setWidget(m_label);
    scrollArea->setFrameStyle(QFrame::NoFrame);
    m_slider->setOrientation(Qt::Horizontal);
    m_slider->setRange(1, 6);
    m_slider->setFixedWidth(80);
    m_zoomLabel->setFixedWidth(50);

    horizontalLayout->addWidget(toolButton);
    horizontalLayout->addSpacing(6);
    horizontalLayout->addWidget(m_slider);
    horizontalLayout->addSpacing(6);
    horizontalLayout->addWidget(m_zoomLabel);
    horizontalLayout->addStretch(1);

    layout->addLayout(horizontalLayout);
    horizontalLayout2->addSpacing(24);
    horizontalLayout2->addWidget(scrollArea);
    layout->addLayout(horizontalLayout2);

    wheelFilter->setTarget(this);

    connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(onSliderMoved(int)));

    foreach (QWidget *childWidget, findChildren<QWidget*>()) {
        childWidget->installEventFilter(wheelFilter);
    }
GeneratedObjectsWizardPage::GeneratedObjectsWizardPage(BombicMap * map):
		map_(map) {

	QLayout * l = new QVBoxLayout(this);
	QScrollArea * scrollArea = new QScrollArea(this);
	scrollArea->setWidgetResizable(true);
	l->addWidget(scrollArea);
	QWidget * scrollWidget = new QWidget;
	scrollArea->setWidget(scrollWidget);

	mainLayout_ = new FlowLayout(scrollWidget, 10, 15);
}
void DDockInternalWidget::addWidget(const QString &title, QWidget *widget)
{
	QPixmap pm = widget->windowIcon().pixmap(16,16);
	Ideal::Button *button;
	if (!pm.isNull())
	{
		button = new Ideal::Button(m_bar, title, pm);
	}
	else
	{
		button = new Ideal::Button(m_bar, title);
	}

	m_bar->addButton(button);

	QDesktopWidget *desktop = new QDesktopWidget();
	
	if (widget->height() > desktop->screen(desktop->primaryScreen ())->height()-230)
	{
		QScrollArea *area = new QScrollArea(m_widgetStack);
		widget->adjustSize();
		area->setWidget(widget);
		area->setWidgetResizable(true);
		m_widgetStack->addWidget(area);
		m_widgets[button] = area;
		m_buttons[area] = button;
// 		area->setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
	}
	else
	{
		m_widgets[button] = widget;
		widget->setParent(m_widgetStack);
		m_widgetStack->addWidget(widget);
		m_buttons[widget] = button;
	}
    
	connect(button, SIGNAL(clicked()), this, SLOT(selectWidget()));
    
    //if the widget was selected last time the dock is deleted 
    //we need to show it

	QSettings config;
	config.beginGroup("DLSLib-"+objectName());
    
	if ( config.value("ViewLastWidget").toString() == title)
	{
		button->setChecked(true);
		selectWidget(button);
	}

	widget->show();
}
EditCalendarsPage::EditCalendarsPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
    m_calendarList = new QListWidget(this);
    connect(m_calendarList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(itemDoubleClicked(QListWidgetItem *)));

#ifndef Q_OS_SYMBIAN
    // Add push buttons for non-Symbian platforms as they do not support soft keys
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *addButton = new QPushButton("Add new", this);
    connect(addButton,SIGNAL(clicked()), this, SIGNAL(addClicked()));
    hbLayout->addWidget(addButton);
    QPushButton *editButton = new QPushButton("Edit", this);
    connect(editButton,SIGNAL(clicked()),this,SLOT(editClicked()));
    hbLayout->addWidget(editButton);
    QPushButton *deleteButton = new QPushButton("Delete", this);
    connect(deleteButton,SIGNAL(clicked()),this,SLOT(deleteClicked()));
    hbLayout->addWidget(deleteButton);
    QPushButton *backButton = new QPushButton("Back", this);
    connect(backButton,SIGNAL(clicked()),this,SLOT(backClicked()));
    hbLayout->addWidget(backButton);
#endif

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addWidget(m_calendarList);

#ifndef Q_OS_SYMBIAN
    scrollAreaLayout->addLayout(hbLayout);
#endif

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addWidget(scrollArea);
    setLayout(mainLayout);

    // Add softkeys
    QAction* cancelSoftKey = new QAction("Back", this);
    cancelSoftKey->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(cancelSoftKey);
    connect(cancelSoftKey, SIGNAL(triggered(bool)), this, SLOT(backClicked()));

    QAction* editSoftKey = new QAction("Edit",this);
    editSoftKey->setSoftKeyRole(QAction::PositiveSoftKey); // Perhaps SelectSoftKey
    addAction(editSoftKey);
    connect(editSoftKey, SIGNAL(triggered(bool)), this, SLOT(editClicked()));
}