示例#1
0
void UIToolBar::prepare()
{
    /* Configure tool-bar: */
    setFloatable(false);
    setMovable(false);

#if QT_VERSION < 0x050000
    /* Remove that ugly frame panel around the toolbar.
     * Doing that currently for Cleanlooks & Windows styles. */
    if (qobject_cast <QWindowsStyle*>(QToolBar::style()) ||
            qobject_cast <QCleanlooksStyle*>(QToolBar::style()))
        setStyleSheet("QToolBar { border: 0px none black; }");
#else /* QT_VERSION >= 0x050000 */
# ifdef VBOX_WS_MAC
    setStyleSheet("QToolBar { border: 0px none black; }");
# endif /* VBOX_WS_MAC */
#endif /* QT_VERSION >= 0x050000 */

    /* Configure tool-bar' layout: */
    if (layout())
        layout()->setContentsMargins(0, 0, 0, 0);

    /* Configure tool-bar' context-menu policy: */
    setContextMenuPolicy(Qt::NoContextMenu);
}
示例#2
0
ToolBar::ToolBar (QWidget *parent = NULL) : QToolBar(parent)
{
  setAllowedAreas(Qt::AllToolBarAreas);
  setMovable(true);
  setFloatable(true);

  initActions();
}
BtModuleChooserBar::BtModuleChooserBar(QWidget *parent)
        : QToolBar(parent),
        BtWindowModuleChooser(CSwordModuleInfo::Unknown, nullptr),
        m_idCounter(0),
        m_window(nullptr) {
    setAllowedAreas(Qt::TopToolBarArea);
    setFloatable(false);
}
示例#4
0
int QToolBar::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 13)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 13;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isMovable(); break;
        case 1: *reinterpret_cast< Qt::ToolBarAreas*>(_v) = allowedAreas(); break;
        case 2: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
        case 3: *reinterpret_cast< QSize*>(_v) = iconSize(); break;
        case 4: *reinterpret_cast< Qt::ToolButtonStyle*>(_v) = toolButtonStyle(); break;
        case 5: *reinterpret_cast< bool*>(_v) = isFloating(); break;
        case 6: *reinterpret_cast< bool*>(_v) = isFloatable(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setMovable(*reinterpret_cast< bool*>(_v)); break;
        case 1: setAllowedAreas(*reinterpret_cast< Qt::ToolBarAreas*>(_v)); break;
        case 2: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
        case 3: setIconSize(*reinterpret_cast< QSize*>(_v)); break;
        case 4: setToolButtonStyle(*reinterpret_cast< Qt::ToolButtonStyle*>(_v)); break;
        case 6: setFloatable(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        bool *_b = reinterpret_cast<bool*>(_a[0]);
        switch (_id) {
        case 0: *_b = (qobject_cast<QMainWindow*>(parentWidget())!=0); break;
        case 1: *_b = (qobject_cast<QMainWindow*>(parentWidget())!=0); break;
        case 2: *_b = (qobject_cast<QMainWindow*>(parentWidget())==0); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
示例#5
0
ToolBar::ToolBar (QWidget *parent) :
    QToolBar(parent)
{
    wheelEventState = false;
    setAllowedAreas(Qt::AllToolBarAreas);
    setMovable(true);
    setFloatable(true);

    initActions();
}
BtModuleChooserBar::BtModuleChooserBar(QStringList useModules, CSwordModuleInfo::ModuleType type, CReadWindow *parent)
        : QToolBar(parent),
        BtWindowModuleChooser(parent, type),
        m_idCounter(0) {

    qDebug() << "BtModuleChooserBar::BtModuleChooserBar";
    setAllowedAreas(Qt::TopToolBarArea);
    setFloatable(false);
    setModules(useModules);
    connect(parent, SIGNAL(sigModuleListSet(QStringList)), SLOT(slotBackendModulesChanged()));
    connect(parent, SIGNAL(sigModuleListChanged()), SLOT(slotWindowModulesChanged()));
}
示例#7
0
ToolBar::ToolBar(QWidget* parent)
	: QToolBar(parent)
{
	setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
	setMovable(false);
	setFloatable(false);
	setIconSize(ICON_SIZE);

	MakeActions();
	UpdateIcons();

	EmulationStopped();
}
示例#8
0
/*
 *  Constructs a QG_CadToolBar as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
QG_CadToolBar::QG_CadToolBar(QWidget* parent, const char* name)
    : QToolBar(parent)
	,actionHandler(nullptr)
{
    setObjectName(name);
	setCursor(Qt::ArrowCursor);
#if QT_VERSION >= 0x050500
    auto const dPxlRatio=QC_ApplicationWindow::getAppWindow()->devicePixelRatio();
    setMinimumSize(73*dPxlRatio,400*dPxlRatio);
#else
    setMinimumSize(73,400);
#endif
    setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea);
    setFloatable(false);
	init();
}
示例#9
0
djvViewAbstractToolBar::djvViewAbstractToolBar(
    djvViewAbstractActions * actions,
    djvViewContext *         context,
    QWidget *                parent) :
    QToolBar(parent),
    _p(new djvViewAbstractToolBarPrivate(actions, context))
{
    setAllowedAreas(
        Qt::TopToolBarArea | Qt::LeftToolBarArea | Qt::RightToolBarArea);
    
    setFloatable(false);
    
    //setMovable(false);
    
    setIconSize(context->iconLibrary()->defaultSize());
}
/*!
	\details Create a new pQueuedMessageToolBar object
	\param parent The parent widget
*/
pQueuedMessageToolBar::pQueuedMessageToolBar( QWidget* parent )
	: QToolBar( parent )
{
	setMovable( false );
	setFloatable( false );
	setAllowedAreas( Qt::TopToolBarArea );
	toggleViewAction()->setEnabled( false );
	toggleViewAction()->setVisible( false );
	mDefaultPalette = palette();
	// create pQueuedMessageWidget
	mQueuedWidget = new pQueuedMessageWidget( this );
	addWidget( mQueuedWidget );
	// connections
	connect( mQueuedWidget, SIGNAL( messageShown( const pQueuedMessage& ) ), this, SLOT( messageShown( const pQueuedMessage& ) ) );
	connect( mQueuedWidget, SIGNAL( cleared() ), this, SLOT( messageCleared() ) );
}
示例#11
0
djvGlslTestPlaybackToolBar::djvGlslTestPlaybackToolBar(
    djvGlslTestPlayback * playback,
    djvGlslTestContext *  context,
    QWidget *             parent) :
    QToolBar(parent),
    _playback(playback),
    _buttons(0),
    _slider (0)
{
    QWidget * widget = new QWidget;
    widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    
    _buttons = new djvPlaybackButtons(context);
    
    _slider = new djvViewFrameSlider(context);
    
    QHBoxLayout * layout = new QHBoxLayout(widget);
    layout->setMargin(5);
    layout->setSpacing(5);
    layout->addWidget(_buttons);
    layout->addWidget(_slider);
    
    addWidget(widget);
    setMovable(false);
    setFloatable(false);
    
    _buttons->setPlayback(playback->playback());
    
    _slider->setFrameList(playback->sequence().frames);
    _slider->setSpeed(playback->sequence().speed);
    
    _slider->connect(
        _playback,
        SIGNAL(frameChanged(qint64)),
        SLOT(setFrame(qint64)));
    
    _playback->connect(
        _buttons,
        SIGNAL(playbackChanged(djvPlaybackUtil::PLAYBACK)),
        SLOT(setPlayback(djvPlaybackUtil::PLAYBACK)));
    
    _playback->connect(
        _slider,
        SIGNAL(frameChanged(qint64)),
        SLOT(setFrame(qint64)));
}
示例#12
0
UIToolBar::UIToolBar(QWidget *pParent)
    : QToolBar(pParent)
    , m_pMainWindow(qobject_cast <QMainWindow*>(pParent))
{
    setFloatable(false);
    setMovable(false);

    /* Remove that ugly frame panel around the toolbar.
     * Doing that currently for Cleanlooks & Windows styles. */
    if (qobject_cast <QCleanlooksStyle*>(QToolBar::style()) ||
        qobject_cast <QWindowsStyle*>(QToolBar::style()))
        setStyleSheet("QToolBar { border: 0px none black; }");

    if (layout())
        layout()->setContentsMargins(0, 0, 0, 0);;

    setContextMenuPolicy(Qt::NoContextMenu);
}
示例#13
0
pQueuedMessageToolBar::pQueuedMessageToolBar( QWidget* parent )
	: QToolBar( parent )
{
	mQueuedWidget = new pQueuedMessageWidget( this );
	
	setObjectName( metaObject()->className() );
	setMovable( false );
	setFloatable( false );
	setAllowedAreas( Qt::TopToolBarArea );
	toggleViewAction()->setEnabled( false );
	toggleViewAction()->setVisible( false );
	
	addWidget( mQueuedWidget );
	layout()->setMargin( 3 );
	
	// connections
	connect( mQueuedWidget, SIGNAL( shown( const pQueuedMessage& ) ), this, SLOT( messageShown( const pQueuedMessage& ) ) );
	connect( mQueuedWidget, SIGNAL( finished() ), this, SLOT( messageFinished() ) );
}
pDockWidgetTitleBar::pDockWidgetTitleBar( pDockWidget* parent )
    : QToolBar( parent )
{
    Q_ASSERT( parent );
    mDock = parent;
    
    // a fake spacer widget
    QWidget* widget = new QWidget( this );
    QHBoxLayout* hlayout = new QHBoxLayout( widget );
    hlayout->setMargin( 0 );
    hlayout->setSpacing( 0 );
    hlayout->addStretch();
    
    // fake spacer item
    mSpacer = new QWidgetAction( this );
    mSpacer->setDefaultWidget( widget );
    
    setMovable( false );
    setFloatable( false );
    setIconSize( QSize( 12, 12 ) );
    layout()->setSpacing( 0 );
    layout()->setMargin( 2 );
    
    aOrientation = new QAction( this );
    aFloat = new QAction( this );
    aClose = new QAction( this );
    
    addAction( mSpacer );
    addAction( aOrientation );
    addAction( aFloat );
    addAction( aClose );
    
    updateStandardIcons();
    dockWidget_featuresChanged( mDock->features() );
    
    connect( mDock, SIGNAL( featuresChanged( QDockWidget::DockWidgetFeatures ) ), this, SLOT( dockWidget_featuresChanged( QDockWidget::DockWidgetFeatures ) ) );
    connect( aOrientation, SIGNAL( triggered() ), this, SLOT( aOrientation_triggered() ) );
    connect( aFloat, SIGNAL( triggered() ), this, SLOT( aFloat_triggered() ) );
    connect( aClose, SIGNAL( triggered() ), mDock, SLOT( close() ) );
}
示例#15
0
ToolBarWidget::ToolBarWidget(int identifier, Window *window, QWidget *parent) : QToolBar(parent),
	m_mainWindow(MainWindow::findMainWindow(parent)),
	m_window(window),
	m_bookmark(NULL),
	m_dragArea(NULL),
	m_identifier(identifier)
{
	setStyleSheet(QLatin1String("QToolBar {padding:0 3px;spacing:3px;}"));
	setAllowedAreas(Qt::NoToolBarArea);
	setFloatable(false);

	layout()->setContentsMargins(0, 0, 0, 0);

	if (identifier >= 0)
	{
		setToolBarLocked(ToolBarsManager::areToolBarsLocked());
		reload();

		connect(ToolBarsManager::getInstance(), SIGNAL(toolBarModified(int)), this, SLOT(toolBarModified(int)));
		connect(ToolBarsManager::getInstance(), SIGNAL(toolBarRemoved(int)), this, SLOT(toolBarRemoved(int)));
		connect(ToolBarsManager::getInstance(), SIGNAL(toolBarsLockedChanged(bool)), this, SLOT(setToolBarLocked(bool)));
	}
示例#16
0
 /**
   * Constructeur
   */
 ActionToolBar::ActionToolBar() :
 _summaryActive(false)
 {
     setObjectName("ActionToolBar");
     setWindowTitle(tr("Barre d'actions"));
     setFloatable(false);
     //On construit le bouton de fin de tour
     _endTurn = new QPushButton(tr("Fin du tour"));
     connect(_endTurn,SIGNAL(clicked()),this,SLOT(endTurnButtonSelected()));
     addWidget(_endTurn);
     addSeparator();
     //On construit le bouton de selection
     _select = new QPushButton(tr("Selectionner"));
     connect(_select,SIGNAL(clicked()),this,SLOT(selectButtonSelected()));
     addWidget(_select);
     addSeparator();
     //On construit le bouton de récapitulatif
     _summary = new QPushButton(tr("Récapitulatif"));
     connect(_summary,SIGNAL(clicked()),this,SLOT(summaryButtonSelected()));
     addWidget(_summary);
     addSeparator();
     //On construit le bouton pour réaliser une action
     _action = new QPushButton(tr("Action"));
     _action->setEnabled(false);
     connect(_action,SIGNAL(clicked()),this,SLOT(actionButtonSelected()));
     addWidget(_action);
     addSeparator();
     //On ajoute le TileInfoWidget
     _tileInfo = new TileInfoWidget;
     _tileInfoAction = addWidget(_tileInfo);
     //On ajotue le BuildingInfoWidget
     _buildingInfo = new BuildingInfoWidget;
     _buildingInfoAction = addWidget(_buildingInfo);
     _buildingInfoAction->setVisible(false);
     addSeparator();
     //On ajoute le EntityInfoWidget
     _entityInfo = new EntityInfoWidget;
     addWidget(_entityInfo);
 }
示例#17
0
pDockWidgetTitleBar::pDockWidgetTitleBar( QDockWidget* parent )
	: QToolBar( parent )
{
	Q_ASSERT( parent );
	mDock = parent;
	mUseNativePaint = mUseNativePaintDefault;
	
	// a fake spacer widget
	QWidget* spacer = new QWidget( this );
	spacer->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum ) );
	
	tbOrientation = new pToolButton( this );
	tbOrientation->installEventFilter( this );
	tbFloat = new pToolButton( this );
	tbFloat->installEventFilter( this );
	tbClose = new pToolButton( this );
	tbClose->installEventFilter( this );
	
	addWidget( spacer );
	aOrientation = addWidget( tbOrientation );
	aFloat = addWidget( tbFloat );
	aClose = addWidget( tbClose );
	
	tbOrientation->setDefaultAction( aOrientation );
	tbFloat->setDefaultAction( aFloat );
	tbClose->setDefaultAction( aClose );
	
	setMovable( false );
	setFloatable( false );
	
	updateStyleChange();
	dockWidget_featuresChanged( mDock->features() );
	
	connect( mDock, SIGNAL( featuresChanged( QDockWidget::DockWidgetFeatures ) ), this, SLOT( dockWidget_featuresChanged( QDockWidget::DockWidgetFeatures ) ) );
	connect( aOrientation, SIGNAL( triggered() ), this, SLOT( aOrientation_triggered() ) );
	connect( aFloat, SIGNAL( triggered() ), this, SLOT( aFloat_triggered() ) );
	connect( aClose, SIGNAL( triggered() ), mDock, SLOT( close() ) );
}
示例#18
0
ControlBar::ControlBar( QWidget* parent )
	: QToolBar( parent )
	, _startButton( new QPushButton( "Start", this ) )
	, _stopButton( new QPushButton( "Stop", this ) )
	, _beltSelector( new QSpinBox( this ) )
{
	setMinimumSize( 200, 46 );
	setFloatable( false );
	setMovable( false );

	addWidget( _startButton );
	addWidget( _stopButton );
	addWidget( _beltSelector );

	_stopButton->setEnabled( false );

	bool ok;
	ok = connect( _startButton, SIGNAL( clicked() ), SLOT( on_startButton_clicked() ) );
	Q_ASSERT( ok );

	ok = connect( _stopButton, SIGNAL( clicked() ), SLOT( on_stopButton_clicked() ) );
	Q_ASSERT( ok );
}
示例#19
0
int QToolBar::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: actionTriggered((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
        case 1: movableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: allowedAreasChanged((*reinterpret_cast< Qt::ToolBarAreas(*)>(_a[1]))); break;
        case 3: orientationChanged((*reinterpret_cast< Qt::Orientation(*)>(_a[1]))); break;
        case 4: iconSizeChanged((*reinterpret_cast< const QSize(*)>(_a[1]))); break;
        case 5: toolButtonStyleChanged((*reinterpret_cast< Qt::ToolButtonStyle(*)>(_a[1]))); break;
        case 6: topLevelChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 7: setIconSize((*reinterpret_cast< const QSize(*)>(_a[1]))); break;
        case 8: setToolButtonStyle((*reinterpret_cast< Qt::ToolButtonStyle(*)>(_a[1]))); break;
        case 9: d_func()->_q_toggleView((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 10: d_func()->_q_updateIconSize((*reinterpret_cast< const QSize(*)>(_a[1]))); break;
        case 11: d_func()->_q_updateToolButtonStyle((*reinterpret_cast< Qt::ToolButtonStyle(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 12;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isMovable(); break;
        case 1: *reinterpret_cast< Qt::ToolBarAreas*>(_v) = allowedAreas(); break;
        case 2: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
        case 3: *reinterpret_cast< QSize*>(_v) = iconSize(); break;
        case 4: *reinterpret_cast< Qt::ToolButtonStyle*>(_v) = toolButtonStyle(); break;
        case 5: *reinterpret_cast< bool*>(_v) = isFloating(); break;
        case 6: *reinterpret_cast< bool*>(_v) = isFloatable(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setMovable(*reinterpret_cast< bool*>(_v)); break;
        case 1: setAllowedAreas(*reinterpret_cast< Qt::ToolBarAreas*>(_v)); break;
        case 2: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
        case 3: setIconSize(*reinterpret_cast< QSize*>(_v)); break;
        case 4: setToolButtonStyle(*reinterpret_cast< Qt::ToolButtonStyle*>(_v)); break;
        case 6: setFloatable(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        bool *_b = reinterpret_cast<bool*>(_a[0]);
        switch (_id) {
        case 0: *_b = (qobject_cast<QMainWindow*>(parentWidget())!=0); break;
        case 1: *_b = (qobject_cast<QMainWindow*>(parentWidget())!=0); break;
        case 2: *_b = (qobject_cast<QMainWindow*>(parentWidget())==0); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}