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


C++ setAlignment函数代码示例

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


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

示例1: QGraphicsView

PatienceView::PatienceView( QWidget * parent )
  : QGraphicsView( parent ),
    KGameRendererClient( Renderer::self(), QStringLiteral("background") )
{
    setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
    setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
    setFrameStyle( QFrame::NoFrame );

    // This makes the background of the widget transparent so that Oxygen's
    // (or any other style's) window gradient is visible in unpainted areas of
    // the scene.
    QPalette p = palette();
    QColor c = p.color( QPalette::Base );
    c.setAlpha( 0 );
    p.setColor( QPalette::Base, c );
    setPalette( p );
    setBackgroundRole( QPalette::Base );

    setAlignment( Qt::AlignLeft | Qt::AlignTop );
    setCacheMode( QGraphicsView::CacheBackground );
}
开发者ID:KDE,项目名称:kpat,代码行数:21,代码来源:view.cpp

示例2: tmpStr

void RTTIBuilder::push_array(llvm::Constant *CI, uint64_t dim, Type *valtype,
                             Dsymbol *mangle_sym) {
  std::string tmpStr(valtype->arrayOf()->toChars());
  tmpStr.erase(remove(tmpStr.begin(), tmpStr.end(), '['), tmpStr.end());
  tmpStr.erase(remove(tmpStr.begin(), tmpStr.end(), ']'), tmpStr.end());
  tmpStr.append("arr");

  std::string initname(mangle_sym ? mangle(mangle_sym) : ".ldc");
  initname.append(".rtti.");
  initname.append(tmpStr);
  initname.append(".data");

  const LinkageWithCOMDAT lwc(TYPEINFO_LINKAGE_TYPE, supportsCOMDAT());

  auto G = new LLGlobalVariable(gIR->module, CI->getType(), true,
                                lwc.first, CI, initname);
  setLinkage(lwc, G);
  G->setAlignment(DtoAlignment(valtype));

  push_array(dim, DtoBitCast(G, DtoType(valtype->pointerTo())));
}
开发者ID:Doeme,项目名称:ldc,代码行数:21,代码来源:rttibuilder.cpp

示例3: getFont

UINodeServerSelector::UINodeServerSelector (IFrontend *frontend, int rows) :
		UINodeSelector<ServerEntry>(frontend, 1, rows)
{
	_headlineFont = getFont(HUGE_FONT);
	_headlineHeight = _headlineFont->getCharHeight();
	setBackgroundColor(backgroundColor);
	setSize(0.8f, 0.6f);
	setScrollingEnabled(true);
	setPageVisible(false);
	setAlignment(NODE_ALIGN_CENTER | NODE_ALIGN_MIDDLE);
	setId("server-selector");
	setFont(HUGE_FONT);
	setRowHeight(getFontHeight() / static_cast<float>(_frontend->getHeight()));
	_mouseWheelScrollAmount = _rowHeight * _frontend->getHeight() * 5;
	Vector4Set(colorWhite, _fontColor);
	reset();
	setRowSpacing(2);
	_entryOffsetY = _headlineHeight;
	_colWidth = _size.x;
	setAutoColsRows();
}
开发者ID:RobertoMalatesta,项目名称:caveexpress,代码行数:21,代码来源:UINodeServerSelector.cpp

示例4: QGraphicsView

DesktopSelectionView::DesktopSelectionView(QWidget* widget_)
    : QGraphicsView(widget_)
    , desktopSelectionRectangle_(0)
{
    // create and set scene for the view
    setScene(new QGraphicsScene());

    // force scene to be anchored at top left
    setAlignment(Qt::AlignLeft | Qt::AlignTop);

    // set attributes of the view
    setInteractive(true);

    // disable scrollbars
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    // create and add the rectangle for the selection area
    desktopSelectionRectangle_ = new DesktopSelectionRectangle();
    scene()->addItem(desktopSelectionRectangle_);
}
开发者ID:sadaszewski,项目名称:DisplayCluster,代码行数:21,代码来源:DesktopSelectionView.cpp

示例5: setAlignment

void Square::setup()
{
	setAlignment(po::scene::Alignment::CENTER_CENTER);
	
	//	Create and add a shape for the active state
	mActive = ShapeView::createRect(100, 100);
	mActive->setFillColor(mActiveColor);
	addSubview(mActive);
	
	//	Create and add a shape for the selected state
	//	Set the alpha to 0 so we can animate it
	mSelected = ShapeView::createRect(100, 100);
	mSelected->setFillColor(mSelectedColor);
	addSubview(mSelected);
	mSelected->setAlpha(0.f);
	
	//	Connect to mouse events
	getSignal(MouseEvent::DOWN_INSIDE).connect(std::bind(&Square::onMouseEvent, this, std::placeholders::_1));
	getSignal(MouseEvent::UP_INSIDE).connect(std::bind(&Square::onMouseEvent, this, std::placeholders::_1));
	getSignal(MouseEvent::UP).connect(std::bind(&Square::onMouseEvent, this, std::placeholders::_1));
}
开发者ID:Potion,项目名称:Cinder-poScene,代码行数:21,代码来源:Square.cpp

示例6: CursesContainer

ChooseCertificateScreen::ChooseCertificateScreen()
	: CursesContainer(mainScreen),
	  CursesKeyHandler(PRI_SCREENHANDLER),
	  title(this, _("Certificates")),
	  menu(this)
{
	setRow(2);
	setAlignment(Curses::PARENTCENTER);
	title.setAlignment(Curses::PARENTCENTER);

	menu.setRow(2);

	std::map<std::string, Certificates::cert>::iterator p;

	for (p=myServer::certs->certs.begin();
	     p != myServer::certs->certs.end(); ++p)
	{
		certs.push_back(cert(this, p->second.name, p->first));
		menu.addPrompt(NULL, &certs.back());
	}
}
开发者ID:MhdAlyan,项目名称:courier,代码行数:21,代码来源:certificates.C

示例7: QLineEdit

//======================================================//
UpDownLineEdit::UpDownLineEdit(QWidget *parent, const char *name, QString possible_value)
    : QLineEdit(parent, name),	possible_val(possible_value)
{    
    buttonUp = new QPushButton(parent, "buttonUp");
    //QPixmap pm ("./image/arrow_up.png");
    QPixmap pm = QPixmap::fromMimeSource("arrow_up.png");
    buttonUp->setPixmap( pm);
    
    buttonDown = new QPushButton(parent, "buttonDown");
    //pm = QPixmap("./image/arrow_down.png");
    pm = QPixmap::fromMimeSource("arrow_down.png");
    buttonDown->setPixmap( pm);
    
    setPosition(0, 0);
    setMaxLength(1);
    setReadOnly(true);
    setAlignment(Qt::AlignHCenter);
    
    QFont f = font();
    f.setPointSize(12);
    f.setBold(false);
    setFont(f);
    
    buttonUp->setFocusPolicy(QWidget::NoFocus);
    buttonDown->setFocusPolicy(QWidget::NoFocus);
    
    QSizePolicy sp (QSizePolicy::Fixed, QSizePolicy::Fixed);
    setSizePolicy(sp);
    buttonUp->setSizePolicy(sp);
    buttonDown->setSizePolicy(sp);
    
    buttonUp->setFlat(true);
    buttonDown->setFlat(true);
    
    connect ( buttonUp, SIGNAL(clicked()), SLOT(GoUp()) );
    connect ( buttonDown, SIGNAL(clicked()), SLOT(GoDown()) );
    
    index = 0;
    //puts("UpDownCreate");
}
开发者ID:oldbay,项目名称:dnc_kassa,代码行数:41,代码来源:updownlineedit.cpp

示例8: QLabel

CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
    : QLabel( parent ), p_intf( _p_i ), p_item( NULL )
{
    setContextMenuPolicy( Qt::ActionsContextMenu );
    CONNECT( THEMIM->getIM(), artChanged( input_item_t * ),
             this, showArtUpdate( input_item_t * ) );

    setMinimumHeight( 128 );
    setMinimumWidth( 128 );
    setScaledContents( false );
    setAlignment( Qt::AlignCenter );

    QAction *action = new QAction( qtr( "Download cover art" ), this );
    CONNECT( action, triggered(), this, askForUpdate() );
    addAction( action );

    action = new QAction( qtr( "Add cover art from file" ), this );
    CONNECT( action, triggered(), this, setArtFromFile() );
    addAction( action );

    showArtUpdate( "" );
}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:22,代码来源:interface_widgets.cpp

示例9: GlassWidget

GlassWindow::GlassWindow() : gcn::Window(), GlassWidget(this), wmhandler() {
	titleBar = gcn::Image::load("/gui/standard/bar_gradient.png");
	mTitleBarHeight = titleBar->getHeight()+3;
	titleBarContainer._setParent(this);
	setAlignment(gcn::Graphics::LEFT);
	shadeState = SH_OPEN;
	titleVisible = true;
	mGradient = false;
	frame = NULL;
	mBorder = 0;
	
	setBackgroundColor(gcn::Color(213,213,213));
	
	wmhandler.setWindow(this);
	
	buildTitleBar(WT_ALL);
	
	//for GlassWidget
	addActionListener(this);
	addFocusListener(this);
	gui->addGlobalKeyListener(this);
}
开发者ID:newerthcom,项目名称:savagerebirth,代码行数:22,代码来源:GlassWindow.cpp

示例10: ExtenderObject

    ExtenderObject(const Plasma::Svg & icon,
            ExtenderButton * parent)
      : BasicWidget(icon, "", "")
    {
        iconInSvg().setUsingRenderingCache(true);

        iconInSvg().setContainsMultipleImages(true);

        frameCount = 0;
        while (iconInSvg().hasElement("frame" + QString::number(frameCount))) {
            frameCount++;
        }
        frameCount--;

        setParentItem(parent);
        setInnerOrientation(Qt::Vertical);
        setAlignment(Qt::AlignCenter);
        setZValue(EXTENDER_Z_VALUE);

        animate = !Global::self()->config("Animation", "disableAnimations", false)
                && Global::self()->config("Animation", "extenderActivationFeedback", true);
    }
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:22,代码来源:ExtenderButton.cpp

示例11: QGraphicsView

FormEditorGraphicsView::FormEditorGraphicsView(QWidget *parent) :
    QGraphicsView(parent),
    m_isPanning(false)
{
    setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
    setResizeAnchor(QGraphicsView::AnchorViewCenter);
    setAlignment(Qt::AlignCenter);
    setCacheMode(QGraphicsView::CacheNone);
    setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
    setOptimizationFlags(QGraphicsView::DontSavePainterState);
//    setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
    setRenderHint(QPainter::Antialiasing, false);

    setFrameShape(QFrame::NoFrame);

    setAutoFillBackground(true);
    setBackgroundRole(QPalette::Window);

    activateCheckboardBackground();

    viewport()->setMouseTracking(true);
}
开发者ID:acacid,项目名称:qt-creator,代码行数:22,代码来源:formeditorgraphicsview.cpp

示例12: ClickableQLabel

TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType  )
    : ClickableQLabel(), p_intf( _p_intf ), bufTimer( new QTimer(this) ),
      buffering( false ), showBuffering(false), bufVal( -1 ), displayType( _displayType )
{
    b_remainingTime = false;
    if( _displayType != TimeLabel::Elapsed )
        b_remainingTime = getSettings()->value( "MainWindow/ShowRemainingTime", false ).toBool();
    switch( _displayType ) {
        case TimeLabel::Elapsed:
            setText( " --:-- " );
            setToolTip( qtr("Elapsed time") );
            break;
        case TimeLabel::Remaining:
            setText( " --:-- " );
            setToolTip( qtr("Total/Remaining time")
                        + QString("\n-")
                        + qtr("Click to toggle between total and remaining time")
                      );
            break;
        case TimeLabel::Both:
            setText( " --:--/--:-- " );
            setToolTip( QString( "- " )
                + qtr( "Click to toggle between elapsed and remaining time" )
                + QString( "\n- " )
                + qtr( "Double click to jump to a chosen time position" ) );
            break;
    }
    setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    bufTimer->setSingleShot( true );

    CONNECT( THEMIM->getIM(), positionUpdated( float, int64_t, int ),
              this, setDisplayPosition( float, int64_t, int ) );
    CONNECT( THEMIM->getIM(), cachingChanged( float ),
              this, updateBuffering( float ) );
    CONNECT( bufTimer, timeout(), this, updateBuffering() );

    setStyleSheet( "padding-left: 4px; padding-right: 4px;" );
}
开发者ID:BloodExecutioner,项目名称:vlc,代码行数:39,代码来源:interface_widgets.cpp

示例13: DataGraphicsView

//=========================================================================
BubbleChartView::BubbleChartView(BlastTaxDataProviders *_dataProviders, QWidget *parent, bool setRank)
    : DataGraphicsView(NULL, parent)
{
    flags |= DGF_BUBBLES | DGF_RANKS;
    config = new BubbleChartParameters();

    if ( setRank && mainWindow->getRank() == TR_NORANK )
        mainWindow->setRank(TR_SPECIES);

    if ( _dataProviders == NULL )
        _dataProviders = new BlastTaxDataProviders();

    taxDataProvider = new ChartDataProvider(_dataProviders, this);

    connect((ChartDataProvider *)taxDataProvider, SIGNAL(taxVisibilityChanged(quint32)), this, SLOT(onTaxVisibilityChanged(quint32)));
    connect((ChartDataProvider *)taxDataProvider, SIGNAL(cacheUpdated()), this, SLOT(onDataChanged()));

    QGraphicsScene *s = new QGraphicsScene(this);
    s->setItemIndexMethod(QGraphicsScene::NoIndex);
    setCacheMode(CacheBackground);
    setViewportUpdateMode(BoundingRectViewportUpdate);
    setRenderHint(QPainter::Antialiasing);
    setTransformationAnchor(AnchorUnderMouse);
    setMinimumSize(400, 200);
    setAlignment(Qt::AlignCenter);
    setScene(s);

    setChartRectSize(800, 800);

    propertiesAction = popupMenu.addAction("Properties...");
    connect(propertiesAction, SIGNAL(triggered(bool)), this, SLOT(showPropertiesDialog()));

    if ( _dataProviders->size() > 0 )
    {
        prepareScene();
        showChart();
    }
    onTaxRankChanged(mainWindow->getRank());
}
开发者ID:vryukhko,项目名称:marva,代码行数:40,代码来源:bubblechartview.cpp

示例14: ClickableQLabel

TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType  )
    : ClickableQLabel(), p_intf( _p_intf ), displayType( _displayType )
{
    b_remainingTime = false;
    if( _displayType != TimeLabel::Elapsed )
        b_remainingTime = getSettings()->value( "MainWindow/ShowRemainingTime", false ).toBool();
    switch( _displayType ) {
        case TimeLabel::Elapsed:
            setText( " --:-- " );
            setToolTip( qtr("Elapsed time") );
            break;
        case TimeLabel::Remaining:
            setText( " --:-- " );
            setToolTip( qtr("Total/Remaining time")
                        + QString("\n-")
                        + qtr("Click to toggle between total and remaining time")
                      );
            break;
        case TimeLabel::Both:
            setText( " --:--/--:-- " );
            setToolTip( QString( "- " )
                + qtr( "Click to toggle between elapsed and remaining time" )
                + QString( "\n- " )
                + qtr( "Double click to jump to a chosen time position" ) );
            break;
    }
    setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    CONNECT( THEMIM->getIM(), positionUpdated( float, int64_t, int ),
              this, setDisplayPosition( float, int64_t, int ) );

    connect( this, SIGNAL( broadcastRemainingTime( bool ) ),
         THEMIM->getIM(), SIGNAL( remainingTimeChanged( bool ) ) );

    CONNECT( THEMIM->getIM(), remainingTimeChanged( bool ),
              this, setRemainingTime( bool ) );

    setStyleSheet( "QLabel { padding-left: 4px; padding-right: 4px; }" );
}
开发者ID:IAPark,项目名称:vlc,代码行数:39,代码来源:interface_widgets.cpp

示例15: QLabel

DItemToolTip::DItemToolTip(QWidget* const parent)
    : QLabel(parent, Qt::ToolTip),
      d(new Private)
{
    hide();

    setBackgroundRole(QPalette::ToolTipBase);
    setPalette(QToolTip::palette());
    ensurePolished();
    const int fwidth = qMax(d->tipBorder, 1 + style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, this));
    setContentsMargins(fwidth, fwidth, fwidth, fwidth);
    setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / 255.0);
    setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);

    setFrameStyle(QFrame::StyledPanel);
/*
    Old-style box:
    setFrameStyle(QFrame::Plain | QFrame::Box);
    setLineWidth(1);
*/
    renderArrows();
}
开发者ID:KDE,项目名称:digikam,代码行数:22,代码来源:ditemtooltip.cpp


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