forked from GLDsuh-a/qt-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1b403e
commit f795538
Showing
711 changed files
with
178,378 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
��Ŀ¼�´�ŵ���Unicode���뷽ʽ��Debug�汾DLL�ļ� |
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 @@ | ||
��Ŀ¼�´�ŵ���Unicode���뷽ʽ��Release�汾DLL�ļ� |
Binary file not shown.
Binary file not shown.
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,3 @@ | ||
��Ŀ¼�´�ŵ���Unicode���뷽ʽ��Release�汾DLL�ļ� | ||
��Ŀ¼Ĭ�ϴ�����п�Ϊ��MT(���߳�) | ||
64λ |
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,3 @@ | ||
��Ŀ¼�´�ŵ���Unicode���뷽ʽ��Release�汾DLL�ļ� | ||
��Ŀ¼Ĭ�ϴ�����п�Ϊ��MD(���߳�DLL) | ||
64λ |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,3 @@ | ||
��Ŀ¼�´�ŵ���Unicode���뷽ʽ��Release�汾DLL�ļ� | ||
��Ŀ¼�´�����п�Ϊ��MT(���߳�) | ||
32λ |
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,3 @@ | ||
��Ŀ¼�´�ŵ���Unicode���뷽ʽ��Release�汾DLL�ļ� | ||
��Ŀ¼Ĭ�ϴ�����п�Ϊ��MD(���߳�DLL) | ||
32λ |
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,172 @@ | ||
/**** | ||
* @file : GLD360MainWindow.h | ||
* @brief : 360风格主窗体 | ||
* | ||
* @date : 2014-04-02 | ||
* @author : duanb | ||
* @remarks: | ||
****/ | ||
#ifndef GLD360MAINWINDOW_H | ||
#define GLD360MAINWINDOW_H | ||
|
||
#include <QWidget> | ||
#include <QPushButton> | ||
#include <QToolButton> | ||
|
||
#include "GLDStrUtils.h" | ||
#include "GLDObjectList.h" | ||
|
||
class QLabel; | ||
class QHBoxLayout; | ||
class QSignalMapper; | ||
|
||
class GLDWIDGETSHARED_EXPORT GLD360PushButton : public QPushButton | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit GLD360PushButton(QWidget *parent = 0); | ||
~GLD360PushButton(); | ||
void loadPixmap(const QString &picName); | ||
protected: | ||
void enterEvent(QEvent *); | ||
void leaveEvent(QEvent *); | ||
void mousePressEvent(QMouseEvent *event); | ||
void mouseReleaseEvent(QMouseEvent *event); | ||
void paintEvent(QPaintEvent *); | ||
private: | ||
//枚举按钮的几种状态 | ||
enum ButtonStatus {NORMAL, ENTER, PRESS, NOSTATUS}; | ||
ButtonStatus m_status; | ||
QPixmap m_pixmap; | ||
int m_btnWidth; //按钮宽度 | ||
int m_btnHeight; //按钮高度 | ||
bool m_mousePress; //按钮左键是否按下 | ||
}; | ||
|
||
class GLDWIDGETSHARED_EXPORT GLD360ToolButton : public QToolButton | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit GLD360ToolButton(const GString &text, const GString &picName, QWidget *parent = 0); | ||
~GLD360ToolButton(); | ||
void setMousePress(bool mousePress); | ||
protected: | ||
void enterEvent(QEvent *); | ||
void leaveEvent(QEvent *); | ||
void mousePressEvent(QMouseEvent *event); | ||
void paintEvent(QPaintEvent *event); | ||
void painterInfo(int topColor, int middleColor, int bottomColor); | ||
public: | ||
bool m_mouseOver; // 鼠标是否移过 | ||
bool m_mousePress; // 鼠标是否按下 | ||
}; | ||
|
||
// 标题栏 | ||
class GLDWIDGETSHARED_EXPORT GLD360WindowTile : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit GLD360WindowTile(QWidget *parent = 0); | ||
virtual ~GLD360WindowTile(); | ||
signals: | ||
void showSkin(); | ||
void showMin(); | ||
void showMax(); | ||
void showMainMenu(); | ||
void closeWidget(); | ||
protected: | ||
void mousePressEvent(QMouseEvent *); | ||
void mouseMoveEvent(QMouseEvent *); | ||
void mouseReleaseEvent(QMouseEvent *); | ||
void mouseDoubleClickEvent(QMouseEvent *); | ||
private: | ||
bool m_isMove; | ||
QPoint m_pressPoint;//鼠标按下去的点 | ||
|
||
QLabel *m_versionTitle; //标题 | ||
GLD360PushButton *m_skinButton; //换肤 | ||
GLD360PushButton *m_mainMenuButton; //主菜单 | ||
GLD360PushButton *m_minButton; //最小化 | ||
GLD360PushButton *m_maxButton; //最大化 | ||
GLD360PushButton *m_closeButton; //关闭 | ||
}; | ||
|
||
// 工具栏 | ||
class GLDWIDGETSHARED_EXPORT GLD360MainToolBar : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit GLD360MainToolBar(QWidget *parent = 0); | ||
virtual ~GLD360MainToolBar(); | ||
public: | ||
void add360Action(const GString &text, const GString &picName); | ||
void setLogo(const GString &picName); | ||
void setCurrentPage(const QString ¤tPage); | ||
public slots: | ||
signals: | ||
void showMax(); | ||
protected: | ||
void mousePressEvent(QMouseEvent *); | ||
void mouseMoveEvent(QMouseEvent *); | ||
void mouseReleaseEvent(QMouseEvent *); | ||
void mouseDoubleClickEvent(QMouseEvent *); | ||
private slots: | ||
void turnPage(const QString ¤tPage); | ||
private: | ||
bool m_isMove; | ||
QPoint m_pressPoint; // 鼠标按下去的点 | ||
GLDVector<GLD360ToolButton *> m_buttonList; | ||
QSignalMapper *m_signalMapper; | ||
QHBoxLayout *m_buttonLayout; | ||
QLabel *m_logoLabel; | ||
}; | ||
|
||
// 主窗体 | ||
class GLDWIDGETSHARED_EXPORT GLD360MainWindow : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit GLD360MainWindow(QWidget *parent = 0); | ||
virtual ~GLD360MainWindow(); | ||
public: | ||
void init(); | ||
bool isCloseWhenMinimized() const; | ||
void setIsCloseWhenMinimized(bool isCloseWhenMinimized); | ||
void setSkinName(const QString &skinName); | ||
bool allowMax() const; | ||
void setAllowMax(bool allowMax); | ||
|
||
GLD360MainToolBar *mainToolBar() const; | ||
void setMainToolBar(GLD360MainToolBar *mainToolBar); | ||
|
||
GLD360WindowTile *titleWidget() const; | ||
void setTitleWidget(GLD360WindowTile *titleWidget); | ||
|
||
public slots: | ||
void showWidget(); | ||
protected: | ||
virtual void initialize(); | ||
signals: | ||
void showSkin(); | ||
protected: | ||
void paintEvent(QPaintEvent *); | ||
private slots: | ||
void showMax(); | ||
void showMainMenu(); | ||
void changeSkin(const QString &skinName); | ||
private: | ||
QRect m_location; | ||
GLD360WindowTile *m_titleWidget; //标题栏 | ||
GLD360MainToolBar *m_mainToolBar; // 工具栏 | ||
// todo 主界面还没有内容 | ||
GObjectList<QWidget*> m_contentWidgetList; //主界面内容 | ||
QHBoxLayout *m_mainLayOut; | ||
QString m_skinName;//主窗口背景图片的名称 | ||
// todo | ||
QMenu *m_mainMenu; //主菜单 | ||
bool m_isCloseWhenMinimized; | ||
bool m_allowMax; | ||
}; | ||
|
||
#endif // GLD360MAINWINDOW_H | ||
|
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,73 @@ | ||
#ifndef GLDABSTRACTBTNEDIT_H | ||
#define GLDABSTRACTBTNEDIT_H | ||
|
||
#include <QWidget> | ||
#include <QVector> | ||
#include "GLDWidget_Global.h" | ||
|
||
class QLineEdit; | ||
class QTextEdit; | ||
class QPlainTextEdit; | ||
class QButtonGroup; | ||
class QAbstractButton; | ||
|
||
class GLDWIDGETSHARED_EXPORT GLDAbstractBtnEdit : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit GLDAbstractBtnEdit(QWidget *parent = 0); | ||
virtual ~GLDAbstractBtnEdit() = 0; | ||
bool setButtonsCount(int nBtnCount); | ||
inline int buttonsCount() const; | ||
inline int maximumButtonsCount() const; | ||
virtual QString text() const = 0; | ||
virtual void setText(QString text) = 0; | ||
bool eventFilter(QObject *obj, QEvent *event); | ||
// bool connectBtnClicked(BtnClickedSlot btnSlot, int btnIndex); | ||
bool setBtnText(QString &text, int btnIndex); | ||
bool setButtonIcon(QIcon &icon, int btnIndex); | ||
|
||
signals: | ||
void ellipsisButtonClicked(int clickedBtnIndex); | ||
void ellipsisButtonClicked(QAbstractButton *clickedBtn); | ||
|
||
public slots: | ||
virtual void onEllipsisButtonClicked(int clickedBtnIndex); | ||
virtual void onEllipsisButtonClicked(QAbstractButton *clickedBtn); | ||
virtual void selectAll() = 0; | ||
virtual void cursorPosInsertANewLine() = 0; | ||
virtual void cursorToEnd() = 0; | ||
protected: | ||
void init(); | ||
protected: | ||
QVector<QSize> m_btnIconSize; | ||
QVector<int> m_btnUsingIcon; | ||
QButtonGroup *m_btns; | ||
QVariant *m_associateData; | ||
static const int m_maxBtnCount = 5; | ||
private: | ||
Q_DISABLE_COPY(GLDAbstractBtnEdit) | ||
}; | ||
|
||
class GLDWIDGETSHARED_EXPORT GLDBtnsLineEdit : public GLDAbstractBtnEdit | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit GLDBtnsLineEdit(int btnCount = 2, QWidget *parent = 0); | ||
~GLDBtnsLineEdit(); | ||
QString text() const; | ||
void setText(QString text); | ||
void paintEvent(QPaintEvent *); | ||
public slots: | ||
void selectAll(); | ||
void cursorPosInsertANewLine(); | ||
void cursorToEnd(); | ||
protected: | ||
void init(int btnCount); | ||
protected: | ||
QLineEdit *m_edit; | ||
private: | ||
Q_DISABLE_COPY(GLDBtnsLineEdit) | ||
}; | ||
|
||
#endif // GLDABSTRACTBTNEDIT_H |
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,79 @@ | ||
#ifndef GLDABSTRACTITEMMODEL_H | ||
#define GLDABSTRACTITEMMODEL_H | ||
|
||
#include <QAbstractItemModel> | ||
#include "GLDVariant.h" | ||
#include "GLDGlobal.h" | ||
|
||
enum GLDItemDataRole | ||
{ | ||
gidrBaseRole = 256, | ||
gidrRowExpandedRole = 257, | ||
gidrColExpandedRole = 258, | ||
gidrRowHeightRole = 259, | ||
gidrColWidthRole = 260, | ||
gidrCommentRole = 261, | ||
gidrCellMargin = 262, | ||
gidrRowHeaderData = 263, | ||
gidrFooterRowCount = 264, | ||
gidrDiagonal = 265, | ||
gidrAntiDiagonal = 266, | ||
gidrMergeIDRole = 268, | ||
gidrConerDataRole = 269, | ||
gidrHeaderDecorationRole = 270, | ||
gidrConerTextAlignmentRole = 271, | ||
gidrHeaderTextAlignmentRole = 272, | ||
gidrHeaderFontRole = 273, | ||
gidrBoundLineRole = 274, | ||
gidrDecorationAlignmentRole = 275, | ||
gidrRightBoundLineColor = 276, // m_bDrawBoundLine为true时右边框线的颜色 | ||
gidrBottomBoundLineColor = 277, // m_bDrawBoundLine为true时下边框线的颜色 | ||
|
||
gidrGSPBaseDataColRole = 384, | ||
gidrUserBaseRole = 512, | ||
|
||
gidrAddUnEnableRole = 513, | ||
gidrRemoveUnEnableRole = 514, | ||
gidrCheckUnEnableRole = 515 | ||
}; | ||
|
||
class GlodonAbstractItemModelPrivate; | ||
class GLDCOMMONSHARED_EXPORT GlodonAbstractItemModel : public QAbstractItemModel | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit GlodonAbstractItemModel(QObject *parent = 0); | ||
virtual ~GlodonAbstractItemModel(); | ||
|
||
public: | ||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; | ||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); | ||
Qt::ItemFlags flags(const QModelIndex &index) const; | ||
bool showCheckBox(); | ||
void setShowCheckBox(const bool &value); | ||
bool isItemIsTristate(); | ||
void setIsTristate(const bool &value); | ||
bool isRecursiveCheck(); | ||
void setRecursiveCheck(const bool &value); | ||
|
||
virtual void afterCurrentChanged(const QModelIndex &index); | ||
|
||
signals: | ||
|
||
public slots: | ||
|
||
protected: | ||
GlodonAbstractItemModel(GlodonAbstractItemModelPrivate &dd, QObject *parent = 0); | ||
|
||
private: | ||
bool recursiveCheck(const QModelIndex &index, const GVariant &value); | ||
bool recursiveCheckParent(const QModelIndex &index, const GVariant &value); | ||
void recursiveCheckParentPartCheck(const QModelIndex &index); | ||
|
||
private: | ||
Q_DECLARE_PRIVATE(GlodonAbstractItemModel) | ||
Q_DISABLE_COPY(GlodonAbstractItemModel) | ||
}; | ||
|
||
#endif // GLDABSTRACTITEMMODEL_H |
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,25 @@ | ||
#ifndef GLDABSTRACTITEMMODEL_P_H | ||
#define GLDABSTRACTITEMMODEL_P_H | ||
|
||
#include <QAbstractItemModel> | ||
#include <QSet> | ||
#include <private/qabstractitemmodel_p.h> | ||
#include "GLDAbstractItemModel.h" | ||
|
||
class GLDCOMMONSHARED_EXPORT GlodonAbstractItemModelPrivate : public QAbstractItemModelPrivate | ||
{ | ||
Q_DECLARE_PUBLIC(GlodonAbstractItemModel) | ||
|
||
public: | ||
GlodonAbstractItemModelPrivate(); | ||
virtual ~GlodonAbstractItemModelPrivate(); | ||
public: | ||
bool m_showCheckbox; | ||
bool m_recursiveCheck; | ||
bool m_isTristate; | ||
QSet<QModelIndex> m_checkedIndexes; | ||
QSet<QModelIndex> m_partiallyCheckedIndexes; | ||
QSet<QModelIndex> m_forbiddenCheckedIndexes; | ||
}; | ||
|
||
#endif // GLDABSTRACTITEMMODEL_P_H |
Oops, something went wrong.