Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • error " use of undeclared idetifier IO_ReadOnly ..."

    Moved Unsolved
    2
    0 Votes
    2 Posts
    190 Views
    JonBJ
    @AnneRanch If you look at the foot of the example page you quote you will see Copyright (c) 2002-2004 by Johan Thelin (e8johan -at- digitalfanatics.org). You must not use such an old example, it was written for Qt 3. Many things have changed since then. The newer constant for IO_ReadOnly is QIODevice::ReadOnly, which should make this compile, but I strongly suggest you simply ditch this example code as there may be other problems (e.g. I don't think your line.latin1() will work) or deprecated code.
  • Always select the first item in a QListView during a search

    Solved
    11
    0 Votes
    11 Posts
    892 Views
    M
    @Gabber said in Always select the first item in a QListView during a search: // add source Model mFungusProxyModel->setSourceModel(mFungusDataModel); mFungusFilterModel->setSourceModel(mFungusDataModel); Seems strange to me, but maybe i'm wrong - Model-View pattern gives me headache, too complicated for my little brain :) In one of my app, i'm using a sorting model and i do like this: historyModel=new HistoryModel(); historySortFilter= new HistorySortFilter(); historySortFilter->setSourceModel(historyModel); tableView->setModel(historySortFilter); As you can see, i first set the proxy model to the sorting model, then set the sorting model to the view. Hope this helps.
  • How to create a childwidget with other color as parent

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    Pl45m4P
    @Lukas02 said in How to create a childwidget with other color as parent: But I dont understand my mistake in my first version. QWidget propagates explicit palette roles from parent to child. If you assign a brush or color to a specific role on a palette and assign that palette to a widget, that role will propagate to all the widget's children, overriding any system defaults for that role. Note that palettes by default don't propagate to windows (see isWindow()) unless the Qt::WA_WindowPropagation attribute is enabled. (from: https://doc.qt.io/qt-5/qwidget.html#palette-prop)
  • Weird Tab Key bug

    Unsolved
    3
    0 Votes
    3 Posts
    384 Views
    Pl45m4P
    @grombog said in Weird Tab Key bug: When I press the Tab key through line edits it doesn't function normally. It's neither weird, nor a bug. As @Kent-Dorfman said, you can change the tab-order in QtD's Design Mode or by code. https://doc.qt.io/qt-5/qwidget.html#setTabOrder
  • Receiving float from Arduino "BLEFloatCharacteristic" via BLE

    Solved
    6
    0 Votes
    6 Posts
    956 Views
    artwawA
    @mpergand thanks.
  • Signals and slots didn't emitted

    Unsolved
    3
    0 Votes
    3 Posts
    284 Views
    M
    @jsulm yes you are right , after a few days, I found my code SetLimitVolt *LimitV = new SetLimitVolt(); in another void. sorry for this newbie's fault
  • Getting data from a web page.

    Solved
    5
    0 Votes
    5 Posts
    496 Views
    J
    @JonB said in Getting data from a web page.: @jenya7 said in Getting data from a web page.: access into incomplete type 'QNetworkReply' For the record: any time you get an incomplete type '...' message it means you have not included the required header file. Thank you. Good to know.
  • 0 Votes
    3 Posts
    283 Views
    JonBJ
    @echo_lovely There is no "problem". First time it is called you are (presumably) changing from no current item (0x0, nullptr) to some current item. Perfectly reasonable? So do not try to access prev->... if prev == nullptr.
  • warning: implicitly-declared ??

    Moved Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    A
    @sierdzio I have disabled compiler warnings and still getting these. Warnings do no bother me but when I get real error it is a pain to scroll thru the warnings to get to it. Yes, I am adding 6.2.2. - hope it will make these disappear. Cheers
  • QProcess won't start executable on Windows

    Solved
    4
    0 Votes
    4 Posts
    304 Views
    S
    Hi @Christian-Ehrlicher, that solved it. Thank you :)
  • 0 Votes
    6 Posts
    703 Views
    W
    @escape said in How are native apps able to show user created content with text and images at random places? (placements inside a listview, etc): Is this only possible with web view? A web browser is a native application, so your premise is a bit confusing. If you want to show web content specifically, then you'll need to use something that can show web content like a WebView. If you want to show something arbitrary based on user input, then that just describes most applications. A picture viewer will show whatever image a user wants to open. A word processor will show whatever content a user types. A paint program will show whatever content a user draws, etc. A web browser isn't fundamentally any different from something like a word processor. The program displays stuff on screen based on data it has loaded. @escape said in How are native apps able to show user created content with text and images at random places? (placements inside a listview, etc): Is it normal to use a local html file in webengine and connect to python/c++ via webchannel to make a hybrid app? To fetch data from an api/server and displaying it in the app? People who are really used to web dev sometimes like to use HTML for making UI. Personally, I just find it confusing and overly complicated to add HTML and webs tuff to an application that doesn't need it because my background isn't mainly web stuff. But it's certainly not terribly unusual.
  • Serialization features in qt

    Solved
    5
    0 Votes
    5 Posts
    392 Views
    SGaistS
    Hi, In addition to my fellows: QXmlStreamReader and QXmlStreamWriter. One important thing: all tools suggested until now won't serialize your objects automagically for you.
  • qdebug compile problem

    Unsolved
    4
    0 Votes
    4 Posts
    501 Views
    O
    I now believe that it is not a QDeBug problem, but something in that particular program that is causing the problem. I tried two other old program and the qDeBug() worked. Sorry, I just jumped the gun on this.
  • What operating systems support QApplication setWindowIcon?

    Solved
    9
    0 Votes
    9 Posts
    796 Views
    SGaistS
    If you want to customize the dock tile then you'll have to use the native API. From the looks of it, create a QImage, draw whatever you want on it, convert to a NSImage and set it on the tile.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • 0 Votes
    5 Posts
    914 Views
    Christian EhrlicherC
    The QSqlTableModel needs a real PK, yes.
  • QScrollArea - minimum width controlled by content? - remove horizontal bars?

    Unsolved qscrollarea
    1
    0 Votes
    1 Posts
    200 Views
    No one has replied
  • How can I use QMessageBox::About differently

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    A
    @HerrWinfried Customise QMessageBox with pixmap or icon QMessageBox *infoMSG = new QMessageBox(this); infoMSG->setMaximumSize(400,200); infoMSG->setStyleSheet("background-color: rgb(167, 210, 219); color:rgb(0,0,0);"); infoMSG->setIconPixmap(QPixmap(":/images/Green-true.png").scaled(QSize(30,30))); infoMSG->setWindowIcon(QIcon(":/images/Admin-logo.png")); infoMSG->setWindowTitle("Title"); infoMSG->setText("Message"); infoMSG->addButton(QMessageBox::Ok)->setMinimumSize(80,30); infoMSG->buttons().at(0)->setStyleSheet("background-color: rgb(255,153,153);color:rgb(0,0,102);"); infoMSG->exec();
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • What `--` is on MacOS?

    Solved configuration build
    2
    0 Votes
    2 Posts
    587 Views
    SGaistS
    Hi, AFAIK, it has nothing to do with macOS. Usually the -- means that what follows will by passed as is to a process started by the script / command / other that you are invoking.