최신 analyzer + 형태소 분석기 합쳐놓음
git-svn-id: svn://192.168.0.12/source@245 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
63
MorphereAnalyzer/sloaddlg.cpp
Normal file
63
MorphereAnalyzer/sloaddlg.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
#include "sloaddlg.h"
|
||||
#include <QMessageBox>
|
||||
#include <QVBoxLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "stable.h"
|
||||
|
||||
SLoadDlg::SLoadDlg()
|
||||
{
|
||||
setWidgets();
|
||||
}
|
||||
|
||||
SLoadDlg::~SLoadDlg()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SLoadDlg::setWidgets()
|
||||
{
|
||||
setWindowTitle("Load");
|
||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
||||
m_plwData = new QListWidget;
|
||||
vlayout->addWidget(m_plwData);
|
||||
m_plwData->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
QPushButton *ppbRefresh = new QPushButton("Refresh");
|
||||
vlayout->addWidget(ppbRefresh);
|
||||
connect(ppbRefresh, SIGNAL(released()),this, SLOT(Refresh()));
|
||||
setLayout(vlayout);
|
||||
connect(m_plwData,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(ItemChanged(QListWidgetItem*)));
|
||||
}
|
||||
|
||||
void SLoadDlg::Refresh()
|
||||
{
|
||||
m_plwData->clear();
|
||||
QSqlQuery query("select id,name,count from datagroup");
|
||||
while (query.next())
|
||||
{
|
||||
QString str = query.value(1).toString();
|
||||
str += " ( ";
|
||||
str += query.value(0).toString();
|
||||
str += " , ";
|
||||
str += query.value(2).toString();
|
||||
str += " )";
|
||||
QListWidgetItem *pItem = new QListWidgetItem(str,m_plwData);
|
||||
pItem->setData(Qt::UserRole, QVariant(query.value(0)));
|
||||
}
|
||||
GetMainWindow()->InsertLog("Start");
|
||||
}
|
||||
|
||||
void SLoadDlg::ItemChanged( QListWidgetItem *item)
|
||||
{
|
||||
QMessageBox msg;
|
||||
msg.setText("Please choose...");
|
||||
msg.setModal(true);
|
||||
QPushButton *pbAll = msg.addButton("All",QMessageBox::ActionRole);
|
||||
QPushButton *pbBody = msg.addButton("Body",QMessageBox::ActionRole);
|
||||
QPushButton *pbReply = msg.addButton("Reply",QMessageBox::ActionRole);
|
||||
msg.exec();
|
||||
if (msg.clickedButton() == pbAll) GetMainWindow()->m_pDataDlg->DataReload("data_" + item->data(Qt::UserRole).toString(),STable::E_ARTICLE_ALL);
|
||||
else if (msg.clickedButton() == pbBody) GetMainWindow()->m_pDataDlg->DataReload("data_" + item->data(Qt::UserRole).toString(),STable::E_ARTICLE_BODY);
|
||||
else if (msg.clickedButton() == pbReply) GetMainWindow()->m_pDataDlg->DataReload("data_" + item->data(Qt::UserRole).toString(),STable::E_ARTICLE_REPLY);
|
||||
}
|
||||
Reference in New Issue
Block a user