Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • XPath query of DOM.

    7
    0 Votes
    7 Posts
    9k Views
    G
    Don't wake the dead, please. The last post here was from August 2010, almost one and a half year ago...
  • QApplication handling unexpected X server shutdown?

    4
    0 Votes
    4 Posts
    3k Views
    T
    rcari: I registered for every possible signal there is, and none of them are caught when the server shuts down. peppe: I mean if the user was to say, logout of Windows that's running an X server. It's not a crash on the X server's part.
  • [SOLVED] Qt + LLVM's JIT on Windows

    3
    0 Votes
    3 Posts
    3k Views
    A
    Going back to an old thread of mine, but just to say that I have since got LLVM to work fine in my Qt application, and this on Windows, Linux and Mac OS X. No doubt, LLVM is very nice!
  • When I must use an "qApp" pointer and when "this" pointer?

    4
    0 Votes
    4 Posts
    14k Views
    L
    qApp is a globally accessible pointer to the QApplication object, this is a pointer to the object for which the member function is called. So in your case qApp points to the QApplcation object which was created in <code>main()</code>, this points to the <code>Notepad</code> object whose member function - or constructor in your case - is called. So if you want to connect to a slot of the QApplication object use qApp, if you want to connect to a slot of the "current" object use this, or if you want to connect to any other object just use any other pointer that points to a valid QObject subclass.
  • Phonon - issue playing video using iodevice object

    12
    0 Votes
    12 Posts
    4k Views
    J
    Ok, one more thing I hate to bring this up Yes -QFile is a QIODevice, but the QIODEvice is not a QFile. Correct and if mediasource was expecting QFile I could not pass a QIODevice. QIODevice is an abstract class as such the only way for me to pass a QIODevice is with a class that extends it - QFile or my own custom device.
  • Data not selected when using a custom delegate in a QTableView

    15
    0 Votes
    15 Posts
    7k Views
    G
    [quote author="shiru" date="1328187678"]This is the second time in this thread that I feel injuried. @Gerolf If you don't want to help, don't post and please don't be sarcastic or at least read all the thread before posting your answer. You "autoproclamed hackers" are all the same, you think you're superior to everyone, you act as you never been beginners. [/quote] Hi shiru, I'm sorry if you fealt like I want to blaim you, that was not my intention. I just tried to give you a hint, where to look. As you perhaps know, nearly all people here are doing this in their free time. So sometimes, you see the problem, but have no time for a long answer. What should I do? give a short hint or not answer? The technical thing is already described by Volker, so I will not go into that.
  • QLineEdit buggy display on MacOS X

    11
    0 Votes
    11 Posts
    3k Views
    O
    Bug report submitted: "see here":https://bugreports.qt-project.org/browse/QTBUG-24051. Thanks for your help.
  • Qt Solutions Archive

    3
    0 Votes
    3 Posts
    4k Views
    rincewindR
    The project builds a library and some examples. It seems to be giving the error when building the example. The last output line says: @mingw32-make.exe[1]: Leaving directory `C:/Projects/libs/qt-solutions/qtwinmigrate-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug/examples' @ What confuses me is that I get this error in the "Compile Output", but in the "Issues" window when I click on the error: @C:\iwmake\build_mingw_opensource\src\winmain\qtmain_win.cpp:131: error: undefined reference to `qMain(int, char**)' @ The second line of the output changes to: @File not found: C:\iwmake\build_mingw_opensource\src\winmain\qtmain_win.cpp@ I don't have such a directory, and it seems to be some hardcoded path somewhere in the make files. So, it seems this is a reference to the Qt source which I installed with the package manager, but I don't know (yet) how to change the path to Qt source on my machine.
  • [SOLVED]QTimer problem

    4
    0 Votes
    4 Posts
    2k Views
    T
    Oh I found som redundant code too here ClearVectors;
  • How to apply QIntValidator for QTextEdit

    6
    0 Votes
    6 Posts
    5k Views
    K
    I guess your problem is that QTextedit does not have a setValidator method. Why that is the case? Volker has given the answer. Multi-line may make it time consuming.
  • 0 Votes
    11 Posts
    33k Views
    J
    Came accross the same issue today: @FranzB Hi, When I use invokeMethod calling the slot as suggested, I receive: QMetaObject::invokeMethod: No such method SomeOtherQObject::1updateProgress(int)(int) Solved it like that (look at the way the slot is passed to invokeMethod): int ThreadTest::showProgress(int percent, void *pContext) { QMetaObject::invokeMethod(someOtherQObject, // obj "updateProgress", // member: don't put parameters Qt::QueuedConnection, // connection type Q_ARG(int, percent)); // val1 return 0; }
  • Help!!!!

    6
    0 Votes
    6 Posts
    3k Views
    Q
    I think part of the issue is scale of task and panic caused due to it rather than the coding itself. Your question is a case of writing something in QT / C++ and is too general for us to help easily at this point. Firstly break down what you need to do. I think Broadpeak & Sierdzio's idea on reading a little introduction on C++ and Qt will help. If you are also new to C++ then look up a basic guide on that first though. Get a basic idea of the terms used and what they do so you know what you need to achieve. Then grab examples of basic code from tutorials and so forth and get them to run so you can take a look at something working. After this, decide a very simple thing to write. Something tangible but very basic which will use multiple classes. Don't get caught up in trying to write something overly complex at this point. If you come across specifi code questions or have snippets of code you need sanity checking for you then the forum is the place if you cant find a similar answer using Google or reading existing posts here. Your goal here is to just write SOMETHING from scratch which ticks your teachers checklist. Then, once that is running and works well with comments in the code and so on, you can think about adding extra bells and whistles or expanding it in the time from then to your deadline. Most important: From the start get used to versioning your code. Its a good habit and will help you no end. Use Subversion or similar and commit code often so you never have to worry about losing anything or deleting a bit of code and breaking things. Then once your main code is done you know it's safe and you can expand it to your hearts content knowing you still have the basics ready to hand in to your tutor if you run out of time or end up with noddle soup rather than a program. I hope this helps. Good luck!
  • 0 Votes
    5 Posts
    3k Views
    A
    Thanks a lot Andre...:) It works..!!!!
  • 0 Votes
    8 Posts
    4k Views
    Q
    It turned out my mousearea had an opacity, which must have snuck in during a copy/paste while I was exploring methods. I kept looking for syntax errors and missed something obvious. Good to see someone else had the same idea of how to do this and such a good clean example set of code. I am sure this will help others as well. Thanks!
  • Is it easy to create a qt macro recorder for both mac and windows&#63;

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    4 Posts
    6k Views
    U
    i just what , underline in the text and make the mouse icon change when it is over the text . now i try to work with ItemDelegate implementing the paint method .. i dont know how it will work :/
  • QSqlQueryModel didn't load all the rows?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Adding libs to my project and using them

    6
    0 Votes
    6 Posts
    3k Views
    G
    [quote author="KillGabio" date="1328036058"]here are the file that i have: winfis.lib winfis32.dll winfis.h ... i read the documentation (i`m working on windows XP, Qt SKD 4.7.4 minGW) so i tried, but failing to exec in Qt environment qmake, mingw32-make.. [/quote] I think the problem is, that you are using mingw xxx.lib is a format that comes from MS compiler toolchain. I am not sure, if mingw can red them, if they are pure C (I don't think so). If they are c++, they are definitly incompatible. If they are C, you need to use late binding or need a mingw compatible link library.
  • Adjust the size of QGraphicstextItem

    2
    0 Votes
    2 Posts
    3k Views
    M
    this is the code i tried @ class GraphicsTextItemSized : public QGraphicsTextItem { public: GraphicsTextItemSized(QGraphicsItem* parent = 0); GraphicsTextItemSized(const QString& text, QGraphicsItem* parent = 0); QRectF boundingRect() const; QString str; QRectF adjustedrect; void forcedsize(qreal x1,qreal y1,qreal x2,qreal y2); }; @ @ #include "graphicstextitemsized.h" #include <QtCore> #include <QtGui> #include <QGraphicsTextItem> GraphicsTextItemSized::GraphicsTextItemSized(const QString &text, QGraphicsItem *parent):QGraphicsTextItem(text,parent) { setPlainText( text); } QRectF GraphicsTextItemSized::boundingRect() const { return (adjustedrect); } void GraphicsTextItemSized::forcedsize(qreal x1,qreal y1,qreal x2,qreal y2) { adjustedrect.setCoords(0,0,x2-x1,y2-y1); } @ @ QGraphicsRectItem *rect = new QGraphicsRectItem(0,0,0,0); GraphicsTextItemSized *tes = new GraphicsTextItemSized(QString("vcc"),rect); tes->forcedsize(0,0,10,10); tes->setPos(10.0,10.0); scene->addItem(rect); @
  • Context menus: trigger an action on an item that has a sub-menu.

    2
    0 Votes
    2 Posts
    4k Views
    A
    You don't. The action is "show the sub menu". It would be very confusing if the action does more than that.