本文整理汇总了C++中setAlignment函数的典型用法代码示例。如果您正苦于以下问题:C++ setAlignment函数的具体用法?C++ setAlignment怎么用?C++ setAlignment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAlignment函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: setAlignment
void
Amarok::OSD::show( Meta::TrackPtr track ) //slot
{
setAlignment( static_cast<OSDWidget::Alignment>( AmarokConfig::osdAlignment() ) );
setOffset( AmarokConfig::osdYOffset() );
QString text;
if( !track || track->playableUrl().isEmpty() )
text = i18n( "No track playing" );
else
{
setRating( track->rating() );
text = track->prettyName();
if( track->artist() && !track->artist()->prettyName().isEmpty() )
text = track->artist()->prettyName() + " - " + text;
if( track->album() && !track->album()->prettyName().isEmpty() )
text += "\n (" + track->album()->prettyName() + ") ";
else
text += '\n';
if( track->length() > 0 )
text += Meta::secToPrettyTime( track->length() );
}
if( text.isEmpty() )
text = track->playableUrl().fileName();
if( text.startsWith( "- " ) ) //When we only have a title tag, _something_ prepends a fucking hyphen. Remove that.
text = text.mid( 2 );
if( text.isEmpty() ) //still
text = i18n("No information available for this track");
QImage image;
if( track && track->album() )
image = track->album()->imageWithBorder( 100, 5 ).toImage();
OSDWidget::show( text, image );
}
开发者ID:weiligang512,项目名称:apue-test,代码行数:39,代码来源:Osd.cpp
示例17: preparePalette
void UIToolsView::prepare()
{
/* Install Tools-view accessibility interface factory: */
QAccessible::installFactory(UIAccessibilityInterfaceForUIToolsView::pFactory);
/* Prepare palette: */
preparePalette();
/* Setup frame: */
setFrameShape(QFrame::NoFrame);
setFrameShadow(QFrame::Plain);
setAlignment(Qt::AlignLeft | Qt::AlignTop);
/* Setup scroll-bars policy: */
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
/* Update scene-rect: */
updateSceneRect();
/* Apply language settings: */
retranslateUi();
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:22,代码来源:UIToolsView.cpp
示例18: QGraphicsView
OverviewView::OverviewView(QGraphicsScene* qgs, QWidget* parent)
: QGraphicsView(qgs, parent)
, barMovement_(false)
, scene_(qgs)
, slide_(false)
, offset_(0)
{
currentFrameGraphicsItem_ = new CurrentFrameGraphicsItem(true, true);
setRenderHint(QPainter::SmoothPixmapTransform);
setCacheMode(CacheBackground);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setAlignment(Qt::AlignLeft);
scene_->setBackgroundBrush(Qt::blue);
QLinearGradient gradient(0, 0, 0, 80);
gradient.setSpread(QGradient::PadSpread);
gradient.setColorAt(0, QColor(255,255,255,0));
gradient.setColorAt(0.5, QColor(150,150,150,200));
gradient.setColorAt(1, QColor(50,0,50,100));
scene_->setBackgroundBrush(gradient);
scene_->addItem(currentFrameGraphicsItem_);
}
开发者ID:bsmr-opengl,项目名称:voreen,代码行数:22,代码来源:overviewwidget.cpp
示例19: QLabel
CActionLabel::CActionLabel(QWidget *parent)
: QLabel(parent)
{
static const int constIconSize(48);
setMinimumSize(constIconSize, constIconSize);
setMaximumSize(constIconSize, constIconSize);
setAlignment(Qt::AlignCenter);
if(0==theUsageCount++)
{
QImage img(KIconLoader::global()->loadIcon("application-x-font-ttf", KIconLoader::NoGroup, 32).toImage());
double increment=360.0/constNumIcons;
for(int i=0; i<constNumIcons; ++i)
theIcons[i]=new QPixmap(QPixmap::fromImage(0==i ? img : img.transformed(rotateMatrix(img.width(), img.height(), increment*i))));
}
setPixmap(*theIcons[0]);
itsTimer=new QTimer(this);
connect(itsTimer, SIGNAL(timeout()), SLOT(rotateIcon()));
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:22,代码来源:ActionLabel.cpp
示例20: setObjectName
IconViewWidget::IconViewWidget(const QString & configId, RazorSettings * config)
{
setObjectName("IconView");
config->beginGroup(configId);
QString dir = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
dir = config->value("directory", dir).toString();
config->endGroup();
// Hack to ensure the fully transparent QGraphicsView background
QPalette palette;
palette.setBrush(QPalette::Base, Qt::NoBrush);
setPalette(palette);
// Required to display wallpaper
setAttribute(Qt::WA_TranslucentBackground);
// no border at all finally
setFrameShape(QFrame::NoFrame);
setAcceptDrops(true);
m_iconScene = new IconScene(dir);
setScene(m_iconScene);
setRenderHint(QPainter::Antialiasing);
setRenderHint(QPainter::TextAntialiasing);
setRenderHint(QPainter::SmoothPixmapTransform);
setRenderHint(QPainter::HighQualityAntialiasing);
setDragMode(QGraphicsView::RubberBandDrag);
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
setCacheMode(QGraphicsView::CacheBackground);
setAlignment(Qt::AlignTop | Qt::AlignLeft);
}
开发者ID:arip33,项目名称:razor-qt,代码行数:38,代码来源:iconview.cpp
注:本文中的setAlignment函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论