Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • [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
    943 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
  • How can set QTabWidget tabs in a certain order?

    14
    0 Votes
    14 Posts
    14k Views
    E
    [quote author="betmens" date="1333654853"]It's impossible :) [/quote] Yes, it's possible! ;) You must iterate through list from the end to the begining. Here is the example (maybe will be useful for somebody, if it's to late for you): @ QStringList list_default, list_user; int i, n, from, to; list_default<<"0"<<"1"<<"2"<<"3"; list_user<<"2"<<"0"<<"3"<<"1"; n = list_user.count() - 1 for (i = n; i > -1; i--) { list_element = list_user[i]; to = i; from = list_default.index(list_element); list_default.insert(to, list_default.pop(from)); // keep default list consistent tb_main->moveTab(from, to); } @ Sorry for the possible program syntax errors (line 11 maybe), in above example - most time I programming in PyQt, so I am not much familiar with C++ & Qt...
  • Phonon module in Qt4 and Qt5

    4
    0 Votes
    4 Posts
    4k Views
    A
    Thanks for reporting.
  • Signal slot crash with static object

    2
    0 Votes
    2 Posts
    2k Views
    C
    What crash? Once I provide and empty implementation for the missing destructor, slot,and Connect() function and a do nothing main() the code compiles and runs without error. You need to rebuild the program am run it in a debugger. When it crashes look at the backtrace to find out what is causing it to die.
  • QT creator font rendereing on Linux

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Making a floatable widget in Qt

    11
    0 Votes
    11 Posts
    3k Views
    A
    Use QWidget::frameGeometry() to get the size and position of the window including the surrounding decorations.
  • Itemview

    9
    0 Votes
    9 Posts
    3k Views
    A
    [quote author="Immii" date="1341867904"]I am wondering how can i use Qt::userRole here.[/quote] Not at all. Why do you make it so difficult for yourself? The proxy method really is the simplest route. An alternative could be to "just" create your own QHeaderView subclasses and render the headers yourself without using the model at all, but it is a much more complex route than using a trivial proxy model. And no, trying to use a delegate on the header is not going to work either.
  • Singleton on Qt.

    9
    0 Votes
    9 Posts
    7k Views
    D
    This fix my problem! Thanks!