当前位置: 首页>>代码示例>>C++>>正文


C++ QLabel::setMinimumHeight方法代码示例

本文整理汇总了C++中QLabel::setMinimumHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QLabel::setMinimumHeight方法的具体用法?C++ QLabel::setMinimumHeight怎么用?C++ QLabel::setMinimumHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QLabel的用法示例。


在下文中一共展示了QLabel::setMinimumHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

KarbonSmallStylePreview::KarbonSmallStylePreview(QWidget* parent)
        : QWidget(parent)
{
    setFont(KGlobalSettings::smallestReadableFont());

    /* Create widget layout */
    QHBoxLayout *layout = new QHBoxLayout(this);
    QLabel * strokeLabel = new QLabel(i18n("Stroke:"), this);
    strokeLabel->setMinimumHeight(FRAMEHEIGHT);
    m_strokeFrame = new KarbonStrokeStyleWidget(this);
    m_strokeFrame->setMinimumSize(QSize(FRAMEWIDTH, FRAMEHEIGHT));

    QLabel * fillLabel = new QLabel(i18n("Fill:"), this);
    fillLabel->setMinimumHeight(FRAMEHEIGHT);
    m_fillFrame = new KarbonFillStyleWidget(this);
    m_fillFrame->setMinimumSize(QSize(FRAMEWIDTH, FRAMEHEIGHT));

    layout->addWidget(strokeLabel);
    layout->addWidget(m_strokeFrame);
    layout->addWidget(fillLabel);
    layout->addWidget(m_fillFrame);
    layout->setContentsMargins(0, 0, 0, 0);

    setLayout(layout);

    connect(KoToolManager::instance(), SIGNAL(changedCanvas(const KoCanvasBase *)),
            this, SLOT(canvasChanged(const KoCanvasBase *)));
    connect(m_strokeFrame, SIGNAL(clicked()), this, SIGNAL(strokeApplied()));
    connect(m_fillFrame, SIGNAL(clicked()), this, SIGNAL(fillApplied()));
}
开发者ID:foren197316,项目名称:calligra,代码行数:30,代码来源:KarbonSmallStylePreview.cpp

示例2: display

void CGraphicBuildingTile::display(QList<QString> _toDisplay)
{
    QDialog* infoDialog = new QDialog;//(dynamic_cast<QWidget*>(this->parent()));
    QVBoxLayout* newLayout = new QVBoxLayout();
    int q=0;
    QScrollArea* scrolArea = new QScrollArea(dynamic_cast<QWidget*>(this->parent()));
    for(int i=0;i<_toDisplay.count();i++)
    {   QLabel* newLabel = new QLabel(_toDisplay.at(i));
        newLabel->setFixedWidth(280);
        newLabel->setMinimumHeight(22);
        newLabel->setStyleSheet("border: 1px solid black");
        newLayout->addWidget(newLabel);
        q++;
    }
    QPalette pal;
    pal.setColor(QPalette::Background,QColor(230,200,167));
    infoDialog->setFixedWidth(330);
    infoDialog->setMinimumHeight(30+22*q);
    infoDialog->setLayout(newLayout);
    infoDialog->setAutoFillBackground(true);
    infoDialog->setPalette(pal);
    infoDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setWidget(infoDialog);
    scrolArea->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setMaximumHeight(infoDialog->size().height()+2);
    scrolArea->setWindowTitle(QString("Info about"));
    scrolArea->show();
}
开发者ID:KulerOvZuo,项目名称:SimCity,代码行数:28,代码来源:cgraphicbuildingtile.cpp

示例3: QDialog

AudioPlayingDialog::AudioPlayingDialog(QWidget *parent,
                                       const QString &name):
        QDialog(parent)
{
    setModal(true);
    setWindowTitle(tr("Playing audio file"));

    QGridLayout *metagrid = new QGridLayout;
    setLayout(metagrid);
    QWidget *w = new QWidget(this);
    QHBoxLayout *wLayout = new QHBoxLayout;
    metagrid->addWidget(w, 0, 0);

    QLabel *label = new QLabel(tr("Playing audio file \"%1\"").arg(name), w );
    wLayout->addWidget(label);
    w->setLayout(wLayout);

    label->setMinimumHeight(80);


    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel);
    metagrid->addWidget(buttonBox, 1, 0);
    metagrid->setRowStretch(0, 10);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
开发者ID:UIKit0,项目名称:rosegarden,代码行数:26,代码来源:AudioPlayingDialog.cpp

示例4: FlashableWidget

KeyboardWidget::KeyboardWidget(int width, int height, QWidget *parent):
    FlashableWidget(width, height, parent)
{

    ifstream keyboardLayout;
    keyboardLayout.open("qwerty.txt");
    if(keyboardLayout.fail())
    {
        QMessageBox errorMessage;
        //If the layout isn't working
        errorMessage.setWindowTitle("Error");
        errorMessage.setIcon(QMessageBox::Critical);
        errorMessage.setText("Can't load the keyboard layout!");
        errorMessage.show();
    }
    else
    {
        for(int i = 0; i < vLabels_.size(); ++i)
        {
            string keyboardKey;
            keyboardLayout >> keyboardKey;
            QLabel *key = vLabels_.at(i);
            key->setText(QString::fromStdString(keyboardKey));
            key->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
            key->setMinimumWidth(90);
            key->setMinimumHeight(90);
        }
    }

}
开发者ID:TheBCIProject,项目名称:MindWriterQt,代码行数:30,代码来源:keyboardwidget.cpp

示例5: setupUi

void SupportPage::setupUi()
{
   QVBoxLayout * vb = new QVBoxLayout;

	QLabel * lblCaption = new QLabel(this);
	lblCaption->setMinimumHeight(30);
   lblCaption->setText("<h3><center>" + tr("Support & Help") + "</center></h3>");
   lblCaption->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   lblCaption->setStyleSheet("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d9ebfb, stop: 0.4 #a1d4fb,stop: 0.5 #a1d4fb, stop: 1.0 #d9ebfb); background-position: left top; border-style: solid; border-width: 1px; border-color: silver; border-radius: 3px; color: black;");

   vb->addWidget(lblCaption);
   
   QTabWidget * tab = new QTabWidget(this);
   SupportWidget * sup = new SupportWidget(this);
   HelpWidget * help = new HelpWidget(this);
   //VideoWidget * video = new VideoWidget(this);
   EulaWidget * eula = new EulaWidget(this);
   tab->addTab(sup, tr("Support"));
   //tab->addTab(video, tr("Video Tutorial"));
   tab->addTab(help, tr("Help"));
   tab->addTab(eula, tr("EULA"));
   vb->addWidget(tab);
   //vb->addStretch(1);
   setLayout(vb);
}
开发者ID:lazyrun,项目名称:pokerbot,代码行数:25,代码来源:SupportPage.cpp

示例6: setGlobalOptions

/**
* Adds the specified HintingLineEdit widgets to this view. A hinting line edit
* comes with a label and an algorithm's name. Headings are also shown.
* @param stages : The stages, pre-process, process or post-process, as a vector
* @param algNames : The algorithm names as a vector
* @param hints : The hints for each algorithm as a vector
*/
void QDataProcessorWidget::setGlobalOptions(
    const std::vector<std::string> &stages,
    const std::vector<std::string> &algNames,
    const std::vector<std::map<std::string, std::string>> &hints) {
  // Headers
  QLabel *stageHeader = new QLabel(QString::fromStdString("<b>Stage</b>"));
  QLabel *algorithmHeader =
      new QLabel(QString::fromStdString("<b>Algorithm</b>"));
  QLabel *optionsHeader =
      new QLabel(QString::fromStdString("<b>Global Options</b>"));
  stageHeader->setMinimumHeight(30);
  ui.processLayout->addWidget(stageHeader, 0, 0);
  ui.processLayout->addWidget(algorithmHeader, 0, 1);
  ui.processLayout->addWidget(optionsHeader, 0, 2);

  int rows = static_cast<int>(stages.size());

  for (int row = 0; row < rows; row++) {

    // The title
    QLabel *stageLabel =
        new QLabel(QString::fromStdString(stages.at(row)), this);
    stageLabel->setMinimumSize(100, 10);
    ui.processLayout->addWidget(stageLabel, row + 1, 0);
    // The name
    QLabel *nameLabel =
        new QLabel(QString::fromStdString(algNames.at(row)), this);
    ui.processLayout->addWidget(new HintingLineEdit(this, hints.at(row)),
                                row + 1, 2);
    // The content
    ui.processLayout->addWidget(nameLabel, row + 1, 1);
  }
}
开发者ID:tyronerees,项目名称:mantid,代码行数:40,代码来源:QDataProcessorWidget.cpp

示例7: addLabel

// Create new label widget
QtWidgetObject* AtenTreeGuiDialog::addLabel(TreeGuiWidget* widget, QString text)
{
	QtWidgetObject* qtwo = widgetObjects_.add();
	QLabel *label = new QLabel(this);
	qtwo->set(widget, label, text);
	label->setText(text);
	label->setEnabled(widget->enabled());
	label->setVisible(widget->visible());
	label->setMinimumHeight(WIDGETHEIGHT);
	label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
	return qtwo;
}
开发者ID:alinelena,项目名称:aten,代码行数:13,代码来源:treegui_funcs.cpp

示例8: setLyric

void LyricWidget::setLyric(const QLyricList &lyric) {
    if (animWidget) delete animWidget;
    animWidget = new QWidget(this);
    animWidget->raise();
    ui->border->raise();
    QRect geo = this->geometry();
    animWidget->setMinimumWidth(geo.width());
    animWidget->setMaximumWidth(geo.width());
    animWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    QVBoxLayout *vbox = new QVBoxLayout(animWidget);
    vbox->setMargin(0);
    vbox->setSpacing(0);
    vbox->setContentsMargins(0, 0, 0, 0);
    animWidget->setLayout(vbox);

    labels.clear();
    curInd = 0;
    this->lyric = lyric;
    firstShowing = false;

    int widgetWidth = this->geometry().width();
    int accuHeight = 0;
    for (const QLyric& lyr : lyric) {
        QLabel *label = new QLabel(animWidget);
        QFont font("文泉驿微米黑", 11);
        font.setStyleStrategy(QFont::PreferAntialias);
        label->setFont(font);
        label->setText(QString("<font color='grey'>") +
                        lyr.lyric + QString("</font>"));
        label->setMaximumWidth(widgetWidth);
        label->setMaximumWidth(widgetWidth);
        label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
        label->setWordWrap(true);
        labels.append(label);
        QRect fsize = label->fontMetrics().boundingRect(label->text());
        int height = (widgetWidth + fsize.width()) / widgetWidth * fsize.height() + 15;
        heights.append(height);
        label->setMinimumHeight(height);
        label->setMaximumHeight(height);
        accuHeight += height;

        animWidget->layout()->addWidget(label);
    }

    if (heights.size() > 0) {
        animWidget->setGeometry(0, this->geometry().height() / 2 + heights[0],
                                this->geometry().width(), accuHeight);
    }
    animWidget->show();
    ui->border->setText("");
}
开发者ID:Argun,项目名称:doubanfm-qt,代码行数:52,代码来源:lyricwidget.cpp

示例9: blankKeyLabel

void DetailWindow::blankKeyLabel(){
  deleteKeyLabels();
  QLabel* dummyLabel = new QLabel();
  QPalette pal = dummyLabel->palette();
  pal.setColor(backgroundRole(), Qt::black);
  dummyLabel->setPalette(pal);
  dummyLabel->setAutoFillBackground(true);
  dummyLabel->setMinimumHeight(20);
  dummyLabel->setMaximumHeight(30);
  dummyLabel->setToolTip(wrapToolTip(tr("Drag an audio file onto the window.")));
  ui->horizontalLayout_keyLabels->addWidget(dummyLabel);
  keyLabels.push_back(dummyLabel);
}
开发者ID:birkestroem,项目名称:is_KeyFinder,代码行数:13,代码来源:guidetail.cpp

示例10: addSection

void DevSettings::addSection(const QString & string)
{
    QString str;
    str.append("<b>");
    str.append(string);
    str.append("</b>");
    QLabel *label = new QLabel(str);
    label->setAlignment(Qt::AlignHCenter/*Left*/ | Qt::AlignBottom);
    if(numWidgets_!=0)
        label->setMinimumHeight(40);
    layout_->addWidget(label, numWidgets_, 0, 1, 2);
    numWidgets_++;
}
开发者ID:gitter-badger,项目名称:vpaint,代码行数:13,代码来源:DevSettings.cpp

示例11: createLayout

QWidget* TKAction::createLayout(QWidget* parent, QWidget* children)
{
  QWidget* base = new QWidget(parent,"KTToolBarLayout");
  QLabel* textLabel = new QLabel(base,"text");
  textLabel->setMinimumHeight(1);
  QLabel* pixLabel = new QLabel(base,"pixmap");
  children->reparent(base,QPoint(0,0));
  children->setName("widget");
  QHBoxLayout* layout = new QHBoxLayout(base,0,3);
  layout->setResizeMode(QLayout::Minimum);
  layout->addWidget(textLabel);
  layout->addWidget(pixLabel);
  layout->addWidget(children,1);

  updateLayout(base);
  return base;
}
开发者ID:RainerBlessing,项目名称:KTagebuch,代码行数:17,代码来源:tkaction.cpp

示例12: QWidget

XmlWindow::XmlWindow(QWidget *parent) : QWidget(parent){

    QFont font;
    font.setFamily("Courier");
    font.setFixedPitch(true);
    font.setPointSize(11);
    font.setBold(true);

    setNulls();

    //Used to avoid loading simulation again when this caused the initial change
    during_update_of_schema = false;

    textEdit = new CodeEditor(this);
    textEdit->setFont(font);
    textEdit->setWordWrapMode( QTextOption::NoWrap );


    QLabel *aa = new QLabel(this);
    aa->setText("");
    aa->setMinimumHeight(37);
    aa->setMaximumHeight(37);
    toolBar = new QToolBar("File/edit", aa);//addToolBar(tr("File"));

    layout = new QVBoxLayout(this);
    layout->setContentsMargins(QMargins(0,0,0,0));
    layout->addWidget(aa);
    layout->addWidget(textEdit);
    this->setLayout(layout);

    highlighter = new XMLHighlighter(textEdit->document());

    createActions();
    createMenus();
    createToolBars();
    createStatusBar();

    readSettings();

    connect(textEdit->document(), SIGNAL(contentsChanged()),
            this, SLOT(documentWasModified()));

    setCurrentFile("");
    //setUnifiedTitleAndToolBarOnMac(true);
}
开发者ID:brainstudio-team,项目名称:BrainStudio,代码行数:45,代码来源:xmlwindow.cpp

示例13: p

ImageComposer::ImageComposer(ImageConnector *conn){
	/**
	 * Create a Qt Window for displaying images and transmitting user commands
	 */
	qRegisterMetaType<Movement>("Movement"); 	// Register Movement struct with Qt
	setFocusPolicy(Qt::ClickFocus);				// Setup window focus behavior
	setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);	// Qt window size behavior
	QObject::connect(conn, SIGNAL(transmitImage(int *,Movement,int,int)), this, SLOT(loadImage(int *,Movement,int,int))); // Connect the image loading slots and signals
	QObject::connect(this, SIGNAL(transmitMovement(Movement)), conn, SLOT(receiveMovement(Movement)));	// Connect the user interaction slots and signals
	QObject::connect( qApp, SIGNAL(lastWindowClosed()), conn, SLOT(receiveDone()) ); // Connect the window close slots and signals

	QLabel *resultLabel = new QLabel();	// Place to put images
	resultLabel->setMinimumWidth(resultSize.width());
	resultLabel->setMinimumHeight(resultSize.height());

	QGridLayout *mainLayout = new QGridLayout; 	// Standard adaptable grid windowing system
	mainLayout->addWidget(resultLabel, 0, 0);	// Only one thing to add
	mainLayout->setSizeConstraint(QLayout::SetFixedSize); // Fill screen
	setLayout(mainLayout);						// Place layout

	this->setAutoFillBackground(true);			// Autofill background between frames (no smearing)
	QPalette p( this->palette());				// Define background color
	p.setColor( QPalette::Window, QColor(Qt::black)); // Black
	this->setPalette(p);						// Set background color

	setWindowTitle(tr("Image Composition"));	// Set window head text
	QTimer *timer = new QTimer(this);			// Prepare frame counter
	connect(timer, SIGNAL(timeout()), this, SLOT(update())); // Connect framerate timer with update function
	timer->start(50);							// Run every 50 ms

//	PVMMatrix.perspective(60,45,0.0001,1000);
	Perspective.ortho(0.0, 1.0, 0.0, 1.0, 0.0, 1.0);	// Orthographic projection for renderer
	Perspective.scale(0.002);							// Rescale the entire scene (should be in model projection)
	Perspective.translate(250,250,0);					// Move to center of screen
	Perspective.rotate(-90,0,0,1);						// Flip so upright

	lrAmount = 0;	// Initialize left-right rotation angle (degrees)
	udAmount = 0;	//		up-down rotation angle

	updatePVM();	// Initial modelview update

	this->counter = 0;	// Frame count
	this->moved = true;	// Creation is movement...
	sendMovement();		// Tell Legion to create an image
}
开发者ID:DocSohl,项目名称:LegionComposite,代码行数:45,代码来源:imagecomposer.cpp

示例14: addSearchIcon

void MimetypeViewer::addSearchIcon()
{
    QIcon searchIcon = QIcon::fromTheme("system-search");
    if (searchIcon.isNull())
        return;

    widget.searchTermLineEdit->setTextMargins(0, 0, 30, 0);
    QHBoxLayout *hBoxLayout = new QHBoxLayout(widget.searchTermLineEdit);
    hBoxLayout->setContentsMargins(0,0,0,0);
    widget.searchTermLineEdit->setLayout(hBoxLayout);
    QLabel *searchIconLabel = new QLabel(widget.searchTermLineEdit);
    searchIconLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    searchIconLabel->setMinimumHeight(30);
    searchIconLabel->setMinimumWidth(30);

    searchIconLabel->setPixmap(searchIcon.pixmap(QSize(20,20)));
    hBoxLayout->addWidget(searchIconLabel, 0, Qt::AlignRight | Qt::AlignVCenter);
}
开发者ID:lxde,项目名称:lxqt-config,代码行数:18,代码来源:mimetypeviewer.cpp

示例15: QGroupBox

QWidget * PrefsDialog::createLanguageForm(QFileInfoList & languages)
{
	QGroupBox * formGroupBox = new QGroupBox(tr("Language"));
    QVBoxLayout *layout = new QVBoxLayout();
	
	QComboBox* comboBox = new QComboBox(this);
    m_translatorListModel = new TranslatorListModel(languages, this);
	comboBox->setModel(m_translatorListModel);
	comboBox->setCurrentIndex(m_translatorListModel->findIndex(m_name));
	connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeLanguage(int)));

	layout->addWidget(comboBox);	

	QLabel * ll = new QLabel();
	ll->setMinimumHeight(45);
	ll->setWordWrap(true);
	ll->setText(QObject::tr("Please note that a new language setting will not take effect "
		                    "until the next time you run Fritzing."));
	layout->addWidget(ll);

	formGroupBox->setLayout(layout);
	return formGroupBox;
}
开发者ID:DHaylock,项目名称:fritzing-app,代码行数:23,代码来源:prefsdialog.cpp


注:本文中的QLabel::setMinimumHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。