-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1691 from 1445643474/master
delete useless lexer files
- Loading branch information
Showing
204 changed files
with
90 additions
and
73,481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "zenoopenpathpanel.h" | ||
#include <zenoui/style/zenostyle.h> | ||
|
||
ZenoOpenPathPanel::ZenoOpenPathPanel(QWidget* parent) | ||
: QWidget(parent) | ||
{ | ||
initUI(); | ||
} | ||
|
||
void ZenoOpenPathPanel::initUI() | ||
{ | ||
m_pLayout = new QVBoxLayout(this); | ||
m_pFileDialog = new QFileDialog(this, "Open path", "", "All Files(*);; "); | ||
m_pFileDialog->setWindowFlags(Qt::Widget); | ||
m_pLayout->addWidget(m_pFileDialog); | ||
m_pFileDialog->installEventFilter(this); | ||
} | ||
|
||
bool ZenoOpenPathPanel::eventFilter(QObject* obj, QEvent* evt) | ||
{ | ||
if (obj == m_pFileDialog) | ||
{ | ||
if (evt->type() == QEvent::ShortcutOverride) | ||
{ | ||
QKeyEvent* keyEvt = dynamic_cast<QKeyEvent*>(evt); | ||
if (keyEvt == QKeySequence::Copy) { | ||
m_pFileDialog->setFocus(); | ||
evt->accept(); | ||
return true; | ||
} | ||
} | ||
else if (evt->type() == QEvent::KeyPress) | ||
{ | ||
QKeyEvent* keyEvt = dynamic_cast<QKeyEvent*>(evt); | ||
if (keyEvt == QKeySequence::Copy) { | ||
QMimeData* pMimeData = new QMimeData; | ||
const QUrl& url = m_pFileDialog->selectedUrls().value(0); | ||
QString text; | ||
if (url.isLocalFile() || url.isEmpty()) | ||
text = url.toLocalFile(); | ||
else | ||
text = url.toString(); | ||
pMimeData->setText(text); | ||
QApplication::clipboard()->setMimeData(pMimeData); | ||
evt->accept(); | ||
return true; | ||
} | ||
} | ||
else if (evt->type() == QEvent::HideToParent) | ||
{ | ||
m_pFileDialog->show(); | ||
} | ||
} | ||
return QWidget::eventFilter(obj, evt); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef __ZENO_OPENPATHPANEL_H__ | ||
#define __ZENO_OPENPATHPANEL_H__ | ||
|
||
#include <QtWidgets> | ||
|
||
class ZenoOpenPathPanel : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
ZenoOpenPathPanel(QWidget *parent = nullptr); | ||
protected: | ||
bool eventFilter(QObject* obj, QEvent* evt) override; | ||
private: | ||
void initUI(); | ||
private: | ||
QFileDialog* m_pFileDialog; | ||
QVBoxLayout* m_pLayout; | ||
}; | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.