本文整理汇总了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());
}
示例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 );
}