本文整理汇总了C++中setFixedHeight函数的典型用法代码示例。如果您正苦于以下问题:C++ setFixedHeight函数的具体用法?C++ setFixedHeight怎么用?C++ setFixedHeight使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFixedHeight函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SettingsItem
NextPageWidget::NextPageWidget(QFrame *parent)
: SettingsItem(parent),
m_title(new NormalLabel),
m_value(new TipsLabel),
m_nextPageBtn(new dcc::widgets::NextButton)
{
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->setSpacing(0);
mainLayout->setMargin(0);
mainLayout->setContentsMargins(20, 0, 10, 0);
mainLayout->addWidget(m_title);
mainLayout->addStretch();
mainLayout->addWidget(m_value);
mainLayout->addSpacing(5);
mainLayout->addWidget(m_nextPageBtn);
setFixedHeight(36);
setLayout(mainLayout);
setObjectName("NextPageWidget");
connect(m_nextPageBtn, &widgets::NextButton::clicked, this, &NextPageWidget::acceptNextPage);
connect(m_nextPageBtn, &widgets::NextButton::clicked, this, &NextPageWidget::clicked);
}
示例2: QDialog
FindDialog::FindDialog( QWidget * parent ) : QDialog( parent )
{
label = new QLabel( tr( "Find &what" ) );
lineEdit = new QLineEdit;
label->setBuddy( lineEdit );
caseCheckBox = new QCheckBox( tr( "Match &case" ) );
backwardCheckBox = new QCheckBox( tr( "Search &backward" ) );
findButton = new QPushButton( tr( "&Find" ) );
findButton->setDefault( true );
findButton->setEnabled( false );
closeButton = new QPushButton( tr( "Close" ) );
connect( lineEdit, SIGNAL( textChanged( const QString &) ),
this, SLOT( enableFindButton( const QString & ) ) );
connect( findButton, SIGNAL( clicked() ),
this, SLOT( findClicked() ) );
connect( closeButton, SIGNAL( clicked() ),
this, SLOT( close() ) );
QHBoxLayout *topLeftLayout = new QHBoxLayout;
topLeftLayout->addWidget( label );
topLeftLayout->addWidget( lineEdit );
QVBoxLayout *leftLayout = new QVBoxLayout;
leftLayout->addLayout( topLeftLayout );
leftLayout->addWidget( caseCheckBox );
leftLayout->addWidget( backwardCheckBox );
QVBoxLayout *rightLayout = new QVBoxLayout;
rightLayout->addWidget( findButton );
rightLayout->addWidget( closeButton );
rightLayout->addStretch();
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addLayout( leftLayout );
mainLayout->addLayout( rightLayout );
setLayout( mainLayout );
setWindowTitle( tr( "Find" ) );
setFixedHeight( sizeHint().height() );
}
示例3: QWidget
SortWidget::SortWidget( QWidget *parent )
: QWidget( parent )
{
setFixedHeight( 28 );
setContentsMargins( 3, 0, 3, 0 );
m_layout = new QHBoxLayout( this );
setLayout( m_layout );
m_layout->setSpacing( 0 );
m_layout->setContentsMargins( 0, 0, 0, 0 );
BreadcrumbItemButton *rootItem = new BreadcrumbItemButton(
KIcon( QPixmap( KStandardDirs::locate( "data", "amarok/images/playlist-sorting-16.png" ) ) ),
QString(), this );
rootItem->setToolTip( i18n( "Clear the playlist sorting configuration." ) );
m_layout->addWidget( rootItem );
connect( rootItem, SIGNAL(clicked()), this, SLOT(trimToLevel()) );
m_ribbon = new QHBoxLayout();
m_layout->addLayout( m_ribbon );
m_ribbon->setContentsMargins( 0, 0, 0, 0 );
m_ribbon->setSpacing( 0 );
m_addButton = new BreadcrumbAddMenuButton( this );
m_addButton->setToolTip( i18n( "Add a playlist sorting level." ) );
m_layout->addWidget( m_addButton );
m_layout->addStretch( 10 );
m_urlButton = new BreadcrumbUrlMenuButton( "playlist", this );
m_layout->addWidget( m_urlButton );
connect( m_addButton->menu(), SIGNAL(actionClicked(QString)), this, SLOT(addLevel(QString)) );
connect( m_addButton->menu(), SIGNAL(shuffleActionClicked()), The::playlistActions(), SLOT(shuffle()) );
QString sortPath = Amarok::config( "Playlist Sorting" ).readEntry( "SortPath", QString() );
readSortPath( sortPath );
}
示例4: setFixedHeight
void ToolBar::init() {
_menu.setTransparent(true);
_menu.setHeight(26);
_settings.setTransparent(true);
_settings.setHeight(26);
_palette.setTransparent(true);
_palette.setHeight(26);
_about.setTransparent(true);
_about.setHeight(26);
setFixedHeight(_st.height + _st.shadow_width);
_label.setStyleSheet(QString("background:%1;color:#ffffff;").arg(_st.background_color.name()));
_label.setFont(QFont(_st.font_family, _st.font_size));
_label.setAlignment(Qt::AlignCenter);
_main.setContentsMargins(_st.left_padding, 0, _st.right_padding, _st.bottom_padding);
_main.setSpacing(_st.left_padding);
if (align() == Align::Ltr) {
_main.addWidget(&_menu);
_main.addWidget(&_label);
_main.addStretch();
_main.addWidget(&_about);
_main.addWidget(&_palette);
_main.addWidget(&_settings);
} else {
_main.addWidget(&_settings);
_main.addWidget(&_palette);
_main.addWidget(&_about);
_main.addStretch();
_main.addWidget(&_label);
_main.addWidget(&_menu);
}
}
示例5: QDialog
//-----------------------------------------------------------------------------
// Function: DeleteWorkspaceDialog()
//-----------------------------------------------------------------------------
DeleteWorkspaceDialog::DeleteWorkspaceDialog(QWidget* parent) : QDialog(parent), workspaceCombo_(0), btnOk_(0)
{
// Create the name label and field.
QLabel* nameLabel = new QLabel(tr("Workspace:"), this);
workspaceCombo_ = new QComboBox(this);
QHBoxLayout* nameLayout = new QHBoxLayout();
nameLayout->addWidget(nameLabel);
nameLayout->addWidget(workspaceCombo_, 1);
// Create the info label.
QLabel* infoLabel = new QLabel(tr("Notice: The default workspace and the currently active workspace cannot be deleted."), this);
infoLabel->setWordWrap(true);
// Create the dialog buttons.
btnOk_ = new QPushButton(tr("OK") , this);
btnOk_->setEnabled(false);
QPushButton* btnCancel = new QPushButton(tr("Cancel"), this);
QHBoxLayout* buttonLayout = new QHBoxLayout();
buttonLayout->addStretch(1);
buttonLayout->addWidget(btnOk_);
buttonLayout->addWidget(btnCancel);
// Create the main mainLayout.
QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->addLayout(nameLayout);
mainLayout->addWidget(infoLabel);
mainLayout->addLayout(buttonLayout);
connect(btnOk_, SIGNAL(clicked()), this, SLOT(accept()));
connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
setWindowTitle(tr("Delete Workspace"));
setFixedWidth(300);
setFixedHeight(sizeHint().height());
}
示例6: QDialog
SnapshotShareDialog::SnapshotShareDialog(QString fileName, QWidget* parent) :
QDialog(parent),
_fileName(fileName),
_networkAccessManager(NULL)
{
setAttribute(Qt::WA_DeleteOnClose);
_ui.setupUi(this);
QPixmap snaphsotPixmap(fileName);
float snapshotRatio = static_cast<float>(snaphsotPixmap.size().width()) / snaphsotPixmap.size().height();
// narrow snapshot
if (snapshotRatio > 1) {
setFixedWidth(WIDE_SNAPSHOT_DIALOG_WIDTH);
_ui.snapshotWidget->setFixedWidth(WIDE_SNAPSHOT_DIALOG_WIDTH);
}
float labelRatio = static_cast<float>(_ui.snapshotWidget->size().width()) / _ui.snapshotWidget->size().height();
// set the same aspect ratio of label as of snapshot
if (snapshotRatio > labelRatio) {
int oldHeight = _ui.snapshotWidget->size().height();
_ui.snapshotWidget->setFixedHeight((int) (_ui.snapshotWidget->size().width() / snapshotRatio));
// if height is less then original, resize the window as well
if (_ui.snapshotWidget->size().height() < NARROW_SNAPSHOT_DIALOG_SIZE) {
setFixedHeight(size().height() - (oldHeight - _ui.snapshotWidget->size().height()));
}
} else {
_ui.snapshotWidget->setFixedWidth((int) (_ui.snapshotWidget->size().height() * snapshotRatio));
}
_ui.snapshotWidget->setPixmap(snaphsotPixmap);
_ui.snapshotWidget->adjustSize();
}
示例7: configurableWidgetMap
QConfigurableLoadSaveDialog::QConfigurableLoadSaveDialog(QMap<QString, QConfigurableWidget*> configurableWidgetMap) :
configurableWidgetMap(configurableWidgetMap) {
function = ConfigurableSave;
setFixedHeight(200);
setMinimumWidth(300);
setLayout(new QVBoxLayout());
setWindowTitle("Select the ConfigurableStates to be saved");
cbFrame_ypos = 0;
cbFrame = new QFrame();
cbFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
grid = new QGridLayout(cbFrame);
int row = 0;
checkBoxConfiguableWidgetList.clear();
foreach(QConfigurableWidget* configurableWidget, configurableWidgetMap)
{
QCheckBox* cb = new QCheckBox();
cb->setText(configurableWidget->getName());
cb->setCheckState(Qt::Checked);
grid->addWidget(cb, row++, 0, Qt::AlignTop);
checkBoxConfiguableWidgetList.append(cb);
}
示例8: QWidget
KNMainWindowStatusBar::KNMainWindowStatusBar(QWidget *parent) :
QWidget(parent),
m_backgroundColor(QColor(255, 255, 255)),
m_background(QLinearGradient(QPointF(0, 0), knDpi->posF(GradientWidth, 0))),
m_mainLayout(new QBoxLayout(QBoxLayout::RightToLeft, this)),
m_mouseInOut(generateTimeline()),
m_opacity(MinimumOpacity),
m_buttonCount(0)
{
//Set properties.
setContentsMargins(0, 0, 0, 0);
setFixedWidth(knDpi->width(GradientWidth));
setFixedHeight(knDpi->height(20));
//Initial the background.
m_background.setColorAt(0, QColor(0, 0, 0, 0));
//Update the gradient.
updateGradient();
//Configure the main layout.
m_mainLayout->setContentsMargins(
knDpi->margins(GradientWidth, 0, RightSpacing, 0));
m_mainLayout->setSpacing(0);
setLayout(m_mainLayout);
}
示例9: QWidget
QIMPenSettingsWidget::QIMPenSettingsWidget( QWidget *parent, const char *name )
: QWidget( parent )
{
setObjectName( name );
// charSets.setAutoDelete( true );
inputStroke = 0;
outputChar = 0;
outputStroke = 0;
mode = Waiting;
currCharSet = 0;
readOnly = false;
// strokes.setAutoDelete( true );
timer = new QTimer(this);
connect( timer, SIGNAL(timeout()), SLOT(timeout()));
setBackgroundRole( QPalette::Base );
/*
setBackgroundColor( qApp->palette().color( QPalette::Active,
QPalette::Base ) );
*/
strokeColor = palette().color(QPalette::Text);
setFixedHeight( 75 );
}
示例10: updateButtons
void KstVvDialogI::fillFieldsForNew() {
// set tag name
_tagName->setText(defaultTag);
_legendText->setText(defaultTag);
_legendText->show();
_legendLabel->show();
// set the curve placement window
_w->_curvePlacement->update();
// for some reason the lower widget needs to be shown first to prevent overlapping?
_w->_curveAppearance->hide();
_w->_curvePlacement->show();
_w->_curveAppearance->show();
_w->_curveAppearance->reset();
QColor qc = _w->_curveAppearance->color();
_w->_curveAppearance->setValue(true, false, false, qc, 0, 0, 0, 0, 0);
updateButtons();
adjustSize();
resize(minimumSizeHint());
setFixedHeight(height());
}
示例11: QWidget
SearchLineEdit_mac::SearchLineEdit_mac(QWidget* parent)
: QWidget(parent)
, d(new SearchLineEdit_mac::Private(this))
{
QHBoxLayout* layout = new QHBoxLayout(this);
layout->addWidget(d);
layout->setContentsMargins(4, 5, 2, 2);
connect(
d,
SIGNAL(textChanged(QString)),
this,
SIGNAL(textChanged(QString))
);
connect(
d,
SIGNAL(returnPressed()),
this,
SIGNAL(returnPressed())
);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
setMinimumSize(sizeHint());
setFixedHeight(sizeHint().height());
}
示例12: QWidget
WindowTitleBar::WindowTitleBar(QWidget *parent) : QWidget(parent),
m_Cache (NULL),
m_Title (this),
m_Minimize(WindowButton::BUTTON_MINIMIZE, this),
m_Maximize(WindowButton::BUTTON_MAXIMIZE, this),
m_Close (WindowButton::BUTTON_CLOSE , this)
{
setFixedHeight(33);
setAttribute(Qt::WA_TranslucentBackground);
m_Title.setStyleSheet("color: white; font-family: Sans; font-weight: bold; font-size: 14px");
UpdateWindowTitle();
connect(&m_Minimize, SIGNAL(clicked ()),
this , SLOT (Minimized()));
connect(&m_Maximize, SIGNAL(clicked ()),
this, SLOT (Maximized()));
connect(&m_Close , SIGNAL(clicked ()),
this , SLOT (Quit ()));
}
示例13: QWidget
/* UIMiniProgressWidget stuff: */
UIMiniProgressWidget::UIMiniProgressWidget(QWidget *pParent /* = 0 */)
: QWidget(pParent)
, m_pProgressBar(new QProgressBar(this))
, m_pCancelButton(new UIMiniCancelButton(this))
{
/* Progress-bar setup: */
m_pProgressBar->setFixedWidth(100);
m_pProgressBar->setFormat("%p%");
m_pProgressBar->setValue(0);
/* Cancel-button setup: */
m_pCancelButton->setFocusPolicy(Qt::NoFocus);
m_pCancelButton->removeBorder();
connect(m_pCancelButton, SIGNAL(clicked()), this, SIGNAL(sigCancel()));
setContentsMargins(0, 0, 0, 0);
setFixedHeight(16);
/* Layout setup: */
QHBoxLayout *pMainLayout = new QHBoxLayout(this);
VBoxGlobal::setLayoutMargin(pMainLayout, 0);
#ifdef Q_WS_MAC
pMainLayout->setSpacing(2);
m_pProgressBar->setFixedHeight(14);
m_pCancelButton->setFixedHeight(11);
pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignTop);
pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignBottom);
#else /* Q_WS_MAC */
pMainLayout->setSpacing(0);
pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignCenter);
pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignCenter);
#endif /* !Q_WS_MAC */
pMainLayout->addStretch(1);
}
示例14: SPage
MainPage::MainPage( SApplication *parent )
: SPage( tr("Disc Eraser") , parent , SPage::WindowedPage )
{
p = new MainPagePrivate;
p->device_list = new SDeviceList( this );
p->dst_combo = new SComboBox();
p->dst_combo->setIconSize( QSize(22,22) );
p->toolbar = new QToolBar();
p->toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
p->toolbar->setStyleSheet( "QToolBar{ border-style:solid ; margin:0px }" );
p->options_widget = new QWidget();
p->options_ui = new Ui::OptionsUi;
p->options_ui->setupUi( p->options_widget );
p->layout = new QVBoxLayout( this );
p->layout->addWidget( p->dst_combo );
p->layout->addWidget( p->options_widget );
p->layout->addWidget( p->toolbar );
p->layout->setContentsMargins( 10 , 10 , 10 , 10 );
setFixedWidth( 373 );
setFixedHeight( EXPANDED_HEIGHT );
p->dst_combo->setCurrentIndex( 0 );
connect( p->device_list , SIGNAL(deviceDetected(SDeviceItem)) , SLOT(deviceDetected(SDeviceItem)) );
p->device_list->refresh();
init_actions();
more_prev();
}
示例15: Operation
void CSVDoc::Operations::setProgress (int current, int max, int type, int threads)
{
for (std::vector<Operation *>::iterator iter (mOperations.begin()); iter!=mOperations.end(); ++iter)
if ((*iter)->getType()==type)
{
(*iter)->setProgress (current, max, threads);
return;
}
int oldCount = mOperations.size();
int newCount = oldCount + 1;
Operation *operation = new Operation (type, this);
connect (operation, SIGNAL (abortOperation (int)), this, SIGNAL (abortOperation (int)));
mLayout->addLayout (operation->getLayout());
mOperations.push_back (operation);
operation->setProgress (current, max, threads);
if ( oldCount > 0)
setFixedHeight (height()/oldCount * newCount);
setVisible (true);
}