10 #include <QHeaderView>
11 #include <QVBoxLayout>
28 mTableView->
setModel(mPinProxyModel);
47 mAddAction =
new QAction(
"Add gate type",
this);
48 mEditAction =
new QAction(
"Edit gate type",
this);
49 mDeleteAction =
new QAction(
"Delete gate type",
this);
50 mSearchAction =
new QAction(
"Search",
this);
104 void GatelibraryContentWidget::handleEditAction()
111 void GatelibraryContentWidget::handleDeleteAction()
118 void GatelibraryContentWidget::handleCurrentSelectionChanged(
QModelIndex prevIndex){
124 void GatelibraryContentWidget::handleDoubleClicked(
QModelIndex index)
145 mCreationMode =
false;
150 std::filesystem::path oldPath = mGateLibrary->
get_path();
152 QFile gldpath(
":/path/gate_library_definitions");
160 QFileDialog fd(
this,
"Save as", path,
"HGL *.hgl");
171 mGateLibrary->
set_path(std::filesystem::path(mPath));
175 mGateLibrary->
set_name(gatelibName);
177 std::string p = mGateLibrary->
get_path().generic_string();
178 mCreationMode =
false;
181 void GatelibraryContentWidget::handleUnsavedChanges()
190 void GatelibraryContentWidget::toggleSearchbar()
214 mReadOnly = readOnly;
223 mReadOnly = readOnly;
245 return mDisabledIconStyle;
250 return mEnabledIconStyle;
255 return mAddTypeIconPath;
260 return mEditTypeIconPath;
265 return mSearchIconPath;
270 return mSearchIconStyle;
275 return mSearchActiveIconStyle;
280 return mDeleteIconPath;
285 return mDeleteIconStyle;
290 mDisabledIconStyle = s;
295 mEnabledIconStyle = s;
300 mAddTypeIconPath = s;
305 mEditTypeIconPath = s;
315 mSearchIconStyle = s;
320 mSearchActiveIconStyle = s;
330 mDeleteIconStyle = s;
std::filesystem::path get_path() const
void set_path(const std::filesystem::path &modified_path)
void set_name(const std::string &modified_name)
void setDeleteIconStyle(const QString &s)
void setGateLibraryPath(std::filesystem::path p)
void triggerEditType(QModelIndex index)
QString searchActiveIconStyle
void handleContextMenuRequested(const QPoint &pos)
void triggerCurrentSelectionChanged(QModelIndex index, QModelIndex prevIndex)
void handleSaveAsAction()
void triggerDoubleClicked(QModelIndex index)
void setSearchActiveIconStyle(const QString &s)
void toggleReadOnlyMode(bool readOnly)
void setDeleteIconPath(const QString &s)
GatelibraryContentWidget(GatelibraryTableModel *model, QWidget *parent=nullptr)
void setEditTypeIconPath(const QString &s)
void setSearchIconStyle(const QString &s)
void triggerDeleteType(QModelIndex index)
void setDisabledIconStyle(const QString &s)
void setEnabledIconStyle(const QString &s)
void activate(bool readOnly=false)
void setAddTypeIconPath(const QString &s)
void toggleSelection(bool selected)
void setGateLibrary(GateLibrary *gl)
QString disabledIconStyle
void setSearchIconPath(const QString &s)
A model to display loaded gatelibraries.
void loadFeature(FacExtensionInterface::Feature ft, const QString &extension=QString())
A proxy model to filter the ContextTableModel by a given string.
GuiPluginTable * mGuiPluginTable
virtual void startSearch(QString text, int options)=0
A QFrame with a QLineEdit that can be used to input a substring to search for.
void setColumnNames(QList< QString > list)
void triggerNewSearch(const QString &text, int searchOptions)
bool save(std::filesystem::path file_path, GateLibrary *gate_lib, bool overwrite)
QIcon getStyledSvgIcon(const QString &from_to_colors_enabled, const QString &svg_path, QString from_to_colors_disabled=QString())
PluginRelay * gPluginRelay
FileStatusManager * gFileStatusManager
QModelIndex currentIndex() const const
void doubleClicked(const QModelIndex &index)
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
QItemSelectionModel * selectionModel() const const
bool isEnabled() const const
void setIcon(const QIcon &icon)
void triggered(bool checked)
virtual bool open(QIODevice::OpenMode mode) override
void setAcceptMode(QFileDialog::AcceptMode mode)
void setDefaultSuffix(const QString &suffix)
QStringList selectedFiles() const const
void setFrameStyle(int style)
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
bool isValid() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const const override
virtual void setSourceModel(QAbstractItemModel *sourceModel) override
QString fromStdString(const std::string &str)
QString fromUtf8(const char *str, int size)
bool isEmpty() const const
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
QString left(int n) const const
QString mid(int position, int n) const const
std::string toStdString() const const
virtual void polish(QWidget *widget)
virtual void unpolish(QWidget *widget)
void sortByColumn(int column)
virtual QModelIndex indexAt(const QPoint &pos) const const override
virtual void setModel(QAbstractItemModel *model) override
void setSortingEnabled(bool enable)