Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Adding some path to a QListView

    5
    0 Votes
    5 Posts
    3k Views
    A
    If you want to use QList_View_, then you are using it with a model, a QAIM subclass. If you want to add something to the displayed list, you have to add that piece of data to the model. The view will then display it. You are not telling us what type of model you are using, so it is hard to tell you how to do this. In your small code sample, you are trying to do something that looks more like how you would work with QListWidget. That will not work. Perhaps your model is a QStandardItemModel? In that case, you can add a new item to this model with a syntax that looks a bit like what you are trying to do.
  • [SOLVED] client can't disconnect user from server

    2
    0 Votes
    2 Posts
    2k Views
    K
    i found what i was looking for. the disconnectFromHost() disconnects the client from the host.
  • QRubberBand + QGLWidget + Transparency

    2
    0 Votes
    2 Posts
    3k Views
    V
    I also found "this answer":http://developer.qt.nokia.com/faq/answer/is_it_possible_to_have_transparent_qt_widgets_on_top_of_a_qglwidget, but it sounds old or false.
  • QList<QLabel *> static or dynamic?

    6
    0 Votes
    6 Posts
    5k Views
    B
    great. thank you for your replies.)
  • Help on QDialog Position

    3
    0 Votes
    3 Posts
    7k Views
    G
    If the new window is a top level window, you have to use global coordinates. that means: @ CMyDialog dlg; dlg.show(); QPoint ptGlobal = ui->pushButton->mapToGlobal(QPoint(0, ui->pushButton->height())); QPoint ptLeftTop = mapToGlobal(QPoint(0,0)); QPoint ptFrame = frameGeometry().topLeft(); ptGlobal += (ptLeftTop - ptFrame); // add border size dlg.setGeometry(QRect(ptGlobal, dlg.size())); dlg.exec&#40;&#41;; @
  • When does an emit start the method to service it?

    5
    0 Votes
    5 Posts
    3k Views
    G
    Slots can be executed immideatly or queued, depending on the connection and the thread appearance. By default, connections are auto connections, which means, if the objects live in the same thread, they are direct connections. direct connections are like direct function calls. If the objects live in different threads or you specify QueuedConnection in the connect statement, the signal is queued to the event queue and executed in the next queue iteration (message Loop). To specify a connect type, use the following connect statement: @ connect (sender, signal, receiver, method, Qt::QueuedConnection); @ "see QObject::connect":http://doc.qt.nokia.com/4.7/qobject.html#connect
  • [solved] How to rebuild qt on windows without CRT dependences?

    3
    0 Votes
    3 Posts
    3k Views
    R
    thank you - i haven't known about this article before.
  • QTableView

    6
    0 Votes
    6 Posts
    3k Views
    A
    How could it do anything? After all, it does know nothing about how in your subclass the data will be stored...
  • Geometry, Layout and Policy: a good tutorial?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Is it good practice to keep data as a member of model?

    7
    0 Votes
    7 Posts
    4k Views
    M
    I think, though, that there are some notable exceptions. For instance, if I'm writing a quick-and-dirty app where I need to expose fairly simple C++-related data to QML or something, I don't have a problem with including data in the model itself. However, this is generally only in the cases where it's not a huge project, and when I don't expect scalability or maintenance to become a major factor. It kind of depends on the application itself, I think.
  • QToolBox and currentChanged() signal

    10
    0 Votes
    10 Posts
    5k Views
    N
    Thanks a lot for the replies! Thinking about this more, I came up with this "model", please correct me if I'm wrong: If Qt doesn't open some "background" threads on its own, there is only one thread dealing with the GUI (in my code). Thus, no race condition can happen since only one method (whether one of mine or Qt's internal stuff) can be executed at the time within one thread. In that sense using QTimer or sending an event into the queue makes no difference since once the signal is delivered to a slot for processing no other event will be handled (as we are in the same thread)? Or is there more to this story? (currently reading the article :))
  • QVideo and AVI Formats

    3
    0 Votes
    3 Posts
    4k Views
    E
    Yes, i've just installed k-lite codec pack, and this still doesn't work. Do you have any example of working "avi" VideoPlayers? Thanks :)
  • Find length of QString text. [SOLVED]

    6
    0 Votes
    6 Posts
    30k Views
    A
    I am just wondering what you are trying to achieve at all. To me grids of buttons filled from a database bring back scary memories of - dare I say it? - calendars. Perhaps a button is not what you need for your UI at all...
  • Problem about Dynamic Language Translation

    3
    0 Votes
    3 Posts
    3k Views
    S
    This "FAQ":http://developer.qt.nokia.com/faq/answer/how_can_i_dynamically_switch_between_languages_in_my_application_using_e.g_ contains a complete example that illustrates how you can implement dynamic translation. You can follow the setup from that example to see if that helps getting the translation to work.
  • [SOLVED] Slide Animation and Layout

    2
    0 Votes
    2 Posts
    13k Views
    J
    The problem was solved by removing all @ self.layout.setSizeConstraint(QtGui.QLayout.SetNoConstraint)@ and by adding a @ self.dashboard.label.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Ignored)@ just before the animation starts.
  • [SOLVED] connect to the server message

    14
    0 Votes
    14 Posts
    4k Views
    L
    If there are any basic questions which prevent you from understanding most of the documentation feel free to ask. That's way better than having tons of specific questions and stumbling from one problem to another.
  • About QScript

    2
    0 Votes
    2 Posts
    3k Views
    B
    See "ECMAScript Reference":http://doc.qt.nokia.com/latest/ecmascript.html and "ECMA-262 specification":http://www.ecma-international.org/publications/standards/Ecma-262.htm.
  • Problem with appending to QVector, when QVector is a private field.

    6
    0 Votes
    6 Posts
    3k Views
    P
    Thanks for advice:) I heard about QStringList but I had never an opportunity to use it. However, I'll check QStringList out and mayby I'll make a switch in my project :)
  • Trouble getting going with Bazaar

    5
    0 Votes
    5 Posts
    2k Views
    T
    Hugues fixed this in the master branch. Thanks for the report!
  • QSS Styling a QToolBox's Page.

    11
    0 Votes
    11 Posts
    13k Views
    T
    Thanks for the notice, that was why it didn't work. By make the page transparent, I mean have a hole inside the QToolBox. And actually not a "hole" like 100% transparent but I would to set the transparency. For example, if you set the stylesheet with: @QToolBox QWidget[myProperty="true"] { background-color: rgba(0, 255, 0,20); }@ You'll see some green and the transparency are here too BUT still with the gray in background. Like if there is another widget to set!