Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Can't get lupdate to work

    Unsolved
    9
    0 Votes
    9 Posts
    3k Views
    Christian EhrlicherC
    @Odelphi Not thinking, reading and gathering information before assuming something.
  • QToolbar Extension Button Stylesheet

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    B
    AFAIK, there's no stylesheet for that button icon. A cheating way is to set the icon property by the object name written in the Qt source code. QToolButton#qt_toolbar_ext_button{qproperty-icon:url(your_custom_image_url)} But the icon will be reset when toolbar's orientation changed, so if your toolbar's orientation may change, you need to connect to orientationChanged signal and set the stylesheet again. Note: The above method may become invalid if Qt changes the source code in the future. Another way is to implement a QProxyStyle and set it to be the application's style. class MyProxyStyle : public QProxyStyle { public: QIcon standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override { if(standardIcon == QStyle::SP_ToolBarHorizontalExtensionButton) return QIcon("your_custom_image_url_for_horizontal"); else if (standardIcon == QStyle::SP_ToolBarVerticalExtensionButton) return QIcon("your_custom_image_url_for_vertical"); return QProxyStyle::standardIcon(standardIcon, option, widget); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setStyle(new MyProxyStyle); ... return a.exec(); } Note: This will work on all toolbars in the application.
  • Database is Open and is Valid but Server has gone away...

    Unsolved
    4
    0 Votes
    4 Posts
    730 Views
    Pablo J. RoginaP
    @U7Development said in Database is Open and is Valid but Server has gone away...: try is to detect the string error and check it, In addition to @JonB suggestion to use the reconnection setting, instead of checking the string you could check the error number (less error prone...) see this post
  • how to update widgets in a tabwidget

    Solved
    4
    0 Votes
    4 Posts
    516 Views
    M
    @mrjj Thank you Your answer was helpful and understandable. I changed the .h - file to: ui->tabWidget->addTab(&mydo, "Action_here"); and it works.
  • Nested images list in QWidget.

    Solved
    3
    0 Votes
    3 Posts
    232 Views
    August WienerA
    @SGaist thanks alot!
  • This topic is deleted!

    Solved
    3
    0 Votes
    3 Posts
    4 Views
  • Multiple threads calling same function

    Unsolved qthread qthreadpool qtconcurrent multithreading
    7
    0 Votes
    7 Posts
    2k Views
    SGaistS
    Looks like you are re-implementing tools that already exist for that purpose. Was tmux/xpanes considered ? In any case, before doing any threading, you should have a proper encapsulation for your connection and command sending. Once you have that you can start thinking about threads or maybe use QtConcurrent. It looks like you rather have lists of commands to send to machines. A bit like what ansible manages for you with its playbook.
  • Can't show() QWindow when it was hidden with cmd + h on MacOS

    Unsolved
    4
    0 Votes
    4 Posts
    326 Views
    SGaistS
    I currently do not know whether the CMD+H action provides any feedback to the application. Your workaround was what came to mind. Glad it is working.
  • Set "socketTimeout" option to QSqlDatabase connection(PostgreSQL)

    Solved
    2
    0 Votes
    2 Posts
    444 Views
    Christian EhrlicherC
    The Qt PostgreSQL driver does not use the PSQL jdbc driver but libpq: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
  • QT Creator launching on windows 10 32-bit

    Solved
    12
    0 Votes
    12 Posts
    4k Views
    mrjjM
    @F-ran-z Im glad it worked. QtCreator can be used with any version of Qt installed so it's not really tied to any version but I have not tried to replace the included one with an other one but it seems to just work so that is good. Happy course :)
  • Getting QHelpContentWidget QUrl with Single-Click

    qhelp
    4
    0 Votes
    4 Posts
    1k Views
    A
    Thanks for this. It was really helpful. I couldn't get it to work with your syntax for connecting the signal and slot but the code below worked for me. Not sure if something has changed over the years - I am v new to Qt. connect(contentWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(testSlot())); void HelpWindow::testSlot() { QModelIndex testIndex = mpHelpEngine->contentWidget()->currentIndex(); QHelpContentItem *item = mpHelpEngine->contentModel()->contentItemAt(testIndex); QUrl testUrl = item->url(); ui->textBrowser->setSource(testUrl); return; } Of course the testSlot function needs to be added to the Slots in the .h file. Hope this helps someone out there
  • Get the writing system for the application font?

    Unsolved
    4
    0 Votes
    4 Posts
    496 Views
    R
    Now I am going ahead by adding an attribute to the configuration file which explicitly matches the writing system with any language which can be selected. The user can change the language as well as the application font in the settings dialog. If the current font is compatible with the new language selected, it will continue to be used; otherwise, the system font will be used, and the user will be prompted to choose a different font if so desired. It would be better to query the system for an appropriate writing system, however. Therefore, I am not marking this as solved just yet.
  • GLTFImporter and GLTFExporter support in 5.15

    Unsolved
    2
    0 Votes
    2 Posts
    216 Views
    Christian EhrlicherC
    It's a plugin for the import in 5.15 but can't find a documentation for it. There is no possiblity to export it from Qt though. https://code.woboq.org/qt5/qt3d/src/plugins/sceneparsers/gltf/
  • sending QHostAddress over Qt Dbus

    Unsolved
    4
    0 Votes
    4 Posts
    369 Views
    Christian EhrlicherC
    And are your calls visible to the compiler where you call qDBusRegisterMetaType? Please show the complete code - best in a simple main.cpp
  • 0 Votes
    16 Posts
    3k Views
    S
    @Pl45m4 I'll try this...changing it's position
  • Hiding the control in a layout and filling it with the other control

    Unsolved
    2
    0 Votes
    2 Posts
    242 Views
    Pl45m4P
    @thomasjohnaj widget2->setVisible(false); or widget2->hide(); Edit: You mixed the names in your image and in your description text. "Widget1 should stretch", but image label says "widget2" :) But doesnt matter... it's the same for every widget :)
  • 0 Votes
    13 Posts
    1k Views
    JonBJ
    @Pl45m4 I do see it as "wrong". The debugger shows, in two different places, that array1[2] is a char (value 'p') and it is a char * (value "strong"). That's just plain "wrong". And btw I don't think this has anything to do with "QtC debugger", Qt Creator just gets its information from the debugger, so (I assume, though untested) this is 100% a gdb vs MSVC issue.
  • How to add QShortcut to QWindow?

    Solved
    3
    0 Votes
    3 Posts
    271 Views
    A
    @SGaist Whops, I completely missed that. It's still a wrapper, I see, but at least the ugly details are hidden from my eyes. EDIT: It still is unclear to me why a QWindow shouldn't also have shortcuts (I certainly don't see technical reasons), but for my purposes, the answer is quite sufficient.
  • sending QMap<enum, QString> over Qt DBus

    Unsolved
    1
    0 Votes
    1 Posts
    443 Views
    No one has replied
  • 0 Votes
    1 Posts
    106 Views
    No one has replied