네이버카페리스트 관리 git-svn-id: svn://192.168.0.12/source@224 8346c931-da38-4b9b-9d4c-e48b93cbd075
79 lines
1.7 KiB
C++
79 lines
1.7 KiB
C++
#ifndef WIDGET_H
|
|
#define WIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include "stable.h"
|
|
#include <QSqlDatabase>
|
|
#include <QThread>
|
|
class QPushButton;
|
|
class QHBoxLayout;
|
|
class QSqlQueryModel;
|
|
class QStringList;
|
|
class QWebPage;
|
|
class SleepThread:public QThread
|
|
{
|
|
public:
|
|
void run();
|
|
|
|
};
|
|
|
|
namespace Ui {
|
|
class Widget;
|
|
}
|
|
|
|
class Widget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Widget(QWidget *parent = 0);
|
|
~Widget();
|
|
enum E_COLUMN
|
|
{
|
|
E_COLUMN_ID = 0,
|
|
E_COLUMN_URL,
|
|
E_COLUMN_GROUP,
|
|
E_COLUMN_CLUBID,
|
|
E_COLUMN_MAX,
|
|
};
|
|
|
|
private:
|
|
Ui::Widget *ui;
|
|
STable *m_pTable;
|
|
QLineEdit *m_pleUrl, *m_pleGroup, *m_pleClubId;
|
|
QPushButton *m_pbtnAdd, *m_pbtnDel, *m_pbtnModify, *m_pbtnRefresh, *m_pbtnGetClubid;
|
|
QSqlDatabase m_db;
|
|
QSqlQueryModel *m_pQueryTable;
|
|
QWebPage *m_pPage;
|
|
bool m_bUsed;
|
|
SleepThread m_thread;
|
|
|
|
public slots:
|
|
void pushAdd();
|
|
void pushDel();
|
|
void pushModify();
|
|
void pushRefresh();
|
|
void pushGetClubId();
|
|
void readWebPage(bool ok);
|
|
//void clickTable(const QModelIndex & row, const QModelIndex & column);
|
|
void clickTable(const QModelIndex & index);
|
|
|
|
private:
|
|
QHBoxLayout* initButtonLayout();
|
|
QHBoxLayout* initInputLayout();
|
|
void initTable();
|
|
bool initDatabase();
|
|
bool connectDatabase();
|
|
void showMessage(QString strMessage);
|
|
bool checkGroup();
|
|
bool checkUrl();
|
|
QStringList selectedIds();
|
|
bool isClubIdNull();
|
|
bool checkClubId();
|
|
void loadUrl(QString url);
|
|
void initWebPage();
|
|
void updateAllClubId(QString url, QString clubid);
|
|
};
|
|
|
|
#endif // WIDGET_H
|