If i drag on my widged a local file in to qtextedit on mac & window the file is open
but on linux kde no ... Why?
result display ....
file:///home/username/Desktop/mone.xml
and not display file inside xml??
kubuntu 6.0.6 uname 2.6.15
{
qDebug() << "### mousePressEvent " ;
event->acceptProposedAction();
}
{
if(event && event->mimeData()) {
Grabdata(event->mimeData());
}
}
void Gui_Main
::Grabdata(const QMimeData *data
) {
if (!data) {
return;
}
QList<QUrl> urlelist;
if (data->hasUrls()) {
urlelist = data->urls();
for ( int i = 0; i < urlelist.size(); ++i ) {
QString unfilone
= urlelist.
at(i
).
toLocalFile();
qDebug() << "### url " << unfilone;
if (is_file(unfilone)) {
if (unfilone.endsWith(".fo")) {
OpenOtherResult(unfilone);
} else if (unfilone.endsWith(".xml")) {
LoadXmlFile(unfilone);
} else if (unfilone.endsWith(".xsl")) {
LoadXsltFile(unfilone);
}
}
}
}
}
void Gui_Main::dragEnterEvent(QDragEnterEvent *event)
{
qDebug() << "### mousePressEvent " ;
event->acceptProposedAction();
}
void Gui_Main::dropEvent(QDropEvent *event)
{
if(event && event->mimeData()) {
Grabdata(event->mimeData());
}
}
void Gui_Main::Grabdata(const QMimeData *data)
{
if (!data) {
return;
}
QList<QUrl> urlelist;
if (data->hasUrls()) {
urlelist = data->urls();
for ( int i = 0; i < urlelist.size(); ++i ) {
QString unfilone = urlelist.at(i).toLocalFile();
qDebug() << "### url " << unfilone;
if (is_file(unfilone)) {
if (unfilone.endsWith(".fo")) {
OpenOtherResult(unfilone);
} else if (unfilone.endsWith(".xml")) {
LoadXmlFile(unfilone);
} else if (unfilone.endsWith(".xsl")) {
LoadXsltFile(unfilone);
}
}
}
}
}
To copy to clipboard, switch view to plain text mode
all code on http://visual-xsltproc.svn.sourcefor...o_Debug_qt4.2/
Bookmarks