本文整理汇总了C++中QScrollArea::setMinimumHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::setMinimumHeight方法的具体用法?C++ QScrollArea::setMinimumHeight怎么用?C++ QScrollArea::setMinimumHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::setMinimumHeight方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
/**
* @brief MapManager::init si occupa di inizializzare il thread che controlla il robot e di fare il setup della GUI
*/
void MapManager::init()
{
// Creo il thread del robot
setupRobotManagerThread();
// Adesso creo la view QML
QQuickView view;
QQmlContext* rootContext = view.rootContext();
// Espongo al modulo QML questa classe, in modo che possa connettere i suoi signal
rootContext->setContextProperty("window", this);
// Inserisco come proprietà QML delle costanti che corrispondono alla grandezza della finestra
rootContext->setContextProperty("WINDOW_WIDTH", WIDTH);
rootContext->setContextProperty("WINDOW_HEIGHT", HEIGHT);
//Carico il file base
view.setSource(QStringLiteral("main.qml"));
// Finito con i setaggi, mostro la finestra
view.show();
// Creo il widget che mostra le immagini della camera del robot durante la rircerca
QWidget cameraWidget;
QHBoxLayout *hbox = new QHBoxLayout(&cameraWidget);
// Aggiungo alla horizontal box la QLabel che conterrà le immagini della camera
hbox->addWidget(&cameraLabel);
cameraWidget.show();
// Creo il widget che mostra le vittime trovate
QWidget victimsFoundWidget;
QScrollArea *scrollArea = new QScrollArea();
layout = new QVBoxLayout(&victimsFoundWidget);
// setto le proprietà della ScrollArea e la mostro
scrollArea->setWidget(&victimsFoundWidget);
scrollArea->setWidgetResizable(true);
scrollArea->setMinimumWidth(260);
scrollArea->setMinimumHeight(300);
scrollArea->show();
// Avvio il loop della GUI
QApplication::instance()->exec();
}
示例2: CryptoConfigComponentGUI
void Kleo::CryptoConfigModule::init( Layout layout ) {
Kleo::CryptoConfig * const config = mConfig;
const KPageView::FaceType type=determineJanusFace( config, layout );
setFaceType(type);
QVBoxLayout * vlay = 0;
QWidget * vbox = 0;
if ( type == Plain ) {
vbox = new QWidget(this);
vlay = new QVBoxLayout( vbox );
vlay->setSpacing( KDialog::spacingHint() );
vlay->setMargin( 0 );
addPage( vbox, i18n("GpgConf Error") );
}
const QStringList components = config->componentList();
for ( QStringList::const_iterator it = components.begin(); it != components.end(); ++it ) {
//kDebug(5150) <<"Component" << (*it).toLocal8Bit() <<":";
Kleo::CryptoConfigComponent* comp = config->component( *it );
Q_ASSERT( comp );
if ( comp->groupList().empty() )
continue;
if ( type != Plain ) {
vbox = new QWidget(this);
vlay = new QVBoxLayout( vbox );
vlay->setSpacing( KDialog::spacingHint() );
vlay->setMargin( 0 );
KPageWidgetItem *pageItem = new KPageWidgetItem( vbox, comp->description() );
if ( type != Tabbed )
pageItem->setIcon( loadIcon( comp->iconName() ) );
addPage(pageItem);
}
QScrollArea* scrollArea = type == Tabbed ? new QScrollArea( this ) : new ScrollArea( this );
scrollArea->setWidgetResizable( true );
vlay->addWidget( scrollArea );
CryptoConfigComponentGUI* compGUI =
new CryptoConfigComponentGUI( this, comp, scrollArea );
compGUI->setObjectName( *it );
scrollArea->setWidget( compGUI );
scrollArea->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
// KJanusWidget doesn't seem to have iterators, so we store a copy...
mComponentGUIs.append( compGUI );
// Set a nice startup size
const int deskHeight = QApplication::desktop()->height();
int dialogHeight;
if (deskHeight > 1000) // very big desktop ?
dialogHeight = 800;
else if (deskHeight > 650) // big desktop ?
dialogHeight = 500;
else // small (800x600, 640x480) desktop
dialogHeight = 400;
assert( scrollArea->widget() );
if ( type != Tabbed )
scrollArea->setMinimumHeight( qMin( compGUI->sizeHint().height(), dialogHeight ) );
}
if ( mComponentGUIs.empty() ) {
const QString msg = i18n("The gpgconf tool used to provide the information "
"for this dialog does not seem to be installed "
"properly. It did not return any components. "
"Try running \"%1\" on the command line for more "
"information.",
components.empty() ? "gpgconf --list-components" : "gpgconf --list-options gpg" );
QLabel * label = new QLabel( msg, vbox );
label->setWordWrap( true);
label->setMinimumHeight( fontMetrics().lineSpacing() * 5 );
vlay->addWidget( label );
}
}
示例3: QPushButton
DvbEpgDialog::DvbEpgDialog(DvbManager *manager_, QWidget *parent) : KDialog(parent),
manager(manager_)
{
setButtons(KDialog::Close);
setCaption(i18nc("@title:window", "Program Guide"));
QWidget *widget = new QWidget(this);
QBoxLayout *mainLayout = new QHBoxLayout(widget);
epgChannelTableModel = new DvbEpgChannelTableModel(this);
epgChannelTableModel->setManager(manager);
channelView = new QTreeView(widget);
channelView->setMaximumWidth(30 * fontMetrics().averageCharWidth());
channelView->setModel(epgChannelTableModel);
channelView->setRootIsDecorated(false);
channelView->setUniformRowHeights(true);
connect(channelView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
this, SLOT(channelActivated(QModelIndex)));
mainLayout->addWidget(channelView);
QBoxLayout *rightLayout = new QVBoxLayout();
QBoxLayout *boxLayout = new QHBoxLayout();
KAction *scheduleAction = new KAction(QIcon::fromTheme(QLatin1String("media-record")),
i18nc("@action:inmenu tv show", "Record Show"), this);
connect(scheduleAction, SIGNAL(triggered()), this, SLOT(scheduleProgram()));
QPushButton *pushButton =
new QPushButton(scheduleAction->icon(), scheduleAction->text(), widget);
connect(pushButton, SIGNAL(clicked()), this, SLOT(scheduleProgram()));
boxLayout->addWidget(pushButton);
boxLayout->addWidget(new QLabel(i18nc("@label:textbox", "Search:"), widget));
epgTableModel = new DvbEpgTableModel(this);
epgTableModel->setEpgModel(manager->getEpgModel());
connect(epgTableModel, SIGNAL(layoutChanged()), this, SLOT(checkEntry()));
KLineEdit *lineEdit = new KLineEdit(widget);
lineEdit->setClearButtonShown(true);
connect(lineEdit, SIGNAL(textChanged(QString)),
epgTableModel, SLOT(setContentFilter(QString)));
boxLayout->addWidget(lineEdit);
rightLayout->addLayout(boxLayout);
epgView = new QTreeView(widget);
epgView->addAction(scheduleAction);
epgView->header()->setResizeMode(QHeaderView::ResizeToContents);
epgView->setContextMenuPolicy(Qt::ActionsContextMenu);
epgView->setMinimumWidth(75 * fontMetrics().averageCharWidth());
epgView->setModel(epgTableModel);
epgView->setRootIsDecorated(false);
epgView->setUniformRowHeights(true);
connect(epgView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
this, SLOT(entryActivated(QModelIndex)));
rightLayout->addWidget(epgView);
contentLabel = new QLabel(widget);
contentLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
contentLabel->setMargin(5);
contentLabel->setWordWrap(true);
QScrollArea *scrollArea = new QScrollArea(widget);
scrollArea->setBackgroundRole(QPalette::Light);
scrollArea->setMinimumHeight(12 * fontMetrics().height());
scrollArea->setWidget(contentLabel);
scrollArea->setWidgetResizable(true);
rightLayout->addWidget(scrollArea);
mainLayout->addLayout(rightLayout);
setMainWidget(widget);
}
示例4: createWidgets
void CloudDialog::createWidgets()
{
QLabel * label = 0;
bool isConnected = false;
m_amazonProviderWidget = new AmazonProviderWidget(this);
m_blankProviderWidget = new BlankProviderWidget(this);
m_vagrantProviderWidget = new VagrantProviderWidget(this);
// BLANK PAGE
QWidget * blankPageWidget = new QWidget();
// LOGIN PAGE
QHBoxLayout * mainLoginLayout = new QHBoxLayout;
mainLoginLayout->setContentsMargins(QMargins(0,0,0,0));
mainLoginLayout->setSpacing(5);
QWidget * loginPageWidget = new QWidget;
loginPageWidget->setLayout(mainLoginLayout);
// LEFT LOGIN LAYOUT
m_leftLoginLayout = new QVBoxLayout();
mainLoginLayout->addLayout(m_leftLoginLayout);
label = new QLabel;
label->setObjectName("H2");
label->setText("Cloud Resources");
m_leftLoginLayout->addWidget(label,0,Qt::AlignTop | Qt::AlignLeft);
m_cloudResourceComboBox = new QComboBox();
m_leftLoginLayout->addWidget(m_cloudResourceComboBox,0,Qt::AlignTop | Qt::AlignLeft);
//m_cloudResourceComboBox->addItem(NO_PROVIDER);
if(showVagrant()) m_cloudResourceComboBox->addItem(VAGRANT_PROVIDER);
m_cloudResourceComboBox->addItem(AMAZON_PROVIDER);
isConnected = connect(m_cloudResourceComboBox, SIGNAL(currentIndexChanged(const QString &)),
this, SLOT(cloudResourceChanged(const QString &)));
OS_ASSERT(isConnected);
// LOGIN STACKED WIDGET
m_loginStackedWidget = new QStackedWidget();
m_leftLoginLayout->addWidget(m_loginStackedWidget);
m_loginStackedWidget->addWidget(m_blankProviderWidget->m_loginWidget);
m_loginStackedWidget->addWidget(m_vagrantProviderWidget->m_loginWidget);
m_loginStackedWidget->addWidget(m_amazonProviderWidget->m_loginWidget);
m_loginStackedWidget->setCurrentIndex(m_blankProviderIdx);
// RIGHT LOGIN LAYOUT
m_rightLoginLayout = new QVBoxLayout();
mainLoginLayout->addLayout(m_rightLoginLayout);
m_legalAgreement = new QLabel;
m_legalAgreement->hide();
m_legalAgreement->setWordWrap(true);
AWSSettings awsSettings;
m_legalAgreement->setText(awsSettings.userAgreementText().c_str());
QScrollArea * scrollArea = new QScrollArea();
scrollArea->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
scrollArea->setFixedWidth(TEXT_WIDTH + 15);
scrollArea->setMinimumHeight(TEXT_HEIGHT);
scrollArea->setStyleSheet("background-color:transparent;");
scrollArea->setWidget(m_legalAgreement);
scrollArea->setWidgetResizable(true);
scrollArea->setAlignment(Qt::AlignTop);
scrollArea->setFrameShape(QFrame::NoFrame);
m_rightLoginLayout->addWidget(scrollArea);
m_iAcceptCheckBox = new QCheckBox("I Agree");
m_iAcceptCheckBox->hide();
m_rightLoginLayout->addWidget(m_iAcceptCheckBox,0,Qt::AlignTop | Qt::AlignLeft);
m_rightLoginLayout->addSpacing(5);
isConnected = connect(m_iAcceptCheckBox, SIGNAL(clicked(bool)),
this, SLOT(iAcceptClicked(bool)));
OS_ASSERT(isConnected);
m_rightLoginLayout->addSpacing(5);
// SETTINGS PAGE
m_mainSettingsLayout = new QVBoxLayout;
m_mainSettingsLayout->setContentsMargins(QMargins(0,0,0,0));
m_mainSettingsLayout->setSpacing(5);
QWidget * settingsPageWidget = new QWidget;
settingsPageWidget->setLayout(m_mainSettingsLayout);
// SETTINGS STACKED WIDGET
m_settingsStackedWidget = new QStackedWidget();
//.........这里部分代码省略.........
示例5: if
//.........这里部分代码省略.........
subsetCombo->setWhatsThis(
tr( "The Boxplot uses the currently selected subset of threads when determining its statistics."
" Other defined subsets can be chosen from the combobox menu, such as \"All\" threads or"
" \"Visited\" threads for only threads that visited the currently selected callpath."
" Additional subsets can be defined from the System Tree with the \"Define subset\" context menu"
" using the currently selected threads via multiple selection (control + left mouseclick)"
" or with the \"Find items\" context menu selection option." ) );
fillSubsetCombo();
connect( subsetCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( displayItems() ) );
connect( subsetCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateSubsetCombo() ) );
//system tabs have a system tree, topologies and box plot
{
ScrollArea* scrollArea = new ScrollArea( this, ScrollAreaTreeWidget );
treeWidget = new TreeWidget( scrollArea, SYSTEMTREE );
connect( treeWidget, SIGNAL( setMessage( QString ) ), this, SIGNAL( setMessage( QString ) ) );
connect( treeWidget, SIGNAL( selectionChanged() ), this, SLOT( resetSubsetCombo() ) );
treeWidget->setFont( treeFont );
treeWidget->setSpacing( spacing );
treeWidget->setTabWidget( this );
treeWidget->initialize( cube );
scrollArea->setMainWidget( treeWidget );
SplitterContainer* container = new SplitterContainer();
container->setComponent( treeWidget ); // main component, used in TabWidget
container->addWidget( scrollArea );
connect( treeWidget, SIGNAL( definedSubsetsChanged( const QString & ) ),
this, SLOT( fillSubsetCombo( const QString & ) ) );
container->addWidget( subsetCombo );
QList<int> sizeList;
sizeList << container->size().height() << 1;
container->setSizes( sizeList );
addTab( container, "System tree" );
}
{ // box plot tab
SplitterContainer* container = new SplitterContainer();
ScrollArea* scrollArea = new ScrollArea( this, ScrollAreaBoxPlot );
systemBoxWidget = new SystemBoxPlot( scrollArea, treeWidget );
scrollArea->setMainWidget( systemBoxWidget );
scrollArea->setWidgetResizable( true );
scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
container->setComponent( systemBoxWidget ); // main component, used in TabWidget
container->addWidget( scrollArea );
// set lower splitter element to minimum size (1 pixel => replaced by minimumSize())
QList<int> sizeList;
sizeList << container->size().height() << 1;
container->setSizes( sizeList );
systemBoxPlotIndex = addTab( container, "Box Plot" );
}
{
SystemTopologyWidget* systemTopologyWidget;
unsigned numTopologies = cube->get_cartv().size();
for ( unsigned i = 0; i < numTopologies; i++ )
{
QString name = ( cube->get_cartv() ).at( i )->get_name().c_str();
if ( name == "" )
{
name.append( "Topology " );
name.append( QString::number( i ) );
}
SplitterContainer* container = new SplitterContainer();
systemTopologyWidget = new SystemTopologyWidget( treeWidget, i );
systemTopologyWidget->setLineType( lineType );
systemTopologyWidget->initialize( cube );
container->setComponent( systemTopologyWidget );
container->addWidget( systemTopologyWidget );
/** add topology dimension toolbar with scrollPane */
QWidget* dimBar = systemTopologyWidget->getDimensionSelectionBar( cube );
if ( dimBar != 0 )
{
QScrollArea* scroll = new QScrollArea();
container->addWidget( scroll );
scroll->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
scroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
scroll->setFrameStyle( QFrame::NoFrame );
scroll->setMinimumHeight( dimBar->minimumSizeHint().height() );
scroll->setMaximumHeight( dimBar->minimumSizeHint().height() );
scroll->setWidget( dimBar );
long ndims = ( cube->get_cartv() ).at( i )->get_ndims();
if ( ndims <= 3 ) // minimize dimension selection bar
{
QList<int> sizeList;
sizeList << 1 << 0;
container->setSizes( sizeList );
}
}
addTab( container, name );
}
} // SYSTEMTAB
}