Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. template
    Log in to post

    • UNSOLVED How to move the definitions from mainwindow.cpp to mainwindow.h?
      General and Desktop • template ui header uiautomator • • BoboFuego  

      4
      0
      Votes
      4
      Posts
      25
      Views

      @JonB the problem is the Meta-Object-Compiler it can't create the magic code to make signal&slots and macros work you could use Verdigris if you really, really need templated QObject classes
    • SOLVED TEMPLATE = app doesn't seem to work correctly with Qt Creator 4.11
      General and Desktop • linux template executable sharedlib • • mdresser  

      8
      0
      Votes
      8
      Posts
      107
      Views

      Thanks for the summary !
    • UNSOLVED typeid in a tempate derived class
      C++ Gurus • template typeid • • addebito  

      6
      0
      Votes
      6
      Posts
      149
      Views

      The only way I see to write this "genericly" would be to have some virtual QVariant getValue() const and virtual QVariant setValue(QVariant v) in your base class and implement it in Derived. This way you wouldn't have to do any casting, simply b2->setValue(b1->getValue()). The implementation in Derived would do the cast to T via QVariant's value().
    • UNSOLVED Passing function as universal reference? Why?
      C++ Gurus • c++ template universal ref rvalue • • Kofr  

      3
      0
      Votes
      3
      Posts
      669
      Views

      BTW, keep in mind that there is no such thing as "universal ref" in C++ standard. It's just a way of thinking about rvalue ref T&& in contexts which provide type deduction for T
    • SOLVED Template function
      General and Desktop • template • • UnitScan  

      7
      0
      Votes
      7
      Posts
      1533
      Views

      since I hate sender() and pb->children().at(0) is even less robust I suggest (assuming you declared QMenu* MainWindow::m): connect(sel, &QPushButton::released, [=]()->void{ const QSize size = m->sizeHint(); m->popup(sel->mapToGlobal(QPoint(0,-size.height()))); }); P.S. Looking at this functionality, are you sure QToolButton is not a better choice? see QToolButton::setMenu
    • SOLVED Template: Force const parameter
      C++ Gurus • c++ template • • Joel Bodenmann  

      13
      0
      Votes
      13
      Posts
      3285
      Views

      @VRonin said in Template: Force const parameter: why wouldn't a simple static_assert work here? It definitely would.
    • QtQuick 5.4 in QtCreator 5.5 Mac OS X 10.9.5: menuBar missing from template project on execute. What the???? [SOLVED]
      QML and Qt Quick • qtcreator qtquick menu menubar template qtbroken • • DooziiInc  

      9
      0
      Votes
      9
      Posts
      2642
      Views

      You're welcome ! SInce everything is OK now, please update the thread title prepending [solved] so other forum users may know a solution has been found :) Also, while browsing the forum, consider up-voting the answers that helped you, it will make them easier to find for other users :)
    • QML generic multi-page template ?
      QML and Qt Quick • qml template qqmlcontext • • clogwog  

      2
      0
      Votes
      2
      Posts
      1118
      Views

      Hi @clogwog Use Screen to get the Screen's deimesions. Bind the width and height of root element to it.
    • [SOLVED] Slot without Q_OBJECT
      General and Desktop • signal qobject slot template • • qtacc32  

      3
      0
      Votes
      3
      Posts
      1990
      Views

      Qt developers have investigated this before, and there is a partially-working patch. There are still a number of important challenges to work through, but devs are focussing on other things at the moment. It is not currently being actively worked on: http://comments.gmane.org/gmane.comp.lib.qt.devel/10327
    • Qt Creator Templates
      General and Desktop • qtcreator creator template advanced templa • • iakko  

      2
      0
      Votes
      2
      Posts
      1103
      Views

      Hi and welcome to devnet, That might interest you
    • check template type for type
      C++ Gurus • template • • themts  

      6
      0
      Votes
      6
      Posts
      2814
      Views

      Thanks for your answers! I think I will go with Template specialization. CU mts