• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setFixedHeight函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setFixedHeight函数的典型用法代码示例。如果您正苦于以下问题:C++ setFixedHeight函数的具体用法?C++ setFixedHeight怎么用?C++ setFixedHeight使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setFixedHeight函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:linuxdeepin,项目名称:dde-control-center,代码行数:23,代码来源:nextpagewidget.cpp


示例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() );
}
开发者ID:castomer,项目名称:code4fun,代码行数:37,代码来源:finddialog.cpp


示例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 );
}
开发者ID:cancamilo,项目名称:amarok,代码行数:37,代码来源:PlaylistSortWidget.cpp


示例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);
	}
}
开发者ID:IMAN4K,项目名称:QtPro,代码行数:37,代码来源:toolbar.cpp


示例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());
}
开发者ID:kammoh,项目名称:kactus2,代码行数:40,代码来源:DeleteWorkspaceDialog.cpp


示例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();
}
开发者ID:BrianPrz,项目名称:hifi,代码行数:37,代码来源:SnapshotShareDialog.cpp


示例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);
      }
开发者ID:CentreForBioRobotics,项目名称:lpzrobots,代码行数:24,代码来源:QConfigurableLoadSaveDialog.cpp


示例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);
}
开发者ID:Kreogist,项目名称:Mu,代码行数:24,代码来源:knmainwindowstatusbar.cpp


示例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 );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:24,代码来源:pensettingswidget.cpp


示例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());
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:24,代码来源:kstvvdialog_i.cpp


示例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());
}
开发者ID:fredemmott,项目名称:jerboa,代码行数:24,代码来源:SearchLineEdit_mac.cpp


示例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     ()));
}
开发者ID:TomasRejhons,项目名称:QtCustomWindow,代码行数:24,代码来源:windowtitlebar.cpp


示例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);
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:37,代码来源:UIDownloader.cpp


示例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();
}
开发者ID:realbardia,项目名称:silicon,代码行数:36,代码来源:mainpage.cpp


示例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);
}
开发者ID:0xmono,项目名称:openmw,代码行数:24,代码来源:operations.cpp


示例16: OSDragableView

LibraryItemView::LibraryItemView(QWidget * parent)
  : OSDragableView(parent)
{
  setFixedHeight(35);

  setObjectName("Container");
  setHasEmphasis(false);

  auto mainHBoxLayout = new QHBoxLayout();
  mainHBoxLayout->setContentsMargins(5,0,5,0);

  setLayout(mainHBoxLayout);

  m_measureTypeBadge = new QLabel(this);
  m_measureTypeBadge->setFixedSize(25,25);
  m_measureTypeBadge->setVisible(false);
  mainHBoxLayout->addWidget(m_measureTypeBadge,Qt::AlignLeft);

  m_measureBadge = new MeasureBadge();
  m_measureBadge->setFixedWidth(25);
  m_measureBadge->setMeasureBadgeType(MeasureBadgeType::MyMeasure);
  
  mainHBoxLayout->addWidget(m_measureBadge,Qt::AlignLeft);

  label = new QLabel("Measure");
  mainHBoxLayout->addWidget(label,Qt::AlignLeft);

  mainHBoxLayout->addStretch();

  errorLabel = new QLabel();
  //errorLabel->setPixmap(QPixmap(":/shared_gui_components/images/error-alert.png"));
  errorLabel->setPixmap(QPixmap(":/shared_gui_components/images/broken_script.png").scaled(24,24));
  errorLabel->setFixedSize(24, 24);
  errorLabel->setVisible(false);
  mainHBoxLayout->addWidget(errorLabel, Qt::AlignRight);
}
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:36,代码来源:LocalLibraryView.cpp


示例17: QWidget

/*Конструктор*/
drawerWidget::drawerWidget(QGLFormat fmt, QWidget *parent) : QWidget(parent)
{
	/*Проверка на поддержку пиксельных буферов*/
	if(QGLPixelBuffer::hasOpenGLPbuffers())
		{	
		pbuffer = new QGLPixelBuffer(512,512,fmt);
		hasbuffers = true;
		}
		else hasbuffers = true;
	setFixedHeight(350);
	setFixedWidth(350);
	
	viewerPosition[0] = 0.0;
	viewerPosition[1] = 0.0;
	viewerPosition[2] = 2.0;
	
	lightPosition [0] = 0.0;
	lightPosition [1] = 3.0;
	lightPosition [2] = 3.1;
	lightPosition [3] = 0.0;
	
	lightAmbient  [0] = 0.0;
	lightAmbient  [1] = 0.0;
	lightAmbient  [2] = 0.0;
	lightAmbient  [3] = 1.0;
	
	lightDiffuse  [0] = 1.0;
	lightDiffuse  [1] = 1.0;
	lightDiffuse  [2] = 1.0;
	lightDiffuse  [3] = 1.0;
	
	lightSpecular [0] = 1.0;
	lightSpecular [1] = 1.0;
	lightSpecular [2] = 1.0;
	lightSpecular [3] = 1.0;
}
开发者ID:molefrog,项目名称:astrid,代码行数:37,代码来源:drawerwidget.cpp


示例18: QDialog

RegExpDialog::RegExpDialog(QWidget *parent)
    : QDialog(parent)
{
    patternComboBox = new QComboBox;
    patternComboBox->setEditable(true);
    patternComboBox->setSizePolicy(QSizePolicy::Expanding,
                                   QSizePolicy::Preferred);

    patternLabel = new QLabel(tr("&Pattern:"));
    patternLabel->setBuddy(patternComboBox);

    escapedPatternLineEdit = new QLineEdit;
    escapedPatternLineEdit->setReadOnly(true);
    QPalette palette = escapedPatternLineEdit->palette();
    palette.setBrush(QPalette::Base,
                     palette.brush(QPalette::Disabled, QPalette::Base));
    escapedPatternLineEdit->setPalette(palette);

    escapedPatternLabel = new QLabel(tr("&Escaped Pattern:"));
    escapedPatternLabel->setBuddy(escapedPatternLineEdit);

    syntaxComboBox = new QComboBox;
    syntaxComboBox->addItem(tr("Regular expression v1"), QRegExp::RegExp);
    syntaxComboBox->addItem(tr("Regular expression v2"), QRegExp::RegExp2);
    syntaxComboBox->addItem(tr("Wildcard"), QRegExp::Wildcard);
    syntaxComboBox->addItem(tr("Fixed string"), QRegExp::FixedString);
    syntaxComboBox->addItem(tr("W3C Xml Schema 1.1"), QRegExp::W3CXmlSchema11);

    syntaxLabel = new QLabel(tr("&Pattern Syntax:"));
    syntaxLabel->setBuddy(syntaxComboBox);

    textComboBox = new QComboBox;
    textComboBox->setEditable(true);
    textComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

    textLabel = new QLabel(tr("&Text:"));
    textLabel->setBuddy(textComboBox);

    caseSensitiveCheckBox = new QCheckBox(tr("Case &Sensitive"));
    caseSensitiveCheckBox->setChecked(true);
    minimalCheckBox = new QCheckBox(tr("&Minimal"));

    indexLabel = new QLabel(tr("Index of Match:"));
    indexEdit = new QLineEdit;
    indexEdit->setReadOnly(true);

    matchedLengthLabel = new QLabel(tr("Matched Length:"));
    matchedLengthEdit = new QLineEdit;
    matchedLengthEdit->setReadOnly(true);

    for (int i = 0; i < MaxCaptures; ++i) {
        captureLabels[i] = new QLabel(tr("Capture %1:").arg(i));
        captureEdits[i] = new QLineEdit;
        captureEdits[i]->setReadOnly(true);
    }
    captureLabels[0]->setText(tr("Match:"));

    QHBoxLayout *checkBoxLayout = new QHBoxLayout;
    checkBoxLayout->addWidget(caseSensitiveCheckBox);
    checkBoxLayout->addWidget(minimalCheckBox);
    checkBoxLayout->addStretch(1);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(patternLabel, 0, 0);
    mainLayout->addWidget(patternComboBox, 0, 1);
    mainLayout->addWidget(escapedPatternLabel, 1, 0);
    mainLayout->addWidget(escapedPatternLineEdit, 1, 1);
    mainLayout->addWidget(syntaxLabel, 2, 0);
    mainLayout->addWidget(syntaxComboBox, 2, 1);
    mainLayout->addLayout(checkBoxLayout, 3, 0, 1, 2);
    mainLayout->addWidget(textLabel, 4, 0);
    mainLayout->addWidget(textComboBox, 4, 1);
    mainLayout->addWidget(indexLabel, 5, 0);
    mainLayout->addWidget(indexEdit, 5, 1);
    mainLayout->addWidget(matchedLengthLabel, 6, 0);
    mainLayout->addWidget(matchedLengthEdit, 6, 1);

    for (int j = 0; j < MaxCaptures; ++j) {
        mainLayout->addWidget(captureLabels[j], 7 + j, 0);
        mainLayout->addWidget(captureEdits[j], 7 + j, 1);
    }
    setLayout(mainLayout);

    connect(patternComboBox, SIGNAL(editTextChanged(QString)),
            this, SLOT(refresh()));
    connect(textComboBox, SIGNAL(editTextChanged(QString)),
            this, SLOT(refresh()));
    connect(caseSensitiveCheckBox, SIGNAL(toggled(bool)),
            this, SLOT(refresh()));
    connect(minimalCheckBox, SIGNAL(toggled(bool)), this, SLOT(refresh()));
    connect(syntaxComboBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(refresh()));

    patternComboBox->addItem(tr("[A-Za-z_]+([A-Za-z_0-9]*)"));
    textComboBox->addItem(tr("(10 + delta4) * 32"));

    setWindowTitle(tr("RegExp"));
    setFixedHeight(sizeHint().height());
    refresh();
}
开发者ID:elProxy,项目名称:qtbase,代码行数:100,代码来源:regexpdialog.cpp


示例19: document

void ExpandingLabel::allTextVisible() {
	QTextDocument *doc = document();
	doc->setTextWidth(width());
	int height = doc->documentLayout()->documentSize().toSize().height();
	setFixedHeight(height);
}
开发者ID:BrainsoftLtd,项目名称:fritzing-app,代码行数:6,代码来源:expandinglabel.cpp


示例20: QTableView

listMemberDialog::listMemberDialog(QWidget *parent,QString classId)
{
	conn = database::connectByC();
	QVBoxLayout *topLeftLayout = new QVBoxLayout;

	view  = new QTableView(this);
	model = new QStandardItemModel(this);
	view->setModel(model);

	model->setHorizontalHeaderItem(0, new QStandardItem(tr("ID")));
	model->setHorizontalHeaderItem(1, new QStandardItem(tr("Name")));
	model->setHorizontalHeaderItem(2, new QStandardItem(tr("Birth year")));
	model->setHorizontalHeaderItem(3, new QStandardItem(tr("Note")));
	model->setHorizontalHeaderItem(4, new QStandardItem(tr("-")));
	
	view->setColumnWidth(0,20);
	view->setColumnWidth(1,90);
	view->setColumnWidth(2,57);
	view->setColumnWidth(3,40);
	view->setColumnWidth(4,30);
	
	label = new QLabel("Member list");
	topLeftLayout->addWidget(label);
	int rowCurrent = 0;

	MYSQL_RES *res = database::classMember_searchClassId(conn,classId);
	while(MYSQL_ROW classMemberRow = mysql_fetch_row(res))
	{
		QString memberId   = classMemberRow[1];
		MYSQL_ROW memberRow = database::member_searchMemberId(conn,memberId);
		
		model->setItem(rowCurrent, 0, new QStandardItem(memberRow[0]));
		model->setItem(rowCurrent, 1, new QStandardItem(memberRow[1]));
		model->setItem(rowCurrent, 2, new QStandardItem(memberRow[2]));
		model->setItem(rowCurrent, 3, new QStandardItem(memberRow[3]));

		QPushButton *button = new QPushButton("");
		QPixmap pixmap("Resources/Delete_icon.png");
		QIcon buttonIcon(pixmap);
		button->setIcon(buttonIcon);
		QSignalMapper *signalMapper = new QSignalMapper(this);
		signalMapper->setMapping(button,memberId);
		QObject::connect(button,SIGNAL(clicked()),signalMapper,SLOT(map()));
		QObject::connect(signalMapper,SIGNAL(mapped(QString)),this,SLOT(deleteMemberAction(QString)));
		view->setIndexWidget(model->index(rowCurrent,4),button);

		rowCurrent++;
	}
	numOldMemberInDialog = rowCurrent;
	topLeftLayout->addWidget(view);

	QHBoxLayout *horizontalLayout = new QHBoxLayout();
	QPushButton *saveButton = new QPushButton("Save");
	QPixmap pixmap1("Resources/save_icon.png");
	QIcon ButtonIcon1(pixmap1);
	saveButton->setIcon(ButtonIcon1);
	QSignalMapper *saveMapper = new QSignalMapper(this);
	saveMapper->setMapping(saveButton,classId);
	QObject::connect(saveButton,SIGNAL(clicked()),saveMapper,SLOT(map()));
	QObject::connect(saveMapper,SIGNAL(mapped(QString)),this,SLOT(saveListAction(QString)));
	
	horizontalLayout->addWidget(saveButton);
	
	QPushButton *addMemberButton = new QPushButton("Add Member");
	QPixmap pixmap("Resources/add-icon.png");
	QIcon ButtonIcon(pixmap);
	addMemberButton->setIcon(ButtonIcon);
	QObject::connect(addMemberButton,SIGNAL(clicked()),this,SLOT(addMemberAction()));
	horizontalLayout->addWidget(addMemberButton);

	setLayout(topLeftLayout);
	topLeftLayout->addLayout(horizontalLayout);
	setWindowTitle(tr("Member list"));
	setFixedHeight(sizeHint().height());
	
}
开发者ID:ndaonguyen,项目名称:QT_EnglishCourse,代码行数:76,代码来源:listMemberDialog.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setFixedSize函数代码示例发布时间:2022-05-30
下一篇:
C++ setFinished函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap