Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. template
    Log in to post
    • All categories
    • C

      Solved why qt6 add more compiled-time check and caused some unexpected errors
      C++ Gurus • moc qt6.2 template • • ComixHe

      12
      0
      Votes
      12
      Posts
      237
      Views

      Chris Kawa

      @ComixHe No problem. Oh, you also said that you now need C++17. Yes, the minimum language version requirement in Qt6 was bumped from C++11 to C++17. It makes a lot stuff easier, the implementation can be cleaner and it is supported by all major compilers anyway.

    • G

      Solved Genericity, extensibility and reuse: QWidgets Vs QML
      General and Desktop • qml c++ qml qwidget performance template • • genner

      7
      0
      Votes
      7
      Posts
      196
      Views

      G

      @sierdzio

      Ok now it's much clearer, thank you again.

      It looks like there is a lot of documentation to read, but apparently most things I have in mind should work. Still, for some reason, I feel QWidgets will perform faster. I'll try to make some tests and get back here.

      Thank you again!

    • CJha

      Solved Is it possible to create template signals?
      General and Desktop • signal template • • CJha

      3
      0
      Votes
      3
      Posts
      160
      Views

      CJha

      @J-Hilk Thanks :)

    • R

      Solved Using template on a QWidget constructor
      General and Desktop • meta-objects qwidget constructor template • • raphasauer

      10
      0
      Votes
      10
      Posts
      386
      Views

      Christian Ehrlicher

      Correct.

    • B

      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
      214
      Views

      J.Hilk

      @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

    • M

      Solved TEMPLATE = app doesn't seem to work correctly with Qt Creator 4.11
      General and Desktop • executable sharedlib template linux • • mdresser

      8
      0
      Votes
      8
      Posts
      614
      Views

      SGaist

      Thanks for the summary !

    • A

      Unsolved typeid in a tempate derived class
      C++ Gurus • typeid template • • addebito

      6
      0
      Votes
      6
      Posts
      562
      Views

      Chris Kawa

      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().

    • K

      Unsolved Passing function as universal reference? Why?
      C++ Gurus • c++ universal ref rvalue template • • Kofr

      3
      0
      Votes
      3
      Posts
      902
      Views

      K

      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

    • UnitScan

      Solved Template function
      General and Desktop • template • • UnitScan

      7
      0
      Votes
      7
      Posts
      1824
      Views

      V

      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

    • Joel Bodenmann

      Solved Template: Force const parameter
      C++ Gurus • c++ template • • Joel Bodenmann

      13
      0
      Votes
      13
      Posts
      3617
      Views

      Chris Kawa

      @VRonin said in Template: Force const parameter:

      why wouldn't a simple static_assert work here?

      It definitely would.

    • D

      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 • qtbroken qtquick qtcreator menu menubar template • • DooziiInc

      9
      0
      Votes
      9
      Posts
      3080
      Views

      SGaist

      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 :)

    • clogwog

      QML generic multi-page template ?
      QML and Qt Quick • qml template qqmlcontext • • clogwog

      2
      0
      Votes
      2
      Posts
      1290
      Views

      p3c0

      Hi @clogwog
      Use Screen to get the Screen's deimesions. Bind the width and height of root element to it.

    • Q

      [SOLVED] Slot without Q_OBJECT
      General and Desktop • slot signal qobject template • • qtacc32

      3
      0
      Votes
      3
      Posts
      2550
      Views

      JKSH

      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

    • iakko

      Qt Creator Templates
      General and Desktop • qtcreator template creator advanced templa • • iakko

      2
      0
      Votes
      2
      Posts
      1215
      Views

      SGaist

      Hi and welcome to devnet,

      That might interest you

    • T

      check template type for type
      C++ Gurus • template • • themts

      6
      0
      Votes
      6
      Posts
      3286
      Views

      T

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

      CU
      mts