| 115 | } |
| 116 | |
| 117 | void DebuggerConsoleView::setupUi() |
| 118 | { |
| 119 | setupToolBar(); |
| 120 | |
| 121 | m_textView = new QTextEdit; |
| 122 | m_textView->setReadOnly(true); |
| 123 | m_textView->setContextMenuPolicy(Qt::CustomContextMenu); |
| 124 | connect(m_textView, &QTextEdit::customContextMenuRequested, |
| 125 | this, &DebuggerConsoleView::textViewContextMenuRequested); |
| 126 | |
| 127 | auto vbox = new QVBoxLayout; |
| 128 | vbox->setContentsMargins(0, 0, 0, 0); |
| 129 | vbox->addWidget(m_textView); |
| 130 | vbox->addWidget(m_toolBar); |
| 131 | |
| 132 | setLayout(vbox); |
| 133 | |
| 134 | m_cmdEditor = new KHistoryComboBox(this); |
| 135 | m_cmdEditor->setDuplicatesEnabled(false); |
| 136 | connect(m_cmdEditor, QOverload<const QString&>::of(&KHistoryComboBox::returnPressed), |
| 137 | this, &DebuggerConsoleView::trySendCommand); |
| 138 | |
| 139 | auto label = new QLabel(i18nc("@label:listbox", "&Command:"), this); |
| 140 | label->setBuddy(m_cmdEditor); |
| 141 | |
| 142 | auto hbox = new QHBoxLayout; |
| 143 | hbox->addWidget(label); |
| 144 | hbox->addWidget(m_cmdEditor); |
| 145 | hbox->setStretchFactor(m_cmdEditor, 1); |
| 146 | hbox->setContentsMargins(0, 0, 0, 0); |
| 147 | |
| 148 | auto cmdEditor = new QWidget(this); |
| 149 | cmdEditor->setLayout(hbox); |
| 150 | m_actCmdEditor = m_toolBar->addWidget(cmdEditor); |
| 151 | } |
| 152 | |
| 153 | void DebuggerConsoleView::setupToolBar() |
| 154 | { |