Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • 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(); } @ 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)
  • TrayIconMenu Color change.

    3
    0 Votes
    3 Posts
    2k Views
    R
    Try it, for example @QMenu{ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dddddd, stop: 1 #eeeeee); }@ It may interest you also http://qt-apps.org/content/show.php/Rizek+Qss+Editor?content=142455
  • Custom HID Device Driver: Not able to go beyond HidD_GetHidGuid Call?

    1
    0 Votes
    1 Posts
    5k Views
    No one has replied
  • How can i download file from servrer right?

    14
    0 Votes
    14 Posts
    8k Views
    J
    I simply pointed out what was wrong with his code. At the time I used the QHttp (the code posted).. there was no other option. I think it is pretty clear to everybody and spelled out many times that it is deprecated now. Honestly, I found that out myself just recently over here. Anyways, I apologize for the confusion and yes.. the OP in the thread I linked would also be better off using the QNetworkManager classes currently. Thanks for adding that info to the thread. [ Edit: Have edited my "post":http://developer.qt.nokia.com/forums/viewreply/39453/ and added the code using the QNetworkManager. Once again sorry about that.. honest mistake..] [ Edit2: @kkrzewniak: Off-topic but its "deprecated" not "depreciated".. we all get it.. but just saying.. :-) ]
  • [SOLVED]save a png file

    7
    0 Votes
    7 Posts
    7k Views
    J
    Thanks kkrzewniak, It was exactly what I was looking for. The problem is solved.
  • Trouble deploying Phonon media player on Windows

    7
    0 Votes
    7 Posts
    5k Views
    M
    Thank you all for your suggestions. I solved my problem. I had already used dependency walker and installed all DLLs that it showed were required, and no DLLs were coming up missing when the application was launched. Process explorer was very helpful. I compared the loaded DLLs on a working and non-working machine, and found what I had done wrong. phonon_ds94.dll must be installed in a folder "phonon_backend" located under the application programs folder. I had put in in a folder called "phononbackend" by mistake. As soon as I corrected the name of that folder, my player started working. Process explorer showed that phonon_ds94.dll was not loading on the non-working machine. On the development machine it was loading phonon_ds94.dll from C:\Qt\2010.05\qt\plugins\phonon_backend.
  • [Another Question2] How to hide a label with fade/opacity levels?

    10
    0 Votes
    10 Posts
    10k Views
    L
    Anyway ok i have done it one by one.. But is there any fade effect for a textedit? Because it returns me this when i do the opacity effect to a textedit: @QPainter::begin: A paint device can only be painted by one painter at a time. QPainter::translate: Painter not active QPainter::worldTransform: Painter not active QPainter::setWorldTransform: Painter not active QPainter::setWorldTransform: Painter not active@
  • MouseOver animation on QTabBar

    3
    0 Votes
    3 Posts
    3k Views
    G
    You can use style sheets for custom coloring, but it will be no animation, just static colors and pictures.
  • QTextCursor::clearSelection() doesn't work

    5
    0 Votes
    5 Posts
    5k Views
    J
    Just to clarify, you could modify the text document with something like @ QTextCursor cursor = textEdit->textCursor(); cursor.insertText("blahblah"); @ without needing to call setTextCursor(). But the selection itself is a property of the text cursor and only on setTextCursor() is the visual cursor updated and hence the selection.
  • Duration of aThread

    6
    0 Votes
    6 Posts
    3k Views
    F
    In that case time is not interesting. You might want to emit a progressChanged() signal containing a percentage. Stick to what you know. You know exactly how many calculations you are going to do, but you have no real clue about how much time it will take to complete them. If you use a percentage output, you can use a standard QProgressDialog and use that. It will by default pop up after 4 seconds of operation, but you can change that value if you wish, or show() immediately. People are usually better at guessing or estimating (guestimating) the time to finish based on tasks-completed progress than computers are.
  • Cross-Compiling Qt Applications from Windows to Mac OS

    2
    0 Votes
    2 Posts
    7k Views
    T
    You will need a special cross compiler for that, a normal mingw will not work: Apple uses a binary format that differs from the one used on windows. The macx-xcode spec expects the mac compiler set up as on a mac, too, so that is unlikely to work with a cross-compiler tool chain on windows. I saw a documentation on how to "cross-compile from Linux to Mac":http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt before, maybe that can be used as some form of inspiration for a similar setup on Windows... Note that the process seems to depend heavily on which version of MacOS you want to target.
  • [SOLVED]Shell error output from QProcess

    7
    0 Votes
    7 Posts
    10k Views
    B
    Thanks for the clarification about the shell etc. I connected a slot to the QProcess::error() signal and it's working great.
  • How to use Qt with Mercurial and Google Code?

    8
    0 Votes
    8 Posts
    5k Views
    S
    From what ive tried which isn't much the QtCreators Mercurial integration only seems to work for local repositories. I tried integrating it into a wider repo and had issues then decided to manage the repo manually from the command line. If anyone has tips for integrating it better it would be much appreciated. One of my main problems is i have multiple projects that use shared libs all in the 1 repository.
  • [SOLVED]Editable combobox that behaves more like a lineedit

    3
    0 Votes
    3 Posts
    6k Views
    B
    That's just what I was after, thanks!
  • Quad Splitter Windows, an implementation?

    6
    0 Votes
    6 Posts
    4k Views
    A
    Yeah, the reason why I'm asking for advice is for faster performance, cleaner syntax, etc. Andre, I suppose why I inherited from QSplitter is because, at first impression, I had intended it to be a splitter varient. But now that I think of it again it's really just an object of its own, and I agree that not all of the inherited functions will work anyway. Most would probably have to be reimplemented. For now I'll just inherit QuadSplit from QObject, I might narrow it down to its true "family line" if I want to venture into that, but I'm not sure if it's necessary. But maybe it is. After all I've barely looked through all of the member functions for these classes as of yet. bq. There are better ways of implementing your QuadSplit than using three QSplitters that need to be kept in sync. What do you have in mind? I could definatly use advice on how to improve it, whether performance or syntax wise.