Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • 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?

    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.
  • Using TreeWidgets

    10
    0 Votes
    10 Posts
    4k Views
    A
    [quote author="Arukas" date="1328130428"]I just want to get the correct item out of the tree. Is the only way to use a @map<QTreeWidgetItem, int>@ or does the treewidget do something like that already for you? [/quote] I posted a solution for that just above...
  • Question about translating

    14
    0 Votes
    14 Posts
    5k Views
    M
    You could also use "ID-based translations":http://developer.qt.nokia.com/wiki/QtInternationalization#43b304ead4174986c238cb4e0c4d5cb0, too. Although they're not as clean of a solution, IMHO, they are an option.
  • SIGSEGV produced when using QNetworkManager after/during post

    4
    0 Votes
    4 Posts
    4k Views
    G
    Thanks for reporting back. We all know that nasty little erros too good. It so often that it's these tiny typos that make you scratch your head for hours :-) Good luck with your further progress and of course you're very welcome to ask again if needed.
  • QLabel::setText() from a secondary thread

    4
    0 Votes
    4 Posts
    4k Views
    M
    While it would be possible to check for which thread is calling a function in debug builds, it would be too much overhead for release builds IMO. The ground rule is that if a method is not marked as being thread safe, it is not. For setting text, it will work unless the main thread is accessing the text at the same time. It will definitely crash once you ship the program to the client, says Murphy's law :-)
  • Using QDialog with the Button Box

    2
    0 Votes
    2 Posts
    2k Views
    A
    Never mind I figured it out. Took several more tries and reading. My problem is I don't know what I'm even looking for. I had to set modal to tree. Is QDialog::setModal how would say that? Also, its the exec method i over looked. I was under the impression that's not what you want to do. I thought the Qapplication exec was the only one i needed. -Thanks
  • QProcess freezen

    2
    0 Votes
    2 Posts
    2k Views
    B
    The problem is the pipe! Instead, you have to run tasklist as one process and pass the resulting data to another process running the find stunnel.exe.
  • Changing the size of the QComboBox's List

    3
    0 Votes
    3 Posts
    3k Views
    A
    I use the function call, and it worked like a charm.
  • [SOLVED] Save a QTableView as an image

    3
    0 Votes
    3 Posts
    2k Views
    A
    Works perfect....thanks a lot.
  • QTcpSocket problem

    4
    0 Votes
    4 Posts
    2k Views
    A
    This is for login dialog, but for connecting the socket, to the other dialog? I mean, yea, this looks similar to what I have in the login dialog, but how to connect, the resulting socket, from this, to the second dialog? Thanks alot.
  • How to define structure inside hash?

    5
    0 Votes
    5 Posts
    3k Views
    A
    Thank u all... I did it.... Thank u so much....