Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • [solved]QImageReader problem in console app

    3
    0 Votes
    3 Posts
    1k Views
    A
    Holly s... what a shame ;) yeah I had QT -=gui But... I compiled it earlier on Linux without any errors. Strange. :o Thanks a lot.
  • A Blocking Window

    4
    0 Votes
    4 Posts
    1k Views
    M
    No raaghuu, I am trying to making something more or less like cyber software.
  • MouseMoveEvent() how to set the refresh interval?

    5
    0 Votes
    5 Posts
    6k Views
    A
    I think my mousemoveevent is already lightweight because the if condtions are rarely satisfied: @void MatrixW::mouseMoveEvent(QMouseEvent *e) { if(thismove!=none) { int xnew=e->x()/larghcell; int ynew =e->y()/altcell; if((xnew!=xN||ynew!=yN)&&(xnew<size_x && ynew<size_y)) { if (isarelease) { isarelease=false; if (thismove==del) setcell(xN,yN,0); else if (thismove==add) setcell(xN,yN,1); } xN=xnew; yN=ynew; if (thismove==del) setcell(xN,yN,0); else if (thismove==add) setcell(xN,yN,1); update(); } } }@ (thismove!=none) only if the mouse is clicked ((xnew!=xN||ynew!=yN)&&(xnew<size_x && ynew<size_y)) is rarely true each 50-100 ms The good way to do this I think is to start a timer when the mouse was clicked, the timer call each 50-100ms a function like MatrixW::mouseMoveEvent(QMouseEvent *e) where the program can read the muose position. The mouse release event stop the timer. But I don't know how to read the mouse position in the function called by the timer continually read the mouse position would be the same as what I do now (about the slowdowns)
  • [Solved] Qt - What kind of images can qgraphicsview display?

    3
    0 Votes
    3 Posts
    3k Views
    N
    :) perfect, thank you so much!!
  • Setup a QGraphicsView with Bottom Left Coordinate origin ?

    3
    -1 Votes
    3 Posts
    4k Views
    X
    Cool but wouldn't all my Item inside the View been flipped as well ? as if I apply a scale(1,-1) to flip the y direction axis and then the transform to reset the origin . the "space" woulld be upside down ? would I have then to also scale(-1,1) all my childs item so they are the right way around ? I will do some test, I want to try to do it the correct way rather than "a way" that kinda works :) Thanks for your reply Damien
  • Put and animate a progress-bar in QTableView

    1
    0 Votes
    1 Posts
    7k Views
    No one has replied
  • Convert QList<int> to QString

    2
    0 Votes
    2 Posts
    19k Views
    L
    @ QList<int> list; QString string; ... ... ... for(int i=0; i<list.size(); i++) { string += QString::number(list[i]); if(i<list.size()-1) string += "," ; } @
  • Qt QFileDialog -- proper use under OSX

    10
    0 Votes
    10 Posts
    4k Views
    F
    No, sorry. I don't use Lion -- it has broken multi-monitor support, and as I have six monitors, I've no interest in it. Also sandboxing, certificating, etc. Lion is a regression as far as I'm concerned. I use Snow Leopard and Leopard in-house, and the errors I described here were discovered and exist under those: 10.5. and 10.6. Those are 10.6 (Snow Leopard) diagnostics in my post above. What you've managed to do, however, is confirm that the Qt bug is problematic under Lion / 10.7 as well, for which I thank you. :)
  • [Solved] Using nextId() in linear wizard

    3
    0 Votes
    3 Posts
    2k Views
    D
    I figured out why nextId() always returns -1. The reason is that I was using the nextId() in the constructor. Before the QWizardPage being inserted into QWizard, QWizard has no reason to know which page is the next page of current page. It's a stupid mistake. Sorry for disturbance.
  • Direction problem

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to prevent changing selection in QtableView, if the data is invalid?

    5
    0 Votes
    5 Posts
    3k Views
    R
    Thanks, I am looking for a similar solution. Since it is a table, and its validation depends on the current column, how to find the column number from the above approach? Or is it possible to similar programming for QtableView?
  • Error because of thread ..

    6
    0 Votes
    6 Posts
    2k Views
    F
    "you will have to use (asynchronous) signals and slots" --> Use Qt::QueuedConnection as the Qt::ConnectionType parameter of QObject::connect(...) parameter, to detach the threads.
  • Upgrade QGraphicsTextItem (and friends) to QGraphicsWidget?

    3
    0 Votes
    3 Posts
    2k Views
    A
    My best idea right now is to use a composition: A QGraphicsWidget containing the item I want. The tricky part is that one essential change notification (boundingRect changes) is missing, which makes things kinda awkward.
  • [solved] Something about listener...

    17
    0 Votes
    17 Posts
    7k Views
    A
    You're right, actually. It was a statement, not a question.
  • Qt .Xresources Equivalent

    4
    0 Votes
    4 Posts
    2k Views
    sierdzioS
    No, they are read at run-time, which actually makes them somewhat slow at times.
  • How to add a default value to QSqlTableModel

    2
    0 Votes
    2 Posts
    2k Views
    L
    There are two possibilites: provide a default value at database level (using a DEFAULT column constraint) provide a default value at code level, by connecting to "QSqlTableModel::primeInsert()":http://doc.qt.nokia.com/4.7-snapshot/qsqltablemodel.html#primeInsert
  • 0 Votes
    6 Posts
    2k Views
    A
    Find the main widget of your application. Usually, an instance is created in your main() function. Usually, it's constructor will have (lots of) stuff like: @ m_lineEdit = new QLineEdit(this); layout->addWidget(m_lineEdit); @ That is where the UI is constructed. moderator note: @ maplesyrup23, could you please edit your first post to give the post a normal title, and put the actual, complete question in the body of your message?
  • Linker error for signal declaration .

    5
    0 Votes
    5 Posts
    7k Views
    M
    Another mistake are your keywords: its not "signal" and "slot" but "signals" and "slots"... Is this really the original source-code? because this shouldn't compile at all, when I try to define a signal with "signal:", I get the following compiler-error: "Not a signal or slot declaration"
  • Problems with running the OpenGL Core Profile tutorial

    4
    0 Votes
    4 Posts
    5k Views
    V
    The tutorial says: "<...> it is required to bind a VAO before setting up the attributes. This behavior is part of the OpenGL 3.3 core profile." Add this in initializeGL before m_shader.setAttributeBuffer: @uint vao; typedef void (APIENTRY _glGenVertexArrays) (GLsizei, GLuint); typedef void (APIENTRY *_glBindVertexArray) (GLuint); _glGenVertexArrays glGenVertexArrays; _glBindVertexArray glBindVertexArray; glGenVertexArrays = (_glGenVertexArrays) QGLWidget::context()->getProcAddress("glGenVertexArrays"); glBindVertexArray = (_glBindVertexArray) QGLWidget::context()->getProcAddress("glBindVertexArray"); glGenVertexArrays(1, &vao); glBindVertexArray(vao);@
  • X Error: BadCursor

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied