Example #1
0
void ThumbnailListWidgetTest::setupUi() {
	QGridLayout *layout = new QGridLayout(this);
	
	QScrollArea *horizontalScrollArea = new QScrollArea(this);
	horizontalScrollArea->setWidget(horizontal);
	horizontalScrollArea->setWidgetResizable(true);
	QScrollArea *verticalScrollArea = new QScrollArea(this);
	verticalScrollArea->setWidget(vertical);
	verticalScrollArea->setWidgetResizable(true);
	layout->addWidget(horizontalScrollArea, 0, 1, 1, 3);
	layout->addWidget(verticalScrollArea, 1, 0, 3, 1);

	lblhorizontalActivated = new QLabel("Horizontal activated");
	lblverticalActivated = new QLabel("Vertical activated");
	layout->addWidget(lblhorizontalActivated, 1, 1);
	layout->addWidget(lblverticalActivated, 1, 2);

	lblhorizontalDeactivated = new QLabel("Horizontal deactivated");
	lblverticalDeactivated = new QLabel("Vertical deactivated");
	layout->addWidget(lblhorizontalDeactivated, 2, 1);
	layout->addWidget(lblverticalDeactivated, 2, 2);

	lblhorizontalVideoAdded = new QLabel("Horizontal video added");
	lblverticalVideoAdded = new QLabel("Vertical video added");
	layout->addWidget(lblhorizontalVideoAdded, 3, 1);
	layout->addWidget(lblverticalVideoAdded, 3, 2);

	setLayout(layout);
}
Example #2
0
void FileBrowser::activated(const QModelIndex &index)
{
    QFileInfo fileInfo = fileSystemModel->fileInfo(index);

    if (fileInfo.isDir() && fileInfo.fileName() != QLatin1String(".")) {
        if (fileInfo.fileName() == QLatin1String("..")) {
            QModelIndex parent = view->rootIndex().parent();

            fileInfo = fileSystemModel->fileInfo(parent);

            if (fileInfo.absoluteFilePath() == rootPath)
                fileSystemModel->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs);

            view->setRootIndex(parent);
        } else {
            fileSystemModel->setFilter(QDir::AllEntries | QDir::AllDirs);

            view->setRootIndex(index);
        }

        setWindowTitle(fileInfo.fileName());
    } else {
        if (fileInfo.fileName() == QLatin1String("."))
            fileInfo = fileSystemModel->fileInfo(view->rootIndex());


#if defined(Q_WS_MAEMO_5)
        DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, this);
        widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);

        QScrollArea *window = new QScrollArea(this);
        window->setWindowFlags(window->windowFlags() | Qt::Window);
        window->setAttribute(Qt::WA_DeleteOnClose);
        window->setAttribute(Qt::WA_Maemo5StackedWindow);
        window->setWidgetResizable(true);
        window->setWidget(widget);
        window->show();
#elif defined (Q_OS_SYMBIAN)
        QScrollArea *window = new QScrollArea(this);
        DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, window);
        widget->setWindowModality(Qt::WindowModal);
        window->setWindowFlags(window->windowFlags() | Qt::Dialog);
        window->setAttribute(Qt::WA_DeleteOnClose);
        window->setWidgetResizable(true);
        window->setWidget(widget);
        window->showMaximized();
#else
        DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, this);
        widget->setWindowFlags(widget->windowFlags() | Qt::Dialog);
        widget->setAttribute(Qt::WA_DeleteOnClose);
        widget->setWindowModality(Qt::WindowModal);
# if defined(Q_OS_SYMBIAN)
        widget->showMaximized();
# else
        widget->show();
# endif
#endif
    }
}
Example #3
0
void StackedWidget::reloadData() {
	removePages();

	DataManager& manager = DataManager::getInstance();

	if( manager.isempty() ) {
		addWidget( new QLabel(tr("No quantities found.")) );
		return;
	}

	//Home
	StackedWidgetHome *home = new StackedWidgetHome(this);
	addWidget(home);
	connect(home, &StackedWidgetHome::quantityChosen, this, &StackedWidget::quantityChosen);

	//all quantities
	for(Quantity& quantity : manager) {
		QScrollArea *scroll = new QScrollArea(this);
		scroll->setWidgetResizable(true);
		scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
		scroll->setWidget(new QuantityWidget( quantity, this ));
		addWidget(scroll);
	}

	QStackedWidget::update();
}
Example #4
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()));
}
EventVideoDownloadsWindow::EventVideoDownloadsWindow(QWidget *parent) :
    QFrame(parent)
{
    setAttribute(Qt::WA_DeleteOnClose, true);
    setMinimumSize(550, 300);
	setWindowTitle(tr("Bluecherry - Download Manager"));

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setSpacing(2);
    layout->setMargin(2);

    QScrollArea *downloadArea = new QScrollArea(this);
    downloadArea->setBackgroundRole(QPalette::Base );
    downloadArea->move(0, 0);
    layout->addWidget(downloadArea);

    QFrame *downloadFrame = new QFrame;
    downloadFrame->setBackgroundRole(QPalette::Base);
    downloadFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);

    m_downloadLayout = new QVBoxLayout(downloadFrame);
    m_downloadLayout->setDirection(QBoxLayout::Up);

    downloadArea->setWidget(downloadFrame);
    downloadArea->setWidgetResizable(true);

    QSettings settings;
    restoreGeometry(settings.value(QLatin1String("ui/downloadsWindow/geometry")).toByteArray());

    connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveSettings()));
}
Example #6
0
/*
 *  Constructs a image as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
imageview::imageview(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
  setupUi(this);


  // signals and slots connections
  connect(_fileList, SIGNAL(clicked()), this, SLOT(sFileList()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));

#ifndef Q_WS_MAC
  _fileList->setMaximumWidth(25);
#endif

  _imageview = new QLabel();
  _imageview->setAlignment(Qt::AlignLeft | Qt::AlignTop);
  QScrollArea * scrollArea = new QScrollArea();
  scrollArea->setWidgetResizable(true);
  scrollArea->setAlignment(Qt::AlignLeft | Qt::AlignTop);
  scrollArea->setWidget(_imageview);
  QHBoxLayout *layout = new QHBoxLayout;
  layout->setMargin(0);
  layout->addWidget(scrollArea);
  _imageFrame->setLayout(layout);
}
Example #7
0
QTORGANIZER_USE_NAMESPACE

AddCalendarPage::AddCalendarPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *okButton = new QPushButton("Save", this);
    connect(okButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
    hbLayout->addWidget(okButton);
    QPushButton *cancelButton = new QPushButton("Cancel", this);
    connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    hbLayout->addWidget(cancelButton);

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addStretch();
    scrollAreaLayout->addLayout(hbLayout);

    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);
}
ChooseSetsPage::ChooseSetsPage(QWidget *parent)
    : OracleWizardPage(parent)
{
    setTitle(tr("Sets selection"));
    setSubTitle(tr("The following sets has been found in the source file. "
                   "Please mark the sets that will be imported."));

    checkBoxLayout = new QVBoxLayout;
    
    QWidget *checkboxFrame = new QWidget(this);
    checkboxFrame->setLayout(checkBoxLayout);
    
    QScrollArea *checkboxArea = new QScrollArea(this);
    checkboxArea->setWidget(checkboxFrame);
    checkboxArea->setWidgetResizable(true);
    
    checkAllButton = new QPushButton(tr("&Check all"));
    connect(checkAllButton, SIGNAL(clicked()), this, SLOT(actCheckAll()));
    uncheckAllButton = new QPushButton(tr("&Uncheck all"));
    connect(uncheckAllButton, SIGNAL(clicked()), this, SLOT(actUncheckAll()));

    QGridLayout *layout = new QGridLayout(this);
    layout->addWidget(checkboxArea, 0, 0, 1, 2);
    layout->addWidget(checkAllButton, 1, 0);
    layout->addWidget(uncheckAllButton, 1, 1);

    setLayout(layout);
}
Example #9
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 #10
0
void ChordsManager::updateManager()
{
    if(chords_==0){
        return;
    }

    tabWidget->clear();
    QList<Instrument> instruments = chords_->getInstruments();
    foreach(Instrument instrument, instruments){
        QScrollArea *area = new QScrollArea();
        QList<Chord> list = chords_->getChords(instrument);

        QGridLayout *gridLayout = new QGridLayout;

        area->setWidgetResizable(true);
        QWidget *w = new QWidget;
        w->setLayout(gridLayout);

        area->setWidget(w);

        int nb = this->width() / 200;

        for(int i=0;i<list.size();i++){
            Guitar *guitar = new Guitar(list[i].getName(), list[i].getFingers());
            guitar->setMenu(!list[i].isLocked(),false,false);
            gridLayout->addWidget( guitar , i/nb, i%nb);
        }

        int index =  tabWidget->addTab(area, instrument.name );

        if(instrument.label=="guitar"){
            tabWidget->setCurrentIndex(index);
        }

    }
Example #11
0
cqts_SkillsEditor::cqts_SkillsEditor(CQTs_Character *selected, CQTs_engine *engine, QWidget *parent):
    QWidget(parent)
{
    eng = engine;
    QWidget* toscroll =  new QWidget();
    QScrollArea *Scroll = new QScrollArea;
    QFormLayout *grid = new QFormLayout();

    newSpinSkills = new QSpinBox* [eng->skillNum()];
    for (int i = 0; i < eng->skillNum(); ++i) {
        newSpinSkills[i] = new QSpinBox();
        newSpinSkills[i]->setValue(selected->getRanks(eng->skillData(i)));
        grid->addRow(eng->skillData(i).myName(),newSpinSkills[i]);
    }

    toscroll->setLayout(grid);
    Scroll->setWidget(toscroll);
    Scroll->setWidgetResizable(true);
    Scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    Scroll->setMinimumWidth(200);

    QVBoxLayout *VLay= new QVBoxLayout();
    VLay->addWidget(Scroll);
    saveBTT = new QPushButton("&Save");
    undoBTT = new QPushButton("&Undo");
    QHBoxLayout *tLay= new QHBoxLayout();
    tLay->addWidget(undoBTT);
    tLay->addWidget(saveBTT);
    VLay->addLayout(tLay);
    setLayout(VLay);

    connect(undoBTT,SIGNAL(clicked()),this,SLOT(close()));
    connect(saveBTT,SIGNAL(clicked()),this,SLOT(update()));
}
void DlgPreferencesImp::resizeEvent(QResizeEvent* ev)
{
    if (canEmbedScrollArea) {
        // embed the widget stack into a scroll area if the size is
        // bigger than the available desktop
        QRect rect = QApplication::desktop()->availableGeometry();
        int maxHeight = rect.height();
        int maxWidth = rect.width();
        if (height() > maxHeight || width() > maxWidth) {
            canEmbedScrollArea = false;
            ui->hboxLayout->removeWidget(ui->tabWidgetStack);
            QScrollArea* scrollArea = new QScrollArea(this);
            scrollArea->setFrameShape(QFrame::NoFrame);
            scrollArea->setWidgetResizable(true);
            scrollArea->setWidget(ui->tabWidgetStack);
            ui->hboxLayout->addWidget(scrollArea);

            // if possible the minimum width should so that it doesn't show
            // a horizontal scroll bar.
            QScrollBar* bar = scrollArea->verticalScrollBar();
            if (bar) {
                int newWidth = width() + bar->width();
                newWidth = std::min<int>(newWidth, maxWidth);
                int newHeight = std::min<int>(height(), maxHeight-30);
                QMetaObject::invokeMethod(this, "resizeWindow",
                    Qt::QueuedConnection,
                    QGenericReturnArgument(),
                    Q_ARG(int, newWidth),
                    Q_ARG(int, newHeight));
            }
        }
    }
Example #13
0
void TwitterApiShowThread::setupUi()
{
    kDebug();
    QVBoxLayout *gridLayout;
    QScrollArea *scrollArea;
    QWidget *scrollAreaWidgetContents;
    QVBoxLayout *verticalLayout_2;
    QSpacerItem *verticalSpacer;
    gridLayout = new QVBoxLayout(this);
    gridLayout->setMargin(0);
    gridLayout->setObjectName("gridLayout");
    scrollArea = new QScrollArea(this);
    scrollArea->setObjectName("scrollArea");
    scrollArea->setFrameShape(QFrame::NoFrame);
    scrollArea->setWidgetResizable(true);
    scrollAreaWidgetContents = new QWidget();
    scrollAreaWidgetContents->setObjectName("scrollAreaWidgetContents");
    scrollAreaWidgetContents->setGeometry(QRect(0, 0, 254, 300));
    verticalLayout_2 = new QVBoxLayout(scrollAreaWidgetContents);
    verticalLayout_2->setMargin(1);
    d->mainLayout = new QVBoxLayout();
    verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);

    d->mainLayout->addItem(verticalSpacer);
    d->mainLayout->setSpacing(3);
    d->mainLayout->setMargin(1);

    verticalLayout_2->addLayout(d->mainLayout);

    scrollArea->setWidget(scrollAreaWidgetContents);

    gridLayout->addWidget(scrollArea);
}
Example #14
0
  virtual int setup() {
    QScrollArea *qw;
    QWidget *qChild;
    uint32_t flags;
    GWEN_WIDGET *wParent;
    QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
    QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
    QLayout *qLayout;

    flags=GWEN_Widget_GetFlags(_widget);
    wParent=GWEN_Widget_Tree_GetParent(_widget);

    qw=new QScrollArea();

    qChild=new QWidget();
    qChild->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    qw->setWidget(qChild);
    qLayout=new QVBoxLayout(qChild);

    qw->setWidgetResizable(true);

    /* handle flags */
    if (flags & GWEN_WIDGET_FLAGS_FILLX)
      hpolicy=QSizePolicy::Expanding;
    if (flags & GWEN_WIDGET_FLAGS_FILLY)
      vpolicy=QSizePolicy::Expanding;
    qw->setSizePolicy(hpolicy, vpolicy);

    GWEN_Widget_SetImplData(_widget, QT5_DIALOG_WIDGET_REAL, (void*) qw);
    GWEN_Widget_SetImplData(_widget, QT5_DIALOG_WIDGET_LAYOUT, (void*) qLayout);

    if (wParent)
      GWEN_Widget_AddChildGuiWidget(wParent, _widget);
    return 0;
  }
Example #15
0
EffectStackEdit::EffectStackEdit(QWidget *parent) :
        QWidget(parent),
        m_in(0),
        m_out(0),
        m_frameSize(QPoint())
{
    setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
    QVBoxLayout *vbox1 = new QVBoxLayout(parent);
    vbox1->setContentsMargins(0, 0, 0, 0);
    vbox1->setSpacing(0);

    QScrollArea *area = new QScrollArea;
    QWidget *wid = new QWidget(parent);
    area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    area->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    wid->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
    area->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding));

    vbox1->addWidget(area);
    area->setWidget(wid);
    area->setWidgetResizable(true);
    m_vbox = new QVBoxLayout(wid);
    m_vbox->setContentsMargins(0, 0, 0, 0);
    m_vbox->setSpacing(0);
    wid->show();

}
void QmitkFunctionality::CreatePartControl(void* parent)
{

  // scrollArea
  QScrollArea* scrollArea = new QScrollArea;  
  //QVBoxLayout* scrollAreaLayout = new QVBoxLayout(scrollArea);
  scrollArea->setFrameShadow(QFrame::Plain);
  scrollArea->setFrameShape(QFrame::NoFrame);
  scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
  scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

  // m_Parent
  m_Parent = new QWidget;
  //m_Parent->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
  this->CreateQtPartControl(m_Parent);

  //scrollAreaLayout->addWidget(m_Parent);
  //scrollArea->setLayout(scrollAreaLayout);

  // set the widget now
  scrollArea->setWidgetResizable(true);
  scrollArea->setWidget(m_Parent);

  // add the scroll area to the real parent (the view tabbar)
  QWidget* parentQWidget = static_cast<QWidget*>(parent);
  QVBoxLayout* parentLayout = new QVBoxLayout(parentQWidget);
  parentLayout->setMargin(0);
  parentLayout->setSpacing(0);
  parentLayout->addWidget(scrollArea);

  // finally set the layout containing the scroll area to the parent widget (= show it)
  parentQWidget->setLayout(parentLayout);

  this->AfterCreateQtPartControl();
}
Example #17
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 #18
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 #19
0
ImageWidget::ImageWidget(QWidget *parent) :
	QWidget(parent),
	m_stack(new QUndoStack(this)),
	m_filePath(QString()),
	m_imageLabel(new QLabel(this)),
	m_magnification(1.),
	m_flagAutoImageResize(true)
{
	// m_stack->setUndoLimit(5);	// 別に制限しなくていいんじゃね?
	connect(m_stack, SIGNAL(canUndoChanged(bool)), this, SIGNAL(canUndoChanged(bool)));
	connect(m_stack, SIGNAL(canRedoChanged(bool)), this, SIGNAL(canRedoChanged(bool)));
	connect(m_stack, SIGNAL(cleanChanged(bool)), this, SIGNAL(cleanChanged(bool)));
	connect(m_stack, SIGNAL(undoTextChanged(QString)), this, SIGNAL(undoTextChanged(QString)));
	connect(m_stack, SIGNAL(redoTextChanged(QString)), this, SIGNAL(redoTextChanged(QString)));

	m_imageLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->setMargin(0);
	QScrollArea *scrollArea = new QScrollArea(this);
	scrollArea->setWidgetResizable(true);
	scrollArea->setBackgroundRole(QPalette::Midlight);
	scrollArea->setWidget(m_imageLabel);
	layout->addWidget(scrollArea);
	setLayout(layout);
}
Example #20
0
int main(int argc, char *argv[])
{
	QApplication app(argc, argv);
//#define ABC
#ifdef ABC
	ParameterWidget *pw = new ParameterWidget();
	pw->setProperties( "a", FloatParameterProperties() );
	pw->setProperties( "b", FloatParameterProperties() );
	pw->setProperties( "c", FloatParameterProperties() );
	pw->setProperties( "d", FloatParameterProperties() );
	pw->show();
#else
	QTabWidget *tw = new QTabWidget();

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

	QWidget *w = new QWidget(  );
	w->setLayout( new QVBoxLayout() );
	w->layout()->addWidget( new CoordinateSystemWidget( "a", FloatParameterProperties(), "b", FloatParameterProperties(), w ) );
	( ( QVBoxLayout * ) w->layout() )->addStretch();

	sa->setWidget( w );

	tw->addTab( sa, "bla" );
	tw->show();

	app.processEvents();
	w->layout()->addWidget( new CoordinateSystemWidget() );
#endif

	return app.exec();
}
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 #22
0
ColorsListChoiceWidget::ColorsListChoiceWidget(QWidget *parent)
    : QWidget(parent)
{
    QVBoxLayout *vLayout = new QVBoxLayout;
    setLayout(vLayout);
    QScrollArea *scrollArea = new QScrollArea;
    scrollArea->setWidgetResizable(true);
    vLayout->addWidget(scrollArea);
    QWidget *scrollableWidget = new QWidget;
    scrollArea->setWidget(scrollableWidget);

    mGridLayout = new QGridLayout;
    mGridLayout->setSpacing(0);
    mGridLayout->setMargin(0);
//    mGridLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
    scrollableWidget->setLayout(mGridLayout);


    mAddColorButton = new QPushButton(QIcon(":/add"), "add", this);
    vLayout->addWidget(mAddColorButton);
    connect(mAddColorButton, SIGNAL(clicked(bool)),
            this, SLOT(addNewRandomColor()));

    mHeaderLabel0 = new QLabel();
    mHeaderLabel1 = new QLabel();
    mGridLayout->addWidget(mHeaderLabel0, 0, 0);
    mGridLayout->addWidget(mHeaderLabel1, 0, 1);
    mGridLayout->setRowStretch(0, 0.1);
    vLayout->addStretch();
    scrollableWidget->show();
}
Example #23
0
void CQTs_ChSkillsViewer::initialize(){
    train = new QPushButton(tr("Show only trained"));
    train->setCheckable(true);
    connect(train,SIGNAL(released()),this,SLOT(showOnlyTrained()));
    // grid->addWidget(train,0,0,1,3);
    QVBoxLayout *vl  = new QVBoxLayout();
    vl->addWidget(train);
    QWidget *container = new QWidget();

    QScrollArea *scroll = new QScrollArea();

    scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    int rows=0;// number of rows before the skill list
    QGridLayout *grid = new QGridLayout();




    for (int i = 0; i < eng->skillNum(); ++i) {
        QLabel *tLab = new QLabel(eng->skillData(i).myName());
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);//[i*8+0] name

        grid->addWidget(tLab,i+rows,0);
        grid->addWidget(tLab= new QLabel("0"),i+rows,1);
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);//[i*8+1] d20

        tLab->setFrameStyle(QFrame::Panel|QFrame::Raised);
        grid->addWidget(tLab= new QLabel("="),i+rows,2);
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);

        grid->addWidget(tLab= new QLabel("0"),i+rows,3);
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);//[i*8+3] abl mod

        grid->addWidget(tLab= new QLabel("+"),i+rows,4);
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);

        grid->addWidget(tLab= new QLabel("0"),i+rows,5);
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);//[i*8+5] ranks

        grid->addWidget(tLab= new QLabel("+"),i+rows,6);
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);

        grid->addWidget(tLab= new QLabel("0"),i+rows,7);
        tLab->setAlignment(Qt::AlignCenter);
        Labels.push_back(tLab);//[i*8+7] var mods
    }
    container->setLayout(grid);
    scroll->setWidget(container);
    scroll->setWidgetResizable(true);
    scroll->setMinimumWidth(300);
    vl->addWidget(scroll);
    setLayout(vl);
}
Example #24
0
PaletteBox::PaletteBox(QWidget* parent)
   : QDockWidget(tr("Palettes"), parent)
      {
      setObjectName("palette-box");
      setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);

      QScrollArea* sa = new QScrollArea;
      sa->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
      sa->setContextMenuPolicy(Qt::CustomContextMenu);
      sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
      sa->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
      sa->setWidgetResizable(true);
      setWidget(sa);

      QWidget* paletteList = new QWidget;
      sa->setWidget(paletteList);
      vbox = new QVBoxLayout;
      paletteList->setLayout(vbox);
      _dirty = false;
      vbox->setMargin(0);
      vbox->setSpacing(1);
      vbox->addStretch();
      paletteList->show();

//      connect(sa, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(contextMenu(const QPoint&)));
      }
void SettingsDialog::AddPage(Page id, SettingsPage* page) {
  // Connect page's signals to the settings dialog's signals
  connect(page, SIGNAL(NotificationPreview(OSD::Behaviour,QString,QString)),
                SIGNAL(NotificationPreview(OSD::Behaviour,QString,QString)));
  connect(page, SIGNAL(SetWiimotedevInterfaceActived(bool)),
                SIGNAL(SetWiimotedevInterfaceActived(bool)));

  // Create the list item
  QListWidgetItem* item = new QListWidgetItem(page->windowIcon(),
                                              page->windowTitle());
  ui_->list->addItem(item);

  if (!page->IsEnabled()) {
    item->setFlags(Qt::NoItemFlags);
  }

  // Create a scroll area containing the page
  QScrollArea* area = new QScrollArea;
  area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  area->setWidget(page);
  area->setWidgetResizable(true);
  area->setFrameShape(QFrame::NoFrame);
  area->setMinimumWidth(page->layout()->minimumSize().width());

  // Add the page to the stack
  ui_->stacked_widget->addWidget(area);

  // Remember where the page is
  PageData data;
  data.index_ = ui_->list->row(item);
  data.scroll_area_ = area;
  data.page_ = page;
  pages_[id] = data;
}
Example #26
0
ZoneChooserView::ZoneChooserView(QWidget* parent)
    : QWidget(parent)
{
    QVBoxLayout * mainLayout = new QVBoxLayout();

    mainLayout->setContentsMargins(0,0,0,0);

    this->setLayout(mainLayout);

    QScrollArea * scrollArea = new QScrollArea();

    scrollArea->setWidgetResizable(true);

    scrollArea->setFrameStyle(QFrame::NoFrame);

    mainLayout->addWidget(scrollArea);

    QWidget * scrollWidget = new QWidget();

    scrollArea->setWidget(scrollWidget);

    m_vLayout = new QVBoxLayout();

    m_vLayout->setContentsMargins(0,0,0,0);

    scrollWidget->setLayout(m_vLayout);
}
Example #27
0
GenericArrayWidget<S>::GenericArrayWidget(
    QString name,
    QString type,
    const RCP<const ParameterEntryValidator> validator,
    QWidget *parent):
    QDialog(parent),
    type(type),
    name(name),
    entryValidator(validator)
{
    setModal(true);
    setSizeGripEnabled(true);
    arrayContainer = new QWidget(this);

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidget(arrayContainer);
    scrollArea->setWidgetResizable(true);

    QPushButton *doneButton = new QPushButton(tr("Done"));
    QPushButton *cancelButton = new QPushButton(tr("Cancel"));
    connect(doneButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
    connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(reject()));
    QGridLayout *layout = new QGridLayout(this);
    layout->addWidget(scrollArea,0,0,1,3);
    layout->addWidget(doneButton,1,2);
    layout->addWidget(cancelButton,1,1);

    this->setLayout(layout);

    setWindowTitle(name);
}
MusicWebDJRadioCategoryWidget::MusicWebDJRadioCategoryWidget(QWidget *parent)
    : QWidget(parent)
{
    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setSpacing(0);
    layout->setContentsMargins(0, 0, 0, 0);
    setLayout(layout);

    QWidget *mainWindow = new QWidget(this);

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->verticalScrollBar()->setStyleSheet(MusicUIObject::MScrollBarStyle01);
    scrollArea->setWidgetResizable(true);
    scrollArea->setFrameShape(QFrame::NoFrame);
    scrollArea->setAlignment(Qt::AlignLeft);
    scrollArea->setWidget(mainWindow);
    layout->addWidget(scrollArea);

    m_gridLayout = new QGridLayout(mainWindow);
    m_gridLayout->setVerticalSpacing(35);
    mainWindow->setLayout(m_gridLayout);

    m_categoryThread = new MusicDJRadioCategoryThread(this);
    connect(m_categoryThread, SIGNAL(downLoadDataChanged(QString)), SLOT(createCategoryItems()));
}
imageview::imageview(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, fl)
{
  setupUi(this);

  setObjectName(name ? name : "imageview");
  setModal(modal);

  _save = _buttonBox->button(QDialogButtonBox::Save);
  _save->setEnabled(false);

  // signals and slots connections
  connect(_fileList, SIGNAL(clicked()), this, SLOT(sFileList()));
  connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave()));

#ifndef Q_WS_MAC
  _fileList->setMaximumWidth(25);
#endif

  _imageview = new QLabel();
  _imageview->setAlignment(Qt::AlignLeft | Qt::AlignTop);
  QScrollArea * scrollArea = new QScrollArea();
  scrollArea->setWidgetResizable(true);
  scrollArea->setAlignment(Qt::AlignLeft | Qt::AlignTop);
  scrollArea->setWidget(_imageview);
  QHBoxLayout *layout = new QHBoxLayout;
  layout->setMargin(0);
  layout->addWidget(scrollArea);
  _imageFrame->setLayout(layout);

  shortcuts::setStandardKeys(this);
}
void MusicRecommendFoundWidget::createLabels()
{
    delete m_statusLabel;
    m_statusLabel = nullptr;

    initFirstWidget();
    m_container->show();

    layout()->removeWidget(m_mainWindow);
    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setStyleSheet(MusicUIObject::MScrollBarStyle01);
    scrollArea->setWidgetResizable(true);
    scrollArea->setFrameShape(QFrame::NoFrame);
    scrollArea->setAlignment(Qt::AlignLeft);
    scrollArea->setWidget(m_mainWindow);
    layout()->addWidget(scrollArea);

    QWidget *function = new QWidget(m_mainWindow);
    function->setStyleSheet(MusicUIObject::MCheckBoxStyle01 + MusicUIObject::MPushButtonStyle03);
    QVBoxLayout *grid = new QVBoxLayout(function);

    QLabel *firstLabel = new QLabel(function);
    firstLabel->setText(tr("<font color=#158FE1> Recommend Music</font>"));
    grid->addWidget(firstLabel);
    QLabel *iconLabel = new QLabel(function);
    iconLabel->setPixmap(QPixmap(":/image/lb_recmd_daily"));
    grid->addWidget(iconLabel);
    ////////////////////////////////////////////////////////////////////////////
    grid->addWidget(m_container);

    m_mainWindow->layout()->addWidget(function);
}