Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Connecting to db

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • QListWidget. How to set column count.

    7
    1 Votes
    7 Posts
    31k Views
    M
    Because a QTreeWidget behaves more like a List than QTableWidget. For example you do not have to care about hiding the gridlines (which you normally do not want to see in a list). Also in a tree you have one Item per Row, in a QTableWidget there's one Item per Cell... but in a usual list, you work row-based. As you said, a table can of course be configured to look like a list, but a tree can be configured to look like a list with less coding and behaves more like it is expected (at least by me) from a list...
  • How to send TCP RST (Reset) packet ?

    13
    0 Votes
    13 Posts
    19k Views
    F
    bq. And how do you think I figured out I needed to send a TCP RST to the device to start with? I thought you were referencing a software manual. We are all here to help you, not to point at you. I do not yet understand what currently the host and what the device is and why one of them absolutely needs a RST. So a better description of platforms is very appreciated.
  • [Solved]How to avoid Gap/Space between my custom widgets ?

    25
    0 Votes
    25 Posts
    11k Views
    C
    Thank you Sam for your information ,i have edited my title as Solved.
  • QSlider problem on OS X - bug in Qt?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Loop for ui object

    4
    0 Votes
    4 Posts
    2k Views
    L
    @ for (int i = 1; i <= 8; i++) { QListWidget widget = findChild<QListWidget>(QString("l%1_mono").arg(i)); if (widget != 0) { widget->addItem(item2, 0); widget->addItem(item3, 1); widget->addItem(item1, 2); } } @ Brain to terminal.
  • [Solved] Question on QDate

    3
    0 Votes
    3 Posts
    2k Views
    E
    Yes, that did it. Thanks for the help.
  • [Solved] How to stop a program if some criteria is not met

    9
    0 Votes
    9 Posts
    4k Views
    M
    bq. Thank you all a lot and sorry for wasting your valuable time. It's not a problem :-) That's what we're here for! Glad you got it working. Please be sure and go back and edit the thread's original post and prepend [Solved] to the beginning of the title. Thanks!
  • QNetworkAccessManager is blocking all signals.

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Table and Forms to edit records

    6
    0 Votes
    6 Posts
    2k Views
    F
    AFAIK those books (found at your link as well) provide less complex examples on how to use the model/view with SQLTables in comparison to the mentioned above or at least getting started with Qt. You may also have a look at the QT documentation, there you will find code snippets that might help your code get running. Maybe "this":http://doc.qt.nokia.com/4.7-snapshot/qsqltablemodel.html#details is a starting point for a small table example.
  • [Solved]How to call userdefined function from StyleSheet?

    10
    0 Votes
    10 Posts
    4k Views
    W
    Thanks Andre, that makes it more clear for me. So the only approach to add more dynamic is the pre-parsing mechanism. That helps yo understand stylesheets more. Thanks again!
  • Showing long message in status bar

    3
    0 Votes
    3 Posts
    3k Views
    L
    As Andre already said the status bar is not meant to display long text. Another option would be putting a label in the status bar to display a short summary of the text and having a tooltip set on the label, which shows the longer text.
  • SetExtraSelections in QGraphicsTextItem

    1
    0 Votes
    1 Posts
    944 Views
    No one has replied
  • About window

    7
    0 Votes
    7 Posts
    8k Views
    A
    [quote author="raaghuu" date="1341998381"]You can create the custom about box as follows: @ QMessageBox::about(<parent-widget>,<window-title>,<window-text>) @ [/quote] Doh! I completely missed that one... So yes, there is a default standard about box provided by Qt.
  • Embedding hidden information in a QTextDocument

    3
    0 Votes
    3 Posts
    2k Views
    A
    My fault, I looked up the destructor for QTextDocument without checking the base class.
  • How to make a JS property assigned a function?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • QDbus: Service Call Returning QList<int>

    2
    0 Votes
    2 Posts
    2k Views
    K
    I figured this problem out. I posted the answer on SO, but wanted to include it here as well. So apparently everything was configured correctly. However, when trying to retrieve the data, instead of doing: @qDebug() << buddies.argumentAt(0).toList().size();@ I should have been doing: @qDebug() << QString::number(buddies.value().size());@ To retrieve the individual ids @foreach(int id, buddies.value() ) qDebug() << QString::number(id); // or simply QList<int> ids = buddies.value();@
  • Resizing QToolButton and QListView without them overlapping

    12
    0 Votes
    12 Posts
    5k Views
    sierdzioS
    Based on my code, just to show what is needed to make it work: @ QRect temp = ui->verticalLayout->geometry(); // That is our main layout temp.setWidth(temp.width() * 2); // We make it bigger temp.setHeight(temp.height() * 2); ui->verticalLayout->setGeometry(temp); // Reset layout's size this->resize(ui->verticalLayout->geometry().size()); // update MainWindow ("this" in this case points to a MainWindow :) ) @
  • QFile write to front

    10
    0 Votes
    10 Posts
    5k Views
    M
    I think for your scenario, that's probably about as efficient as you can hope for. There are always trade-offs in these kind of situations (size vs speed, etc..)
  • Which models can be used with QDataWidgetMapper?

    3
    0 Votes
    3 Posts
    1k Views
    D
    Wow, it's true, sorry. That's a I-should've-thought-about-it inheritance issue. Thank you for your kind answer