Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • QGraphicsView - how to organize scene and items

    11
    0 Votes
    11 Posts
    5k Views
    M
    I defined the struct as: @class Joystick : public QObject, public QGraphicsEllipseItem { Q_OBJECT public: Joystick(int posx, int posy, int radiusvalues, bool fixX=false, bool fixY=false); private: signals: void updateSticks(int x, int y); public slots: void updatedSticks(int t, int y); };@ @Joystick::Joystick(int x, int y, int radiusLimitParam, bool fixX, bool fixY) : QGraphicsEllipseItem(0, 0, 100, 100) { //... //do stuff //... stick = new StickItem(this, fixX, fixY); }@ @class StickItem : public QObject, public QGraphicsEllipseItem { Q_OBJECT public: Stick( QGraphicsItem * parent = 0, bool fixX=false, bool fixY=false); private: signals: void updateSticks(int x, int y); };@ @int main(int argc, char **argv) { QGraphicsScene scene; QGraphicsView view(&scene); left = new Joystick(/*...*/) right = new Joystick(/*...*/) scene.addItem(left); scene.addItem(right); //... //do stuff //... return app.exec(); }@ My last doubt (I hope lol) is how I should set the Joystick position and size instead of use the fix values? Instead of QGraphicsEllipseItem(0, 0, 100, 100) can I create it with all zeros, and after set the position and size? something like: @Joystick::Joystick(int x, int y, int radius, bool fixX, bool fixY) : QGraphicsEllipseItem(0, 0, 0, 0) { this.setRect(x,y,radius,radius) //... //do stuff //... stick = new StickItem(this, fixX, fixY); }@ To change the height and width of the ellipse it is normal to use setRect?
  • 0 Votes
    4 Posts
    3k Views
    A
    You could just put them both inside another widget, and put them in a layout together...
  • Swipe in Listview

    5
    0 Votes
    5 Posts
    4k Views
    A
    Perhaps this can be an inspiration? http://labs.qt.nokia.com/2008/11/15/flick-list-or-kinetic-scrolling/
  • Using standard local socket code with QLocalServer

    2
    0 Votes
    2 Posts
    2k Views
    L
    after messing around a bit, I did get this to work. my initial coding attempt must have had an error. a standard linux PF_LOCAL socket can connect to a Qt QLocalServer
  • Excel Groups with Qt

    10
    0 Votes
    10 Posts
    4k Views
    O
    Understood
  • Inverting mask example

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    8 Posts
    4k Views
    I
    qRegisterMetaType() registers type with namespace prefix, if any. You can't change it. qRegisterMetaType (const char *typeName) allows to set particular name, so you can register type w/o namespace prefix
  • Anchor layout QGraphicsView

    11
    0 Votes
    11 Posts
    5k Views
    T
    I just moved to this "thread":http://qt-project.org/forums/viewthread/16310/.
  • Trouble with mouse events over graphicsview inside mdiarea subwindow

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • List Widget with icon view enabled - large number of images solution

    5
    0 Votes
    5 Posts
    5k Views
    A
    Ok, gonna learn this stuff well :) Thanks. I'll post back if I came with any problem regarding qt!
  • Display images in a Windows

    6
    0 Votes
    6 Posts
    3k Views
    G
    You may also consider using QGraphicsView. Create a set of QGraphicsPixmapItem from your resource images. Set proper size for them, put into layout (i.e. "QGraphicsGridLayout":http://qt-project.org/doc/qt-4.8/qgraphicsgridlayout.html) or align manually and you're done.
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] Memory operations in QList..

    6
    0 Votes
    6 Posts
    3k Views
    A
    Yes, i have already done it. thanks... :)
  • Mouse events disappearing for non-Qt window on windows [Solved]

    6
    0 Votes
    6 Posts
    3k Views
    jensen82J
    Congratz and thumbs up! :-)
  • How to create back function using Qt

    8
    0 Votes
    8 Posts
    3k Views
    A
    You got tips, do something completely different, dump a large piece of code without explaining what that code is supposed to do, and then ask for comments... That simply isn't an effective way to solicit help. Read Eric Steven Raymonds "article on how to ask questions":http://www.catb.org/~esr/faqs/smart-questions.html if you don't understand the above.
  • How to make signal slot work faster

    4
    0 Votes
    4 Posts
    2k Views
    A
    One more observation is when I move mouse over this QWebView , my GUI therad process all the pending signals immediately, Not able to understand why mouse move causng my GUI thread to wake up and process all the pending singlas qucikly!!!!!!! Please advice some way!!!!!!
  • QProgressDialog won't block user inputs in MainWindow before it appears

    2
    0 Votes
    2 Posts
    2k Views
    D
    IMO, you can show another Model dialog(frameless and very small) during this time.
  • BindTexture crash in release version

    2
    0 Votes
    2 Posts
    2k Views
    D
    I'm just bumping to say that I found a solution. Apparently it was glActiveTexture that caused the problem. I used GLEE instead of QGLFunctions and it started working.
  • [SOLVED] how to overlap widgets

    5
    0 Votes
    5 Posts
    28k Views
    P
    Thanks, that certainly makes life easier!
  • MacOS ODBC issue

    2
    0 Votes
    2 Posts
    2k Views
    R
    https://bugreports.qt-project.org/browse/QTBUG-25260 I have found walkaround for this issue (see bug description).