Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.6k Posts
  • 0 Votes
    4 Posts
    2k Views
    I resolve it. I setted font of text as property of QML Text component. (Like font.family : parent.fontfamily) and on Qt 5.7's QML, there are no enough options to control font properties. so, I moved to C++ side and set a whole application font. QFont font = someClass.getLangFont(); //set property of font instance here // such as hinting policy, style etc. QApplication::setFont(font); now it looks very cleary... thank you..
  • QWidgetwindow in qt5

    Unsolved 26 Oct 2018, 07:04
    0 Votes
    5 Posts
    791 Views
    @nikhil_belani said in QWidgetwindow in qt5: any can help me any changes made from migration qt5.9 from qt4 I suggest you start by adding QT += widgets to your .pro file. Then, try to build your application for Qt 5 and address each error that appears. If you get stuck, copy the first few error messages that you get and paste them here.
  • How to Insert QVideoWidget Item into QTabWidget

    Solved 29 Oct 2018, 14:34
    0 Votes
    5 Posts
    844 Views
    Ok it's done :) My video source was not handled, many thanks :)
  • QSlider Customize bug?

    Solved 29 Oct 2018, 08:42
    0 Votes
    4 Posts
    2k Views
    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 29 Oct 2018, 23:06
    0 Votes
    1 Posts
    698 Views
    No one has replied
  • Edit text in File

    Unsolved 29 Oct 2018, 03:58
    0 Votes
    9 Posts
    2k Views
    sed is *nix command that allows you to parse and modify file content using regular expressions. As for regular expression in Qt see QRegularExpression.
  • 0 Votes
    15 Posts
    2k Views
    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 ?
  • 0 Votes
    20 Posts
    2k Views
    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
    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 29 Oct 2018, 04:20
    0 Votes
    5 Posts
    503 Views
    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 29 Oct 2018, 11:55
    0 Votes
    3 Posts
    334 Views
    @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))
  • 0 Votes
    2 Posts
    305 Views
    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 29 Oct 2018, 14:40
    0 Votes
    4 Posts
    487 Views
    @Engelard Well some widgets, like LineEdit has a context menu so setting CustomContextMenu as default would break all default context menus.
  • Service

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

    Solved 29 Oct 2018, 10:10
    0 Votes
    2 Posts
    861 Views
    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
    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 27 Oct 2018, 00:52
    0 Votes
    8 Posts
    986 Views
    @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.
  • 0 Votes
    11 Posts
    3k Views
    @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
    692 Views
    @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.
  • 0 Votes
    5 Posts
    3k Views
    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 }