本文整理汇总了C++中KToolBar::setOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ KToolBar::setOrientation方法的具体用法?C++ KToolBar::setOrientation怎么用?C++ KToolBar::setOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KToolBar
的用法示例。
在下文中一共展示了KToolBar::setOrientation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupScriptPanel
QWidget* MainWindow::setupScriptPanel()
{
m_hScriptSplitter = new QSplitter(this);
m_hScriptSplitter->setOrientation(Qt::Horizontal);
KToolBar *executeCommands = new KToolBar(this);
executeCommands->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
executeCommands->setOrientation(Qt::Vertical);
m_runScript = new QAction(QIcon::fromTheme("media-playback-start"), i18nc("@action:intoolbar Script Execution", "Run"), this);
m_runScript->setToolTip(i18nc("@info:tooltip", "Execute currently active script on active graph document."));
m_stopScript = new QAction(QIcon::fromTheme("process-stop"), i18nc("@action:intoolbar Script Execution", "Stop"), this);
m_stopScript->setToolTip(i18nc("@info:tooltip", "Stop script execution."));
m_stopScript->setEnabled(false);
executeCommands->addAction(m_runScript);
executeCommands->addAction(m_stopScript);
// add actions to action collection to be able to set shortcuts on them in the ui
actionCollection()->addAction("_runScript", m_runScript);
actionCollection()->addAction("_stopScript", m_stopScript);
connect(m_runScript, &QAction::triggered, this, &MainWindow::executeScript);
connect(m_stopScript, &QAction::triggered, this, &MainWindow::stopScript);
m_hScriptSplitter->addWidget(m_codeEditorWidget);
m_hScriptSplitter->addWidget(m_outputWidget);
QWidget *scriptInterface = new QWidget(this);
scriptInterface->setLayout(new QHBoxLayout);
scriptInterface->layout()->addWidget(m_hScriptSplitter);
scriptInterface->layout()->addWidget(executeCommands);
return scriptInterface;
}
示例2: QWidget
DataOutputWidget::DataOutputWidget(QWidget *parent)
: QWidget(parent)
, m_model(new DataOutputModel(this))
, m_view(new DataOutputView(this))
, m_isEmpty(true)
{
m_view->setModel(m_model);
QHBoxLayout *layout = new QHBoxLayout(this);
m_dataLayout = new QVBoxLayout();
KToolBar *toolbar = new KToolBar(this);
toolbar->setOrientation(Qt::Vertical);
toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
toolbar->setIconSize(QSize(16, 16));
/// TODO: disable actions if no results are displayed or selected
KAction *action;
action = new KAction( KIcon("distribute-horizontal-x"), i18nc("@action:intoolbar", "Resize columns to contents"), this);
toolbar->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(resizeColumnsToContents()));
action = new KAction( KIcon("distribute-vertical-y"), i18nc("@action:intoolbar", "Resize rows to contents"), this);
toolbar->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(resizeRowsToContents()));
action = new KAction( KIcon("edit-copy"), i18nc("@action:intoolbar", "Copy"), this);
toolbar->addAction(action);
m_view->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(slotCopySelected()));
action = new KAction( KIcon("document-export-table"), i18nc("@action:intoolbar", "Export..."), this);
toolbar->addAction(action);
m_view->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(slotExport()));
action = new KAction( KIcon("edit-clear"), i18nc("@action:intoolbar", "Clear"), this);
toolbar->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(clearResults()));
toolbar->addSeparator();
KToggleAction *toggleAction = new KToggleAction( KIcon("applications-education-language"), i18nc("@action:intoolbar", "Use system locale"), this);
toolbar->addAction(toggleAction);
connect(toggleAction, SIGNAL(triggered()), this, SLOT(slotToggleLocale()));
m_dataLayout->addWidget(m_view);
layout->addWidget(toolbar);
layout->addLayout(m_dataLayout);
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout);
}
示例3: fixedFont
TextOutputWidget::TextOutputWidget(QWidget *parent)
: QWidget(parent)
{
m_succesTextColor = QColor::fromRgb(3, 191, 3);
m_succesBackgroundColor = QColor::fromRgb(231, 247, 231);
m_errorTextColor = QColor::fromRgb(191, 3, 3);
m_errorBackgroundColor = QColor::fromRgb(247, 231, 231);
m_layout = new QHBoxLayout(this);
m_output = new QTextEdit();
m_output->setReadOnly(true);
QFont fixedFont(KGlobalSettings::fixedFont());
m_output->setCurrentFont(fixedFont);
KToolBar *toolbar = new KToolBar(this);
toolbar->setOrientation(Qt::Vertical);
toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
toolbar->setIconSize(QSize(16, 16));
/// TODO: disable actions if no results are displayed
KAction *action;
action = new KAction( KIcon("edit-clear"), i18nc("@action:intoolbar", "Clear"), this);
toolbar->addAction(action);
connect(action, SIGNAL(triggered()), m_output, SLOT(clear()));
m_layout->addWidget(toolbar);
m_layout->addWidget(m_output, 1);
setLayout(m_layout);
}