Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • [Moved] Problem using QXmlStreamReader to parse html tag

    3
    0 Votes
    3 Posts
    4k Views
    K
    Maybe instead of using TextEdit you could use "QWebView":http://developer.qt.nokia.com/doc/qt-4.7/qwebview.html instead. This way you can edit your content inside the WebView like a "WYSIWYG editor":http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/ by setting the content to editable. @htmlView->page()->setContentEditable(true);@ And as a bonus you can also parse your HTML doc using "QWebElement":http://developer.qt.nokia.com/doc/qt-4.7/qwebelement.html with Css like selectors.
  • WaitForFinished() fires early

    9
    0 Votes
    9 Posts
    17k Views
    T
    Thanks guys. Andrew you plucked the right nerve as the program itself need a lot of time to start and optimize. When setting the value to -1 it will wait till the program really exits. The final solution for everyone: @ QProcess *process; process = new QProcess( this ); process->start("myOptimizationApp"); process->waitForFinished(-1); @
  • [QtNetwork] How to identify dead connection

    9
    0 Votes
    9 Posts
    4k Views
    T
    It does work, but it waits for a usually rather long time out.
  • [Solved]How to move a widget to the center of the dialog?

    9
    0 Votes
    9 Posts
    6k Views
    T
    bq. There is one noob solution.. Setting the width of the label the same as the window and the X position to 0.. So the text will be at center and no need for the label to be at center.. But if there is another solution for this i would be glad to know :) Which is what a layout does for you...
  • Dynamically show/hide QTreeView items.

    4
    0 Votes
    4 Posts
    6k Views
    S
    Thanks a lot guys, I should have read the docs more carefully.
  • Help with what should i include for translation at my app.

    15
    0 Votes
    15 Posts
    7k Views
    L
    Using the arg function with tr() i see that at qt linquist i see the %1%2 part... Is it a problem? Is there a way not be able to see %1%2? EDIT: What about dots and "!"? EDIT2: What about unicode text? How can this be translatable? I mean something like this: @QString::fromUtf8("and it will change every ½ hour")@
  • How to use "windows-1252" charset ?

    9
    0 Votes
    9 Posts
    12k Views
    P
    I didn't even know that i must use wide chars. Thanks you, for all your help :)
  • 0 Votes
    2 Posts
    2k Views
    A
    For those curious about the above 'problem' that I reported, you can find some interesting information at Qt Centre where I also asked for some help: http://www.qtcentre.org/threads/42849-Plugin-can-load-or-not-depending-on-whether-my-app-is-launched-from-Qt-Creator-or-not.
  • Problem with arg at QString.

    19
    0 Votes
    19 Posts
    8k Views
    L
    It seems like the textbrowzer has a different type of html.. so i finally found a solution and it is: @ QString written = QString("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"><p margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%1%2").arg(tr("In random order")).arg(":</p><p margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span font-family:'Sans'; font-size:10pt;">Leon Vytanos <</span><a ><span font-family:'Sans'; font-size:10pt; text-decoration: underline; color:#ff5500;">leon.check.me@gmail.com</span></a><span font-family:'Sans'; font-size:10pt;">></span></p><p margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span font-family:'Sans'; font-size:10pt;">Alex Solanos <</span><a ><span font-family:'Sans'; font-size:10pt; text-decoration: underline; color:#ff5500;">alexsol.developer@gmail.com</span></a><span font-family:'Sans'; font-size:10pt;">></span></p></body></html>"); @ But the @ QString written = QString("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">@ part if i remove it there will be no problem, Should it be with or without this line?
  • How to get column Count if i have only the QModelIndex

    4
    0 Votes
    4 Posts
    4k Views
    G
    if you only have the index, ypou can also write: @ index.model()->columnCount(index.parent()); int nRow = index.row(); @ A look to the documentation would help: "QModelIndex":http://doc.qt.nokia.com/4.7/qmodelindex.html
  • Trouble with slots and signals

    8
    0 Votes
    8 Posts
    5k Views
    G
    [quote author="ProgrammerAtHeart3344" date="1309702177"]nope still didn't this happens a lot to me for some reason I'm trying to make it so depending on the index pickec in the combo box it does different things. Maybe i don't fully understand slots and signals....hmm[/quote] A signal can't be dependent on the parameter value, it's is translated to a function call. That's whxy it must be int not X.
  • Problem in running the exe file

    13
    0 Votes
    13 Posts
    14k Views
    K
    You are missing the VS2010 specific dlls. That is why I was already adding: [quote author="koahnig" date="1309689725"] Certainly you can copy every time the exe and the dll to the desired directories. But with vs2010 you may want to create a "Setup and Deployment" project. If you add a project in vs you should have such a possibility under other projects. [/quote] The only way I know to handle this is the "Setup and Deployment" project. You need to consult the microsoft help text for this. I was once doing it for VS2005. Under VS2005 you somehow detect all the dlls you need. For VS2010 you need to find your way through. I doubt that is close to VS2005 procedure.
  • Conversion warnings in qt headers 4.7.3 under x86_64 linux

    2
    0 Votes
    2 Posts
    2k Views
    K
    My experience is yes. Typically you should worry about errors, because then you do not get the libs. It is similar under linux(ubuntu) and windows.
  • [SOLVED]Calling new window from menu bar

    6
    0 Votes
    6 Posts
    5k Views
    J
    Yeah, I've archived what I wanted. I've made new class like Andre said, and added another form to my project to make it look how i wanted. Thank you very much :]
  • How to debug and get the source of signal and slots linking error's

    3
    0 Votes
    3 Posts
    3k Views
    D
    if your use qmake, please run it again.
  • QObject question please, it's simple but I can't get it!!

    6
    0 Votes
    6 Posts
    4k Views
    A
    [quote author="maherali" date="1309665951"]error: main.moc: No such file or directory [/quote] Did you run qmake again? [quote author="maherali" date="1309665951"] sorry for that but the solution doesn't work with the above message. [/quote] It works. @ anselmo@skadi ~/projects/Qt/devnet/project $ ls main.cpp project.pro @ main.cpp @ class TempClass:public QObject { Q_OBJECT public: explicit TempClass(QObject * parent=0) :QObject(parent) {} public slots: void closed() { } }; #include "main.moc" int main(int argc, char *argv[]) { QApplication app(argc, argv); TempClass temp; return app.exec&#40;&#41;; } @ project.pro @ TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . Input SOURCES += main.cpp @ @ anselmo@skadi ~/projects/Qt/devnet/project $ qmake anselmo@skadi ~/projects/Qt/devnet/project $ make /usr/bin/moc -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. main.cpp -o main.moc g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o main.o main.cpp g++ -Wl,-O1 -o project main.o -L/usr/lib -lQtGui -L/usr/lib -L/usr/X11R6/lib -lQtCore -lpthread anselmo@skadi ~/projects/Qt/devnet/project $ ls main.cpp main.moc main.o Makefile project project.pro @ project is the binary. Attention to the first line of the compilation output, there you can see moc being called to generate main.moc.
  • [Solved] Showing "Loading" widget while heavy processing...

    5
    0 Votes
    5 Posts
    5k Views
    M
    No problems ;) I've only put the decrypt() and encrypt() in a different thread ;) And i've connected "start" with "show", and "finished" with "close" :D Thank you anyway !
  • Where can i find translators for my application?

    7
    0 Votes
    7 Posts
    3k Views
    L
    In any language except the 2 that i have already. When the second version is ready i will contact you soroush :) Any other language is welcome.
  • [SOLVED] Database warning

    6
    0 Votes
    6 Posts
    3k Views
    S
    Thank you I ran out of scope of methods that was at least one query used in them and also deleted pointers to queries. now there is no warning :-) bq. An even simpler approach would be to simply ignore the warning. It won’t hurt you. I know, this is a homework => should look clear ;-)
  • 0 Votes
    3 Posts
    3k Views
    A
    Thank Tobias for the answer! No! The problem is specific :) I have my own (really safe, no files used) way to check if my application is running. I don't need this. I want your opinion about what would you have done in an occassion where your program was running in non-GUI mode and GUI was called, and briefly how would you do it (I have mentioned my way in the 1st post)