You are not logged in.

Search results

Search results 1-11 of 11.

Wednesday, June 2nd 2004, 11:46am

Author: boyadg

KHistoryCombo

There's a place in my app where the user should insert an URL and I thought it would be nice if the app remembered last n URLs for the user and then tries to autocomplete the URL with the ones in the history (like Internet Explorer does). After reading about the different input widgets, I thought that KHistoryCombo did everything I wanted. The problem is that at the moment, it does nothing of all this! First I thought that the only thing I had to do was to set the insertionPolicy property to AtT...

Wednesday, May 26th 2004, 8:12pm

Author: boyadg

return QFile::errorString()

Thanks both wysota and anda_skoa, your last answers cleared everything up. wysota: Overloading is of course a possibility if I want to make the error argument optional, I hadn't thought of that. That works perfectly. And anda_skoa: You found my mistake. Changing the line to if( error != NULL ) *error = file.errorString(); solved the problem. Thanks all, I'm learning a lot from you guys!

Wednesday, May 26th 2004, 3:34pm

Author: boyadg

return QFile::errorString()

Thanks for the answer wysota. I'm probably too hard-headed, but I still don't understand. You say that it means: "take the address error, look what it points at..." Isn't it pointing at a QString object? In the calling function I declared a QString error, and the I passed &error, which, as far as I know means "the address of the QString object error" "...and assign the object that error points to the value of something()" In my case, something() returns a QString and as I thought that error poin...

Wednesday, May 26th 2004, 12:56pm

Author: boyadg

return QFile::errorString()

I have this function that opens a file and then does stuff. The function returns FALSE if the file couldn't be opened and TRUE if it could. Now I would like it to notify the error it encountered when it cannot open the file. I thought that this was the correct way to do it: Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 bool MyClass::DoSomethingWithAFile( const QString& path, QString* error ) { QFile file( path ); if( file.open( IO_ReadOnly ) ) { ...doing stuff file.close(); return( TRUE ); } else...

Thursday, May 20th 2004, 8:26am

Author: boyadg

klistview drag and drop

Thanks, I'm gonna try right now!

Wednesday, May 19th 2004, 12:16pm

Author: boyadg

klistview drag and drop

Hi, it's me again. Today's problem has to do with a KListView I have in my app. I would like it to support dnd, but I can't get it to work. First I did: MyList->setAcceptDrops( TRUE ); connect( MyList, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), this, SLOT( slotDropped( QDropEvent*, QListViewItem* ) ) ); Then I made the slotDropped function MyApp::slotDropped( QDropEvent* event, QListViewItem* after) { kdDebug << "slotDropped called" << endl; } Only to find out it never gets called! Not su...

Sunday, May 16th 2004, 2:44pm

Author: boyadg

dcop output message

I have a function in my app called setUrl, and this function is accessible through dcop: dcop myapp remote_control setUrl http://www.site.com Sometimes it isn't possible to set the URL and I would like my app to be able to output a (warning) message on the terminal where the dcop command was issued. All the functions I tried (cout, qWarning, etc) output the text on the terminal the app is running on, and not on the terminal where the dcop command was typed. I can't seem to find anything in the D...

Tuesday, May 11th 2004, 9:57pm

Author: boyadg

KStatusBar

> "This is actually a mistake in your code. You must make the MyUIClass object a child of mainWin, otherwise you get two independent toplevel windows... This way, you get only one window (mainWin). Now do a mainWin->show() and all is good You're absolutely right, now the app closes properly. Thanks so much! Also, I got the window to startup big enough by adding the line: mainWin->setMinimumSize( centralWidget->size() ); I don't know if that's what I supposed to have done, but it works. What stil...

Tuesday, May 11th 2004, 10:31am

Author: boyadg

KStatusBar

Thanks a lot for the quick reply!!! > "I think mainWin->show() would be more appropriate" That was my logic too, but if I do that, a small, empty window appears. If I combine both mainWin->show() and MyUIClass->show() two windows appear, one with the UI and one empty! So I finally chose to only show MyUIClass. > "Hmm, the application should quit if the mainWidget closes" Maybe it's because the mainWidget has a centralWidget of its own? > "you can try if QObject::connect(...) before the call to a...

Tuesday, May 11th 2004, 9:15am

Author: boyadg

KStatusBar

Thanks (again) dfaure for your help! I did what you said, but some things seem to not work. Here's what I did in main(): KApplication app; KMainWindow* mainWin = new KMainWindow(); app.setMainWidget( mainWin ); MyUIClass* centralWidget = 0; centralWidget = new MyUIClass(); mainWin->setCentralWidget( MyUIClass ); MyUIClass->show(); return app.exec(); note: MyUIClass is derived from the class that Qt Designer creates, which in turn is derived from QWidget. As I said, it works, but with some glitch...

Monday, May 10th 2004, 10:27pm

Author: boyadg

KStatusBar

Hi all, I created an app following the tutorial at: http://women.kde.org/articles/tutorials/kdevelop3/index.html Now I want to add a statusbar to my app, but my entire user interface class is derived from QWidget instead of KMainWindow (that's how it's done in the tutorial), and I don't understand how to add a statusbar to it. All the examples I could find on the net are for KMainWindow based apps. I already tried changing the .ui file, changing <widget class="QWidget"> to <widget class="KMainWi...