Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 456.8k Posts
  • QSlider Customize bug?

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    M
    i solve this problem.. Some options have been changed and solved. but I still don't know why this is happening. below is my code .QSlider { min-height: 34px; max-height: 34px; } .QSlider::groove:horizontal { border: 1px solid #262626; height: 8px; background: #393939; margin: 0px 1px; border-radius:5px; } .QSlider::handle:horizontal { background:transparent; border: 1px solid red; width: 15px; height: 100px; margin: -12px -6px; border-radius:5px; border-image: url(:/icons/icons/av/svg/production/ic_stop_24px.svg); } QSlider::add-page:qlineargradient { background: lightgrey; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; } QSlider::sub-page:qlineargradient { background: blue; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 5px; border-bottom-left-radius: 5px; } result [image: aa526795-dbad-4c81-bcca-53deab3a91ef.png]
  • Buggy user interface on wayland

    Unsolved c++ wayland x11 linux
    1
    0 Votes
    1 Posts
    701 Views
    No one has replied
  • Edit text in File

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    SGaistS
    sed is *nix command that allows you to parse and modify file content using regular expressions. As for regular expression in Qt see QRegularExpression.
  • how to modify mainform.ui components from other form, and vice versa

    Solved
    15
    0 Votes
    15 Posts
    2k Views
    mrjjM
    Hi 1: Always in the .cpp and .h for the slots. the moc files are generated and will override any changes you make for them. Notice that a slot always have its header in .h and the body in .cpp A custom signal on the other hand, only has header in .h as it has no body. Terms used: header = the signature of the function/method/slot like void SomeSlot(int param); Body = the actual implementation of the slot void Classsname::SomeSlot(int param) { ---code-- } on the other hand a signal would just be void SomeSignal(int param); in .h and nothing in .cpp. 2: You may send a signal to any other class that inherit QObject and has Q_OBJECT macro and the slot that matches class Someclass: public QObject { Q_OBJECT 3: emit is used to send the signal. So if you create new signals, its how you "send" them emit MySignal() 4: a signal is just a method header/signature and listed under signals: signals: void MySignal(); // your custom signal. Did you read http://doc.qt.io/qt-5/signalsandslots.html ?
  • single QProgressDialog button push produces two signals

    Solved
    20
    0 Votes
    20 Posts
    2k Views
    mzimmersM
    I think I may have found at least part of the problem. It seems that my call to close() emits the canceled() signal, which was getting me in trouble, as my slot wasn't prepared for a signal under these circumstances. I guess I'm not supposed to call close(), which is actually a slot. My app seems to be working now. I'm going to keep this unsolved for another day, just in case someone has something else to add. So
  • 0 Votes
    4 Posts
    1k Views
    E
    I am curious on how the clarification will evolve for the topic “Describing build components for CMake support with Qt”.
  • Sum values in differents tables

    Solved
    5
    0 Votes
    5 Posts
    503 Views
    mrjjM
    Hi You could use a function :) int CalcSumFromCol(QTableWidget* table, int col) { int sum = 0; for (int i = 0; i < table->rowCount(); i++) { QTableWidgetItem* item = table->item(i, 3); int value = item->text().toFloat(); sum += value; } return sum; } and simply call it // get from first table int sum1 = CalcSumFromCol(ui->tableWidget_1, 3); // get from second table int sum2 = CalcSumFromCol(ui->tableWidget_2, 4); // 4 is random. use real col number // add the sums int masterSum=sum1+sum2;
  • Request and send data securely through PHP

    Solved
    3
    0 Votes
    3 Posts
    339 Views
    C
    @VRonin Thank you for your reply. i have another question, in our context (w/ Laravel Framework) how we should do it properly? i mean the Laravel using bcrypt with its own salting. So our problem that we need to sync different methods on the DB (and its our main problem for weeks now ) edit: ( i wasnt exact... Laravel is on the same site as the DB we want to manage but its use its on DB for the password (mysql))
  • how to transporting signals through the network to make a daemon-gui program pair?

    Unsolved
    2
    0 Votes
    2 Posts
    305 Views
    mrjjM
    Hi You could have a look at https://doc.qt.io/qt-5.11/qtremoteobjects-index.html Not sure it fits 100% for your use case but the remote part of your description does sound like RPC-ish.
  • CustomContextMenu SLOT not working(QTableWidget)

    Solved
    4
    0 Votes
    4 Posts
    487 Views
    mrjjM
    @Engelard Well some widgets, like LineEdit has a context menu so setting CustomContextMenu as default would break all default context menus.
  • Service

    Unsolved
    2
    0 Votes
    2 Posts
    360 Views
    VRoninV
    You can use @kshegunov 's library: https://bitbucket.org/kshegunov/qtdaemon [Fixed link ~kshegunov]
  • Margins in a bar chart Grid <QtCharts>

    Solved
    2
    0 Votes
    2 Posts
    866 Views
    J
    I answer myshelf, I found a solution in another direction; Simply making the bar width bigger QHorizontalStackedBarSeries *series = new QHorizontalStackedBarSeries(); series->setBarWidth(0.9); //where 1 fill the grid
  • 0 Votes
    116 Posts
    67k Views
    VRoninV
    Of course I'll cast my -1 vote as well. I'll add to point 1: If the data contained in the model is all of basic types or implicitly shared types then it's possible to already use the current framework without ever triggering any expensive* copy , to point 2: There's no clarity on how to support different types in different roles would we need an additional template argument for each used role beyond Qt::UserRole? is so the problems above grow exponentially with the roles And to point 3: No possible implementation for a reliable dataChanged emission if model internals are exposed directly *expensive = a copy that implies more that a: memcpy of less than 65bits and an increase/decrease of a numeric reference counter
  • Qt 5.7 cannot render 'Bengali' font

    Unsolved
    8
    0 Votes
    8 Posts
    988 Views
    S
    @jsulm @SGaist Thanks for the suggestion and yes, std::cout << "বাংলাদেশ-BD!" << std::endl; correctly prints the font like this: বাংলাদেশ-BD! However, using this font in my code crashes the program abruptly. Instead if I use std::cout << "Bangladesh-BD!" << std::endl; The program runs fine. However, I am new in Qt and couldn't find how to pass the string correctly to a std::string variable so that it could render the font properly instead of Question marks.
  • Appending a std::uint16_t literal constant to a QByteArray

    Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    aha_1980A
    @fryn3, I have read the demand again, and it's like this: The 0x89 byte should come first, the 0x01 byte second. So the only portable way to do is your proposal, slightly adopted by me: const std::uint16_t FOO = 0x8901; QByteArray ba; ba.append(char(FOO >> 8)); // 0x89 ba.append(char(FOO & 0xFF)); // 0x01 Static casting the 16-Bit word is not endian-awere, the same applies for this one: cout << hex << int((uint8_t)&t) << " " << int((((uint8_t)&t) + 1)); which is by the way, wrong as 0x01 comes first here. And if you try this on a big endian machine, it will give other results. Regards
  • 1 Votes
    2 Posts
    696 Views
    K
    @Ajay-Krishna Hi and welcome to devnet forum More out of gut feeling than knowledge I am assuming that something might have changed on the Android side. Possibly it is better to check also in Android groups e.g. android-qt or others for an answer on this. However, android-qt has slowed down significantly over time.
  • how to check for a file/directory if the file has read only permissions

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    sierdzioS
    const QFileInfo info("some/file"); if (info.permission(QFile::WriteOwner | QFile::WriteGroup | QFile::WriteUser)) { // file is writable! } else { // file is read only } // Or even simpler: if (info.isWritable()) { // Yup } else { // Nope }
  • Qt3D picking triangles

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    M
    @unclejimbo-0 Hello. My Entity is imported with Qt3DRender::QSceneLoader like this: m_sceneLoaderEntity = new Qt3DCore::QEntity(); Qt3DRender::QSceneLoader *sceneLoader = new Qt3DRender::QSceneLoader(m_sceneLoaderEntity); // EditorSceneItemModel::handleImportEntityLoaderStatusChanged is a slot developed to react to a signal when import operation is finished QObject::connect(sceneLoader, &Qt3DRender::QSceneLoader::statusChanged, this, &EditorSceneItemModel::handleImportEntityLoaderStatusChanged); sceneLoader->setSource(fileUrl); m_sceneLoaderEntity->addComponent(sceneLoader); So, it might be considered as custom mesh! I think picking triangles should work fine with custom meshes. By the way, I'm working with Qt 5.11.2
  • dynamically enabled QGroupBox

    Solved
    6
    0 Votes
    6 Posts
    643 Views
    dheerendraD
    as @J-Hilk & @Christian-Ehrlicher suggested, it is findChildren is the option to go.
  • QFrame, focus, border

    Solved
    4
    0 Votes
    4 Posts
    896 Views
    M
    @mrjj Hi it perfectly works! Thank you very much mrjj!!