7#include <QtDesigner/abstractformwindow.h>
9#include <QtWidgets/qtablewidget.h>
10#include <QtWidgets/qlineedit.h>
11#include <QtWidgets/qstyle.h>
12#include <QtWidgets/qstyleoption.h>
14#include <QtGui/qaction.h>
16#include <QtCore/qcoreevent.h>
17#include <QtCore/qvariant.h>
18#include <QtCore/qdebug.h>
25 : QDesignerTaskMenu(button, parent),
26 m_tableWidget(button),
27 m_editItemsAction(
new QAction(tr(
"Edit Items..."),
this))
29 connect(m_editItemsAction, &QAction::triggered,
this, &TableWidgetTaskMenu::editItems);
30 m_taskActions.append(m_editItemsAction);
32 QAction *sep =
new QAction(
this);
33 sep->setSeparator(
true);
34 m_taskActions.append(sep);
42 return m_editItemsAction;
47 return m_taskActions + QDesignerTaskMenu::taskActions();
52 m_formWindow = QDesignerFormWindowInterface::findFormWindow(m_tableWidget);
53 if (m_formWindow.isNull())
56 Q_ASSERT(m_tableWidget !=
nullptr);
60 if (dlg.exec() == QDialog::Accepted) {
62 if (newCont != oldCont) {
63 ChangeTableContentsCommand *cmd =
new ChangeTableContentsCommand(m_formWindow);
64 cmd->init(m_tableWidget, oldCont, newCont);
65 m_formWindow->commandHistory()->push(cmd);
73 m_editor->deleteLater();
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.