mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
add QQtNoFocusDelegate
This commit is contained in:
parent
b63b605195
commit
2f5e4b1256
@ -1,13 +1,25 @@
|
||||
#include "qqtdicttreemodel.h"
|
||||
#include "qqtcore.h"
|
||||
#include "qqtdicttreemodel.h"
|
||||
#include <QModelIndex>
|
||||
#include <QFile>
|
||||
|
||||
#include "qqtcore.h"
|
||||
|
||||
QQtDictTreeModel::QQtDictTreeModel ( QObject* parent ) : QQtTreeModel ( parent )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QQtDictTreeModel::setDictionary ( QQtDictionary* dict )
|
||||
{
|
||||
this->pdict = dict;
|
||||
query ( "" );
|
||||
}
|
||||
|
||||
QQtDictionary* QQtDictTreeModel::dictionary()
|
||||
{
|
||||
return pdict;
|
||||
}
|
||||
|
||||
void QQtDictTreeModel::setFilePath ( QString dictfile )
|
||||
{
|
||||
QFile file ( dictfile );
|
||||
@ -32,6 +44,11 @@ void QQtDictTreeModel::setFilePath ( QString dictfile )
|
||||
return;
|
||||
}
|
||||
|
||||
void QQtDictTreeModel::parseDictNodeToModel ( const QQtDictionary& node, QStandardItem& item )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool QQtDictTreeModel::query ( QString condition )
|
||||
{
|
||||
Q_UNUSED ( condition )
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef QQTDICTTREEMODEL_H
|
||||
#ifndef QQTDICTTREEMODEL_H
|
||||
#define QQTDICTTREEMODEL_H
|
||||
|
||||
#include <qqttreemodel.h>
|
||||
@ -11,18 +11,26 @@ class QQTSHARED_EXPORT QQtDictTreeModel : public QQtTreeModel
|
||||
public:
|
||||
explicit QQtDictTreeModel ( QObject* parent = 0 );
|
||||
|
||||
//里面用的是外面的dictionary句柄,所以外部句柄必须保持存在。
|
||||
void setDictionary ( QQtDictionary* dict );
|
||||
QQtDictionary* dictionary();
|
||||
|
||||
virtual bool query ( QString condition ) override;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
// QQtDictTreeModel interface
|
||||
public:
|
||||
bool query ( QString condition ) override;
|
||||
void setFilePath ( QString dictfile ) override;
|
||||
protected:
|
||||
virtual void setFilePath ( QString dictfile ) override;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void parseDictNodeToModel ( const QQtDictionary& node, QStandardItem& item );
|
||||
|
||||
private:
|
||||
QQtDictionary* pdict;
|
||||
};
|
||||
|
||||
#endif // QQTDICTTREEMODEL_H
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "qqtfilesystemtreemodel.h"
|
||||
#include "qqtfilesystemtreemodel.h"
|
||||
#include <QFile>
|
||||
#include "qqtcore.h"
|
||||
#include <QModelIndex>
|
||||
|
||||
#include "qqtcore.h"
|
||||
|
||||
QQtFileSystemTreeModel::QQtFileSystemTreeModel ( QObject* parent ) : QFileSystemModel ( parent )
|
||||
{
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
#ifndef QQTFILESYSTEMTREEMODEL_H
|
||||
#ifndef QQTFILESYSTEMTREEMODEL_H
|
||||
#define QQTFILESYSTEMTREEMODEL_H
|
||||
|
||||
#include <QFileSystemModel>
|
||||
#include <QDomDocument>
|
||||
#include <qqt-local.h>
|
||||
/**
|
||||
* @brief The QQtFileSystemTreeModel class
|
||||
|
@ -1,14 +1,19 @@
|
||||
#ifndef QQTFTPTREEMODEL_H
|
||||
#ifndef QQTFTPTREEMODEL_H
|
||||
#define QQTFTPTREEMODEL_H
|
||||
|
||||
#include <QObject>
|
||||
#include "qqt-local.h"
|
||||
|
||||
/**
|
||||
* @brief The QQtFTPTreeModel class
|
||||
* 将FTP解析到QQtDictionary里,然后写入Model。
|
||||
* 未实现
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtFTPTreeModel : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QQtFTPTreeModel(QObject* parent = 0);
|
||||
explicit QQtFTPTreeModel ( QObject* parent = 0 );
|
||||
|
||||
signals:
|
||||
|
||||
|
@ -1,10 +1,16 @@
|
||||
#ifndef QQTJSONTREEMODEL_H
|
||||
#ifndef QQTJSONTREEMODEL_H
|
||||
#define QQTJSONTREEMODEL_H
|
||||
|
||||
#include <qqttreemodel.h>
|
||||
#include <QDomDocument>
|
||||
#include <qqt-local.h>
|
||||
|
||||
/**
|
||||
* @brief The QQtJsonTreeModel class
|
||||
* 将Json格式的内容解析到Tree里。
|
||||
* 废弃
|
||||
* 使用QQtDictTreeModel代替。
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtJsonTreeModel : public QQtTreeModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
2
src/gui/qqtnofocusdelegate.cpp
Normal file
2
src/gui/qqtnofocusdelegate.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
#include <qqtnofocusdelegate.h>
|
||||
|
37
src/gui/qqtnofocusdelegate.h
Normal file
37
src/gui/qqtnofocusdelegate.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef QQTNOFOCUSDELEGATE_H
|
||||
#define QQTNOFOCUSDELEGATE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QPainter>
|
||||
#include <QModelIndex>
|
||||
#include <QItemDelegate>
|
||||
#include <QStyleOptionViewItem>
|
||||
|
||||
#include <qqt-local.h>
|
||||
/**
|
||||
* @brief The QQtNoFocusDelegate class
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtNoFocusDelegate : public QItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QQtNoFocusDelegate ( QObject* parent = 0 )
|
||||
: QItemDelegate ( parent ) {}
|
||||
virtual ~QQtNoFocusDelegate() {}
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
|
||||
// QItemDelegate interface
|
||||
protected:
|
||||
virtual void drawFocus ( QPainter* painter,
|
||||
const QStyleOptionViewItem& option,
|
||||
const QRect& rect ) const override {
|
||||
}
|
||||
};
|
||||
|
||||
#endif // QQTNOFOCUSDELEGATE_H
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef QQTSQLTREEMODEL_H
|
||||
#ifndef QQTSQLTREEMODEL_H
|
||||
#define QQTSQLTREEMODEL_H
|
||||
|
||||
#include <qqttreemodel.h>
|
||||
@ -16,7 +16,6 @@ class QQTSHARED_EXPORT QQtSqlTreeModel : public QQtTreeModel
|
||||
public:
|
||||
explicit QQtSqlTreeModel ( QObject* parent = 0 );
|
||||
|
||||
//TODO:
|
||||
QSqlDatabase& database() { return m_db; }
|
||||
void setAbsoluteFilePath ( QString dbname );
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
/**
|
||||
* @brief The QQtTableModel class
|
||||
* QQTSqlRelationalTableModel 方便起见,仅仅使用这个model
|
||||
* QSqlRelationalTableModel 方便起见,仅仅使用这个model
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtTableModel : public QSqlRelationalTableModel
|
||||
{
|
||||
|
@ -1,10 +1,16 @@
|
||||
#ifndef QQTXMLTREEMODEL_H
|
||||
#ifndef QQTXMLTREEMODEL_H
|
||||
#define QQTXMLTREEMODEL_H
|
||||
|
||||
#include <qqttreemodel.h>
|
||||
#include <QDomDocument>
|
||||
#include <qqt-local.h>
|
||||
|
||||
/**
|
||||
* @brief The QQtXmlTreeModel class
|
||||
* 将XML格式的内容解析到Tree里。
|
||||
* 废弃
|
||||
* 使用QQtDictTreeModel代替。
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtXmlTreeModel : public QQtTreeModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -61,6 +61,12 @@ HEADERS += \
|
||||
$$PWD/sql/qqtsqlquery.h
|
||||
|
||||
#gui
|
||||
#add_object_class(QQtNoFocusDelegate, $$PWD/gui)
|
||||
SOURCES += \
|
||||
$$PWD/gui/qqtnofocusdelegate.cpp
|
||||
HEADERS += \
|
||||
$$PWD/gui/qqtnofocusdelegate.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/gui/qqttablemodel.cpp \
|
||||
$$PWD/gui/qqtdicttreemodel.cpp \
|
||||
|
Loading…
x
Reference in New Issue
Block a user