Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.6k Posts
  • Check state change only when mouse clicks on checkbox

    Unsolved qlistwidget mouse checkstate
    6
    0 Votes
    6 Posts
    4k Views
    A
    @nebulaekg It wasn't wrong, it was just the easy method. With easy comes very little customization. Now that you want to change it's behavior it becomes much harder. For simple lists you can definitely use the widget but for anything more you want a view/model and then delegates to control display. Check into it I'm sure you'll find it's not that much harder than the widget and will give you the control you want. :)
  • QCombobox dropdown list transparent QComboBoxPrivateContainer

    Unsolved
    3
    0 Votes
    3 Posts
    973 Views
    M
    @SGaist Hi, i'm using Qt 5.11.0, Window10 I'll try it your suggestion. Thank you.
  • How to get this icon's name?

    Unsolved
    17
    0 Votes
    17 Posts
    5k Views
    cloud21C
    @Cobra91151 Nice.
  • Dynamic color for a selected QTreeViewItem?

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    mbruelM
    Well I thought I tried... Then I was overriding the whole QPalette with the constructor with 9 QBrush... I've just test your code and it works if I remove any color from the stylesheet on QTreeView:item Thanks a lot! Here is my code: void TreeItemDelegate::initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const { QStyledItemDelegate::initStyleOption(option, index); option->textElideMode = Qt::ElideNone; TreeItem *item = static_cast<const TreeModel*>(index.model())->itemFromIndex(index); if (item) { QColor color = item->data(Qt::ForegroundRole).value<QColor>(); option->palette.setColor(QPalette::WindowText, color); option->palette.setColor(QPalette::HighlightedText, color); if (item->isLargeItem()) { option->font.setBold(true); option->decorationSize = QSize(24,24); } if (item->isReadOnly() ) option->font.setItalic(true); } }
  • WASAPI

    Unsolved
    2
    0 Votes
    2 Posts
    366 Views
    SGaistS
    Hi, Looks like there's a backend for it in QtMultimedia. If not what you are looking for, then you should explain what you are trying to do, what is your current status, etc.
  • Creating custom slots and signals

    Unsolved
    14
    0 Votes
    14 Posts
    5k Views
    SGaistS
    From the code you posted, you don't start timer.
  • Widget with Qt::Popup flag ignores KeyPressEvents when MainWindow is minimized

    Unsolved
    2
    0 Votes
    2 Posts
    291 Views
    SGaistS
    Hi, Why are you not calling the base class implementation of keyPressEvent ?
  • Resource Files

    Unsolved
    2
    0 Votes
    2 Posts
    401 Views
    sierdzioS
    @user614 said in Resource Files: How do I reference this file correctly when running the executable file? You can't use Qt resource system for that, because it is read only. However, you have many other options: add a default xml file to Qt resource system, then on first run of your app copy that file on disk - and open there using TiXmlDocument. This is probably the easiest option deploy your default xml file together with your app. How - that depends entirely on how you distribute your application. Put it in an .AppImage, Debian or RPM package. Or package it inside some installer (for example using Qt Installer Framework). Then you will know where the package is installed and what the path to the file will be If you need to place the file relative to your application binary, you can use application dir path to know where your binary is (as opposed to current directory).
  • qtcpsocket readready signal

    Unsolved
    4
    0 Votes
    4 Posts
    648 Views
    K
    @Sunfluxgames This typically depends on your needs and the speed of incoming data. You can use bytesAvailable to check the size of the QTcpSocket buffer content. An additional QByteArray is probably not required, but again that depends on your application and communication line. In most cases you probably you might have to wait a short momentfor receiving all 38 bytes. If you receive always 38 bytes at a certain let's assume once pe second, you probably need a loop reading. The tricky part is that none of those layers knows the details of your data. Therefore, you have totake care of. Note: you will not receive an additional readyRead signal while you are processing the data in your slot routine. Therefore, you need to take care of this yourself.
  • Static Library from Qt UI Project

    Unsolved
    7
    0 Votes
    7 Posts
    879 Views
    Pablo J. RoginaP
    @CodeFreaks is it possible to configure this "another program that doesn't have proper tools for creating a gui" with a properties/text file right now? I mean, if this "another program that doesn't have proper tools for creating a gui" is capable of being run like: ./mysterious-app -f super_config.cfg I'd say create a super-duper Qt app with all the bells and whistles to configure the app w/o gui and save all the settings as a config file. Then you can even have a button in the GUI to launch such app w/o gui with the recently created config file.
  • OpenGL rendering very slow on ATI

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    Roy44R
    In debug output I have the message: qt.qpa.gl: Invalid value set for QT_OPENGL: "Desktop" maybe it's linked to my problem ?
  • Draw a Ruler using QtOpenGL

    Unsolved gui opengl
    3
    0 Votes
    3 Posts
    2k Views
    H
    @kenchan I want to draw it on QOpenGLWidget and i want to relate it to an audio file so i can position it wherever i want
  • Legal | Licensing - Qt

    Solved
    3
    0 Votes
    3 Posts
    423 Views
    ODБOïO
    @koahnig thx!
  • QFileDialog on 4K screen

    Unsolved
    5
    0 Votes
    5 Posts
    928 Views
    Q
    Apparently I had to do sign out and sign in to apply windows user scale correctly to all applications. After doing this everything look fine.
  • Using different Views with one model and different data

    Unsolved
    22
    0 Votes
    22 Posts
    5k Views
    W
    @SGaist said in Using different Views with one model and different data: Ok, good. So at what point are you now ? After reading you question I had a new idea (before I thought it is not possible to use KDChart to plot) :D : a data class which stores all the data a table model which stores a pointer to the data which I would like to display. In this model I reimplement the data, rowcount and columncount function as following: class Data { public: QVector<double>* getDataPointer(int index){return &m_data.at(index);} private: QVector<QVector<double>> m_data; }; // Every Diagram uses an object of this class class SignalModel: public QAbstractTableModel { public: - override rowcount - override columncount - override data void addData(QVector<double>* xaxis, QVector<double>* yaxis); private: QVector<QVector<double>*> m_data; }; void SignalModel::addData(QVector<double>* xaxis, QVector<double>* yaxis){ // KDChart expects, that the axis keys and values are stored in different rows m_data.append(xaxis); m_data.append(yaxis); } int SignalModel::rowCount(const QModelIndex &parent) const { return m_data.lenght(); } int SignalModel::columnCount(const QModelIndex &parent) const{ int column = m_data.at(0)->length() return column; } QVariant SignalModel::data(const QModelIndex &index) const{ return m_data.at(index.row)->at(index.column); } removeRow and insertRow must be reimplemented too, to add dynamically new data. For showing the signal names I would reimplement a listmodel. I think it is the simplest method to do my task. (If there are errors in my code, it is because I didn't tested it, it's just a sketch). I found kst-plot which does exactly what I want. So I think it is easier to extend this program and help to contribute to this one, than rewriting a new one. Thank you SGaist for your help and the inspiration. If this last concept is unclear, just write and I will extend it.
  • QSqlTableModel::setFilter order by _rowid_

    Unsolved
    3
    0 Votes
    3 Posts
    426 Views
    K
    If I use QSortFilterProxyModel with QSqlRelationalTableModel, i don't have comboBox editors for foreign keys I think the problem is with the QTableView::setItemDelegate, cause it expects model to be QSqlRelationalTableModel, not QSortFilterProxyModel
  • Are you finding recent Qt versions buggy on macOS?

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    aha_1980A
    @AndyBrice You don't have to tell me that - I'd fully agree. Please discuss this with the developers in the corresponding bugreport. But as said, you can fix that locally with a little effort. Therefore it is annoying, but not a showstopper. Regards
  • This topic is deleted!

    Unsolved
    9
    0 Votes
    9 Posts
    60 Views
  • lupdate is not producing .ts files for me

    Solved
    2
    0 Votes
    2 Posts
    4k Views
    J.HilkJ
    hi @kitfox there are two ways I know of. The, in my opinion, best way is to specify your translation files inside your *.pro file TRANSLATIONS = myApp_de.ts \ .... myApp_en.ts if you don't want to do it this way, than you'll have to specify a file.ts name as argument to the lUpdate program call. I know this works, but I'm unsure where exactly to place the file-argument. So I can't give you an example for that.
  • Creating qt based FBOs for 3D objects.

    Unsolved
    5
    0 Votes
    5 Posts
    527 Views
    S
    @SGaist No. The example uses VBOs and not FBOs for the 3D object. I've tried using it before; while I succeeded, but my problem wasn't solved. The problem in this case being that I wish to edit/remove/add a 3D object without affecting the other objects. The code currently removes all 3D objects and redraws / renders them onto the display after every edit. To hopefully skip that I wanted to create each object in a separate FBO and "Blit" the FBO onto the main canvas removing a small blink which happens for all objects.