void PaintWidget::setViewportType( const PaintWidget::ViewportType t ) { switch( t ) { case fixedViewport: painter.fixedSize = false; setWidgetResizable( false ); painter.resize( painter.size ); break; case resizableViewport: painter.fixedSize = false; setWidgetResizable( true ); break; case hintViewport: painter.fixedSize = true; setWidgetResizable( true ); break; } setAlignment( Qt::AlignCenter ); painter.update(); update(); }
/* default constructor */ rfc::gui::DiscAbstract::DiscAbstract(QWidget *parent) : QScrollArea(parent) { QWidget *widg = new QWidget(); setWidgetResizable(true); setWidget(widg); QVBoxLayout *lay = new QVBoxLayout(widg); QHBoxLayout *butsLay = new QHBoxLayout; activator = new QPushButton(lang::activate, this); connect(activator, SIGNAL(clicked(bool)), this, SLOT(slotActivateDiscipline())); butsLay->addWidget(activator); /* finalizer button */ finalizer = new QPushButton(lang::finalize, this); finalizer->setEnabled(false); connect(finalizer, SIGNAL(clicked(bool)), this, SLOT(slotFinalize())); butsLay->addWidget(finalizer); lay->addLayout(butsLay); } /* end of 'Qualify' constructor */
PrettyImageView::PrettyImageView(QNetworkAccessManager* network, QWidget* parent) : QScrollArea(parent), network_(network), container_(new QWidget(this)), layout_(new QHBoxLayout(container_)), current_index_(-1), scroll_animation_( new QPropertyAnimation(horizontalScrollBar(), "value", this)), recursion_filter_(false) { setWidget(container_); setWidgetResizable(true); setMinimumHeight(PrettyImage::kTotalHeight + 10); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setFrameShape(QFrame::NoFrame); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); scroll_animation_->setDuration(250); scroll_animation_->setEasingCurve(QEasingCurve::InOutCubic); connect(horizontalScrollBar(), SIGNAL(sliderReleased()), SLOT(ScrollBarReleased())); connect(horizontalScrollBar(), SIGNAL(actionTriggered(int)), SLOT(ScrollBarAction(int))); layout_->setSizeConstraint(QLayout::SetMinAndMaxSize); layout_->setContentsMargins(6, 6, 6, 6); layout_->setSpacing(6); layout_->addSpacing(200); layout_->addSpacing(200); container_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); }
SetupEditor::SetupEditor(QWidget* const parent) : QScrollArea(parent), d(new Private) { d->tab = new QTabWidget; // -------------------------------------------------------- d->iface = new SetupEditorIface(d->tab); d->versioning = new SetupVersioning(d->tab); d->iofiles = new SetupIOFiles(d->tab); // -------------------------------------------------------- d->tab->addTab(d->iface, i18nc("@title:tab", "Editor Window")); d->tab->addTab(d->versioning, i18nc("@title:tab", "Versioning")); d->tab->addTab(d->iofiles, i18nc("@title:tab", "Save Settings")); d->raw = new SetupRaw(d->tab); // -------------------------------------------------------- setWidget(d->tab); setWidgetResizable(true); readSettings(); }
KeyBindingPage::KeyBindingPage(CSMPrefs::Category& category, QWidget* parent) : PageBase(category, parent) , mStackedLayout(0) , mPageLayout(0) , mPageSelector(0) { // Need one widget for scroll area QWidget* topWidget = new QWidget(); QVBoxLayout* topLayout = new QVBoxLayout(topWidget); // Allows switching between "pages" QWidget* stackedWidget = new QWidget(); mStackedLayout = new QStackedLayout(stackedWidget); mPageSelector = new QComboBox(); connect(mPageSelector, SIGNAL(currentIndexChanged(int)), mStackedLayout, SLOT(setCurrentIndex(int))); topLayout->addWidget(mPageSelector); topLayout->addWidget(stackedWidget); topLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); // Add each option for (CSMPrefs::Category::Iterator iter = category.begin(); iter!=category.end(); ++iter) addSetting (*iter); setWidgetResizable(true); setWidget(topWidget); }
SetupPlugins::SetupPlugins(QWidget* parent) : QScrollArea(parent), d(new SetupPluginsPriv) { QWidget* panel = new QWidget(viewport()); setWidget(panel); setWidgetResizable(true); QVBoxLayout* layout = new QVBoxLayout(panel); d->pluginsNumber = new QLabel(panel); if (KIPI::PluginLoader::instance()) { d->kipiConfig = KIPI::PluginLoader::instance()->configWidget(panel); d->kipiConfig->setWhatsThis(i18n("A list of available Kipi plugins appears below.")); } layout->addWidget(d->pluginsNumber); layout->addWidget(d->kipiConfig); layout->setMargin(KDialog::spacingHint()); layout->setSpacing(KDialog::spacingHint()); if (KIPI::PluginLoader::instance()) { KIPI::PluginLoader::PluginList list = KIPI::PluginLoader::instance()->pluginList(); initPlugins((int)list.count()); } // -------------------------------------------------------- setAutoFillBackground(false); viewport()->setAutoFillBackground(false); panel->setAutoFillBackground(false); }
SortableView::SortableView(const QString &mimeType, QWidget *parent) : QScrollArea(parent) , m_children() , m_layoutWidget(this) , m_layout(&m_layoutWidget) // Scroll area child widget , m_mimeType(mimeType) , m_indicator(this) , m_scrollTimer(this) , m_scrollDelta(0) , m_curLevel(0) , m_curMousePos(0, 0) { // Display the layout widget in the scroll area setWidget(&m_layoutWidget); // Remove layout margin and spacing m_layout.setMargin(0); m_layout.setSpacing(0); // Add stretch item at the end of the list m_layout.addStretch(); // Allow the scroll area to resize the layout widget dynamically setWidgetResizable(true); // Hide the indicator widget m_indicator.hide(); // This widget can accept drag-and-drop items setAcceptDrops(true); // Connect timer signals connect(&m_scrollTimer, &QTimer::timeout, this, &SortableView::scrollTimeout); }
TracksPanel::TracksPanel(QWidget *parent) : SidePanel("Tracks", parent), d(new TracksPanelPrivate(this)) { d->tracks_bus = new TracksBus; d->tracks_list = new QWidget; auto layout0 = new QVBoxLayout; layout0->setMargin(0); layout0->setSpacing(0); for(int i = 0; i < 16; ++i) { layout0->addWidget(new TracksItem); } layout0->addStretch(); d->tracks_list->setLayout(layout0); auto scroll_area = new QScrollArea; scroll_area->setWidgetResizable(true); scroll_area->setWidget(d->tracks_list); scroll_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); auto layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); layout->addWidget(d->tracks_bus); layout->addWidget(scroll_area); this->centralWidget()->setLayout(layout); }
MessageDisplayWidget::MessageDisplayWidget(QWidget *parent) : QScrollArea(parent) { // Scroll down on new Message QScrollBar* scrollbar = verticalScrollBar(); connect(scrollbar, &QScrollBar::rangeChanged, this, &MessageDisplayWidget::moveScrollBarToBottom, Qt::UniqueConnection); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setWidgetResizable(true); setFrameShape(QFrame::NoFrame); QWidget *widget = new QWidget(this); widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); setWidget(widget); mainlayout = new QVBoxLayout(widget); mainlayout->setSpacing(1); mainlayout->setContentsMargins(1,1,1,1); // Animation if(Settings::getInstance().isAnimationEnabled()) { animation = new QPropertyAnimation(this, "scrollPos"); animation->setDuration(200); animation->setLoopCount(1); mainlayout->setMargin(1); } }
WordCounts::WordCounts(QWidget* parent) : QScrollArea(parent), m_show_max(false) { setBackgroundRole(QPalette::Mid); setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); QWidget* contents = new QWidget(this); setWidget(contents); setWidgetResizable(true); QLabel* label = new QLabel(QString("<small><b>%1<br>%2</b></small>").arg(tr("Letters:"), tr("Found:")), contents); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); QHBoxLayout* layout = new QHBoxLayout(contents); layout->setSpacing(12); layout->addWidget(label); for (int i = 0; i < 26; ++i) { Group group; group.length = i; group.count = 0; group.max = 0; group.label = new QLabel(contents); group.label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); group.label->setVisible(false); layout->addWidget(group.label); m_groups.append(group); } layout->addStretch(); updateString(); setMinimumHeight(contents->sizeHint().height() + horizontalScrollBar()->sizeHint().height()); }
SelectedEntityPropertiesViewer::SelectedEntityPropertiesViewer( QWidget* parent ) : QScrollArea( parent ) , m_selectedEntityProperties( NULL ) , m_displayedEntity( NULL ) { setWidgetResizable( true ); }
void SoundPluginRack::update_rack() { spacer=NULL; if (rack_box) { rack_box->hide(); delete rack_box; //all will be deleted viewport()->setBackgroundRole(QPalette::NoRole); } rack_elements.clear(); rack_box=NULL; if (track==NULL) return; rack_box = new RackHBox(this); rack_box->hide(); QObject::connect(rack_box,SIGNAL(new_height_signal(int)),this,SLOT(rack_height_chanegd_slot( int ))); setWidget(rack_box); setWidgetResizable(true); for (int i=0;i<track->get_plugin_count();i++) { CVBox *plugin_vb = new CVBox(rack_box); plugin_vb->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); SoundPluginUI *ui = SoundPluginUI_List::get_singleton()->create_UI( track->get_plugin( i ), plugin_vb ); ERR_CONTINUE( ui==NULL ); ui->set_property_editor_updater( property_edit_updater ); RackElement e; e.plugin_ui=ui; QString preset_name=QStrify(track->get_plugin( i )->get_current_preset_name()); e.top=new PluginTop(plugin_vb,preset_name,i,track->get_plugin( i )->skips_processing(),track->get_plugin_count()); rack_elements.push_back(e); QObject::connect(ui,SIGNAL(property_edited_signal( Property*, double )),this,SLOT(property_edited_slot( Property*, double ))); QObject::connect(e.top,SIGNAL(action_signal( int,int )),this,SLOT(plugin_action_signal( int,int )),Qt::QueuedConnection); QObject::connect(ui,SIGNAL(property_options_requested( Property* )),this,SLOT(property_options_requested( Property* )),Qt::QueuedConnection); //queue is necesary to avoid crashes QObject::connect(ui,SIGNAL(preset_name_changed_signal()),this,SLOT(plugin_renamed_slot())); //queue is necesary to } spacer = new QFrame(rack_box); spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); rack_box->layout()->setMargin(0); rack_box->layout()->setSpacing(0); rack_box->adjustSize(); rack_box->show(); repaint(); update_scrollbar(); }
void PropertiesDialog::addTab(QTabWidget* tabWidget, QString name, IntListIter begin, IntListIter end) { auto scrollArea = new QScrollArea; scrollArea->setFrameStyle(QFrame::NoFrame); auto scrollWidget = new QWidget; auto scrollLayout = new QVBoxLayout; scrollWidget->setLayout(scrollLayout); scrollLayout->setContentsMargins(0, 0, 0, 0); scrollArea->setWidget(scrollWidget); scrollArea->setWidgetResizable(true); for(auto it = begin; it != end; ++it) { auto& prop = m_propertyWidgets[*it]; auto groupBox = new QGroupBox; auto layout = new QVBoxLayout; layout->setContentsMargins(5, 5, 5, 5); groupBox->setLayout(layout); QString title = QString::fromStdString(prop.property->name()); groupBox->setTitle(title); groupBox->setToolTip(QString::fromStdString(prop.property->help())); layout->addWidget(prop.widget->createWidgets()); scrollLayout->addWidget(groupBox); prop.groupBox = groupBox; prop.title = title; } scrollLayout->addStretch(1); tabWidget->addTab(scrollArea, name); }
VerticalScrollArea::VerticalScrollArea(QWidget *parent) : QScrollArea(parent) { setWidgetResizable(true); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); }
KNPreferenceCategoryList::KNPreferenceCategoryList(QWidget *parent) : QScrollArea(parent) { //Set properties. setContentsMargins(0,0,0,0); setWidgetResizable(true); setFrameShape(QFrame::NoFrame); //Set background transparent. QPalette pal=palette(); pal.setColor(QPalette::Base, QColor(0,0,0,0)); pal.setColor(QPalette::Window, QColor(0,0,0,0)); setPalette(pal); //Initial container. QWidget *contentsContainer=new QWidget(this); contentsContainer->setContentsMargins(0,0,0,0); setWidget(contentsContainer); //Set main layout. m_mainLayout=new QBoxLayout(QBoxLayout::TopToBottom, this); m_mainLayout->setContentsMargins(0,5,0,5); m_mainLayout->setSpacing(0); contentsContainer->setLayout(m_mainLayout); //Initial the signal mapper. m_buttonMapper=new QSignalMapper(this); connect(m_buttonMapper, SIGNAL(mapped(int)), this, SLOT(setCurrentIndex(int))); m_mainLayout->addStretch(); }
ScrollingWidget::ScrollingWidget(QWidget *parent) : QScrollArea(parent), _direction(true) { _timer = new QTimer(this); QWidget *widget = new QWidget(this); _label = new QLabel(widget); QHBoxLayout *layout = new QHBoxLayout; layout->setContentsMargins(4,0,4,0); layout->setSpacing(10); layout->addWidget(_label); layout->addSpacerItem(new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Fixed)); widget->setLayout(layout); setWidget(widget); setWidgetResizable(true); setMaximumHeight(35); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); connect(_label, SIGNAL(linkActivated(QString)), this, SIGNAL(open(QString))); connect(_timer, SIGNAL(timeout()), this, SLOT(scroll())); _timer->start(50); }
PartSpecificationsWidget::PartSpecificationsWidget(QList<QWidget*> widgets, QWidget *parent) : QScrollArea(parent) { m_scrollContent = new QFrame(this); m_scrollContent->setObjectName("scroll"); //m_scrollContent->setSizePolicy(QSizePolicy::M,QSizePolicy::Expanding); QGridLayout *layout = new QGridLayout(m_scrollContent); for(int i=0; i < widgets.size(); i++) { //widgets[i]->setFrameStyle(QFrame::StyledPanel | QFrame::Raised); widgets[i]->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); layout->addWidget(widgets[i],i,0); if(widgets[i]->metaObject()->indexOfSignal(QMetaObject::normalizedSignature("editionStarted()")) > -1) { connect(widgets[i],SIGNAL(editionStarted()),this,SLOT(updateLayout())); } if(widgets[i]->metaObject()->indexOfSignal(QMetaObject::normalizedSignature("editionFinished()")) > -1) { connect(widgets[i],SIGNAL(editionFinished()),this,SLOT(updateLayout())); } } layout->setMargin(0); layout->setSpacing(10); setWidget(m_scrollContent); setMinimumWidth(m_scrollContent->width()+15); //scrollbar setWidgetResizable(true); QGridLayout *mylayout = new QGridLayout(this); mylayout->setMargin(0); mylayout->setSpacing(0); //resize(sizeHint()); }
LegendView(QWidget *parent): QScrollArea(parent) { contentsWidget = new QWidget(this); setWidget(contentsWidget); setWidgetResizable(false); }
ContextualView::ContextualView(QWidget *parent) : QScrollArea(parent) { setPalette(parent->palette()); scrollingContextualView = new ScrollingContextualView(this); setFrameShape(QFrame::NoFrame); setWidgetResizable(true); setWidget(scrollingContextualView); }
/** StackedWidgetHome **/ StackedWidgetHome::StackedWidgetHome(QWidget *parent) : QScrollArea(parent) { setWidgetResizable(true); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); connect(&Settings::getInstance(), &Settings::homeLayoutChanged, this, &StackedWidgetHome::setHomeLayout); setHomeLayout(Settings::getInstance().homeLayout()); }
/////////////////////// // ScrollArea ////////////////////// NCPreviewScrollArea::NCPreviewScrollArea( NCPreview * parent ) : QScrollArea( parent ) { setBackgroundRole(QPalette::Dark); //setAlignment( Qt::AlignCenter ); setWidgetResizable( false ); pvForm = parent; //setViewportMargins ( 20, 20, 20, 20 ); }
CABSLBehaviorScrollingWidget(CABSLBehaviorView& cabslBehaviorView) { setFrameStyle(QFrame::NoFrame); setWidgetResizable(true); cabslBehaviorWidget = new CABSLBehaviorWidget(cabslBehaviorView, this); setWidget(cabslBehaviorWidget); setFocusProxy(cabslBehaviorWidget); }
void ThumbnailsPanel::basicInit() { m_thumbnailsList.clear(); m_scrollArea = this; m_widget = new QWidget(m_scrollArea); m_scrollArea->setWidget(m_widget); setWidgetResizable(true); }
SettingsPanel::SettingsPanel(QSettings* settings, QWidget* parent) : QScrollArea(parent), _settings(settings) { QWidget* widget = new QWidget(this); auto layout = new QVBoxLayout(widget); widget->setLayout(layout); setWidget(widget); setWidgetResizable(true); }
void GraphEditor::handleShowFlattenedDialog(void) { if (not this->isVisible()) return; std::string errorMsg; try { //temp file auto tempFile = Poco::TemporaryFile::tempName(); Poco::TemporaryFile::registerForDeletion(tempFile); //create args Poco::Process::Args args; args.push_back("-Tpng"); //yes png args.push_back("-o"); //output to file args.push_back(tempFile); //launch Poco::Pipe inPipe, outPipe, errPipe; Poco::Process::Env env; Poco::ProcessHandle ph(Poco::Process::launch( Poco::Environment::get("DOT_EXECUTABLE", "dot"), args, &inPipe, &outPipe, &errPipe, env)); //write the markup into dot Poco::PipeOutputStream os(inPipe); os << _topologyEngine->getTopology().toDotMarkup(); os.close(); outPipe.close(); //check for errors if (ph.wait() != 0 or not QFile(QString::fromStdString(tempFile)).exists()) { Poco::PipeInputStream es(errPipe); std::string errMsg; es >> errMsg; throw Pothos::Exception("PothosGui.GraphEditor.showFlattenedGraphDialog()", "png failed: " + errMsg); } //create the image from file QImage image(QString::fromStdString(tempFile), "png"); //create the dialog auto dialog = new QDialog(this); dialog->setWindowTitle(tr("Flattened graph")); dialog->setMinimumSize(800, 600); auto layout = new QVBoxLayout(dialog); dialog->setLayout(layout); auto scroll = new QScrollArea(dialog); layout->addWidget(scroll); auto label = new QLabel(scroll); scroll->setWidget(label); scroll->setWidgetResizable(true); label->setPixmap(QPixmap::fromImage(image)); dialog->exec(); delete dialog; }
PFSViewWidgetArea::PFSViewWidgetArea( QWidget *parent ) : QScrollArea( parent ) { PFSViewWidget *pfsview = new PFSViewWidget( this ); setWidget( pfsview ); setWidgetResizable( true ); setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); }
StackedScrollWidget::StackedScrollWidget(StackedScrollGroup* group, QWidget* parent) : StackedWidgetT<QScrollArea>(group, parent) { setFrameStyle(QFrame::NoFrame); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); setWidgetResizable(true); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); }
VariablesTabView::VariablesTabView(openstudio::model::Model t_model, QWidget * parent) : MainTabView("Output Variables", MainTabView::MAIN_TAB, parent) { auto scrollarea = new QScrollArea(); VariablesList *vl = new VariablesList(t_model); scrollarea->setWidget(vl); scrollarea->setWidgetResizable(true); addTabWidget(scrollarea); vl->setAutoFillBackground(false); }
FastViewWidget::FastViewWidget(QWidget *parent) : QScrollArea(parent) { currentPage = -1; doc = 0; scaleFactor = 1.0; setAlignment(Qt::AlignCenter); setWidgetResizable(true); setMouseTracking(true); setStyleSheet("background: rgb(127, 127, 127)"); }
PreviewWidget::PreviewWidget(KileInfo *info, QWidget *parent, const char *name) : QScrollArea(parent), m_info(info), m_running(false) { setObjectName(name); setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); setWidgetResizable(true); m_imageDisplayWidget = new ImageDisplayWidget(this); setWidget(m_imageDisplayWidget); }