跳到內容

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k 主題 456.4k 貼文
  • 此主題已被刪除!

    Solved
    2
    0 評價
    2 貼文
    21 瀏覽
  • 0 評價
    2 貼文
    312 瀏覽
    SGaistS
    Hi and welcome to devnet, First thing: Qt does not use exceptions so you either need to adapt your code or follow the guide that shows how you may make use of them. My recommendation, drop the exception in that piece of code. Next: why are you throwing everywhere in your code without doing a proper check of the return values of the method you use ? Finally: don't store QDatabase objects, the class documentation explains why.
  • 0 評價
    2 貼文
    192 瀏覽
    Y
    I just figured out that our app name is Bitcoin-ABC, but we try to copy QSettings from app Bitcoin or Bitcoin-QT, but actually those apps may absent in our system: static const QString legacyAppName("Bitcoin-Qt"), legacyOrg("Bitcoin"); QSettings legacy(legacyOrg, legacyAppName), abc; const QStringList legacyKeys(legacy.allKeys()); // We only migrate settings if we have Core settings but no Bitcoin-ABC // settings if (!legacyKeys.isEmpty() && abc.allKeys().isEmpty()) { for (const QString &key : legacyKeys) { // now, copy settings over abc.setValue(key, legacy.value(key)); } } so this code is seeking app Bitcoin or Bitcoin-QT and copy settings. And if there is no such apps this code produces warning: QVariant::load: unknown user type with name BitcoinUnits::Unit. So, first we need to check if apps Bitcoin or Bitcoin-Qt actually exist. Is it possible to check existence of apps in QT5? I think this hack of copying settings from other apps is too self-confident action from Bitcoin-ABC developers, but if they want such, need to help them to check if such apps really exist. This hack might be related to old name of Bitcoin-ABC app, so in some commit number they changed app name and now try to copy settings from their app with old name. Please, is qt5 support such functionality of copying settings from other apps and how to check existence of apps Bitcoin, Bitcoin-Qt in this case?
  • The Qt charting module is unresponsive

    Solved
    7
    0 評價
    7 貼文
    348 瀏覽
    B
    @JonB I minimized the issue and rediscovered that the reason why I wasn't showing updates to the data was because my charts belonged to different objects hum_wdiget * H_wdiget; I define an object pointer so that the data passed through the object pointer belongs only to that object. So, I commented out the code that created the view in the diagram file and added it to the layout hum_wdiget.cpp void hum_wdiget::create_hum_charts() { ...other code... // vbox_hum->addWidget(view_hum); // setLayout(vbox_hum); } After that, I created the chart in the main interface directly from the object, and added the following paragraph. widget.cpp Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { ui->setupUi(this); ...ohter code... vbox_hum = new QVBoxLayout(); vbox_hum->addWidget(H_wdiget->view_hum); setLayout(vbox_hum); }
  • Help with extending QTableWidgetItem

    Unsolved
    1
    0 評價
    1 貼文
    115 瀏覽
    尚無回覆
  • Error in Application

    Unsolved
    3
    0 評價
    3 貼文
    218 瀏覽
    S
    Really??? "Error in application" isn't informative? Wow... (sarcasm) If had more information about this problem - I'd share it, but that is all, that application gave to me. And the docs won't help, I followed all the installation steps from them and got this error. Is there any solution to this problem? Maybe someone has already encountered something similar? And yes, if I could solve this problem myself, I would not write here. And the last few days of searching on the Internet have not given me a single working solution
  • QComboBox qss

    Unsolved
    1
    0 評價
    1 貼文
    81 瀏覽
    尚無回覆
  • 此主題已被刪除!

    Unsolved
    1
    0 評價
    1 貼文
    12 瀏覽
    尚無回覆
  • Automatic create class functions defined in .h file

    Unsolved
    3
    0 評價
    3 貼文
    2k 瀏覽
    L
    It worked... Btw, this problem is solved and it works perfect 😄.
  • QGraphicsview zooming under mouse cursor

    Unsolved
    6
    0 評價
    6 貼文
    1k 瀏覽
    Ketan__Patel__0011K
    @JonB Well my code is also is in used and it giving the perfect result and working very well.
  • why the text of the qpushbutton could not be set text-align:center?

    Unsolved
    8
    0 評價
    8 貼文
    3k 瀏覽
    JonBJ
    @nicker-player As @ChrisW67 says, since the default of QPushButton is to center text it is not clear what your issue is exactly. Do you require adjustment by stylesheet? If not you can control the placement or hide the menu indicator more directly via code?
  • WhatsThis '?' not showing

    Solved
    5
    0 評價
    5 貼文
    393 瀏覽
    N
    @Pl45m4 Thanks again. I figured in the end it must be a change in default settings. I did make a pretty significant jump from 5.15 to 6.6, though in the end it was relatively straightforward. No super major changes!
  • Qwidgets can become a part of the main form and a separate form

    Unsolved
    5
    0 評價
    5 貼文
    342 瀏覽
    SGaistS
    Hi, Sounds like you might be describing QDockWidget ?
  • Text label with irregular shape?

    Solved
    3
    0 評價
    3 貼文
    235 瀏覽
    R
    Thanks very much @Chris-Kawa ... this is exactly what I was hoping for.
  • 0 評價
    4 貼文
    412 瀏覽
    Axel SpoerlA
    @Pl45m4 myComboBox->setFocusPolicy(Qt::ClickFocus); should solve it.
  • How to invoke qRegisterMetaType when run thread with pointer to another thread?

    Unsolved
    2
    0 評價
    2 貼文
    190 瀏覽
    Christian EhrlicherC
    Just call it in main if you don't find another / better place.
  • QChartView setRubberBand prevents mouse events from reaching eventFilter

    Solved
    2
    0 評價
    2 貼文
    326 瀏覽
    E
    @EricR Problem Solved Need to call the following: ui->graphicsView->setRubberBand(QChartView::RectangleRubberBand | QChartView::ClickThroughRubberBand); For unknown reason, the compiler (Desktop Qt 6.6.1 MinGW 64-bit) does not like the previous line of code; error message: error: invalid user-defined conversion from 'int' to 'const RubberBands& Qt ClickThroughRubberBand documentation states: "An option on the above rubber band choices that allows left clicks to be passed on to chart items if those chart items accept clicks. To select this, OR it with one of the rubber band selection modes. since qt version 6.2." enum RubberBand { NoRubberBand = 0x0, VerticalRubberBand = 0x1, HorizontalRubberBand = 0x2, RectangleRubberBand = 0x3, ClickThroughRubberBand = 0x80 }; So I looked in QChartView.h and found the above definitions for ClickThroughRubberBand (0x80) and RectangleRubberBand (0x03) and ORed them together for 0x83. ui->graphicsView->setRubberBand((QChartView::RubberBand)0x83); Now it works. Problem solved.
  • invalid use of incomplete type ‘class Ui::Task’ Qt with C++

    Unsolved
    3
    0 評價
    3 貼文
    329 瀏覽
    Chris KawaC
    It's the same thing as last time.
  • Have the main UI remain fixed when expanding

    Unsolved
    33
    0 評價
    33 貼文
    4k 瀏覽
    M
    @Rangerguy128 As a test you can set the parent to your map: auto frame=new QFrame(your map widget): and see how it looks.
  • Qt application severe hangs on process->start()

    Unsolved
    26
    0 評價
    26 貼文
    4k 瀏覽
    jeremy_kJ
    Yup, there is a qWarning(). Its presence predates the modularization project, and the oldest repo clone I have at the moment. As such, I can't tell if the warning and the behavior in question were from the same author. There are other qWarnings() that don't appear to indicate a problematic condition. Compare this to the documentation for QThread::~QThread() prior to 6.3, which clearly indicates a "bad" situation. Note that deleting a QThread object will not stop the execution of the thread it manages. Deleting a running QThread (i.e. isFinished() returns false) will result in a program crash. Qt developers, or "the trolls", aren't a hive mind. The people who work on it have differing, and changing, and sometimes outright conflicting opinions. Sometimes they make mistakes.