Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 0 Votes
    13 Posts
    9k Views
    A
    That is a good suggestion, and is probably the fastest code path. I did not think of using find() in such a scenario.
  • [Solved]help serializing a QMultiHash

    7
    0 Votes
    7 Posts
    3k Views
    A
    Doh! I guess we have all been in similar situations. I certainly have!
  • Code for Click on QLabel!?

    16
    0 Votes
    16 Posts
    20k Views
    A
    hi again flat property was grate. :) thanks to all about help me in this case . Best regards
  • 64 bit problem when compile

    4
    0 Votes
    4 Posts
    1k Views
    L
    I have solved with QT # -= gui
  • [SOLVED]How do I know that the window is fully displayed on the screen

    8
    0 Votes
    8 Posts
    4k Views
    E
    Greate. This solution more suitable for me. Thanks to all.
  • Using QSvgRenderer with QGraphicsObject, image is to large

    2
    0 Votes
    2 Posts
    2k Views
    E
    I found the missing element. When rendering I used the default bounds of the render method. This seems to be the bounds of the painter, and expected it to be the at least related to the SVG information. The display is correct when adding a second parameter: @renderer->render(painter, renderer->boundsOnElement(QLatin1String("layer1")));@ It works now, but it still seems a bit strange. Wouldn't it be better if the default bounds was the size of the image?
  • Child dialog in a mail dialog.

    19
    0 Votes
    19 Posts
    7k Views
    A
    [quote author="fluca1978" date="1323178212"]I'm totally unable to understand what you are trying to achieve...[/quote] Hence the request to send a sketch that we can look at...
  • 0 Votes
    6 Posts
    3k Views
    T
    thanks that one is suitable for me
  • Get Windows Terminal Server Session-ID

    15
    0 Votes
    15 Posts
    8k Views
    W
    [quote author="Gerolf" date="1323172406"]In windows it's the session ID, as each logged in user has an own session (also multi logins on win7 have own sessions, but no terminal sessions). However that works on Linux etc.[/quote] Yes, but is there any environment variable other way to distinguish Linux sessions?
  • QtNetwork on Windows by default with or without SSL

    9
    0 Votes
    9 Posts
    7k Views
    W
    Volker, you are a genius, that worked like a charm. Thank you very much!
  • Getting error in encoding data?

    7
    0 Votes
    7 Posts
    2k Views
    G
    The literal string "could not decode" is not used in Qt sources (with an exception of phonon sources, which do not apply here). I don't see any connection to Qt at the moment. Oh, and BTW: decoding usually is done in a read step. Your snippet just writes...
  • How can we set restriction to .ini file?

    18
    0 Votes
    18 Posts
    9k Views
    G
    [quote author="pratik041" date="1323146684"] can we store general text information using QResource and it can be compiled into binary.Can you give some example of that? [/quote] Qt resources are just a storage container for regular files. You can put into that whatever you want. For examples, see the documentation.
  • [Solved] FlowLayout in a QScrollArea

    3
    0 Votes
    3 Posts
    10k Views
    C
    Thanks for the help! The code you posted crashes the program during runtime since I never set a widget to the scrollArea (hence scrollArea->widget() returns 0). However, the solution was similar. The solution was to create a custom widget that holds the flowLayout and set that as the QScrollArea's widget. Code for future reference (hi there, people of the future!): @ QScrollArea *scrollArea = new QScrollArea(); scrollArea->setWidgetResizable(true); // Important or else the widget won't expand to the size of the QScrollArea, resulting in the FlowLayout showing up as a vertical list of items rather than a flow layout scrollArea->setWidget(<name of custom widget>);@ Custom widget constructor: @ // Create FlowLayout FlowLayout *flowLayout = new FlowLayout; // Populate FlowLayout with QLabels for (int i=0; i<gamelist->size(); i++) { QLabel *label = new QLabel(gamelist->getGame(i)->getTitle()); flowLayout->addWidget(label); } setLayout(flowLayout);@
  • [SOLVED] Visual Studio and Example Program = Debug Assertion Failed

    8
    0 Votes
    8 Posts
    8k Views
    E
    Understood, Thank you very much, Hugo Ribeira
  • How to save style before changing it?

    21
    0 Votes
    21 Posts
    8k Views
    A
    Quite a thread, for such a simple question! My main issue is that my application is a little schizophrenic: Within the main window's client area, it is a simulation of how it would run on the embedded device, with a corresponding style. Outside that (the menu bar, dialogs that are only used on the PC), it should look and behave like a good desktop application. I need the style that is used on the embedded device to properly test the configuration on the PC. On the other hand, I need the dialogs and menus to at least work in the PC. Setting the style manually on the widgets that should have the "PC style" sounded like the best approach. However, I have found out that my main troubles did not come from the style at all...it came from the palette. Somehow, I implicitly assumed that the palette would be part of the style. It is not. So I could solve most of my troubles by copying the palette before changing it, and setting that palette on the "PC widgets". Fortunately, a palette can be copied easily. Thanks all for discussing and making suggestions!
  • Generating XML in Qt

    5
    0 Votes
    5 Posts
    2k Views
    K
    Qt has a whole QtXml module with a bunch of classes for DOM and SAX support
  • [Solved]Swedish sp letters

    5
    0 Votes
    5 Posts
    3k Views
    T
    Thank you for your answers. I think that this is a problem I have to solve with the Andre solution
  • QTreeView sorts but not QTableView

    7
    0 Votes
    7 Posts
    5k Views
    S
    The following lines were causing the issue: [code] // set the header settings Qt::Orientation orientation(balanceView->horizontalHeader()->orientation()); QHeaderView *headerView = new QHeaderView(orientation, this); headerView->setHighlightSections(true); headerView->setMovable(true); balanceView->setHorizontalHeader(headerView); [/code] It's interesting that setting the header view to its same settings (even if I comment out only the setHighlightSections and setMovable line) will still cause it not to sort. I just discovered the following will work instead, so I'm good with the movable and sortable columns. [code] // set the header settings balanceView->horizontalHeader()->setHighlightSections(true); balanceView->horizontalHeader()->setMovable(true); [/code] These properties have been in the code for a while so I forgot that they were there. Sorry I didn't try this earlier. Thanks for your assistance and info!
  • [SOLVED]MS Word file - PrintOut method

    3
    0 Votes
    3 Posts
    6k Views
    B
    I want the document to stay in my main window. So my code for opening the document: @ WordDocument=new QAxWidget ("Word.Document", this-> ui-> centralWidget); WordDocument-> setGeometry (QRect (10, 10, 621, 471)); WordDocument-> setControl ("D:/c.docx"); WordDocument-> show (); @ And I have a PushButton for printing : @ void MainWindow::on_printButton_clicked() { WordDocument->querySubObject("PrintOut()"); } @ It works perfectly unless I modify the document. If I type something to the document, and try to print it gives these errors : QAxBase: Error calling IDispatch member PrintOut: Exception thrown by server Code : 4605 Source : Microsoft Word Description: Bu y?ntem veya ?zellik kullan?lamaz. ??nk? bu belge, ba?ka bir uygulama program? taraf?ndan d?zenleniyor. (meaning: this method or property could not be used, other application is editing ...) Help : C:\Program Files\Microsoft Office\Office12\1055\WDMAIN11.CHM [37373] Connect to the exception(int,QString,QString,QString) signal to catch this exception
  • PyQt: Combobox with checkable items (no external libs)

    4
    1 Votes
    4 Posts
    6k Views
    B
    I solved the problem - the custom model with checkstate role supported was working all along. It turns out checkboxes were just not being rendered when using Gnome under Ubuntu (10.04). Checkboxes are rendered correctly when using KDE or Windows XP. This must be a bug in Qt.