| rohanpm | dispraekailo: show code? (or at least explain "doesn't like it too much" :-) |
| dispraekailo | ugh I figured it out.. still getting used to this framework ; |
| dispraekailo | I'm overlooking a lot of overloaded functions. |
| Skrot- | Can I overload the operator< for a class to use qSort() on a QList containing pointers of said class? |
| dispraekailo | rohanpm, I really hate that I make such silly mistakes despite doing some really awesome stuff :P |
| rohanpm | dispraekailo: it's OK, mistakes are good 90% of the time... |
| dispraekailo | haha |
| rohanpm | as long as the mistaker is not foolish :-) |
| dispraekailo | :3 |
| rohanpm | Skrot-: not sure if that would work; using the qSort with the lessThan parameter is probably better |
| wahnfrieden | hi |
| dispraekailo | hi |
| wahnfrieden | How can I disable the button on macs that toggles the toolbar visibility? |
| wahnfrieden | the only information I could find for this suggested to disable/change the context menu for the toolbar in windows, which obviously wont work on mac |
| wahnfrieden | I'm using the unified toolbar and title mode |
| Elv13 | how can I replace an utf8 character in a qstring, replace("\u2029","\n"); does nto work |
| wahnfrieden | ah, Qt::MacWindowToolBarButtonHint |
| pietro10 | Elv13: try wrapping the strings in QString() |
| pietro10 | replace(QString("\u2029"),QString("\n")); |
| Elv13 | pietro10: it is in a QString, I am calling QString::replace |
| pietro10 | Elv13: read what I did |
| pietro10 | replace(QString("\u2029"),QString("\n")); |
| pietro10 | if that doesn't work |
| pietro10 | change all the QString() calls to QString::fromUtf8String or whatever the function's name is |
| rohanpm | Elv13: can you show code of your testcase? it's not clear to me what your input is... |
| rohanpm | for instance, it wouldn't surprise me if you meant "\\u2029", not "\u2029 |
| rohanpm | " |
| Elv13 | ; |
| Elv13 | rohanpm:sure just use a QTextCursor, get the selection (::selectedText) and try to split the lines |
| rohanpm | you should write a simple testcase which doesn't use a UI... |
| Elv13 | according to the doc, I have to replace the unicode caracter by a \n to make it work |
| rohanpm | then you'll be able to focus on just getting this one thing right |
| Elv13 | rohanpm: The Qt doc say this will happen, and that I need to do that to fix it, see http://doc.trolltech.com/4.6/qtextcursor.html#selectedText |
| rohanpm | Elv13: ok, the point is that I think you may be constructing your "U+2029" character wrongly |
| Elv13 | so how can I construct it right? |
| rohanpm | well, if you write a simple testcase, it should be pretty easy to figure that out with a little trial and error :-) |
| Elv13 | rohanpm: My test case it quite simple, convert a Textcursor selection to an array of lines, it can not be more simple |
| Elv13 | pietro10: Your solution does not work, toAscii() return a bunch of ???? instead of the utf8 character |
| pietro10 | ok |
| pietro10 | I dunno then |
| aep | who said toAscii returns utf8 ? |
| aep | it returns ascii |
| Elv13 | I hope it does not ;), @pietro10 thanks |
| Elv13 | aep: and replace utf character by ???? |
| aep | yes. everything not ascii is replaced |
| aep | or even undefined i think |
| Elv13 | aep: do you have an idea how can I convert utf8 linebreak to \n for a QTextStream or QString::split to handle it? |
| aep | whats an utf8 linebreak? |
| Elv13 | aep: \n, but in UTF8, so it does not have the linebreak problem of ascii (\n on unix, \r on OSX and \n\r on windows) |
| aep | NEL ? |
|
|
| rdancer | rohanpm: what is the right way to cast it? |
| aep | who had that retarded idea. now we have 6 newlines |
| rohanpm | rdancer: qobject_cast |
| Elv13 | this is my problem |
| rohanpm | rdancer: better to refactor the code to not need that, though (trivial in your example, but I imagine your real code is different...) |
| dispraekailo | How should I be accessing widgets in the .ui file from within the corresponding .h/.cpp files? |
| rdancer | rohanpm: as in using a variable for the layout? |
| aep | Elv13: qt doesnt offer what you need. |
| Elv13 | dispraekailo: by extending the class generated by your .ui |
| dispraekailo | I'm not quite sure how I'm supposed to be retrieving them; they don't resolve as members by the names I gave them in the .ui file |
| aep | theres some unicode libs around that can convert stuff into sanity |
| dispraekailo | elaborate Elv13 |
| Elv13 | aep: http://doc.trolltech.com/4.6/qtextcursor.html#selectedText Qt cause the problem and say .replace should work |
| rohanpm | rdancer: no... just don't "lose" the pointer to the real type until after you don't need it any more... |
| Elv13 | dispraekailo: extend the class generated by your .ui, the object names are going to be accessible as member variables |
| dispraekailo | Elv13, you're saying I should extend the Ui::<classname> instead of the one I already defined? |
| Elv13 | dispraekailo: you can extend as many class as you want in C++ |
| dispraekailo | Elv13, countless tutorials I've seen simply make a class extending some base widget, then have a Ui::<derivedClass> defined as well.. then in the constructor use the ui( new Ui::<derivedclass>) and ui->setupUi(this) |
| dispraekailo | Right I just didn't think that was an appropriate paradigm considering how many examples I've seen like this. |
| Elv13 | that work too |
| dispraekailo | Apparently not. |
| dispraekailo | Or I'm setting up my stuff in the .ui file wrong. |
| rdancer | rohanpm: like this?: http://pastebin.com/K3F4W0Yb |
| Elv13 | setupUI? yes it does work |
| dispraekailo | Elv13, yes it makes it look like the .ui file fine, but it doesn't give me access to any members |
| rohanpm | rdancer: sure... though it may be more efficient to setLayout only at the end |
| Elv13 | dispraekailo: look at the .h generated by qmake/cmake and see the API it created |
| rdancer | rohanpm: addQuestions() is uses this->layout->addWidget() |
| dispraekailo | Elv13, it's in there. Not showing up in my derived class. |
| Elv13 | dispraekailo: what are you deriving? If you use an object to represent your .ui, then you have to access them using that object, not from this->, to use this->, you have to extend the .ui |
| Elv13 | I think you are mixing the two way and got confused |
| rdancer | rohanpm: I feel like I'm doing it wrong -- is it correct to be adding child widgets to the layout as opposed to the widget itself? |
| dispraekailo | Ahhh I didn't consider accessing it through the ui-> |
| dispraekailo | Nice, thanks :) |
| Elv13 | no problem |
| dispraekailo | I've never seen a construct like that in c++ before |
| Elv13 | dispraekailo: it is easier to extend the ui than using a variable |
| dispraekailo | with a virtual member in the header, polymorphism with an external .h file, then using the external file as such :) |
| dispraekailo | elaborate |
| kizzx21 | hey guys, is there a way tell QWebFrame::print() to use the normal screen stylesheet instead of the print stylesheet? |
| kizzx21 | * QWebFrame :: print() |
| dispraekailo | Does anyone know why setting a fileSystemModel's rootpath to QDir::currentPath() would cause the application to crash? I've verified that the path is legit,and I'm using that same path elsewhere without problem. |
| dispraekailo | correction, it's crashing on the treeview->setModel( .. ) |
| dispraekailo | ugh I'm tired ; |
| dispraekailo | stupid mistakes again |
| rohanpm | rdancer: yes it is |
| ryanevans | how can i select each row in a QTableWidget, when i clicked any cell ? |
| JohnFlux | Has anyone found a way to add images to tooltips? |
| JohnFlux | Specifically, a QImage or QPixmap |
| JohnFlux | I asked.. 4 years ago and at that time was told to wait for Qt4.3 ;-) |
| JohnFlux | how time flies |
| zeke | JohnFlux: what about something like this? http://lists.trolltech.com/qt-interest/2004-08/thread01069-0.html |
| zeke | it's 6 years old but maybe still works the same? |
| zeke | http://doc.trolltech.com/4.6/qmimesource.html |
| JohnFlux | zeke: sweet |
| JohnFlux | zeke: that's exactly what I want |
| zeke | :> |
| zeke | wait |
| zeke | class is obsolete |
| zeke | xD |
| JohnFlux | haha |
| zeke | you can probably use QMimeData |
| zeke | blah |
| JohnFlux | yeah it's also now called Q3MimeSourceFactory |
| zeke | all I am finding is how to do it in Qt3 |
| zeke | xD |
| ryanevans | how can i setstylesheet to the qtablewidget ? it doesn't work. |
| ryanevans | sorry, it works :x |
| Znurre | Hello everyone, I have some problems with QtScript. I created a small sample code to showcase my issue. If someone would take a quick look at this code and tell me if this is even possible, I would be very grateful: http://pastebay.com/102183 |
| kizzx2 | hey guys, is there a way tell QWebFrame :: print() to use the normal screen stylesheet instead of the print stylesheet? |
| mta`chrono | does anyone know how to hide the title of a widget? |
| Znurre | mta`chrono: what title do you mean? got any example? |
| mta`chrono | Znurre: if you create a widget/qdialog under normal circumstances it has got a window title bar at the top (like every window has). I would like to hide this. |
| Znurre | check the Qt::FramelessWindowHint |
| Znurre | widget->setWindowFlags( Qt::FramelessWindowHint ); |
| mta`chrono | Znurre: thank you very much!!!! |
| Znurre | no problem! :) |
| extreme001 | hi |
| extreme001 | after learning c++ in school i want to get in gui-apps and want to use qt |
| extreme001 | but there's a thing i don't understand...i never had to worry about licenses and qt has more than one (right?)? |
| extreme001 | can i sell my software i coded with qt without charging any fees to qt/nokia ? |
| extreme001 | is that right ? |
| Znurre | extreme001: as far as I understand it, you can now release commercial non-opensource applications without charging any fees to Nokia as long as your application is linked dynamically and no changes to the Qt source has been made |
| extreme001 | dynamically? |
| extreme001 | oh i have to put the dlls in my app ? |
| extreme001 | and no change to qt toolkit self? |
| Znurre | yes, atleast this is how I understood it, I am not very good with licenses myself but since noone else here replied I try to help you the best I can :) |
| Znurre | extreme001: see this: http://en.wikipedia.org/wiki/Static_linking |
| extreme001 | ah ok... |
| extreme001 | i have to use the dlls, that's all |
| extreme001 | thank you very much |
| Znurre | yeah |
| Znurre | no problem |
| extreme001 | first c++ gui app starts... :D |
| Znurre | I wish you good luck :) |
| Znurre | feel free to ask me if you run into any problems |
| Sjors | so, let's see if my patch to Qt applies to trunk, if so, I'll submit it on the tracker |
| Sjors | or is there a better place? |
| Sjors | the patch adds custom icons for Growl notifications and possibly others in the future |
| jpnurmi | Sjors: qt.gitorious.org :) |
| jpnurmi | !f contrib |
| qtassistant | jpnurmi: [contribute] http://qt.gitorious.org/qt/pages/QtContributionGuidelines |
| Sjors | thanks jpnurmi |
| jpnurmi | np |
| passito | Hello, i have a question about QNetworkAccessManager |
| passito | what is the proper way to handle a download with this class ? |
| passito | http://pastebin.com/TUKuHkT2 <-- I am doing right ? |
| Znurre | since the finished() signal passes a pointer to the QNetworkReply object, you can just connect this to a slot and handle the reading there, atleast that's how I use to do it |
| Sjors | jpnurmi: would it be best to provide patches for 4.6, 4.7 and master, 4.7 and master, or just master? |
| pumphaus | passito: no. you need to create a custom slot for the finished(QNetworkReply*) signal and read from the reply there |
| passito | okay, and about the error handling ? |
| passito | timeout, etc |
| pumphaus | passito: http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html - see the examples there |
| passito | w.out this, if a query is not valid (fake proxy, etc) ... it timeouts after more than 1 min. |
| passito | thanks |
| jpnurmi | Sjors: i'd go with master and let Trolls to decide whether to backport the bugfix |
| Sjors | jpnurmi: it's not a bugfix :) |
| Sjors | jpnurmi: it adds a feature |
| Sjors | to QSystemTrayIcon :) |
| jpnurmi | Sjors: does it affect public api? if so, it goes to master :) |
| Sjors | jpnurmi: it adds two methods to public api :) |
| jpnurmi | it might be hard to get new stuff to 4.7 anymore |
| Sjors | oh and it adds an enum value |
| Sjors | i.e. it only adds new stuff, doesn't change existing |
| jpnurmi | ok, then master definitely |
| Sjors | allright |
| Sjors | that means the new feature will only be in qt 4.8? o_O |
| gnusar | is there a way to check if keys on the keyboard are being pressed? i dont want to receive keyevents but check every frame. |
| Znurre | I have some problems with QtScript, and passing a pointer to the script. I created a small sample code to showcase my issue. If someone would take a quick look at this code and tell me if this is even possible, I would be very grateful: http://pastebay.com/102183 |
| passito | okay so, if I want to handle properly a qnetworkreply, i have to use the readyRead signal, and the waitForReadyRead method to specify the timeout value ? |
| Znurre | passito: waitForReadyRead is a blocking function, and has nothing to do with the readyRead signal |
| Znurre | it will return true when there is data to read, if you want to implement your own event loop |
| passito | y i've seen that, sorry |
| Znurre | I will write a small example code for you, to show you how I would do it |
| passito | how can I specify a timeout value so that it will send a error(QNetworkReply::NetworkError) signal to the reply ? |
| passito | okay znurre :) |
| Znurre | passito: http://pastebay.com/102198 |
| Znurre | something like that |
| Znurre | you would ofcourse have to define the new slots in your header file too |
| passito | okay I see |
| passito | i'm going to try that |
| Znurre | :) |
| Znurre | good luck, and feel free to ask me if you run into any problems |
| passito | i'm just wondering |
| passito | with this code, i can't display a progress bar for the download ? |
| Znurre | true |
| passito | i'd have to use ready read |
| ecko | does qt declarative have an equivalent of a QGroupBox? |
| passito | and handle the progression by myself ? |
| Znurre | passito: then you would need to use downloadProgress ( qint64 bytesReceived, qint64 bytesTotal ) signal in QNetworkReply |
Popular searches: