10 #include <QDialogButtonBox>
13 #include <QFileDialog>
15 #include <QGridLayout>
18 #include <QPushButton>
19 #include <QRegularExpression>
20 #include <QSpacerItem>
32 QString suggestedGateLibraryPath;
33 QString suggestedGateLibraryName;
35 int suggestedProjectCount = 0;
38 ++suggestedProjectCount;
40 }
while (
QFileInfo(mProjectdir).exists());
47 layout->setRowStretch(irow - 1, 20);
67 int n = mGateLibraryPath.
size();
69 mGateLibraryMap.
insert(qName,
n);
71 mGateLibraryPath.
append(qPath);
72 if (qPath == suggestedGateLibraryPath)
73 suggestedGateLibraryName = qName;
75 if (suggestedGateLibraryName.
isEmpty() && !suggestedGateLibraryPath.
isEmpty())
79 suggestedGateLibraryName = info.
fileName();
80 int n = mGateLibraryPath.
size();
81 mGateLibraryMap.
insert(suggestedGateLibraryName,
n);
82 mGateLibraryPath.
append(suggestedGateLibraryPath);
85 if (!suggestedGateLibraryName.
isEmpty())
92 layout->setRowStretch(irow - 1, 20);
93 mCheckCopyGatelib =
new QCheckBox(
"Copy gate library into project directory");
96 layout->setRowStretch(irow - 1, 100);
111 void NewProjectDialog::handleFileDialogTriggered()
119 void NewProjectDialog::handleGateLibraryPathChanged(
const QString& txt)
121 if (mGateLibraryMap.
value(txt, -1) < 0)
139 int inx = mGateLibraryMap.
value(seltxt, -1);
142 return mGateLibraryPath.
at(inx);
bool isCopyGatelibChecked() const
QString projectDirectory() const
NewProjectDialog(QWidget *parent=nullptr)
QString gateLibraryPath() const
std::vector< std::filesystem::path > get_all_path()
QIcon getStyledSvgIcon(const QString &from_to_colors_enabled, const QString &svg_path, QString from_to_colors_disabled=QString())
QLineEdit * mEditProjectdir
QComboBox * mComboGatelib
void setCheckState(Qt::CheckState state)
void addItem(const QString &text, const QVariant &userData)
void addItems(const QStringList &texts)
void setCurrentText(const QString &text)
void currentTextChanged(const QString &text)
QString absoluteFilePath(const QString &fileName) const const
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options)
QString fileName() const const
virtual void addItem(QLayoutItem *item)=0
void append(const T &value)
const T & at(int i) const const
QMap::iterator insert(const Key &key, const T &value)
QList< Key > keys() const const
const T value(const Key &key, const T &defaultValue) const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString fromStdString(const std::string &str)
bool isEmpty() const const
virtual void polish(QWidget *widget)
virtual void unpolish(QWidget *widget)