Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • QML - Unable to set the spinbox text color

    Solved
    3
    0 Votes
    3 Posts
    720 Views
    P
    @raven-worx Thank you very much! I must have missed this piece of documentation.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Closing a QDockWidget While the User is Actively Resizing It

    Solved
    8
    1 Votes
    8 Posts
    585 Views
    N
    @Pl45m4 I want to close this out for future devs looking for the right answer. The above solution is run before dockwidget->hide() and deleteLater(). We aren't ever undocking the dockwidget here. As far as I understand, my solution sends an event to the QMainWindow telling it the left mouse button was released, and the mainwindow responds accordingly, in this case, it ends the resizing of the dockwidget. The reason we send the event to the qmainwindow is that it is in charge of the dockwidget separators; I figured this out from some inspection of the source code and searching online. Also notably, the pointer to our parent qmainwindow is guaranteed safe in my implementation. The code that closes the dockwidget is running in the scope of the qmainwindow and we are just using 'this'. It might be dangerous to use this code within the scope of the qdockwidget and get the pointer to the parent with parent().
  • how to change the qtversion in shell/default for system

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    pgiovanniP
    @ChrisW67 ok i copied that exactly, and it actually changed the output of the error code. So I think it actually worked. There were some other errors involving cmake. But I contacted the devs of the kdeconnect app and they suggest I use something called craft to build the application and test changes to code. I'm gonna leave that last post as the solved answer, because it did work.
  • Horizontal Spacer expanding incorrectly

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    JoeCFDJ
    You can also try to align G label to left when it is added to the layout. something like: layout->addWidget( g_label, 0 , Qt::AlignLeft ); In this case, spacer may not be needed at all.
  • Qpixman makes gui run slow

    Unsolved
    9
    0 Votes
    9 Posts
    438 Views
    SGaistS
    @Garza said in Qpixman makes gui run slow: @SGaist currently I'm just calling this function and not handling what you mentioned. Will have a look at it. Does image size is an issue? is 2048x1280. It depends on: At which pace do you load them ? file compression level storage type and speed if network, network speed your machine specification
  • Getting Loading percentage of Program Startup?

    Solved
    5
    0 Votes
    5 Posts
    346 Views
    JoeCFDJ
    @BDC_Patrick You can launch your app(GUI) quickly while throwing loading of files into a thread.
  • QTableView how to selectRow, highlight and fire select event?

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    JoeCFDJ
    void QAbstractItemView::setCurrentIndex(const QModelIndex &index) does this help?
  • QT OPC UA with open62541 backend, encryption

    Unsolved
    2
    0 Votes
    2 Posts
    459 Views
    mrjjM
    Hi I think its something with the QtOpcUa plugin as when I tried using open62541 API directly it worked but I was not able to get working using the Qt API. But I didn't find out why exactly and for my use case, using the native API was ok. If you dont get any answers here I would ask on the mailing list. https://lists.qt-project.org/
  • Font Scaling on High DPI Linux displays

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    D
    In my main routine I added to following 2 lines int main(int argc, char *argv[]) { // Set up High DPI Scaling QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling,true); std::cout << "Enable High DPI Scaling to " << (QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling) ? "true" : "false") << std::endl; // Existing Code QApplication a(argc,argv); // rest of main } I still saw the same font scaling and clipping issue. As a possible alternative, I tried swapping out the AA_EnableHighDpiScaling with AA_Use96Dpi, but that did not change anything. Dale
  • Questions about Windows notifications in Qt

    Unsolved
    9
    0 Votes
    9 Posts
    732 Views
    C
    @mrjj That is unfortunate .... anyway thank you for the help ! I will investigate this library. I already tried something similar in Python without success. Hoping this one will work. For now I keep this topic open just in case someone find a solution to this issue.
  • expose mutiple enum from one class to QML

    Unsolved
    2
    0 Votes
    2 Posts
    300 Views
    raven-worxR
    @javs IMHO this is rather bad design to have different enum valueswith the same name. Better add State/Action to the enum value names.
  • How Can i get array in another class

    Unsolved
    46
    0 Votes
    46 Posts
    8k Views
    CP71C
    @dziko147 You are welcome! :)
  • Replacing subjectDisplayName() by issuerInfo, keeping the same behavior

    Unsolved
    7
    0 Votes
    7 Posts
    349 Views
    P
    Ok great, I'll keep you posted. Thanks for the help and have a nice day.
  • How to save and load image in qt

    Unsolved
    11
    0 Votes
    11 Posts
    770 Views
    jsulmJ
    @UG-SEP An alternative would be to encode the image content as BASE64 and put this BASE64 string in your text file. But I would not do this for bigger images.
  • QChart Yaxis quits adjusting with small numbers

    Unsolved qchart yaxis scaling
    4
    0 Votes
    4 Posts
    881 Views
    S
    As a workaround, it seems you can setRange(0,1) then add the axis to the chart, then call setRange(realMin,realMax) and the chart is drawn properly.
  • Qt disable clicking on the left corner icon

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    K
    @Chris-Kawa Okey, I know that this is a windows stuff, and thanks for you help.
  • QFLAGS : signed value is out of range for enum constant

    Unsolved
    18
    0 Votes
    18 Posts
    2k Views
    jsulmJ
    @MNGL @KroMignon asked you whether your enum really has to contain bitfields: means 2^x values (0001, 0010, 0100, ...). If this is not required then use just normal numbers, then your range is what an int provides and is for sure enough.
  • QTransposeproxymodel rewrite?

    Unsolved qtransposeproxy
    4
    0 Votes
    4 Posts
    214 Views
    F
    Thanks guys so far! Maybe I am in less trouble than I thought (see @VRonin s comment) I am not 100% sure to be honest. I am going to implement a new Dialog where I will realy need the transposed view. Maybe then it is easier to understand for me what the problem is or if there is no real problem... :-) I leave this ticket open if thats ok
  • SIGNAL AND SLOTS

    Solved
    10
    0 Votes
    10 Posts
    644 Views
    J.HilkJ
    @AlexandruToma first of, I'm glad that you were able to solve your problem, and also thanks for sharing the answer, not something everyone does. If I already have all ui components created and styled in one window, it s like a reuse of code, I didn't copy/paste something from web, was my code and I knew what I am doing, when I move all ui components. I just miss that line because in c++ I didn't use that line. You were not trying to help me here, just make fun of me as i copy and paste code. I understand there are many people doing this, but it s not fair to treat all of us like that. to address this: I never said, nor assumed you copied anything from the internet. you said: when I added new window ... signal and slots stop working and on the question "Moved" in which way? you answered: I moved (ctrl+x) all components with their implementation from centralwidget(QMainWindow) into other window. That plus the actual connect call, is all the information we have to go on with. That is not a lot of information. For example had you posted more code of your class in the opening post, @Pl45m4 or @JonB would have easily spotted the missing slots macro Which by the way is a copy and paste error on your part. And, had you, like we suggested, used the new Qt5 Signal/Slot syntax the problem would have gone away, as it does not require the slots macro any longer. Btw, the Qt4 connect statement you used, should have provided the following message during runtime: QObject::connect: No such slot Mainview::TextChanged() in .... which would have been nice to know as well, as it would have made the error obvious. If anything, take this with you: Don't be discouraged to ask for or provide other in this forum with help. If you ask a question, provide as much information as possible, ideally a code example or even better, a minimal compileable example. The more the better! treat warnings as errors (-Werror) Change over to the new signal/slot syntax, it makes life easier Think positive 😄