| 11 | #include <QWidgetAction> |
| 12 | |
| 13 | void DialogAgent::createUI() |
| 14 | { |
| 15 | this->setWindowTitle("Generate Agent"); |
| 16 | this->setProperty("Main", "base"); |
| 17 | |
| 18 | listenerLabel = new QLabel("Listener:", this); |
| 19 | listenerInput = new QLineEdit(this); |
| 20 | listenerInput->setReadOnly(true); |
| 21 | |
| 22 | listenerDisplayEdit = new QLineEdit(this); |
| 23 | listenerDisplayEdit->setReadOnly(true); |
| 24 | listenerDisplayEdit->setPlaceholderText("Click to select listeners..."); |
| 25 | |
| 26 | listenerSelectBtn = new QPushButton("...", this); |
| 27 | listenerSelectBtn->setToolTip("Select listeners"); |
| 28 | |
| 29 | listenerListWidget = new QListWidget(); |
| 30 | listenerListWidget->setSelectionMode(QAbstractItemView::SingleSelection); |
| 31 | listenerListWidget->setDragDropMode(QAbstractItemView::InternalMove); |
| 32 | listenerListWidget->setDefaultDropAction(Qt::MoveAction); |
| 33 | listenerListWidget->setMinimumWidth(250); |
| 34 | listenerListWidget->setMinimumHeight(150); |
| 35 | |
| 36 | btnMoveUp = new QPushButton("↑"); |
| 37 | btnMoveUp->setToolTip("Move selected listener up"); |
| 38 | btnMoveDown = new QPushButton("↓"); |
| 39 | btnMoveDown->setToolTip("Move selected listener down"); |
| 40 | |
| 41 | auto btnLayout = new QVBoxLayout(); |
| 42 | btnLayout->setContentsMargins(0, 0, 0, 0); |
| 43 | btnLayout->setSpacing(4); |
| 44 | btnLayout->addWidget(btnMoveUp); |
| 45 | btnLayout->addWidget(btnMoveDown); |
| 46 | btnLayout->addStretch(); |
| 47 | |
| 48 | auto popupLayout = new QHBoxLayout(); |
| 49 | popupLayout->setContentsMargins(8, 8, 8, 8); |
| 50 | popupLayout->setSpacing(4); |
| 51 | popupLayout->addWidget(listenerListWidget); |
| 52 | popupLayout->addLayout(btnLayout); |
| 53 | |
| 54 | listenerPopupDialog = new QDialog(this, Qt::Popup | Qt::FramelessWindowHint); |
| 55 | listenerPopupDialog->setLayout(popupLayout); |
| 56 | listenerPopupDialog->setProperty("Main", "base"); |
| 57 | |
| 58 | listenerSelectionWidget = new QWidget(this); |
| 59 | auto listenerSelectionLayout = new QHBoxLayout(listenerSelectionWidget); |
| 60 | listenerSelectionLayout->setContentsMargins(0, 0, 0, 0); |
| 61 | listenerSelectionLayout->setSpacing(4); |
| 62 | listenerSelectionLayout->addWidget(listenerDisplayEdit); |
| 63 | listenerSelectionLayout->addWidget(listenerSelectBtn); |
| 64 | listenerSelectionWidget->setVisible(false); |
| 65 | |
| 66 | agentLabel = new QLabel("Agent:", this); |
| 67 | agentCombobox = new QComboBox(this); |
| 68 | |
| 69 | profileLabel = new QLabel("Profile:", this); |
| 70 |
no test coverage detected