Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Can't configure properly my layouts

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    P
    I Changed a little thing: I added all my controls (in the bottom of the CurveEditorWidget) in a simple widget container (see in the inspector) : [image: 6a459ab1-db90-40bc-8a2e-082c0797366c.jpg] In the structure, here are size policy (H / V): CurveEditorWidget = MinimumExpanding / Prefered curve_scrollArea = Expanding / Expanding optionsContainer_widget = MinimumExpanding / Prefered currentPointFunction_lineEdit = MinimumExpanding / Fixed All other widgets under optionsContainer_widget = Fixed / Fixed For the OperatorPanel widget: OperatorPanel = MinimumExpanding / Prefered pitchDials_widget = Maximum / Fixed All other widgets under pitchDials_widget = Fixed / Fixed I change the width of the instance of the OperatorPanel added dynamically to the main window. It's not placed in a layout, it's placed in the main window itself and positionned in an absolute place. Should i add another container to embed the operator panel widget like this ? QWidget *container = new QWidget(this); QHBoxLayout *container_hLayout = new QHBoxLayout(container); container_hLayout->addWidget(operatorPanel); container->setFixedWidth(this->width() - 5); It doesn't make really sense because the OperatorPanel widget should be sizable with size I want..
  • QMenuBar: menu is hidden when moving window to another monitor

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    Z
    Sorry for a long break. After holidays i have returned to development. I have added new QTwidget line and everything is ok now. Thanks a lot
  • Qt MQTT and while loop

    Solved
    3
    0 Votes
    3 Posts
    401 Views
    G
    Great, it works, Qtimer was the solution. Thank you!
  • Fill all space in QLayout

    Solved
    5
    0 Votes
    5 Posts
    6k Views
    ivanicyI
    @J.Hilk Wow! thank you very much!! That works fine!
  • 0 Votes
    4 Posts
    1k Views
    jsulmJ
    @Mahendra-HD said in How to use QStackedwidget without using designer form ?Also should be capable of navigating between pages when button is clicked.: So please help me to navigate between pages using QStackedWidget when button is clicked See http://doc.qt.io/qt-5/qstackedwidget.html#currentIndex-prop
  • GStreamer : Pipeline to connect VNC server and Display/Record the remote GUI

    Solved
    35
    0 Votes
    35 Posts
    21k Views
    SGaistS
    Maybe another encoder could work better. No, QVNCClient is not from me, I just found it :)
  • QFlags is only usable on enumeration types

    Solved
    3
    0 Votes
    3 Posts
    734 Views
    M
    That is right. Thank you very much for your help.
  • resize QImage in TableView

    Unsolved
    2
    0 Votes
    2 Posts
    276 Views
    VRoninV
    There is QImage in the 0,0 Index of QTableView. How is it saved in the model?
  • Some error occuring on destructor

    Unsolved
    31
    0 Votes
    31 Posts
    8k Views
    J.HilkJ
    @Ovidiu_GCO ah alright, you made the ui form independet from your class and than added it afterwards, alright. PS. thanks, fixed the obvious typo :P
  • How to automatically add some actions to context menus

    Solved
    3
    0 Votes
    3 Posts
    940 Views
    JonBJ
    Well here is the outline of what I have implemented, bearing in mind my desire to make as little code changes as possible and to provide the basic export facility quite "transparently" & automatically to all existing JTableViews which do not have their own context menus to add in. Step 1 is just to make JTableView's constructor go setContextMenuPolicy(Qt.CustomContextMenu) and set its own slot on customContextMenuRequested to its own openContextMenu() method which displays its export custom menu. At this point all existing JTableViews have the export menu without them even knowing about it/changing any of their code. That deals with 50% of client cases, with 0 lines of code changes. Step 2 is to handle those callers which already have their own customContextMenuRequested slot registered (after the JTableView has been created and registered its own) with their own menu. The problem is that will lead to 2 separate menus being shown, one after the other, and the caller-specific one won't be called till after the JTableView's one has executed, so it will be too late to do anything about that at that point. So I provide a JTableView.replaceCustomContextMenuRequested() which accepts the caller's own slot as a parameter: it disconnect()s its own slot first and then registers the caller's slot in its place. The caller's slot code builds its own menu as before, but now instead of displaying it directly it passes it to JTableView's openContextMenu() which merges that with its own export menu and then displays it for the caller. This deals with the remaining 50% of client cases, at just 2 lines of code changes per client. Ugly? Possibly. But achieves desired with minimal changes, and it's not that bad is it?
  • 0 Votes
    28 Posts
    12k Views
    O
    Well, I rebuilt QtAV with a new installation of Qt, and it works .... So, even if I didn't understand the mistake, thanks a lot for your help !
  • Enter admin rights once, use it in multiple process calls to terminal [Linux]

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    JonBJ
    @fleppe And there was I thinking pkexec was something to do with running some pkzip command..... This "polkit" stuff is all very good, and if that's what you want to use fine. But it's going to require a bit of setting up to use. I do not know how much configuring you want to do, or how "secure" you need to be for your purposes. I will just say that in terms of "simplicity", if that's really what you want, my two thoughts would be: Use sudo and rely on what I quoted from the man page to ensure the user only gets prompted for password once every 15 minutes, if that works for you. Use setuid. It sounds like all your commands are apt updates? I would not make your Qt program itself setuid (unless you really know what you are doing). Rather, a tiny executable wrapper program supplied with your Qt app to just do apt update with setuid would suffice (installed with just chown root & chmod u+s). I would suggest this might be the simplest solution if you want to avoid any password prompting at all, as per your original question. Have you at least considered/do you know about setuid, even if you have good reason to reject it?
  • CGAL - Insert edge in a face

    Unsolved
    7
    0 Votes
    7 Posts
    948 Views
    N
    @SGaist thank you for help :)
  • 0 Votes
    2 Posts
    299 Views
    jsulmJ
    @RahibeMeryem You could have an increasing id for each frame and use this id to know the order.
  • 0 Votes
    10 Posts
    3k Views
    realhamidrezakpR
    What do you mean by modify the model ? i mean updating model , like a search window that needs to update model every time user change input. You can see how to handle QtSQL models and views in the QtSQL modules examples. i saw it, and figure out some of examples. but i need to read more about MVC in qt. thanks you.
  • How to convert QVariant to HTML

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    M
    I have .docx file. I get simple text from .docx: QString ResumeFileName (""); ResumeFileName = QFileDialog::getOpenFileName(0, "Text ", "", "*.doc *.docx *.rtf"); ResumeFileName.replace(QRegExp("[/]"), "\\"); qDebug()<<ResumeFileName; if (ResumeFileName != "") { QAxObject wordApplication("Word.Application"); QAxObject *documents = wordApplication.querySubObject("Documents"); QAxObject *document = documents->querySubObject("Open(const QString&, bool)", ResumeFileName, true); QAxObject *words = document->querySubObject("Words"); QString TextResume; QString HTMLResume; int countWord = words->dynamicCall("Count()").toInt(); for (int a = 1; a <= countWord; a++){ TextResume.append(words->querySubObject("Item(int)", a)->dynamicCall("Text()").toString()); HTMLResume.append(words->querySubObject("Item(int)", a)->dynamicCall("Text()").SomethingFfunction); } document->dynamicCall("Close (boolean)", false); TextResume.replace(QRegExp("[\r]"), "\r\n"); qDebug()<<TextResume; But I also need text with formatting and pictures
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • 0 Votes
    10 Posts
    4k Views
    dheerendraD
    Boiler plate code which you are trying to implement is already taken care by Qt using Signals/Slots across threads. It is better to use tried & tested inbuilt mechanism. It is good with code maintainability & readability as well. Suggest to use signals/slots.
  • how to convert c++ modelIndex to QML modelIndex?

    Unsolved
    2
    0 Votes
    2 Posts
    334 Views
    J
    ok i make some mistake and fix the code as below: function expandallitem( tindex) { var parenti= (tindex.parent) var parentii= (parenti.parent) var i=getIndexFromCpp(tindex); var index0 = treeViewModel.index(0,0 ) var index1 = treeViewModel.index(i,0 ) expand(parenti) expand(tindex ) sel.select(tindex,ItemSelectionModel.Select) } sel is the selection.. and it is still the expand can work well . and slect is fail to work
  • widget container with custom type

    Unsolved
    4
    0 Votes
    4 Posts
    587 Views
    jsulmJ
    @user4592357 Something like // Base would be QWidget in your case class Base {}; class W1 : public Base {}; class W2: public Base {}; template<typename W> Base* createWidget() { return new W(); } class Container { public: Container(std::function<Base*()> factory) { // Create an instance of the widget Base* widget = factory(); } } Container container1(createWidget<W1>); Container container2(createWidget<W2>); Regarding connections: as long as these widgets have same signals/slots (from base class from example) I don't see any issues. But if they have different signals/slots I don't see how you can do this in a generic way as your container needs to know what these different widgets have.