Navigation

    Qt Forum

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

    • UNSOLVED Custom widget with designer
      General and Desktop • widget designer custom widget • • Josef Lintz  

      1
      0
      Votes
      1
      Posts
      93
      Views

      No one has replied

    • UNSOLVED Custom Button, paintEvent issue
      Qt for Python • pyqt5 button custom widget pyside6 paintevent • • Emrecp  

      11
      0
      Votes
      11
      Posts
      180
      Views

      The smoothing done for the antialiasing will not be the same for all colors.
    • SOLVED Help about Custom Paint Event of Progressbar
      Qt for Python • python css custom widget theme progressbar • • Emrecp  

      5
      0
      Votes
      5
      Posts
      193
      Views

      @SGaist Wow thank you very much! I fixed with pt.setClipPath(path2, Qt.ClipOperation.ReplaceClip) Some part of total code: progress_filled_width = self.value()/self.maximum()*self.width() pt.setClipPath(path2, Qt.ClipOperation.ReplaceClip) for i in range(100):
    • UNSOLVED QLabel paintEvent only Pixmap area
      General and Desktop • custom widget paintevent rectangle • • Emrecp  

      7
      0
      Votes
      7
      Posts
      304
      Views

      Any idea?
    • UNSOLVED How to Create Qt Custom Designer Widget
      General and Desktop • qlabel custom widget designer plugin • • Glenomat  

      1
      0
      Votes
      1
      Posts
      126
      Views

      No one has replied

    • UNSOLVED Python Qt Designer Custom Widget with PaintEvent
      General and Desktop • widget qt designer custom widget paintevent • • Emrecp  

      3
      0
      Votes
      3
      Posts
      209
      Views

      @jsulm I think this is for C++, I don't know how to use it on Python?
    • UNSOLVED Custom QScrollBar
      QML and Qt Quick • qml stylesheet custom widget qscrollbar • • Emrecp  

      2
      0
      Votes
      2
      Posts
      353
      Views

      Hi I don't think Qt stylesheet supports even half of this #style-9::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); background-color: #F5F5F5; } so you best bet is to dig into https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qscrollbar and see how close you can get it.
    • SOLVED uic + CMake + GCC + custom widgets + out-of-source problem
      Tools • cmake custom widget header custom widgets uic • • stan423321  

      12
      0
      Votes
      12
      Posts
      1392
      Views

      Well, huh. I thought I tried that one with the bigger project before, but it does work with the test program here, so that must have been something else. Thank you for your assistance.
    • SOLVED Manually Implementing Custom Widget in MainWindow
      General and Desktop • custom widget source code dependencies circular • • Burke212  

      15
      0
      Votes
      15
      Posts
      5752
      Views

      @Burke212 change setup(); CWC = new customWidgetClass(); to CWC = new customWidgetClass(); setup(); hopefully you did initialize CWC as nullptr, otherwise that would have crashed in release mode 10/10 times.
    • SOLVED Custom Widget in QListView/QTreeView expands whole width
      General and Desktop • model-view custom widget modelview • • SKovalev  

      4
      0
      Votes
      4
      Posts
      1302
      Views

      Finaly I have finished my little example! Previous version have been really buggy in items move. So I have to subclass from QAbstractItemModel. Many thanks to @Patou355 with his solution. NB I haven't deal with mousePressEvent() yet.
    • UNSOLVED How to load multiple custom plugins for form editor in Qt Creator
      Tools • plugins custom widget metadata • • moditg  

      4
      0
      Votes
      4
      Posts
      924
      Views

      Why do you have your plugins and application all in the same project ?
    • UNSOLVED Promoting to custom widget in QtDesigner '*.hpp' no such file or directory [cmake]
      General and Desktop • c++ cmake qtdesigner custom widget cmakelists.txt • • Valveware  

      4
      0
      Votes
      4
      Posts
      1874
      Views

      @Valveware said in Promoting to custom widget in QtDesigner '*.hpp' no such file or directory [cmake]: file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/dashboard/*.hpp) Ok that looks like it would indeed moc your cameraframe.hpp.. So that's probably not the issue. Can you share the build log from gcc? And also the ui_main_window.h file as well as ui_cameraframe.h?
    • UNSOLVED Qt 5.6 how to use QWebEngineView in my custom widget plugin?
      QtWebEngine • qwebengineview custom widget qtplugin • • ricklxm  

      1
      0
      Votes
      1
      Posts
      682
      Views

      No one has replied

    • UNSOLVED Items' pos return wrong position
      QML and Qt Quick • custom widget draw lines qlabel position • • mghqt  

      5
      0
      Votes
      5
      Posts
      1251
      Views

      @mghqt i assume CWidget class is the main widget (window)? How do you compose/layout the form items? Are you using sub-widgets containers? Anyways you should do like you did for pos4 if you want to map a child to a parent. QPoint childPos=ui->label_2->mapTo(this, ui->label_2->pos());
    • SOLVED Window with custom background and modify the content area.
      General and Desktop • custom widget content margins custom window • • GranVeoDuendes  

      8
      0
      Votes
      8
      Posts
      2226
      Views

      Perfect. Thank you very much. It works perfect. So that other people, if they have the same problem here have the solution. It's very simple and I did not fall for something so simple. In the properties where I assign the texts and icons we call a method that modifies the margins. Only that. For example: #import PyQt5 or PySide (To the taste of the client) class Test(QDialog): def __init__(self, parent: QDialog = None): super().__init__(parent) self.__row_Text = None @property def row_Text(self) -> str: return self.__row_Text @row_Text.setter def row_Text(self, value: str): self.__row_Text = value self.updateFancyBackground() self.repaint() def updateFancyBackground(self): # I liked the name Fancy Background if self.__row_Text is not None: margins = self.layout().contentsMargins() margins.setTop(24) self.layout().setContentsMargins(margins) def paintEvent(self, event: QPaintEvent): # Your code for height = 24 pass Many thanks to "SGaist" and "mrjj", for giving me the idea to solve it.
    • UNSOLVED Custom widget in Qt designer
      Tools • qt designer custom widget • • Ilan  

      2
      0
      Votes
      2
      Posts
      930
      Views

      @Ilan My question is what method of the widget does the Qt designer use for showing If you mean Qt Designer showing your custom widget in the toolbox along default widgets (i.e. QLabel, QLineEdit, etc.) I guess you may need to create a plugin for Qt Designer from your custom widget. Qt Designer used a plugin based approach, see here.
    • SOLVED What is the best way to implement a custom widget in an application?
      General and Desktop • application custom widget gui development customplugin • • Sh1gs  

      4
      0
      Votes
      4
      Posts
      1032
      Views

      @Sh1gs Just as a note. There is no difference adding widgets in code or adding via Designer. The setupUI() as seen in mainwindow ctor creates the Designer widgets as code. So the only true difference is handwritten versus generated from UI file. Also adding via Designer, gives easier translations as the translate function is generated for the user.
    • SOLVED QListWidget doesn't show properly custom QWidget
      General and Desktop • custom widget list • • Ioseph12  

      16
      0
      Votes
      16
      Posts
      5175
      Views

      @VRonin After some headache days I found the problem. The FilterWindow widget had set wrong the parent in children widgets, so, the right way would be : void FilterWindow::setUi(std::string tittle) { Frame = new QFrame(this); //Here it must be this, to set the widget itself as the parent Frame->setObjectName(QStringLiteral("Frame")); Frame->setFixedWidth(281); Frame->setFixedHeight(89); Frame->setStyleSheet(QLatin1String("QFrame\n" "{\n" " border-style: solid;\n" " border-width: 0px;\n" " border-radius: 4px;\n" " border-color: transparent;\n" "}")); Frame->setFrameShape(QFrame::StyledPanel); Frame->setFrameShadow(QFrame::Raised); Frame->setAttribute(Qt::WA_DeleteOnClose); checkBox = new QCheckBox(Frame); checkBox->setText(tittle.c_str()); checkBox->setObjectName(QStringLiteral("checkBox")); checkBox->setGeometry(QRect(0, 0, 248, 35)); checkBox->setAutoFillBackground(false); checkBox->setStyleSheet(QLatin1String("QCheckBox\n" "{\n" " background-color: rgb(128,139,143);\n" " color: white;\n" " border-radius: 4px;\n" " padding-left: 8px;\n" "}\n" "\n" "QCheckBox::indicator:unchecked {\n" " image: url(:/OptiNanoPro/uchk);\n" "}\n" "\n" "\n" "QCheckBox::indicator:checked {\n" " image: url(:/OptiNanoPro/chk);\n" "}\n" "")); checkBox->setChecked(true); ArrowBtn = new QPushButton(Frame); ArrowBtn->setObjectName(QStringLiteral("ArrowBtn")); ArrowBtn->setGeometry(QRect(246, 0, 36, 35)); ArrowBtn->setAutoFillBackground(true); QIcon icon; icon.addFile(QStringLiteral(":/OptiNanoPro/DownArrwLd"), QSize(), QIcon::Normal, QIcon::Off); ArrowBtn->setIcon(icon); ArrowBtn->setIconSize(QSize(36, 35)); ArrowBtn->setFlat(true); Table = new QTableWidget(Frame); Table->setObjectName(QStringLiteral("Table")); Table->setGeometry(QRect(0, 35, 281, 31)); Table->setStyleSheet(QLatin1String("QTableWidget\n" "{\n" " background-color: white;\n" " border-radius: 0px;\n" "}" "\n" "QCheckBox\n" "{\n" " color: white;\n" " padding-left: 8px;\n" "}\n" "\n" "QCheckBox::indicator:unchecked {\n" " image: url(:/OptiNanoPro/uchk);\n" "}\n" "\n" "QCheckBox::indicator:checked {\n" " image: url(:/OptiNanoPro/chk);\n" "}\n" "")); ResetBtn = new QPushButton(Frame); ResetBtn->setText("Reset"); ResetBtn->setObjectName(QStringLiteral("ResetBtn")); ResetBtn->setGeometry(QRect(0, 66, 169, 23)); ResetBtn->setStyleSheet(QLatin1String("QPushButton\n" "{\n" " background-color: white;\n" " border-width: 1px;\n" " border-style: solid;\n" " border-color: rgb(86,86,84);\n" " border-radius: 3px;\n" " color: rgb(86,86,84);\n" "}")); AplyBtn = new QPushButton(Frame); AplyBtn->setText("Apply"); AplyBtn->setObjectName(QStringLiteral("AplyBtn")); AplyBtn->setGeometry(QRect(169, 66, 111, 23)); AplyBtn->setStyleSheet(QLatin1String("QPushButton\n" "{\n" " background-color: white;\n" " border-width: 1px;\n" " border-style: solid;\n" " border-color: rgb(86,86,84);\n" " border-radius: 3px;\n" " color: rgb(86,86,84);\n" "}")); }
    • SOLVED Create/Preview Custom Widget without using forms
      General and Desktop • custom widget preview • • Sh1gs  

      6
      0
      Votes
      6
      Posts
      1758
      Views

      @Sh1gs Just as a note. You can visually design the UI in Designer and then just grab the c++ code. ;) If you look inside the setupUI, there is the code for what u have"drawn"
    • Example of model/view with custom widget
      General and Desktop • drag and drop custom widget model view prog • • l1q1d56  

      3
      0
      Votes
      3
      Posts
      1701
      Views

      Hi @Joel-Bodenmann , thank you, I got the point about the item delegate but I see two issues: implement a drag and drop listview because I ended up with empty lines (on the list view) and fields on the widget mapper: https://s32.postimg.org/47yyrq7id/Untitled.png implement a delegate that paint a checkbox with custom pixmap, the input with number and the input with text.
    • SOLVED Can't load custom widget using QUiLoader
      General and Desktop • custom widget quiloader • • Prisco  

      10
      0
      Votes
      10
      Posts
      6168
      Views

      @Prisco I'm glad it worked out. Good luck with your project!
    • UNSOLVED Custom Widgets Plugins: QT_INSTALL_PLUGIN not working on Windows 7 & Bug in Qt 5.6 Custom Widget Interface template
      General and Desktop • windows bug plugins custom widget • • ghielmetti  

      4
      0
      Votes
      4
      Posts
      2158
      Views

      @ghielmetti Hi Normally I do have the .h file in the project folder and point to that in the Promote dialog. Im not sure it will take a full path in the dialog but I never tried :)
    • UNSOLVED Custom Widget and #include error in the ap
      General and Desktop • plugin qt5.6 custom widget qtcreator 3.6.1 • • maurofaresoftware.it  

      2
      0
      Votes
      2
      Posts
      749
      Views

      Hi, You followed the "simple way" of creating a Designer plugin. For a "real world" approach take a look at this. Short version: you split your plugin code in two: a library which will include your widget(s) the plugin itself That way you have the plugin for designer and you can link your application to the library which will not have any dependency on designer related code. Hope it helps
    • SOLVED Tap into QWidget::create
      General and Desktop • widgets custom widget qstackedwidget notifications • • kshegunov  

      8
      0
      Votes
      8
      Posts
      2567
      Views

      @raven-worx Hello, Thanks for the code, but I know how to do the scheduling. I actually went with QPointer<QObject> since the QObject might be deleted while waiting in the event loop. Like this: bool AgDial::eventFilter(QObject * object, QEvent * event) { switch (event->type()) { case QEvent::ChildAdded: QMetaObject::invokeMethod(this, "scheduleChildAdd", Qt::QueuedConnection, Q_ARG(QPointer<QObject>, QPointer<QObject>(reinterpret_cast<QChildEvent *>(event)->child()))); break; case QEvent::ChildRemoved: d()->detachAction(reinterpret_cast<QChildEvent *>(event)->child()); break; } return QStackedWidget::eventFilter(object, event); } Thanks for taking the time though! Kind regards.
    • UNSOLVED How to create a custom native OSX webkit widget with Objective C?
      General and Desktop • qt5.5 webkit osx custom widget objective-c • • maximo  

      4
      0
      Votes
      4
      Posts
      1600
      Views

      Hi @maximo, did you have success with the MacNativeWidget and didi it reach your requirements.
    • SOLVED Custom plugin fails with 'Plugin Verification Data Mismatch'
      General and Desktop • qtcreator qt5 linux custom widget color • • Votato  

      2
      0
      Votes
      2
      Posts
      1523
      Views

      Hi, That generally means that you are trying to use a plugin built with a version of Qt (e.g. 5.5) with an application built with a different version (e.g. 5.4) So check what version of Qt was used to build Qt Creator and use it to build your plugin.
    • SOLVED How do I make my custom button element focusable?
      QML and Qt Quick • button focus custom widget • • archeria  

      3
      0
      Votes
      3
      Posts
      1313
      Views

      @p3c0 Thank you! Works fine.
    • [SOLVED]QUiLoader only creates base classes of custom widgets
      General and Desktop • c++ custom widget quiloader • • courtjester199  

      4
      0
      Votes
      4
      Posts
      1114
      Views

      Hi and welcome to devnet, How are you calling findChildren ?