Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • qopenglwidget trying to output to 3d model in format .obj .

    Unsolved qopenglwidget 3d model
    2
    0 Votes
    2 Posts
    641 Views
    Pl45m4P
    @timob256 This is some years old but maybe it helps. Also found this: https://github.com/GarageGames/Qt/blob/master/qt-5/qt3d/src/render/io/objloader.cpp
  • TableLayout in the centralwindow

    Unsolved
    21
    0 Votes
    21 Posts
    3k Views
    Thank YouT
    @Swati777999 If that is not fully related to the original question posting another question would be helpful to newcomers. I use it for QTableWidget. QTableWidget or QTableView
  • QMAKE_POST_LINK action with sed: in file replacement?

    Solved
    3
    0 Votes
    3 Posts
    261 Views
    B
    Since qmake's sed apparently doesn't support in-file replacements, I redirected the output of the sed -e command to a .tmp file, and then renamed that .tmp file using $$QMAKE_MOVE. Works fair enough :-)
  • How to print contents from stackedWidget with QPrinter

    Unsolved
    5
    0 Votes
    5 Posts
    524 Views
    JonBJ
    @LT-K101 You can go down @artwaw's way of creating a document from your data and printing that. But it's quite a lot of work. Are you instead just wanting to print/paint a "screenshot" of each page (just like it looks on screen) on the printer?
  • qopenglwidget doesn't fire

    Solved qt5.11 qopenglwidget
    10
    0 Votes
    10 Posts
    2k Views
    Christian EhrlicherC
    And this example still has the errors? Then simplify it (and fix the memleaks - a new[] needs a delete[] and paintGL() is not called only once so your vectors grow indefinitly) until we can really try it out. E.g. loading an object file is not needed - drawing a simple rectangle to reproduce the issue is enough.
  • how to define repeated string with qtranslator?

    Unsolved
    26
    0 Votes
    26 Posts
    4k Views
    Q
    @Christian-Ehrlicher said in how to define repeated string with qtranslator?: e How do you solve this situation: Project1 dll1 dll2 app Project2 dll3 dll4 app Project1 and Project2 or other projects need to use the same string. many many string(like ok, yes, no ...) if you translate each BIg Project, you donot need to do the repetitive work? and you cannot put dll1.ts to Project2, you mean linguist know it's already translated?
  • Disable the combo box specific item

    Solved
    2
    0 Votes
    2 Posts
    414 Views
    SGaistS
    Hi, What comes to mind: Use a QSortFilterProxyModel on top of a QStringListModel and filter out the values the person cannot select Use a custom model where you re-implement the flags The first avoids to show "invalid values" to your user (asking why can't I select them ?). The second should do what you original want at the risk of your users wondering why there are unelectable items in a control which should offer them only valid choices.
  • QPushButton Emits Signal Multiple Times in a Single Click.

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    Christian EhrlicherC
    @Phamy1289 said in QPushButton Emits Signal Multiple Times in a Single Click.: just needed to add a conditional to have it only connect to it once or do the connect in the ctor.
  • How to get class name from a class ?

    Solved
    5
    0 Votes
    5 Posts
    921 Views
    SPlattenS
    @Christian-Ehrlicher , ok, that will work, just didn't think of it immediately.
  • How to access ?

    Solved
    4
    0 Votes
    4 Posts
    378 Views
    M
    Use qobject_cast and check if the cast worked (the result is not null). Also, don't expect a cast to work if it's not derived from the type you are casting to (i.e., just adding a class as friend should not make it work). Adding a class as a friend should work for what you are trying do, you may have to cast the object to the type that it's a friend of first. For example, if the object is coming in as a QAbstractButton but was created as your custom button type, cast it to your type first, then try to access private methods from an object that is of the friend type.
  • Handling Database on Multiple Thread

    Solved qthread sql database c++ multithread debugging
    13
    0 Votes
    13 Posts
    4k Views
    Kent-DorfmanK
    to continue the point @Christian-Ehrlicher mentioned above, blocking serial tasks usually exist on server daemon applications, but not on anything with user interaction or a GUI.
  • Qt 6 build - qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""

    Solved
    6
    0 Votes
    6 Posts
    555 Views
    nicmoraisN
    Update: I got it compiled by changing to development branch (6.3.0)! Thanks a lot for your help!
  • get login name in qmake script

    Solved
    3
    0 Votes
    3 Posts
    674 Views
    B
    Yes, thanks. That was also what I have figured out in the meanwhile :-)
  • Button bug. Why the button width is truncated.

    Solved
    2
    0 Votes
    2 Posts
    228 Views
    A
    Thanks all. I have just played with the buttons and reverted changes. I don't know where was the problem Button{ Layout.minimumWidth: availableWidth id: create text: "Создать" }
  • How to get elements from json array

    Solved
    6
    0 Votes
    6 Posts
    5k Views
    D
    @Gojir4 Thanks it worked.
  • Correct use of setWindowTitle for QWidget object

    Solved
    5
    0 Votes
    5 Posts
    905 Views
    JKSHJ
    @Swati777999 said in Correct use of setWindowTitle for QWidget object: So to summarise the learning point here; To use the object of MainWindow class in the constructor of MainWindow in mainWindow.cpp file, use ‘this’ as the object of the MainWindow instead of ‘parent’ To use the member function; this -> member_function() Yes. Note also that this is implied. The 2 calls to member_function() below do exactly the same thing: void MyClass::func() { this->member_function(); // 1st call member_function(); // 2nd call } Just want to be confirmed at this point, members of any class can be accessed by dot operator, right? Yes, unless you have a pointer to the object. For pointers, you use -> not . Note: this is a pointer
  • Couldn't print Arabic right

    Unsolved
    5
    0 Votes
    5 Posts
    577 Views
    JKSHJ
    @deleted385 said in Couldn't print Arabic right: those diacritical marks still overlaps with previous/following rows and becomes unreadable. I'm not familiar with the QTextCursor API, so I'll let someone else comment on your code. For now, I recommend you just try to print a simple PDF with 2 lines. Keep modifying the code until you get 2 lines that don't overlap. When I upload a folder in github, it doesn't work! GitHub is not for uploading files. You should commit your code on your PC and then push it to GitHub: https://docs.github.com/en/get-started/quickstart/hello-world
  • Linux application crashes.

    Unsolved
    19
    0 Votes
    19 Posts
    3k Views
    J
    Very peculiar. If I create a widget app - all is good, it runs in Debug. A console app just created, no files or libs added - generates the problem.
  • Advice for best practice high-DPI development needed

    Unsolved
    1
    0 Votes
    1 Posts
    421 Views
    No one has replied
  • Set Delegate for each cell in a QTableWidget?

    Solved
    23
    0 Votes
    23 Posts
    9k Views
    H
    @VRonin hi, I have finished modifying the delegate button so I can use it in my code and it works fine. However, I am wondering how can I set a stylesheet for it. With my old QPushButton I had it like this: QPushButton* cancel_button = new QPushButton(this); cancel_button->setIcon(QIcon(QPixmap(":/Icons/cancel.png"))); cancel_button->setStyleSheet("QPushButton{background-color: transparent; background-repeat: none; border: none;} QPushButton:pressed{ background-color: transparent; }"); Can I do it with the delegate button? The reason I want to do this is because I want the the button to display only the icon I set for it. Edit: I think I have solved it by going in the QStyleOptionButton buttonOptions(const QStyleOptionViewItem &option, bool skipRct=false) const function and change the QStyleOptionButton features to flat: QStyleOptionButton buttonOption; buttonOption.features = QStyleOptionButton::Flat;