本文整理汇总了C++中QToolBar::setMovable方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolBar::setMovable方法的具体用法?C++ QToolBar::setMovable怎么用?C++ QToolBar::setMovable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolBar
的用法示例。
在下文中一共展示了QToolBar::setMovable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QLabel
void BitcoinGUI::createToolBars2()
{
QLabel *mylabel = new QLabel (this);
mylabel->setPixmap(QPixmap(":images/head"));
mylabel->show();
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setObjectName("toolbar");
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setMovable( false );
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->setIconSize(QSize(50,25));
toolbar->addWidget(mylabel);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(blockAction);
toolbar->addAction(statisticsAction);
toolbar->addAction(optionsAction);
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolbar->addWidget(spacer);
spacer->setObjectName("spacer");
toolbar->setStyleSheet(
"#toolbar { font-weight:600;border:none;height:100%;padding-top:20px; background: rgb(37,40,46); text-align: left; color: white;min-width:180px;max-width:180px;}"
"QToolBar QToolButton:hover {background:rgb(28,29,33);}"
"QToolBar QToolButton:checked {background:rgba(28,29,33,100);}"
"QToolBar QToolButton { font-weight:600;font-size:10px;font-family:'Century Gothic';padding-left:20px;padding-right:181px;padding-top:5px;padding-bottom:5px; width:100%; color: white; text-align: left; background:transparent;text-transform:uppercase; }");
wId = new QWidget(this);
wId3 = new QWidget(this);
QToolBar *toolbars = addToolBar(tr("Settings2"));
addToolBar(Qt::RightToolBarArea,toolbars);
toolbars->setOrientation(Qt::Horizontal);
toolbars->setMovable( false );
toolbars->setStyleSheet("QToolBar QToolButton {border:0px;margin-right:3px} QToolBar{ border:0px; }");
toolbars->setIconSize(QSize(102,25));
QHBoxLayout *vbox5 = new QHBoxLayout();
vbox5->addWidget(toolbars);
vbox5->setContentsMargins(0,0,0,0);
wId3->setFixedSize(250,30);
wId3->move(260,10);
wId3->setLayout(vbox5);
wId3->setFocus();
wId3->raise();
QMenu *menu = new QMenu(tr("Mini"));
menu->setStyleSheet("border:none;background:none;");
menu->addAction(toggleHideAction);
menu->menuAction()->setIcon(QIcon(":/icons/mini"));
QHBoxLayout *vbox3 = new QHBoxLayout();
vbox3->setContentsMargins(0,0,0,0);
wId->setFixedSize(120,40);
wId->move(915,1);
wId->setLayout(vbox3);
wId->setFocus();
}
示例2: createToolBar
void MainWindow::createToolBar(){
QToolBar* toolBar = new QToolBar();
toolBar->setMovable(false);
newFileButton = new QPushButton();
newFileButton->setIcon(QIcon(":new-file.png"));
newFileButton->setIconSize(QSize(20,20));
newFileButton->setToolTip(tr("Create a new file"));
newFileButton->setMaximumWidth(28);
newFileButton->setCursor(Qt::PointingHandCursor);
connect(newFileButton,SIGNAL(released()),this,SLOT(createNewFile()));
toolBar->addWidget(newFileButton);
openFileButton = new QPushButton();
openFileButton->setIcon(QIcon(":open-file.png"));
openFileButton->setIconSize(QSize(20,20));
openFileButton->setToolTip(tr("Open a file"));
openFileButton->setMaximumWidth(28);
openFileButton->setCursor(Qt::PointingHandCursor);
connect(openFileButton,SIGNAL(released()),this,SLOT(openFile()));
toolBar->addWidget(openFileButton);
saveFileButton = new QPushButton();
saveFileButton->setIcon(QIcon(":save-file.png"));
saveFileButton->setIconSize(QSize(20,20));
saveFileButton->setToolTip(tr("Save the current file"));
saveFileButton->setMaximumWidth(28);
saveFileButton->setCursor(Qt::PointingHandCursor);
saveFileButton->setShortcut(QKeySequence("Ctrl+S"));
connect(saveFileButton,SIGNAL(released()),this,SLOT(saveFile()));
toolBar->addWidget(saveFileButton);
addToolBar(toolBar);
}
示例3: createMenus
void MainWindow::createMenus()
{
QAction * quitAction = new QAction("Quit", this);
QObject::connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
QIcon quitIcon;
quitIcon.addPixmap(QPixmap("data/images/QuitIcon.png"), QIcon::Normal);
quitAction->setIcon(quitIcon);
QToolBar * toolBar = addToolBar("oriToolBar");
toolBar->setMovable(false);
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolBar->addAction("Left-aligned button");
QAction * startAction = new QAction("Start", this);
QObject::connect(startAction, SIGNAL(triggered()), this, SLOT(start()));
toolBar->addAction(startAction);
toolBar->addWidget(spacer);
toolBar->addAction(quitAction);
}
示例4: QMainWindow
/* \x41\x41\x41\x41\x41\x41\x41 */
TempleWin::TempleWin(QWidget *parent)
: QMainWindow(parent) {
lang = new TempleLang();
std::cout << "==========" << std::endl;
//menu
QAction *quit = new QAction("&Quit", this);
QMenu *file;
file = menuBar()->addMenu("&File");
file->addAction(quit);
connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
//toolbar
QToolBar *tb = new QToolBar("TOOLBAR");
TBar *tbw = new TBar(this, lang);
tb->addWidget(tbw);
tb->setMovable(false);
addToolBar(Qt::RightToolBarArea, tb);
GLWidget *widGl = new GLWidget(this, lang);
widGl->show();
widGl->resize(200,200);
setCentralWidget(widGl);
}
示例5: createToolBars
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Screens toolbar"));
toolbar->setObjectName("toolbar");
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setMovable( false );
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->setIconSize(QSize(50,25));
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(exportAction);
toolbar->addAction(optionsAction);
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolbar->addWidget(spacer);
spacer->setObjectName("spacer");
QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar2->addAction(openRPCConsoleAction);
toolbar2->setVisible(false);
}
示例6: createToolBars
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setObjectName("toolbar");
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setFixedWidth(205);
toolbar->setMovable( false );
toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);
QLabel* header = new QLabel();
header->setMinimumSize(156,156);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setPixmap(QPixmap(":/images/header"));
header->setMaximumSize(156,156);
header->setContentsMargins(26,26,0,0);
header->setScaledContents(true);
toolbar->addWidget(header);
QLabel *l = new QLabel(this);
l->setPixmap(QPixmap(":/images/spacer"));
toolbar->addWidget(l);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");
}
示例7: createToolBars
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setObjectName("toolbar");
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setMovable(false);
QWidget* header = new QWidget();
header->setMinimumSize(140, 45);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setStyleSheet("QWidget { background-color: rgb(0,0,0); background-repeat: no-repeat; background-image: url(:/images/header); background-position: top center; }");
toolbar->addWidget(header);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(bittrexPageAction);
toolbar->addAction(shockBotAction);
toolbar->addAction(blockAction);
toolbar->addAction(socialPageAction);
toolbar->addAction(chatAction);
toolbar->addAction(exportAction);
}
示例8: createToolBars
void spincoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setObjectName("toolbar");
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setMovable( false );
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->setIconSize(QSize(50,25));
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(statisticsAction);
toolbar->addAction(blockAction);
toolbar->addAction(unlockWalletAction);
toolbar->addAction(lockWalletAction);
// toolbar->addAction(exportAction);
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolbar->addWidget(spacer);
spacer->setObjectName("spacer");
}
示例9: createToolBars
void FujicoinGUI::createToolBars()
{
if(walletFrame)
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
appToolBar = toolbar;
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setMovable(false);
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
overviewAction->setChecked(true);
#ifdef ENABLE_WALLET
QWidget *spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolbar->addWidget(spacer);
m_wallet_selector = new QComboBox();
connect(m_wallet_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentWalletBySelectorIndex(int)));
m_wallet_selector_label = new QLabel();
m_wallet_selector_label->setText(tr("Wallet:") + " ");
m_wallet_selector_label->setBuddy(m_wallet_selector);
m_wallet_selector_label_action = appToolBar->addWidget(m_wallet_selector_label);
m_wallet_selector_action = appToolBar->addWidget(m_wallet_selector);
m_wallet_selector_label_action->setVisible(false);
m_wallet_selector_action->setVisible(false);
#endif
}
}
示例10: createToolBars
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setObjectName("toolbar");
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setMovable( false );
toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);
QLabel *l = new QLabel(this);
l->setPixmap(QPixmap(":/images/spacer"));
toolbar->addWidget(l);
toolbar->addAction(overviewAction);
toolbar->addAction(statisticsAction);
toolbar->addAction(blockAction);
toolbar->addAction(chatAction);
#ifdef ENABLE_TRADE_REQUIRE_QT5
toolbar->addAction(TradingAction);
#endif
// toolbar->addAction(radioAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->setStyleSheet("#toolbar { border:1px;height:100%;padding-top:100px; background: transparent; text-align: center; color: #4DD0F0;min-width:200px;max-width:200px;} QToolBar QToolButton:hover {background-image: url(:images/1); background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-image: url(:images/2); background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton { margin: 2px; background-image:url(:images/3); font-family:'Bebas'; font-size:14px; min-width:160px;max-width:160px; min-height:40px;max-height:40px; color: white; text-align: center; }");
}
示例11: createToolBars
void BitcoinGUI::createToolBars()
{
if(walletFrame)
{
QToolBar *toolbar = new QToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->setMovable(false); // remove unused icon in upper left corner
overviewAction->setChecked(true);
/** Create additional container for toolbar and walletFrame and make it the central widget.
This is a workaround mostly for toolbar styling on Mac OS but should work fine for every other OSes too.
*/
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(toolbar);
layout->addWidget(walletFrame);
layout->setSpacing(0);
layout->setContentsMargins(QMargins());
QWidget *containerWidget = new QWidget();
containerWidget->setLayout(layout);
setCentralWidget(containerWidget);
}
}
示例12: createSpriteView
void MainWindow::createSpriteView(SpriteModel* model)
{
QMainWindow* window = new QMainWindow;
QToolBar* bar = new QToolBar( window );
bar->addAction( ui.actionSpritesNewFolder );
bar->addAction( ui.actionSpritesNewSprite );
bar->addAction( ui.actionSpritesMoveSprite );
bar->addAction( ui.actionSpritesRemoveItem );
bar->setMovable( false );
window->addToolBar( bar );
window->setParent( ui.dockWidgetComposition );
spriteView = new SpriteView( this );
spriteView->setModel(model);
spriteView->addAction( ui.actionSpritesNewFolder );
spriteView->addAction( ui.actionSpritesNewSprite );
spriteView->addAction( ui.actionSpritesMoveSprite );
spriteView->addAction( ui.actionSpritesRemoveItem );
spriteView->setContextMenuPolicy( Qt::ActionsContextMenu );
window->setCentralWidget( spriteView );
ui.dockWidgetSprites->setWidget( window );
connect( ui.actionSpritesNewFolder, SIGNAL( triggered() ), this, SLOT( actionSpritesNewFolder() ) );
connect( ui.actionSpritesNewSprite, SIGNAL( triggered() ), this, SLOT( actionSpritesNewSprite() ) );
connect( ui.actionSpritesMoveSprite, SIGNAL( triggered() ), this, SLOT( actionSpritesMoveSprite() ) );
connect( ui.actionSpritesRemoveItem, SIGNAL( triggered() ), this, SLOT( actionSpritesRemoveItem() ) );
}
示例13: addView
void IdealController::addView(Qt::DockWidgetArea area, View* view)
{
IdealDockWidget *dock = new IdealDockWidget(this, m_mainWindow);
// dock object name is used to store toolview settings
QString dockObjectName = view->document()->title();
// support different configuration for same docks opened in different areas
if (m_mainWindow->area())
dockObjectName += '_' + m_mainWindow->area()->objectName();
dock->setObjectName(dockObjectName);
KAcceleratorManager::setNoAccel(dock);
QWidget *w = view->widget(dock);
if (w->parent() == 0)
{
/* Could happen when we're moving the widget from
one IdealDockWidget to another. See moveView below.
In this case, we need to reparent the widget. */
w->setParent(dock);
}
QList<QAction *> toolBarActions = view->toolBarActions();
if (toolBarActions.isEmpty()) {
dock->setWidget(w);
} else {
QMainWindow *toolView = new QMainWindow();
QToolBar *toolBar = new QToolBar(toolView);
int iconSize = m_mainWindow->style()->pixelMetric(QStyle::PM_SmallIconSize);
toolBar->setIconSize(QSize(iconSize, iconSize));
toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
toolBar->setWindowTitle(i18n("%1 Tool Bar", w->windowTitle()));
toolBar->setFloatable(false);
toolBar->setMovable(false);
toolBar->addActions(toolBarActions);
toolView->setCentralWidget(w);
toolView->addToolBar(toolBar);
dock->setWidget(toolView);
}
dock->setWindowTitle(view->widget()->windowTitle());
dock->setWindowIcon(view->widget()->windowIcon());
dock->setFocusProxy(dock->widget());
if (IdealButtonBarWidget* bar = barForDockArea(area)) {
QAction* action = bar->addWidget(
view->document()->title(), dock,
static_cast<MainWindow*>(parent())->area(), view);
m_dockwidget_to_action[dock] = m_view_to_action[view] = action;
m_docks->addAction(action);
connect(dock, &IdealDockWidget::closeRequested, action, &QAction::toggle);
}
connect(dock, &IdealDockWidget::dockLocationChanged, this, &IdealController::dockLocationChanged);
dock->hide();
docks.insert(dock);
}
示例14: createToolBar
static QToolBar* createToolBar(const QString& name, QWidget* parent, bool visible) {
QToolBar* bar = new QToolBar(parent);
bar->setObjectName(name);
bar->setFloatable(false);
bar->setMovable(true);
bar->setVisible(visible);
return bar;
}
示例15: QWidget
EditWidget::EditWidget(IMessageWidgets *AMessageWidgets, IMessageWindow *AWindow, QWidget *AParent) : QWidget(AParent)
{
ui.setupUi(this);
ui.medEditor->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
FWindow = AWindow;
FMessageWidgets = AMessageWidgets;
FBufferPos = -1;
FSendEnabled = true;
FEditEnabled = true;
setRichTextEnabled(false);
QToolBar *toolBar = new QToolBar;
toolBar->setMovable(false);
toolBar->setFloatable(false);
toolBar->setIconSize(QSize(16,16));
toolBar->layout()->setMargin(0);
toolBar->setStyleSheet("QToolBar { border: none; }");
toolBar->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
FEditToolBar = new ToolBarChanger(toolBar);
FEditToolBar->setMinimizeWidth(true);
FEditToolBar->setSeparatorsVisible(false);
connect(FEditToolBar,SIGNAL(itemRemoved(QAction *)),SLOT(onUpdateEditToolBarVisibility()));
connect(FEditToolBar,SIGNAL(itemInserted(QAction *, QAction *, Action *, QWidget *, int)),SLOT(onUpdateEditToolBarVisibility()));
ui.wdtSendToolBar->setLayout(new QHBoxLayout);
ui.wdtSendToolBar->layout()->setMargin(0);
ui.wdtSendToolBar->layout()->addWidget(toolBar);
FSendAction = new Action(toolBar);
FSendAction->setToolTip(tr("Send"));
FSendAction->setIcon(RSR_STORAGE_MENUICONS,MNI_MESSAGEWIDGETS_SEND);
connect(FSendAction,SIGNAL(triggered(bool)),SLOT(onSendActionTriggered(bool)));
FEditToolBar->insertAction(FSendAction,TBG_MWEWTB_SENDMESSAGE);
ui.medEditor->installEventFilter(this);
ui.medEditor->setContextMenuPolicy(Qt::CustomContextMenu);
Shortcuts::insertWidgetShortcut(SCT_MESSAGEWINDOWS_EDITNEXTMESSAGE,ui.medEditor);
Shortcuts::insertWidgetShortcut(SCT_MESSAGEWINDOWS_EDITPREVMESSAGE,ui.medEditor);
connect(ui.medEditor,SIGNAL(createDataRequest(QMimeData *)),SLOT(onEditorCreateDataRequest(QMimeData *)));
connect(ui.medEditor,SIGNAL(canInsertDataRequest(const QMimeData *, bool &)),
SLOT(onEditorCanInsertDataRequest(const QMimeData *, bool &)));
connect(ui.medEditor,SIGNAL(insertDataRequest(const QMimeData *, QTextDocument *)),
SLOT(onEditorInsertDataRequest(const QMimeData *, QTextDocument *)));
connect(ui.medEditor->document(),SIGNAL(contentsChange(int,int,int)),SLOT(onEditorContentsChanged(int,int,int)));
connect(ui.medEditor,SIGNAL(customContextMenuRequested(const QPoint &)),SLOT(onEditorCustomContextMenuRequested(const QPoint &)));
onOptionsChanged(Options::node(OPV_MESSAGES_EDITORAUTORESIZE));
onOptionsChanged(Options::node(OPV_MESSAGES_EDITORMINIMUMLINES));
connect(Options::instance(),SIGNAL(optionsChanged(const OptionsNode &)),SLOT(onOptionsChanged(const OptionsNode &)));
connect(Shortcuts::instance(),SIGNAL(shortcutUpdated(const QString &)),SLOT(onShortcutUpdated(const QString &)));
connect(Shortcuts::instance(),SIGNAL(shortcutActivated(const QString &, QWidget *)),SLOT(onShortcutActivated(const QString &, QWidget *)));
onUpdateEditToolBarVisibility();
}