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


C++ QToolBar::height方法代码示例

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


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

示例1: addControlItems

void ProfileGraphicsView::addControlItems()
{
    QAction *scaleAction = new QAction(QIcon(":scale"), tr("Scale"), this);
    QAction *rulerAction = new QAction(QIcon(":ruler"), tr("Ruler"), this);
    QToolBar *toolBar = new QToolBar("", 0);
    toolBar->addAction(rulerAction);
    toolBar->addAction(scaleAction);
    //make toolbar transparent
    toolBar->setStyleSheet(QString::fromUtf8 ("background-color: rgba(255,255,255,0);"));

    connect(scaleAction, SIGNAL(triggered()), this, SLOT(on_scaleAction()));
    connect(rulerAction, SIGNAL(triggered()), this, SLOT(on_rulerAction()));
    toolBarProxy = scene()->addWidget(toolBar);
    //Put it into the lower right corner of the profile
    toolBarProxy->setPos(gc.maxx-toolBar->width(), gc.maxy-toolBar->height());
}
开发者ID:hide5stm,项目名称:subsurface,代码行数:16,代码来源:profilegraphics.cpp

示例2: MDIChild

MDIClass::MDIClass( QWidget* parent )
	: MDIChild( parent )
{
	setObjectName( "MDIClass" );
	setType( ctClass );
	setWindowIcon( QIcon( ":/Icons/Icons/projectshowfile.png" ) );
	//
	QVBoxLayout* vboxLayout = new QVBoxLayout( this );
	vboxLayout->setObjectName( "vboxLayout" );
	vboxLayout->setSpacing( 0 );
	vboxLayout->setMargin( 0 );
	// Toolbar
	QToolBar* tb = new QToolBar( tr( "Files" ), this );
	tb->setFixedHeight( tb->height() );
	tb->setIconSize( QSize(16, 16 ) );
	// Action Group
	aGroup = new QActionGroup( this );
	aGroup->setObjectName( "aGroup" );
	// Actions
	actionForm = new QAction( QIcon( ":/Icons/Icons/form.png" ), tr( "Form" ), this );
	actionForm->setCheckable( true );
	aGroup->addAction( actionForm );
	actionHeader = new QAction( QIcon( ":/Icons/Icons/h.png" ), tr( "Header" ), this );
	actionHeader->setCheckable( true );
	aGroup->addAction( actionHeader );
	actionSource = new QAction( QIcon( ":/Icons/Icons/cpp.png" ), tr( "Source" ), this );
	actionSource->setCheckable( true );
	aGroup->addAction( actionSource );
	tb->addActions( aGroup->actions() );
	vboxLayout->addWidget( tb );
	// Workspace
	wSpace = new QWorkspace( this );
	wSpace->setObjectName( "wSpace" );
	vboxLayout->addWidget( wSpace );
	// Form
	// Header
	teHeader = new TextEditor( this );
	teHeader->setObjectName( "teHeader" );
	teHeader->setFrameShape( QFrame::NoFrame );
	teHeader->setFrameShadow( QFrame::Plain );
	teHeader->setMidLineWidth( 1 );
	teHeader->setDefaultComponents( true );
	teHeader->setWindowIcon( actionHeader->icon() );
	setSettings( teHeader );
	connect( teHeader, SIGNAL( replaceDialogRequested() ), this, SIGNAL( replaceDialogRequested() ) );
	connect( teHeader->completion(), SIGNAL( beforeCompletionShow() ), this, SLOT( beforeCompletionShow() ) );
	connect( teHeader->document(), SIGNAL( modificationChanged( bool ) ), this, SIGNAL( modified( bool ) ) );
	connect( teHeader, SIGNAL( fileOpen( bool ) ), this, SLOT( fileOpened( bool ) ) );
	connect( teHeader, SIGNAL( completionRequested( Completion*, TextEditor* ) ), this, SLOT( completionRequested( Completion*, TextEditor* ) ) );
	wSpace->addWindow( teHeader, Qt::WindowTitleHint );
	// Source
	teSource = new TextEditor( this );
	teSource->setObjectName( "teSource" );
	teSource->setFrameShape( QFrame::NoFrame );
	teSource->setFrameShadow( QFrame::Plain );
	teSource->setMidLineWidth( 1 );
	teSource->setDefaultComponents( true );
	teSource->setWindowIcon( actionSource->icon() );
	setSettings( teSource );
	connect( teSource, SIGNAL( replaceDialogRequested() ), this, SIGNAL( replaceDialogRequested() ) );
	connect( teSource, SIGNAL( beforeCompletionShow() ), this, SLOT( beforeCompletionShow() ) );
	connect( teSource->document(), SIGNAL( modificationChanged( bool ) ), this, SIGNAL( modified( bool ) ) );
	connect( teSource, SIGNAL( fileOpen( bool ) ), this, SLOT( fileOpened( bool ) ) );
	connect( teSource, SIGNAL( completionRequested( Completion*, TextEditor* ) ), this, SLOT( completionRequested( Completion*, TextEditor* ) ) );
	wSpace->addWindow( teSource, Qt::WindowTitleHint );
	// Connections
	QMetaObject::connectSlotsByName( this );
}
开发者ID:pasnox,项目名称:monkeystudio1,代码行数:68,代码来源:MDIClass.cpp


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