Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.3k Posts
  • qmake generating bogus makefile

    Unsolved
    6
    0 Votes
    6 Posts
    438 Views
    D
    @JonB hi sure here it is: link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' processorArchitecture=''" /MANIFEST:embed /OUT:debug\tester.exe @C:\Users\server\AppData\Local\Temp\tester.exe.612.0.jom LINK : fatal error LNK1104: cannot open file 'C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib.obj' "C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32" is where i installed qt compiled from source. again the issue is that qmake is automatically adding C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib to the LIBS variable when generating the makefile but this is clearly a PATH not a library. The linker is therefore looking for lib.obj library which obviously does not exist here's the relevant section in the makefile: LIBS = C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Widgetsd.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Guid.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Cored.lib glu32.lib opengl32.lib gdi32.lib user32.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\qtmaind.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib shell32.lib
  • C++ - Application crashes at QsciScintilla auto complete

    Solved
    4
    0 Votes
    4 Posts
    552 Views
    J
    Oh... I figure it out. I think it's the problem of not using the pointer references. // QsciAPIs api(this); // crashes! QsciAPIs* api; api = new QsciAPIs(this); // Now it won't crash for (const QString &s : /**/) { ///... ///... ///...
  • How to set QComboBox menu background transparent?

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    H
    If you're okay with disabling the animation part of the drop down, it will prevent the black box from appearing. You do this through QApplication::setEffectEnabled: QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • use widget as a shared library and update gui from main (non-qt) application

    Unsolved
    3
    0 Votes
    3 Posts
    300 Views
    SGaistS
    @xiaoyingwang hi, it might be doable but it's not guaranteed to work on all platforms. See this Stack Overflow thread.
  • More MySql issues.

    Solved
    5
    0 Votes
    5 Posts
    394 Views
    C
    @Christian-Ehrlicher said in More MySql issues.: @Chrisw01 said in More MySql issues.: They have also been placed within the lib files of the compiler as well. Why? What should this help? I don't know where you put them, the important thing is that the libmysql.dll is found when the application is run - so adjust your PATH accordingly. And don't mix MSVC and MinGW libs & plugins. Honestly, I have been fighting this problem all week. Reading blog after blog after blog. I did not mix up the libraries. I followed MSVC instructions for MSVC and MinGW instructions for it. The problem appears to be where to place the libmysql.dll file so it can be seen within Qt Creator while I Develop. I know it needs to be in the application folder when you distribute. Previously placing the libmysql.dll file within the applications build folder satisfied this apparently not anymore. I managed to find a fix however. I added created a folder and placed the required files there. Then I added LIBS += -L"C:\MySql" -lmysql to my project file and the program now works. May or may not be the proper way to do it but it works. I have not had to do this in the past but again, I've taken a break from Qt for a while and things may have changed. Thanks for your help..
  • MacOS: Problem setting the App Icon

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    L
    @Lonsdaleite I created my own info.plist instead of copied the file generated with the xcode package for iOS and it solved the problem. Don't know why, but it works ! Thanks for you response. Little question for the end : i created an icon catalog assets which include both iOS and macOS Icon (required for iOS if i understand all ?). Can i use it for Mac bundle instead of .icns ?
  • QPrinter orientation problem

    Unsolved
    3
    0 Votes
    3 Posts
    808 Views
    M
    @JoeCFD I added: printer->setPageOrientation(QPageLayout::Portrait); And now it prints in Landscape!!! So no, did not help...
  • Segfault after removal of Q_OBJECT macro - what "other services" may fail

    Unsolved
    4
    0 Votes
    4 Posts
    440 Views
    J
    @Christian-Ehrlicher https://doc.qt.io/qt-6/qobject.html#qobject_cast Thanks. This is an excellent hint. There are indeed some qobject_cast in our code, in close vicinity to the classes that did not suffer Q_OBJECT to be removed.
  • Using translatable strings in a static library

    Unsolved
    4
    0 Votes
    4 Posts
    431 Views
    Christian EhrlicherC
    @Perdrix said in Using translatable strings in a static library: How should I modify that to also load the ts files starting with "kernel"? The same way - there is no difference, the only thing you have to do for static app is, as the doc says and you do - init the resources with Q_INIT_RESOURCE
  • Qt Creator 9.0.1 offline installer

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    A
    @ChrisW67 I dont get warnings, but plenty errors. It seems that the editor clang plugin does not recognize the qt library
  • Custom widget plugin not shown on plugins list (Windows)

    Solved
    3
    0 Votes
    3 Posts
    572 Views
    DragoonD
    @Dragoon yes... it was... using a precompiled QtCreator binary found here the plugin works. Nope it was not... the problem was the path of plugins directory. As QtCreator config file states the folder in which it search for plugins is the plugins\bin\designer subfolder of the QtCreator tool directory i.e. (in standard Windows installs): C:\Qt\Tools\QtCreator\bin\plugins\designer And not (as make install script like to think): C:\Qt\<release>\<toolchain>\plugins\designer BTW on Windows the plugin must be compiled as Release otherwise QtCreator will not load it but you will have an explanation on the: Tools->Form Editor->About Qt Designer Plugins dialog.
  • C2102: '&' requires I-Value

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    JonBJ
    @jorTry85 said in C2102: '&' requires I-Value: When i now try to comile it in QT Qt is not a compiler. You seem to be using MSVC compiler. That is where you you should be looking. I suggest you Google for C2102 and read e.g. the stackoverflow posts. It looks like you either change the compiler options ("disabling /permissive-") or better actually "fix". I believe it is telling you that those functions return a "temporary" object, so you shouldn't take its address, you should rather assign to a local variable and use that, or pass a const reference?
  • Can a widget be notified if it's parent changed?

    Solved parent & child signal & slot qdockwidget
    2
    0 Votes
    2 Posts
    678 Views
    bibasmallB
    I was looking for bool MyBaseClass::event(QEvent* e) { if (e->type() == QEvent::DynamicPropertyChange && qobject_cast<QDockWidget*>(parent())) //... }
  • QSystemTrayIcon tool tip not showing on mouse hover

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    A
    @SGaist, I faced the same problem on Ubuntu 20.04. I have Qt5 and Qt6 installed, in both versions toolTips are not displayed. However, in Windows 10 everything works without problems. Windows 10: [image: 1e3bfadc-2a1a-475d-be1a-dc214a2a252a.png] Ubuntu 20.04 [image: d589b262-f452-4fd5-9e36-6a55b7d550e4.png]
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    11 Views
    No one has replied
  • invalid style sheet error for QButton

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    jsulmJ
    @agmar C++ basics. What you wrote is not valid C++. A style-sheet is a string... And you also need to use https://doc.qt.io/qt-6/qwidget.html#styleSheet-prop if you want to set style-sheet in code.
  • Proper way for adding 2nd language

    Unsolved
    14
    0 Votes
    14 Posts
    923 Views
    Christian EhrlicherC
    @masa4 said in Proper way for adding 2nd language: But how will i change dynamically created widget's texts like this messagebox? Since you can't show a MessageBox and change the language simulatneously this shouldn't be a problem since the next time you call the message box you text is properly translated due to the tr() call. If you changed a text in your ui after setupUi() you have to do the same manually after the language change event. See the documentation.
  • QListWidget IconMode ,set selected style

    Unsolved
    2
    0 Votes
    2 Posts
    300 Views
    EmrecpE
    @wuj10n When adding QListWidgetItem to QListWidget, update QListWidgetItem flag like this listeWidgetItem.setFlags(listWidgetItem.flags() & (~Qt.ItemIsSelectable))
  • QDESIGNER_WIDGET_EXPORT macro usage

    Unsolved
    8
    0 Votes
    8 Posts
    514 Views
    DragoonD
    @Christian-Ehrlicher forget it I was editing the reply...