free blog   apache   shopping directory   php powered
rohanpmdispraekailo: show code?  (or at least explain "doesn't like it too much" :-)
dispraekailough I figured it out.. still getting used to this framework ;
dispraekailoI'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?
dispraekailorohanpm, I really hate that I make such silly mistakes despite doing some really awesome stuff :P
rohanpmdispraekailo: it's OK, mistakes are good 90% of the time...
rohanpmas long as the mistaker is not foolish :-)
rohanpmSkrot-: not sure if that would work; using the qSort with the lessThan parameter is probably better
wahnfriedenHow can I disable the button on macs that toggles the toolbar visibility?
wahnfriedenthe 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
wahnfriedenI'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
wahnfriedenah, Qt::MacWindowToolBarButtonHint
pietro10Elv13: try wrapping the strings in QString()
Elv13pietro10: it is in a QString, I am calling QString::replace
pietro10Elv13: read what I did
pietro10if that doesn't work
pietro10change all the QString() calls to QString::fromUtf8String or whatever the function's name is
rohanpmElv13: can you show code of your testcase?  it's not clear to me what your input is...
rohanpmfor instance, it wouldn't surprise me if you meant "\\u2029", not "\u2029
Elv13rohanpm:sure just use a QTextCursor, get the selection (::selectedText) and try to split the lines
rohanpmyou should write a simple testcase which doesn't use a UI...
Elv13according to the doc, I have to replace the unicode caracter by a \n to make it work
rohanpmthen you'll be able to focus on just getting this one thing right
Elv13rohanpm: The Qt doc say this will happen, and that I need to do that to fix it, see
rohanpmElv13: ok, the point is that I think you may be constructing your "U+2029" character wrongly
Elv13so how can I construct it right?
rohanpmwell, if you write a simple testcase, it should be pretty easy to figure that out with a little trial and error :-)
Elv13rohanpm: My test case it quite simple, convert a Textcursor selection to an array of lines, it can not be more simple
Elv13pietro10: Your solution does not work, toAscii() return a bunch of ???? instead of the utf8 character
pietro10I dunno then
aepwho said toAscii returns utf8 ?
aepit returns ascii
Elv13I hope it does not ;), @pietro10 thanks
Elv13aep: and replace utf character by ????
aepyes. everything not ascii is replaced
aepor even undefined i think
Elv13aep: do you have an idea how can I convert utf8 linebreak to \n for a QTextStream or QString::split to handle it?
aepwhats an utf8 linebreak?
Elv13aep: \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)
aepNEL ?
rdancerrohanpm: what is the right way to cast it?
aepwho had that retarded idea. now we have 6 newlines
rohanpmrdancer: qobject_cast
Elv13this is my problem
rohanpmrdancer: better to refactor the code to not need that, though (trivial in your example, but I imagine your real code is different...)
dispraekailoHow should I be accessing widgets in the .ui file from within the corresponding .h/.cpp files?
rdancerrohanpm: as in using a variable for the layout?
aepElv13: qt doesnt offer what you need.
Elv13dispraekailo: by extending the class generated by your .ui
dispraekailoI'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
aeptheres some unicode libs around that can convert stuff into sanity
dispraekailoelaborate Elv13
Elv13aep: Qt cause the problem and say .replace should work
rohanpmrdancer: no... just don't "lose" the pointer to the real type until after you don't need it any more...
Elv13dispraekailo: extend the class generated by your .ui, the object names are going to be accessible as member variables
dispraekailoElv13, you're saying I should extend the Ui::<classname> instead of the one I already defined?
Elv13dispraekailo: you can extend as many class as you want in C++
dispraekailoElv13, 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)
dispraekailoRight I just didn't think that was an appropriate paradigm considering how many examples I've seen like this.
Elv13that work too
dispraekailoApparently not.
dispraekailoOr I'm setting up my stuff in the .ui file wrong.
rdancerrohanpm: like this?:
Elv13setupUI? yes it does work
dispraekailoElv13, yes it makes it look like the .ui file fine, but it doesn't give me access to any members
rohanpmrdancer: sure... though it may be more efficient to setLayout only at the end
Elv13dispraekailo: look at the .h generated by qmake/cmake and see the API it created
rdancerrohanpm: addQuestions() is uses this->layout->addWidget()
dispraekailoElv13, it's in there.  Not showing up in my derived class.
Elv13dispraekailo: 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
Elv13I think you are mixing the two way and got confused
rdancerrohanpm: 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?
dispraekailoAhhh I didn't consider accessing it through the ui->
dispraekailoNice, thanks :)
Elv13no problem
dispraekailoI've never seen a construct like that in c++ before
Elv13dispraekailo: it is easier to extend the ui than using a variable
dispraekailowith a virtual member in the header, polymorphism with an external .h file, then using the external file as such :)
kizzx21hey guys, is there a way tell QWebFrame::print() to use the normal screen stylesheet instead of the print stylesheet?
kizzx21* QWebFrame :: print()
dispraekailoDoes 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.
dispraekailocorrection, it's crashing on the treeview->setModel( .. )
dispraekailough I'm tired ;
dispraekailostupid mistakes again
rohanpmrdancer: yes it is
ryanevanshow can i select each row in a QTableWidget, when i clicked any cell  ?
JohnFluxHas anyone found a way to add images to tooltips?
JohnFluxSpecifically, a QImage or QPixmap
JohnFluxI asked.. 4 years ago and at that time was told to wait for Qt4.3 ;-)
JohnFluxhow time flies
zekeJohnFlux: what about something like this?
zekeit's 6 years old but maybe still works the same?
JohnFluxzeke: sweet
JohnFluxzeke: that's exactly what I want
zekeclass is obsolete
zekeyou can probably use QMimeData
JohnFluxyeah it's also now called Q3MimeSourceFactory
zekeall I am finding is how to do it in Qt3
ryanevanshow can i setstylesheet to the qtablewidget ? it doesn't work.
ryanevanssorry, it works :x
ZnurreHello 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:
kizzx2hey guys, is there a way tell QWebFrame :: print() to use the normal screen stylesheet instead of the print stylesheet?
mta`chronodoes anyone know how to hide the title of a widget?
Znurremta`chrono: what title do you mean? got any example?
mta`chronoZnurre: 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.
Znurrecheck the Qt::FramelessWindowHint
Znurrewidget->setWindowFlags( Qt::FramelessWindowHint );
mta`chronoZnurre: thank you very much!!!!
Znurreno problem! :)
extreme001after learning c++ in school i want to get in gui-apps and want to use qt
extreme001but there's a thing i don't understand...i never had to worry about licenses and qt has more than one (right?)?
extreme001can i sell my software i coded with qt without charging any fees to qt/nokia ?
extreme001is that right ?
Znurreextreme001: 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
extreme001oh i have to put the dlls in my app ?
extreme001and no change to qt toolkit self?
Znurreyes, 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 :)
Znurreextreme001: see this:
extreme001ah ok...
extreme001i have to use the dlls, that's all
extreme001thank you very much
Znurreno problem
extreme001first c++ gui app starts... :D
ZnurreI wish you good luck :)
Znurrefeel free to ask me if you run into any problems
Sjorsso, let's see if my patch to Qt applies to trunk, if so, I'll submit it on the tracker
Sjorsor is there a better place?
Sjorsthe patch adds custom icons for Growl notifications and possibly others in the future
jpnurmiSjors: :)
jpnurmi!f contrib
qtassistantjpnurmi: [contribute]
Sjorsthanks jpnurmi
passitoHello, i have a question about QNetworkAccessManager
passitowhat is the proper way to handle a download with this class ?
passito <-- I am doing right ?
Znurresince 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
Sjorsjpnurmi: would it be best to provide patches for 4.6, 4.7 and master, 4.7 and master, or just master?
pumphauspassito: no. you need to create a custom slot for the finished(QNetworkReply*) signal and read from the reply there
passitookay, and about the error handling ?
passitotimeout, etc
pumphauspassito: - see the examples there
passitow.out this, if a query is not valid (fake proxy, etc) ... it timeouts after more than 1 min.
jpnurmiSjors: i'd go with master and let Trolls to decide whether to backport the bugfix
Sjorsjpnurmi: it's not a bugfix :)
Sjorsjpnurmi: it adds a feature
Sjorsto QSystemTrayIcon :)
jpnurmiSjors: does it affect public api? if so, it goes to master :)
Sjorsjpnurmi: it adds two methods to public api :)
jpnurmiit might be hard to get new stuff to 4.7 anymore
Sjorsoh and it adds an enum value
Sjorsi.e. it only adds new stuff, doesn't change existing
jpnurmiok, then master definitely
Sjorsthat means the new feature will only be in qt 4.8? o_O
gnusaris there a way to check if keys on the keyboard are being pressed? i dont want to receive keyevents but check every frame.
ZnurreI 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:
passitookay 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 ?
Znurrepassito: waitForReadyRead is a blocking function, and has nothing to do with the readyRead signal
Znurreit will return true when there is data to read, if you want to implement your own event loop
passitoy i've seen that, sorry
ZnurreI will write a small example code for you, to show you how I would do it
passitohow can I specify a timeout value so that it will send a error(QNetworkReply::NetworkError) signal to the reply ?
passitookay znurre :)
Znurresomething like that
Znurreyou would ofcourse have to define the new slots in your header file too
passitookay I see
passitoi'm going to try that
Znurregood luck, and feel free to ask me if you run into any problems
passitoi'm just wondering
passitowith this code, i can't display a progress bar for the download ?
passitoi'd have to use ready read
eckodoes qt declarative have an equivalent of a QGroupBox?
passitoand handle the progression by myself ?
Znurrepassito: then you would need to use downloadProgress ( qint64 bytesReceived, qint64 bytesTotal ) signal in QNetworkReply
Popular searches: zsched   qtablewidget button   thinkpad r31 suspend   qt application crash can   

Generated by 2.1mg by Jeff Waugh - return