Hello again.
I have no idea how much it cost to fix this one, and I guess it's not
that important since I'm beginning to realize PyKDE is not going to cut
it for me. But for documentation purposes, please find attached a sample
python script exercising KURLCompletion which does not work, together
with a C++ translation which does (linking needs -lkio).
Cheers,
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Any life, no matter how long and complex it may be, is made up of a
single moment: the moment in which a man finds out, once and for all,
who he is.
-- Jorge Luis Borges
import sys
import kio
import kfile
import kdeui
import kdecore
def main():
application = kdecore.KApplication(sys.argv, 'test app')
main_window = MainWindow(None, 'main window')
main_window.show()
application.exec_loop()
class MainWindow(kdeui.KMainWindow):
def __init__ (self, *args):
kdeui.KMainWindow.__init__(self, *args)
self.combo = kfile.KURLComboBox(kfile.KURLComboBox.Directories, True, self, 'combo')
self.combo.setCompletionObject(kio.KURLCompletion(kio.KURLCompletion.DirCompletion))
if __name__ == '__main__':
main()
#include <iostream>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kmainwindow.h>
#include <kurlcombobox.h>
#include <kurlcompletion.h>
class MainWindow : public KMainWindow
{
Q_OBJECT;
public:
MainWindow();
~MainWindow();
private:
KURLComboBox *combo;
};
MainWindow::MainWindow() : KMainWindow()
{
combo = new KURLComboBox(KURLComboBox::Directories, true, this, "combo");
combo->setCompletionObject(new KURLCompletion(KURLCompletion::DirCompletion));
}
MainWindow::~MainWindow()
{
delete combo;
}
int
main (int argc, char **argv)
{
KCmdLineArgs::init(argc, argv, "test", "test", "test", "1.0");
KApplication app;
MainWindow *window = new MainWindow;
app.setTopWidget(window);
window->show();
return app.exec();
}
#include "combo_moc.cc"
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt